@teleporthq/teleport-types
Advanced tools
Comparing version 0.34.0-alpha.0 to 0.34.0
@@ -1,2 +0,2 @@ | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources } from './uidl'; | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources, UIDLLocalFontAsset } from './uidl'; | ||
export declare enum FileType { | ||
@@ -56,3 +56,2 @@ CSS = "css", | ||
devDependencies: Record<string, string>; | ||
projectResources?: Record<string, ProjectResource>; | ||
strategy: ProjectStrategy; | ||
@@ -82,6 +81,2 @@ rootFolder: GeneratedFolder; | ||
} | ||
export interface ProjectResource { | ||
fileName: string; | ||
path: string; | ||
} | ||
export interface GeneratorOptions { | ||
@@ -93,2 +88,4 @@ localDependenciesPrefix?: string; | ||
mappings?: Record<string, string>; | ||
fontsFolder?: string; | ||
localFonts?: UIDLLocalFontAsset[]; | ||
}; | ||
@@ -108,3 +105,8 @@ mapping?: Mapping; | ||
}; | ||
projectResources?: Record<string, ProjectResource>; | ||
extractedResources?: Record<string, { | ||
fileName: string; | ||
fileType: FileType; | ||
path: string[]; | ||
content: string; | ||
}>; | ||
designLanguage?: { | ||
@@ -116,4 +118,3 @@ tokens?: UIDLDesignTokens; | ||
cache: UIDLResources['cache']; | ||
} & { | ||
path: ProjectStrategy['resources']['path']; | ||
path: string[]; | ||
}; | ||
@@ -144,3 +145,3 @@ } | ||
}) => void; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping) => Promise<GeneratedFolder>; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping, strictHtmlWhitespaceSensitivity?: boolean) => Promise<GeneratedFolder>; | ||
addMapping: (mapping: Mapping) => void; | ||
@@ -158,2 +159,3 @@ getAssetsPath: () => string[]; | ||
variation?: StyleVariation; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -164,3 +166,2 @@ export type ComponentGeneratorInstance = (params?: GeneratorFactoryParams) => ComponentGenerator; | ||
externals: Record<string, ComponentUIDL>; | ||
skipValidation?: boolean; | ||
assets?: GeneratorOptions['assets']; | ||
@@ -340,2 +341,3 @@ }) => void; | ||
readyState?: string; | ||
passwordProtection?: string; | ||
} | ||
@@ -410,2 +412,4 @@ export interface VercelDeleteProject { | ||
assetsFolder?: string[]; | ||
excludeGlobalsFromHTMLComponents?: boolean; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -415,2 +419,3 @@ export interface GenerateOptions { | ||
styleVariation?: StyleVariation; | ||
plugins?: ComponentPlugin[]; | ||
} | ||
@@ -455,3 +460,7 @@ export declare enum ReactStyleVariation { | ||
export type GenerateComponentFunction = (componentUIDL: ComponentUIDL, options: GenerateOptions) => Promise<CompiledComponent>; | ||
export type ElementsLookup = Record<string, { | ||
count: number; | ||
nextKey: string; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=generators.d.ts.map |
export type Modify<T, R> = Omit<T, keyof R> & R; | ||
export type ModifyUnionNumber<T, U, V> = T extends U ? V : T; | ||
//# sourceMappingURL=helper.d.ts.map |
@@ -43,4 +43,4 @@ import { Modify } from './helper'; | ||
method?: 'GET' | 'POST'; | ||
body?: Record<string, UIDLStaticValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue>; | ||
body?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue>; | ||
mappers?: string[]; | ||
@@ -124,2 +124,7 @@ response?: { | ||
} | ||
export interface UIDLLocalFontAsset { | ||
type: 'local-font'; | ||
path: string; | ||
properties: Record<string, UIDLStaticValue>; | ||
} | ||
export interface UIDLCanonicalAsset { | ||
@@ -137,3 +142,3 @@ type: 'canonical'; | ||
} | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset; | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset | UIDLLocalFontAsset; | ||
export interface ComponentUIDL { | ||
@@ -157,8 +162,11 @@ name: string; | ||
name: string; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
}; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
@@ -177,3 +185,7 @@ cache?: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
@@ -189,3 +201,2 @@ } | ||
pagination?: PagePaginationOptions; | ||
dynamicRouteAttribute?: string; | ||
initialPropsData?: UIDLInitialPropsData; | ||
@@ -202,3 +213,3 @@ initialPathsData?: UIDLInitialPathsData; | ||
type: string; | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void); | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | UIDLElementNode; | ||
isRequired?: boolean; | ||
@@ -232,4 +243,2 @@ id?: string; | ||
fallback?: boolean; | ||
dynamicRouteAttribute?: string; | ||
isIndex?: boolean; | ||
pagination?: PagePaginationOptions; | ||
@@ -241,3 +250,3 @@ initialPropsData?: UIDLInitialPropsData; | ||
} | ||
export type ReferenceType = 'prop' | 'state' | 'local' | 'attr' | 'children' | 'token' | 'expr'; | ||
export type ReferenceType = 'prop' | 'state' | 'local' | 'attr' | 'children' | 'token'; | ||
export interface UIDLDynamicReference { | ||
@@ -247,2 +256,3 @@ type: 'dynamic'; | ||
referenceType: ReferenceType; | ||
refPath?: string[]; | ||
id: string; | ||
@@ -283,2 +293,18 @@ }; | ||
} | ||
export interface UIDLCMSMixedTypeNode { | ||
type: 'cms-mixed-type'; | ||
content: { | ||
elementType: string; | ||
name: string; | ||
key: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
nodes: { | ||
fallback?: UIDLElementNode; | ||
error?: UIDLElementNode; | ||
}; | ||
mappings?: Record<string, UIDLElementNode>; | ||
}; | ||
} | ||
export interface UIDLCMSListRepeaterNode { | ||
@@ -288,9 +314,15 @@ type: 'cms-list-repeater'; | ||
} | ||
export interface UIDLResourceLink { | ||
export type UIDLResourceLink = UIDLLocalResource | UIDLExternalResource; | ||
export interface UIDLLocalResource { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
export interface UIDLExternalResource { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
export interface UIDLCMSListNodeContent { | ||
elementType: string; | ||
name: string; | ||
name?: string; | ||
key: string; | ||
@@ -306,5 +338,4 @@ attrs?: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
valuePath?: string[]; | ||
valuePath: string[]; | ||
paginationQueryParam?: UIDLStaticValue | UIDLPropValue | UIDLExpressionValue; | ||
itemValuePath?: string[]; | ||
resource?: UIDLResourceLink; | ||
@@ -326,6 +357,6 @@ initialData?: UIDLPropValue; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLResourceLink; | ||
initialData?: UIDLPropValue; | ||
entityKeyProperty?: string; | ||
} | ||
@@ -336,2 +367,3 @@ export interface UIDLCMSListRepeaterNodeContent { | ||
key: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -342,2 +374,3 @@ list: UIDLElementNode; | ||
renderPropIdentifier: string; | ||
source?: string; | ||
} | ||
@@ -354,3 +387,3 @@ export interface UIDLNestedStyleDeclaration { | ||
node: UIDLElementNode; | ||
dataSource: UIDLAttributeValue; | ||
dataSource: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
meta?: UIDLRepeatMeta; | ||
@@ -368,3 +401,4 @@ } | ||
node: UIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
importDefinitions?: Record<string, UIDLExternalDependency>; | ||
value?: string | number | boolean; | ||
@@ -404,5 +438,4 @@ condition?: UIDLConditionalExpression; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
} | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode; | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode | UIDLCMSMixedTypeNode; | ||
export interface UIDLComponentStyleReference { | ||
@@ -412,3 +445,3 @@ type: 'comp-style'; | ||
} | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue | UIDLElementNode; | ||
export type UIDLStyleValue = UIDLDynamicReference | UIDLStaticValue; | ||
@@ -426,3 +459,3 @@ export type UIDLStyleDefinitions = Record<string, UIDLStyleValue>; | ||
content: { | ||
url: UIDLAttributeValue; | ||
url: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
newTab: boolean; | ||
@@ -435,3 +468,3 @@ }; | ||
content: { | ||
section: string; | ||
section: UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
@@ -442,3 +475,3 @@ } | ||
content: { | ||
routeName: UIDLAttributeValue; | ||
routeName: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
}; | ||
@@ -445,0 +478,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLStateValue, UIDLInjectValue, UIDLStateValueDetails, UIDLRouteDefinitions, UIDLStateDefinition } from './uidl'; | ||
import { Modify } from './helper'; | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLLocalResource, UIDLExternalResource, UIDLInjectValue, UIDLStateValueDetails, UIDLStateDefinition, UIDLCMSMixedTypeNode, UIDLDependency, UIDLLocalFontAsset, UIDLStyleValue, UIDLPropDefinition } from './uidl'; | ||
import { Modify, ModifyUnionNumber } from './helper'; | ||
export interface VUIDLElementNode extends Modify<UIDLElementNode, { | ||
@@ -19,8 +19,4 @@ content: VUIDLElement; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
resource?: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
}; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
initialData?: UIDLPropValue; | ||
@@ -41,3 +37,5 @@ }; | ||
content: { | ||
elementType: string; | ||
name?: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -49,8 +47,4 @@ key?: string; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue>; | ||
}; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
initialData?: UIDLPropValue; | ||
@@ -60,6 +54,21 @@ }; | ||
} | ||
export interface VUIDLCMSMixedTypeNode extends Modify<UIDLCMSMixedTypeNode, { | ||
content: { | ||
elementType: string; | ||
name: string; | ||
nodes: { | ||
fallback?: VUIDLElementNode; | ||
error?: VUIDLElementNode; | ||
}; | ||
renderPropIdentifier: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, VUIDLAttributeValue | string | number>; | ||
mappings: Record<string, VUIDLElementNode>; | ||
}; | ||
}> { | ||
} | ||
export type VUIDLConditionalNode = Modify<UIDLConditionalNode, { | ||
content: { | ||
node: VUIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
value?: string | number | boolean; | ||
@@ -72,14 +81,20 @@ condition?: UIDLConditionalExpression; | ||
node: VUIDLElementNode; | ||
dataSource?: UIDLAttributeValue; | ||
dataSource?: UIDLRepeatNode['content']['dataSource']; | ||
meta?: UIDLRepeatMeta; | ||
}; | ||
}>; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | VUIDLCMSMixedTypeNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLElement = Modify<UIDLElement, { | ||
elementType: string; | ||
semanticType?: string; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
abilities?: { | ||
link?: VUIDLLinkNode; | ||
}; | ||
events: UIDLElement['events']; | ||
dependency?: UIDLDependency; | ||
children?: VUIDLNode[]; | ||
style?: Record<string, UIDLAttributeValue | string | number>; | ||
attrs?: Record<string, UIDLAttributeValue | string | number>; | ||
style?: Record<string, UIDLStyleValue | string | number>; | ||
attrs?: Record<string, VUIDLAttributeValue | string | number>; | ||
referencedStyles: Record<string, UIDLElementNodeProjectReferencedStyle | VUIDLElementNodeInlineReferencedStyle | VUIDLElementNodeClassReferencedStyle>; | ||
@@ -91,3 +106,3 @@ }>; | ||
conditions: UIDLStyleConditions[]; | ||
styles: Record<string, UIDLAttributeValue | string | number>; | ||
styles: Record<string, UIDLStyleValue | string | number>; | ||
}; | ||
@@ -110,7 +125,11 @@ }>; | ||
node: VUIDLElementNode; | ||
stateDefinitions: { | ||
route: Modify<UIDLRouteDefinitions, { | ||
stateDefinitions?: { | ||
route: { | ||
type: string; | ||
defaultValue: string; | ||
values: VUIDLStateValueDetails[]; | ||
}>; | ||
[x: string]: UIDLStateDefinition; | ||
}; | ||
[x: string]: UIDLStateDefinition & { | ||
values?: VUIDLStateValueDetails[]; | ||
}; | ||
}; | ||
@@ -138,7 +157,9 @@ designLanguage: { | ||
export type VUIDLSectionLinkNode = Modify<UIDLSectionLinkNode, { | ||
content: Record<string, string>; | ||
content: { | ||
section: string | UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
}>; | ||
export type VUIDLURLLinkNode = Modify<UIDLURLLinkNode, { | ||
content: { | ||
url: UIDLAttributeValue | string; | ||
url: UIDLURLLinkNode['content']['url'] | string; | ||
newTab: boolean; | ||
@@ -149,3 +170,3 @@ }; | ||
content: { | ||
routeName: string | UIDLAttributeValue; | ||
routeName: string | UIDLNavLinkNode['content']['routeName']; | ||
}; | ||
@@ -162,3 +183,3 @@ }>; | ||
export type VUIDLLinkNode = VUIDLURLLinkNode | VUIDLSectionLinkNode | VUIDLNavLinkNode | UIDLMailLinkNode | UIDLPhoneLinkNode | VUIDLDynamicLinkNode; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset | UIDLLocalFontAsset; | ||
export type VUIDLStyleInlineAsset = Modify<UIDLStyleInlineAsset, { | ||
@@ -179,2 +200,6 @@ attrs?: Record<string, UIDLStaticValue | string | boolean | number>; | ||
}>; | ||
export type VUIDLAttributeValue = ModifyUnionNumber<UIDLAttributeValue, UIDLElementNode, VUIDLElementNode>; | ||
export type VUIDLPropDefinitions = Modify<UIDLPropDefinition, { | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | VUIDLElementNode; | ||
}>; | ||
//# sourceMappingURL=vuidl.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources } from './uidl'; | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources, UIDLLocalFontAsset } from './uidl'; | ||
export declare enum FileType { | ||
@@ -56,3 +56,2 @@ CSS = "css", | ||
devDependencies: Record<string, string>; | ||
projectResources?: Record<string, ProjectResource>; | ||
strategy: ProjectStrategy; | ||
@@ -82,6 +81,2 @@ rootFolder: GeneratedFolder; | ||
} | ||
export interface ProjectResource { | ||
fileName: string; | ||
path: string; | ||
} | ||
export interface GeneratorOptions { | ||
@@ -93,2 +88,4 @@ localDependenciesPrefix?: string; | ||
mappings?: Record<string, string>; | ||
fontsFolder?: string; | ||
localFonts?: UIDLLocalFontAsset[]; | ||
}; | ||
@@ -108,3 +105,8 @@ mapping?: Mapping; | ||
}; | ||
projectResources?: Record<string, ProjectResource>; | ||
extractedResources?: Record<string, { | ||
fileName: string; | ||
fileType: FileType; | ||
path: string[]; | ||
content: string; | ||
}>; | ||
designLanguage?: { | ||
@@ -116,4 +118,3 @@ tokens?: UIDLDesignTokens; | ||
cache: UIDLResources['cache']; | ||
} & { | ||
path: ProjectStrategy['resources']['path']; | ||
path: string[]; | ||
}; | ||
@@ -144,3 +145,3 @@ } | ||
}) => void; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping) => Promise<GeneratedFolder>; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping, strictHtmlWhitespaceSensitivity?: boolean) => Promise<GeneratedFolder>; | ||
addMapping: (mapping: Mapping) => void; | ||
@@ -158,2 +159,3 @@ getAssetsPath: () => string[]; | ||
variation?: StyleVariation; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -164,3 +166,2 @@ export type ComponentGeneratorInstance = (params?: GeneratorFactoryParams) => ComponentGenerator; | ||
externals: Record<string, ComponentUIDL>; | ||
skipValidation?: boolean; | ||
assets?: GeneratorOptions['assets']; | ||
@@ -340,2 +341,3 @@ }) => void; | ||
readyState?: string; | ||
passwordProtection?: string; | ||
} | ||
@@ -410,2 +412,4 @@ export interface VercelDeleteProject { | ||
assetsFolder?: string[]; | ||
excludeGlobalsFromHTMLComponents?: boolean; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -415,2 +419,3 @@ export interface GenerateOptions { | ||
styleVariation?: StyleVariation; | ||
plugins?: ComponentPlugin[]; | ||
} | ||
@@ -455,3 +460,7 @@ export declare enum ReactStyleVariation { | ||
export type GenerateComponentFunction = (componentUIDL: ComponentUIDL, options: GenerateOptions) => Promise<CompiledComponent>; | ||
export type ElementsLookup = Record<string, { | ||
count: number; | ||
nextKey: string; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=generators.d.ts.map |
export type Modify<T, R> = Omit<T, keyof R> & R; | ||
export type ModifyUnionNumber<T, U, V> = T extends U ? V : T; | ||
//# sourceMappingURL=helper.d.ts.map |
@@ -43,4 +43,4 @@ import { Modify } from './helper'; | ||
method?: 'GET' | 'POST'; | ||
body?: Record<string, UIDLStaticValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue>; | ||
body?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue>; | ||
mappers?: string[]; | ||
@@ -124,2 +124,7 @@ response?: { | ||
} | ||
export interface UIDLLocalFontAsset { | ||
type: 'local-font'; | ||
path: string; | ||
properties: Record<string, UIDLStaticValue>; | ||
} | ||
export interface UIDLCanonicalAsset { | ||
@@ -137,3 +142,3 @@ type: 'canonical'; | ||
} | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset; | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset | UIDLLocalFontAsset; | ||
export interface ComponentUIDL { | ||
@@ -157,8 +162,11 @@ name: string; | ||
name: string; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
}; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
@@ -177,3 +185,7 @@ cache?: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
@@ -189,3 +201,2 @@ } | ||
pagination?: PagePaginationOptions; | ||
dynamicRouteAttribute?: string; | ||
initialPropsData?: UIDLInitialPropsData; | ||
@@ -202,3 +213,3 @@ initialPathsData?: UIDLInitialPathsData; | ||
type: string; | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void); | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | UIDLElementNode; | ||
isRequired?: boolean; | ||
@@ -232,4 +243,2 @@ id?: string; | ||
fallback?: boolean; | ||
dynamicRouteAttribute?: string; | ||
isIndex?: boolean; | ||
pagination?: PagePaginationOptions; | ||
@@ -241,3 +250,3 @@ initialPropsData?: UIDLInitialPropsData; | ||
} | ||
export type ReferenceType = 'prop' | 'state' | 'local' | 'attr' | 'children' | 'token' | 'expr'; | ||
export type ReferenceType = 'prop' | 'state' | 'local' | 'attr' | 'children' | 'token'; | ||
export interface UIDLDynamicReference { | ||
@@ -247,2 +256,3 @@ type: 'dynamic'; | ||
referenceType: ReferenceType; | ||
refPath?: string[]; | ||
id: string; | ||
@@ -283,2 +293,18 @@ }; | ||
} | ||
export interface UIDLCMSMixedTypeNode { | ||
type: 'cms-mixed-type'; | ||
content: { | ||
elementType: string; | ||
name: string; | ||
key: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
nodes: { | ||
fallback?: UIDLElementNode; | ||
error?: UIDLElementNode; | ||
}; | ||
mappings?: Record<string, UIDLElementNode>; | ||
}; | ||
} | ||
export interface UIDLCMSListRepeaterNode { | ||
@@ -288,9 +314,15 @@ type: 'cms-list-repeater'; | ||
} | ||
export interface UIDLResourceLink { | ||
export type UIDLResourceLink = UIDLLocalResource | UIDLExternalResource; | ||
export interface UIDLLocalResource { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
export interface UIDLExternalResource { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
export interface UIDLCMSListNodeContent { | ||
elementType: string; | ||
name: string; | ||
name?: string; | ||
key: string; | ||
@@ -306,5 +338,4 @@ attrs?: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
valuePath?: string[]; | ||
valuePath: string[]; | ||
paginationQueryParam?: UIDLStaticValue | UIDLPropValue | UIDLExpressionValue; | ||
itemValuePath?: string[]; | ||
resource?: UIDLResourceLink; | ||
@@ -326,6 +357,6 @@ initialData?: UIDLPropValue; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLResourceLink; | ||
initialData?: UIDLPropValue; | ||
entityKeyProperty?: string; | ||
} | ||
@@ -336,2 +367,3 @@ export interface UIDLCMSListRepeaterNodeContent { | ||
key: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -342,2 +374,3 @@ list: UIDLElementNode; | ||
renderPropIdentifier: string; | ||
source?: string; | ||
} | ||
@@ -354,3 +387,3 @@ export interface UIDLNestedStyleDeclaration { | ||
node: UIDLElementNode; | ||
dataSource: UIDLAttributeValue; | ||
dataSource: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
meta?: UIDLRepeatMeta; | ||
@@ -368,3 +401,4 @@ } | ||
node: UIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
importDefinitions?: Record<string, UIDLExternalDependency>; | ||
value?: string | number | boolean; | ||
@@ -404,5 +438,4 @@ condition?: UIDLConditionalExpression; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
} | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode; | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode | UIDLCMSMixedTypeNode; | ||
export interface UIDLComponentStyleReference { | ||
@@ -412,3 +445,3 @@ type: 'comp-style'; | ||
} | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue | UIDLElementNode; | ||
export type UIDLStyleValue = UIDLDynamicReference | UIDLStaticValue; | ||
@@ -426,3 +459,3 @@ export type UIDLStyleDefinitions = Record<string, UIDLStyleValue>; | ||
content: { | ||
url: UIDLAttributeValue; | ||
url: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
newTab: boolean; | ||
@@ -435,3 +468,3 @@ }; | ||
content: { | ||
section: string; | ||
section: UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
@@ -442,3 +475,3 @@ } | ||
content: { | ||
routeName: UIDLAttributeValue; | ||
routeName: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
}; | ||
@@ -445,0 +478,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLStateValue, UIDLInjectValue, UIDLStateValueDetails, UIDLRouteDefinitions, UIDLStateDefinition } from './uidl'; | ||
import { Modify } from './helper'; | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLLocalResource, UIDLExternalResource, UIDLInjectValue, UIDLStateValueDetails, UIDLStateDefinition, UIDLCMSMixedTypeNode, UIDLDependency, UIDLLocalFontAsset, UIDLStyleValue, UIDLPropDefinition } from './uidl'; | ||
import { Modify, ModifyUnionNumber } from './helper'; | ||
export interface VUIDLElementNode extends Modify<UIDLElementNode, { | ||
@@ -19,8 +19,4 @@ content: VUIDLElement; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
resource?: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
}; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
initialData?: UIDLPropValue; | ||
@@ -41,3 +37,5 @@ }; | ||
content: { | ||
elementType: string; | ||
name?: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -49,8 +47,4 @@ key?: string; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue>; | ||
}; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
initialData?: UIDLPropValue; | ||
@@ -60,6 +54,21 @@ }; | ||
} | ||
export interface VUIDLCMSMixedTypeNode extends Modify<UIDLCMSMixedTypeNode, { | ||
content: { | ||
elementType: string; | ||
name: string; | ||
nodes: { | ||
fallback?: VUIDLElementNode; | ||
error?: VUIDLElementNode; | ||
}; | ||
renderPropIdentifier: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, VUIDLAttributeValue | string | number>; | ||
mappings: Record<string, VUIDLElementNode>; | ||
}; | ||
}> { | ||
} | ||
export type VUIDLConditionalNode = Modify<UIDLConditionalNode, { | ||
content: { | ||
node: VUIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
value?: string | number | boolean; | ||
@@ -72,14 +81,20 @@ condition?: UIDLConditionalExpression; | ||
node: VUIDLElementNode; | ||
dataSource?: UIDLAttributeValue; | ||
dataSource?: UIDLRepeatNode['content']['dataSource']; | ||
meta?: UIDLRepeatMeta; | ||
}; | ||
}>; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | VUIDLCMSMixedTypeNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLElement = Modify<UIDLElement, { | ||
elementType: string; | ||
semanticType?: string; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
abilities?: { | ||
link?: VUIDLLinkNode; | ||
}; | ||
events: UIDLElement['events']; | ||
dependency?: UIDLDependency; | ||
children?: VUIDLNode[]; | ||
style?: Record<string, UIDLAttributeValue | string | number>; | ||
attrs?: Record<string, UIDLAttributeValue | string | number>; | ||
style?: Record<string, UIDLStyleValue | string | number>; | ||
attrs?: Record<string, VUIDLAttributeValue | string | number>; | ||
referencedStyles: Record<string, UIDLElementNodeProjectReferencedStyle | VUIDLElementNodeInlineReferencedStyle | VUIDLElementNodeClassReferencedStyle>; | ||
@@ -91,3 +106,3 @@ }>; | ||
conditions: UIDLStyleConditions[]; | ||
styles: Record<string, UIDLAttributeValue | string | number>; | ||
styles: Record<string, UIDLStyleValue | string | number>; | ||
}; | ||
@@ -110,7 +125,11 @@ }>; | ||
node: VUIDLElementNode; | ||
stateDefinitions: { | ||
route: Modify<UIDLRouteDefinitions, { | ||
stateDefinitions?: { | ||
route: { | ||
type: string; | ||
defaultValue: string; | ||
values: VUIDLStateValueDetails[]; | ||
}>; | ||
[x: string]: UIDLStateDefinition; | ||
}; | ||
[x: string]: UIDLStateDefinition & { | ||
values?: VUIDLStateValueDetails[]; | ||
}; | ||
}; | ||
@@ -138,7 +157,9 @@ designLanguage: { | ||
export type VUIDLSectionLinkNode = Modify<UIDLSectionLinkNode, { | ||
content: Record<string, string>; | ||
content: { | ||
section: string | UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
}>; | ||
export type VUIDLURLLinkNode = Modify<UIDLURLLinkNode, { | ||
content: { | ||
url: UIDLAttributeValue | string; | ||
url: UIDLURLLinkNode['content']['url'] | string; | ||
newTab: boolean; | ||
@@ -149,3 +170,3 @@ }; | ||
content: { | ||
routeName: string | UIDLAttributeValue; | ||
routeName: string | UIDLNavLinkNode['content']['routeName']; | ||
}; | ||
@@ -162,3 +183,3 @@ }>; | ||
export type VUIDLLinkNode = VUIDLURLLinkNode | VUIDLSectionLinkNode | VUIDLNavLinkNode | UIDLMailLinkNode | UIDLPhoneLinkNode | VUIDLDynamicLinkNode; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset | UIDLLocalFontAsset; | ||
export type VUIDLStyleInlineAsset = Modify<UIDLStyleInlineAsset, { | ||
@@ -179,2 +200,6 @@ attrs?: Record<string, UIDLStaticValue | string | boolean | number>; | ||
}>; | ||
export type VUIDLAttributeValue = ModifyUnionNumber<UIDLAttributeValue, UIDLElementNode, VUIDLElementNode>; | ||
export type VUIDLPropDefinitions = Modify<UIDLPropDefinition, { | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | VUIDLElementNode; | ||
}>; | ||
//# sourceMappingURL=vuidl.d.ts.map |
{ | ||
"name": "@teleporthq/teleport-types", | ||
"version": "0.34.0-alpha.0", | ||
"version": "0.34.0", | ||
"description": "The collection of reusable types across the entire teleport ecosystem", | ||
@@ -26,3 +26,3 @@ "author": "teleportHQ", | ||
}, | ||
"gitHead": "89e99b8d79cd3895febd6ba5cd26499c8e743e16" | ||
"gitHead": "e96dd1dda3eebc0a845b2ede19f057702170f0d8" | ||
} |
@@ -13,2 +13,3 @@ import { | ||
UIDLResources, | ||
UIDLLocalFontAsset, | ||
} from './uidl' | ||
@@ -77,3 +78,2 @@ | ||
devDependencies: Record<string, string> | ||
projectResources?: Record<string, ProjectResource> | ||
strategy: ProjectStrategy | ||
@@ -115,7 +115,2 @@ rootFolder: GeneratedFolder | ||
export interface ProjectResource { | ||
fileName: string | ||
path: string | ||
} | ||
export interface GeneratorOptions { | ||
@@ -127,2 +122,4 @@ localDependenciesPrefix?: string | ||
mappings?: Record<string, string> | ||
fontsFolder?: string | ||
localFonts?: UIDLLocalFontAsset[] | ||
} | ||
@@ -142,9 +139,15 @@ mapping?: Mapping | ||
} | ||
projectResources?: Record<string, ProjectResource> | ||
extractedResources?: Record< | ||
string, | ||
{ | ||
fileName: string | ||
fileType: FileType | ||
path: string[] | ||
content: string | ||
} | ||
> | ||
designLanguage?: { | ||
tokens?: UIDLDesignTokens | ||
} | ||
resources?: { items: UIDLResources['items']; cache: UIDLResources['cache'] } & { | ||
path: ProjectStrategy['resources']['path'] | ||
} | ||
resources?: { items: UIDLResources['items']; cache: UIDLResources['cache']; path: string[] } | ||
} | ||
@@ -184,3 +187,4 @@ | ||
template?: GeneratedFolder, | ||
mapping?: Mapping | ||
mapping?: Mapping, | ||
strictHtmlWhitespaceSensitivity?: boolean | ||
) => Promise<GeneratedFolder> | ||
@@ -200,2 +204,3 @@ addMapping: (mapping: Mapping) => void | ||
variation?: StyleVariation | ||
strictHtmlWhitespaceSensitivity?: boolean | ||
} | ||
@@ -208,3 +213,2 @@ | ||
externals: Record<string, ComponentUIDL> | ||
skipValidation?: boolean | ||
assets?: GeneratorOptions['assets'] | ||
@@ -407,2 +411,3 @@ }) => void | ||
readyState?: string | ||
passwordProtection?: string | ||
} | ||
@@ -489,2 +494,4 @@ | ||
assetsFolder?: string[] | ||
excludeGlobalsFromHTMLComponents?: boolean | ||
strictHtmlWhitespaceSensitivity?: boolean | ||
} | ||
@@ -495,2 +502,3 @@ | ||
styleVariation?: StyleVariation | ||
plugins?: ComponentPlugin[] | ||
} | ||
@@ -557,1 +565,3 @@ | ||
) => Promise<CompiledComponent> | ||
export type ElementsLookup = Record<string, { count: number; nextKey: string }> |
export type Modify<T, R> = Omit<T, keyof R> & R | ||
export type ModifyUnionNumber<T, U, V> = T extends U ? V : T |
127
src/uidl.ts
@@ -53,4 +53,4 @@ import { Modify } from './helper' | ||
method?: 'GET' | 'POST' | ||
body?: Record<string, UIDLStaticValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue> | ||
body?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue> | ||
mappers?: string[] | ||
@@ -145,2 +145,9 @@ response?: { | ||
} | ||
export interface UIDLLocalFontAsset { | ||
type: 'local-font' | ||
path: string | ||
properties: Record<string, UIDLStaticValue> | ||
} | ||
export interface UIDLCanonicalAsset { | ||
@@ -150,2 +157,3 @@ type: 'canonical' | ||
} | ||
export interface UIDLIconAsset { | ||
@@ -167,2 +175,3 @@ type: 'icon' | ||
| UIDLIconAsset | ||
| UIDLLocalFontAsset | ||
@@ -185,12 +194,18 @@ export interface ComponentUIDL { | ||
export type UIDLDesignTokens = Record<string, UIDLStaticValue> | ||
export interface UIDLInitialPropsData { | ||
exposeAs: { | ||
name: string | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
valuePath: string[] | ||
} | ||
resource: { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue> | ||
} | ||
resource: | ||
| { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
| { | ||
name: string | ||
dependency: UIDLExternalDependency | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
/* | ||
@@ -217,6 +232,12 @@ We allow the configuration of cache strategy globally for the whole project under | ||
} | ||
resource: { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue> | ||
} | ||
resource: | ||
| { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
| { | ||
name: string | ||
dependency: UIDLExternalDependency | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
} | ||
@@ -232,3 +253,2 @@ | ||
pagination?: PagePaginationOptions | ||
dynamicRouteAttribute?: string | ||
initialPropsData?: UIDLInitialPropsData | ||
@@ -248,3 +268,3 @@ initialPathsData?: UIDLInitialPathsData | ||
type: string | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | UIDLElementNode | ||
isRequired?: boolean | ||
@@ -283,4 +303,2 @@ id?: string | ||
fallback?: boolean | ||
dynamicRouteAttribute?: string | ||
isIndex?: boolean | ||
pagination?: PagePaginationOptions | ||
@@ -293,3 +311,3 @@ initialPropsData?: UIDLInitialPropsData | ||
export type ReferenceType = 'prop' | 'state' | 'local' | 'attr' | 'children' | 'token' | 'expr' | ||
export type ReferenceType = 'prop' | 'state' | 'local' | 'attr' | 'children' | 'token' | ||
@@ -300,2 +318,3 @@ export interface UIDLDynamicReference { | ||
referenceType: ReferenceType | ||
refPath?: string[] | ||
id: string | ||
@@ -344,2 +363,19 @@ } | ||
export interface UIDLCMSMixedTypeNode { | ||
type: 'cms-mixed-type' | ||
content: { | ||
elementType: string | ||
name: string | ||
key: string | ||
dependency?: UIDLDependency | ||
attrs: Record<string, UIDLAttributeValue> | ||
renderPropIdentifier: string | ||
nodes: { | ||
fallback?: UIDLElementNode | ||
error?: UIDLElementNode | ||
} | ||
mappings?: Record<string, UIDLElementNode> | ||
} | ||
} | ||
export interface UIDLCMSListRepeaterNode { | ||
@@ -354,14 +390,20 @@ type: 'cms-list-repeater' | ||
It can have either remote resource or prop but not both. | ||
In the case of `prop` the data is fetched using `getStaticProps` | ||
or `getStaticPaths` at the moment in NextJS. | ||
*/ | ||
export interface UIDLResourceLink { | ||
export type UIDLResourceLink = UIDLLocalResource | UIDLExternalResource | ||
export interface UIDLLocalResource { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue> | ||
} | ||
export interface UIDLExternalResource { | ||
name: string | ||
dependency: UIDLExternalDependency | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue> | ||
} | ||
export interface UIDLCMSListNodeContent { | ||
elementType: string | ||
name: string | ||
name?: string | ||
key: string // internal usage | ||
@@ -377,5 +419,4 @@ attrs?: Record<string, UIDLAttributeValue> | ||
renderPropIdentifier: string | ||
valuePath?: string[] | ||
valuePath: string[] | ||
paginationQueryParam?: UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | ||
itemValuePath?: string[] | ||
resource?: UIDLResourceLink | ||
@@ -398,6 +439,6 @@ initialData?: UIDLPropValue | ||
} | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
valuePath: string[] | ||
resource?: UIDLResourceLink | ||
initialData?: UIDLPropValue | ||
entityKeyProperty?: string | ||
} | ||
@@ -409,2 +450,3 @@ | ||
key: string // internal usage | ||
dependency?: UIDLDependency | ||
nodes: { | ||
@@ -415,2 +457,3 @@ list: UIDLElementNode | ||
renderPropIdentifier: string | ||
source?: string | ||
} | ||
@@ -430,3 +473,9 @@ | ||
node: UIDLElementNode | ||
dataSource: UIDLAttributeValue | ||
dataSource: | ||
| UIDLExpressionValue | ||
| UIDLDynamicReference | ||
| UIDLStaticValue | ||
| UIDLImportReference | ||
| UIDLComponentStyleReference | ||
| UIDLRawValue | ||
meta?: UIDLRepeatMeta | ||
@@ -446,3 +495,4 @@ } | ||
node: UIDLNode | ||
reference: UIDLDynamicReference | ||
reference: UIDLDynamicReference | UIDLExpressionValue | ||
importDefinitions?: Record<string, UIDLExternalDependency> | ||
value?: string | number | boolean | ||
@@ -487,3 +537,2 @@ condition?: UIDLConditionalExpression | ||
selfClosing?: boolean | ||
ignore?: boolean | ||
} | ||
@@ -506,2 +555,3 @@ | ||
| UIDLCMSListRepeaterNode | ||
| UIDLCMSMixedTypeNode | ||
@@ -520,2 +570,3 @@ export interface UIDLComponentStyleReference { | ||
| UIDLRawValue | ||
| UIDLElementNode | ||
@@ -538,3 +589,9 @@ export type UIDLStyleValue = UIDLDynamicReference | UIDLStaticValue | ||
content: { | ||
url: UIDLAttributeValue | ||
url: | ||
| UIDLExpressionValue | ||
| UIDLDynamicReference | ||
| UIDLStaticValue | ||
| UIDLImportReference | ||
| UIDLComponentStyleReference | ||
| UIDLRawValue | ||
newTab: boolean | ||
@@ -551,3 +608,3 @@ } | ||
type: 'section' | ||
content: { section: string } | ||
content: { section: UIDLStaticValue | UIDLExpressionValue } | ||
} | ||
@@ -558,3 +615,9 @@ | ||
content: { | ||
routeName: UIDLAttributeValue | ||
routeName: | ||
| UIDLExpressionValue | ||
| UIDLDynamicReference | ||
| UIDLStaticValue | ||
| UIDLImportReference | ||
| UIDLComponentStyleReference | ||
| UIDLRawValue | ||
} | ||
@@ -561,0 +624,0 @@ } |
105
src/vuidl.ts
@@ -45,9 +45,14 @@ import { | ||
UIDLDateTimeNode, | ||
UIDLStateValue, | ||
UIDLLocalResource, | ||
UIDLExternalResource, | ||
UIDLInjectValue, | ||
UIDLStateValueDetails, | ||
UIDLRouteDefinitions, | ||
UIDLStateDefinition, | ||
UIDLCMSMixedTypeNode, | ||
UIDLDependency, | ||
UIDLLocalFontAsset, | ||
UIDLStyleValue, | ||
UIDLPropDefinition, | ||
} from './uidl' | ||
import { Modify } from './helper' | ||
import { Modify, ModifyUnionNumber } from './helper' | ||
@@ -69,8 +74,4 @@ export interface VUIDLElementNode extends Modify<UIDLElementNode, { content: VUIDLElement }> {} | ||
} | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
resource?: { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue> | ||
} | ||
valuePath: string[] | ||
resource?: UIDLLocalResource | UIDLExternalResource | ||
initialData?: UIDLPropValue | ||
@@ -99,3 +100,5 @@ } | ||
content: { | ||
elementType: string | ||
name?: string | ||
dependency?: UIDLDependency | ||
nodes: { | ||
@@ -107,11 +110,4 @@ key?: string | ||
} | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
resource: { | ||
id: string | ||
params?: Record< | ||
string, | ||
UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue | ||
> | ||
} | ||
valuePath: string[] | ||
resource?: UIDLLocalResource | UIDLExternalResource | ||
initialData?: UIDLPropValue | ||
@@ -122,2 +118,21 @@ } | ||
export interface VUIDLCMSMixedTypeNode | ||
extends Modify< | ||
UIDLCMSMixedTypeNode, | ||
{ | ||
content: { | ||
elementType: string | ||
name: string | ||
nodes: { | ||
fallback?: VUIDLElementNode | ||
error?: VUIDLElementNode | ||
} | ||
renderPropIdentifier: string | ||
dependency?: UIDLDependency | ||
attrs: Record<string, VUIDLAttributeValue | string | number> | ||
mappings: Record<string, VUIDLElementNode> | ||
} | ||
} | ||
> {} | ||
export type VUIDLConditionalNode = Modify< | ||
@@ -128,3 +143,3 @@ UIDLConditionalNode, | ||
node: VUIDLNode | ||
reference: UIDLDynamicReference | ||
reference: UIDLDynamicReference | UIDLExpressionValue | ||
value?: string | number | boolean | ||
@@ -141,3 +156,3 @@ condition?: UIDLConditionalExpression | ||
node: VUIDLElementNode | ||
dataSource?: UIDLAttributeValue | ||
dataSource?: UIDLRepeatNode['content']['dataSource'] | ||
meta?: UIDLRepeatMeta | ||
@@ -160,2 +175,3 @@ } | ||
| VCMSListRepeaterElementNode | ||
| VUIDLCMSMixedTypeNode | ||
| UIDLExpressionValue | ||
@@ -168,8 +184,14 @@ | UIDLInjectValue | ||
{ | ||
elementType: string | ||
semanticType?: string | ||
selfClosing?: boolean | ||
ignore?: boolean | ||
abilities?: { | ||
link?: VUIDLLinkNode | ||
} | ||
events: UIDLElement['events'] | ||
dependency?: UIDLDependency | ||
children?: VUIDLNode[] | ||
style?: Record<string, UIDLAttributeValue | string | number> | ||
attrs?: Record<string, UIDLAttributeValue | string | number> | ||
style?: Record<string, UIDLStyleValue | string | number> | ||
attrs?: Record<string, VUIDLAttributeValue | string | number> | ||
referencedStyles: Record< | ||
@@ -190,3 +212,3 @@ string, | ||
conditions: UIDLStyleConditions[] | ||
styles: Record<string, UIDLAttributeValue | string | number> | ||
styles: Record<string, UIDLStyleValue | string | number> | ||
} | ||
@@ -222,10 +244,9 @@ } | ||
node: VUIDLElementNode | ||
stateDefinitions: { | ||
route: Modify< | ||
UIDLRouteDefinitions, | ||
{ | ||
values: VUIDLStateValueDetails[] | ||
} | ||
> | ||
[x: string]: UIDLStateDefinition | ||
stateDefinitions?: { | ||
route: { | ||
type: string | ||
defaultValue: string | ||
values: VUIDLStateValueDetails[] | ||
} | ||
[x: string]: UIDLStateDefinition & { values?: VUIDLStateValueDetails[] } | ||
} | ||
@@ -271,3 +292,5 @@ designLanguage: { | ||
{ | ||
content: Record<string, string> | ||
content: { | ||
section: string | UIDLStaticValue | UIDLExpressionValue | ||
} | ||
} | ||
@@ -280,3 +303,3 @@ > | ||
content: { | ||
url: UIDLAttributeValue | string | ||
url: UIDLURLLinkNode['content']['url'] | string | ||
newTab: boolean | ||
@@ -291,3 +314,3 @@ } | ||
content: { | ||
routeName: string | UIDLAttributeValue | ||
routeName: string | UIDLNavLinkNode['content']['routeName'] | ||
} | ||
@@ -330,2 +353,3 @@ } | ||
| VUIDLFontAsset | ||
| UIDLLocalFontAsset | ||
@@ -366,1 +390,14 @@ export type VUIDLStyleInlineAsset = Modify< | ||
> | ||
export type VUIDLAttributeValue = ModifyUnionNumber< | ||
UIDLAttributeValue, | ||
UIDLElementNode, | ||
VUIDLElementNode | ||
> | ||
export type VUIDLPropDefinitions = Modify< | ||
UIDLPropDefinition, | ||
{ | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | VUIDLElementNode | ||
} | ||
> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
306497
5173