@wix/zero-config-implementation 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/converters/data-item-builder.d.ts +1 -1
- package/dist/converters/to-editor-component.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6973 -6833
- package/dist/information-extractors/css/selector-matcher.d.ts +4 -1
- package/dist/information-extractors/css/types.d.ts +10 -0
- package/dist/manifest-pipeline.d.ts +1 -0
- package/dist/wix-type-to-data-type.d.ts +6 -0
- package/package.json +3 -2
- package/src/converters/data-item-builder.ts +5 -4
- package/src/converters/to-editor-component.ts +197 -43
- package/src/index.ts +2 -2
- package/src/information-extractors/css/parse.ts +161 -34
- package/src/information-extractors/css/selector-matcher.ts +29 -2
- package/src/information-extractors/css/types.ts +11 -0
- package/src/information-extractors/ts/utils/semantic-type-resolver.ts +1 -3
- package/src/manifest-pipeline.ts +6 -2
- package/src/wix-type-to-data-type.ts +33 -0
- package/dist/schema.d.ts +0 -168
- package/src/schema.ts +0 -206
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { CSS_PROPERTIES } from '@wix/zero-config-schema'
|
|
2
|
+
import { camelCase } from 'case-anything'
|
|
1
3
|
import { transform } from 'lightningcss'
|
|
4
|
+
import type { TokenOrValue } from 'lightningcss'
|
|
2
5
|
import type { CSSParserAPI, CSSProperty } from './types'
|
|
3
6
|
// Store parsed selectors for later DOM selector computation
|
|
4
7
|
const parsedSelectors = new Map<string, unknown[]>()
|
|
@@ -13,7 +16,7 @@ export function parseCss(cssString: string): CSSParserAPI {
|
|
|
13
16
|
parsedSelectors.clear()
|
|
14
17
|
|
|
15
18
|
// Parse all properties eagerly at initialization using lightningcss
|
|
16
|
-
const allProperties = parseAllProperties(cssString)
|
|
19
|
+
const { propertiesMap: allProperties, varUsagesByProperty } = parseAllProperties(cssString)
|
|
17
20
|
|
|
18
21
|
return {
|
|
19
22
|
getPropertiesForSelector(selector: string): CSSProperty[] {
|
|
@@ -25,27 +28,8 @@ export function parseCss(cssString: string): CSSParserAPI {
|
|
|
25
28
|
},
|
|
26
29
|
|
|
27
30
|
getVarUsages(varName: string): string[] {
|
|
28
|
-
// Normalize variable name to include --
|
|
29
31
|
const normalizedVarName = varName.startsWith('--') ? varName : `--${varName}`
|
|
30
|
-
|
|
31
|
-
const propertyNames = new Set<string>()
|
|
32
|
-
|
|
33
|
-
// Search through all properties for var() usage
|
|
34
|
-
for (const properties of allProperties.values()) {
|
|
35
|
-
for (const property of properties) {
|
|
36
|
-
// Check if the value contains var(--varName)
|
|
37
|
-
const varPattern = new RegExp(`var\\(\\s*${escapeRegex(normalizedVarName)}\\s*[,)]`, 'i')
|
|
38
|
-
|
|
39
|
-
if (varPattern.test(property.value)) {
|
|
40
|
-
// Ignore shorthand properties (values with multiple space-separated values)
|
|
41
|
-
if (!isShorthandValue(property.value)) {
|
|
42
|
-
propertyNames.add(property.name)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return Array.from(propertyNames)
|
|
32
|
+
return [...(varUsagesByProperty.get(normalizedVarName) ?? [])]
|
|
49
33
|
},
|
|
50
34
|
|
|
51
35
|
getUniqueProperties(selectors: string[]): Map<string, string> {
|
|
@@ -76,17 +60,35 @@ export function parseCss(cssString: string): CSSParserAPI {
|
|
|
76
60
|
if (!parsed) return null
|
|
77
61
|
return buildDomSelector(parsed)
|
|
78
62
|
},
|
|
63
|
+
|
|
64
|
+
getVarPropertyType(varName: string, defaultValue: string): string | undefined {
|
|
65
|
+
const usages = this.getVarUsages(varName)
|
|
66
|
+
if (usages.length === 0) return undefined
|
|
67
|
+
const uniqueProperties = [...new Set(usages)]
|
|
68
|
+
if (uniqueProperties.length === 1) {
|
|
69
|
+
const camelCased = camelCase(uniqueProperties[0])
|
|
70
|
+
const validValues = Object.values(CSS_PROPERTIES.CSS_PROPERTY_TYPE) as string[]
|
|
71
|
+
if (validValues.includes(camelCased)) return camelCased
|
|
72
|
+
}
|
|
73
|
+
return inferCssDataType(defaultValue)
|
|
74
|
+
},
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
/**
|
|
83
|
-
* Parses all selectors and their properties from the CSS using lightningcss
|
|
79
|
+
* Parses all selectors and their properties from the CSS using lightningcss.
|
|
80
|
+
* Also builds a direct map of var() usages by scanning unparsed declaration tokens,
|
|
81
|
+
* since serialized property values lose var() references.
|
|
84
82
|
* Supports @media rules, @keyframes, and nested selectors
|
|
85
83
|
* @param cssString - CSS string to parse
|
|
86
|
-
* @returns
|
|
84
|
+
* @returns propertiesMap (selector → properties) and varUsagesByProperty (varName → CSS property names)
|
|
87
85
|
*/
|
|
88
|
-
function parseAllProperties(cssString: string):
|
|
86
|
+
function parseAllProperties(cssString: string): {
|
|
87
|
+
propertiesMap: Map<string, CSSProperty[]>
|
|
88
|
+
varUsagesByProperty: Map<string, Set<string>>
|
|
89
|
+
} {
|
|
89
90
|
const propertiesMap = new Map<string, CSSProperty[]>()
|
|
91
|
+
const varUsagesByProperty = new Map<string, Set<string>>()
|
|
90
92
|
|
|
91
93
|
try {
|
|
92
94
|
// Use lightningcss transform with visitor to collect properties
|
|
@@ -113,10 +115,26 @@ function parseAllProperties(cssString: string): Map<string, CSSProperty[]> {
|
|
|
113
115
|
// Extract properties from declarations
|
|
114
116
|
const properties: CSSProperty[] = []
|
|
115
117
|
for (const decl of rule.value.declarations?.declarations ?? []) {
|
|
116
|
-
const
|
|
118
|
+
const declTyped = decl as LightningDecl
|
|
119
|
+
const extracted = extractPropertyNameAndValue(declTyped)
|
|
117
120
|
if (extracted) {
|
|
118
121
|
properties.push(extracted)
|
|
119
122
|
}
|
|
123
|
+
|
|
124
|
+
// Track var() usages by scanning unparsed declaration tokens directly.
|
|
125
|
+
// propertyValueToString cannot recover var() from unparsed values, so
|
|
126
|
+
// we inspect the token array instead.
|
|
127
|
+
if (declTyped.property === 'unparsed') {
|
|
128
|
+
const unparsed = declTyped.value as { propertyId?: { property?: string }; value?: unknown[] }
|
|
129
|
+
const cssPropertyName = unparsed.propertyId?.property
|
|
130
|
+
if (cssPropertyName) {
|
|
131
|
+
for (const varName of extractVarNamesFromTokens(unparsed.value ?? [])) {
|
|
132
|
+
const usageSet = varUsagesByProperty.get(varName) ?? new Set<string>()
|
|
133
|
+
usageSet.add(cssPropertyName)
|
|
134
|
+
varUsagesByProperty.set(varName, usageSet)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
120
138
|
}
|
|
121
139
|
|
|
122
140
|
// Store properties for each selector
|
|
@@ -176,7 +194,36 @@ function parseAllProperties(cssString: string): Map<string, CSSProperty[]> {
|
|
|
176
194
|
console.error('CSS parsing error:', error)
|
|
177
195
|
}
|
|
178
196
|
|
|
179
|
-
return propertiesMap
|
|
197
|
+
return { propertiesMap, varUsagesByProperty }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Extracts all CSS custom property names referenced via var() from a lightningcss token array.
|
|
202
|
+
* Handles nested token arrays recursively (e.g. tokens inside function arguments).
|
|
203
|
+
*/
|
|
204
|
+
function extractVarNamesFromTokens(tokens: unknown[]): string[] {
|
|
205
|
+
const varNames: string[] = []
|
|
206
|
+
|
|
207
|
+
for (const token of tokens) {
|
|
208
|
+
if (!token || typeof token !== 'object') continue
|
|
209
|
+
const tokenObj = token as Record<string, unknown>
|
|
210
|
+
|
|
211
|
+
if (tokenObj.type === 'var') {
|
|
212
|
+
const varValue = tokenObj.value as Record<string, unknown> | undefined
|
|
213
|
+
const nameObj = varValue?.name as Record<string, unknown> | undefined
|
|
214
|
+
const identName = nameObj?.ident as string | undefined
|
|
215
|
+
if (identName) {
|
|
216
|
+
varNames.push(identName.startsWith('--') ? identName : `--${identName}`)
|
|
217
|
+
}
|
|
218
|
+
} else if (tokenObj.type === 'function' || Array.isArray(tokenObj.value)) {
|
|
219
|
+
const nestedTokens = tokenObj.value as unknown[]
|
|
220
|
+
if (Array.isArray(nestedTokens)) {
|
|
221
|
+
varNames.push(...extractVarNamesFromTokens(nestedTokens))
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return varNames
|
|
180
227
|
}
|
|
181
228
|
|
|
182
229
|
/**
|
|
@@ -271,7 +318,7 @@ interface LightningDecl {
|
|
|
271
318
|
|
|
272
319
|
interface CustomPropertyValue {
|
|
273
320
|
name: string
|
|
274
|
-
value:
|
|
321
|
+
value: TokenOrValue[]
|
|
275
322
|
}
|
|
276
323
|
|
|
277
324
|
/**
|
|
@@ -339,19 +386,33 @@ function serializeCustomPropertyValue(valueArray: unknown[]): string {
|
|
|
339
386
|
parts.push(`rgba(${r}, ${g}, ${b}, ${a})`)
|
|
340
387
|
}
|
|
341
388
|
}
|
|
342
|
-
} else if (t.type === 'length' || t.type === '
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
389
|
+
} else if (t.type === 'length' || t.type === 'resolution') {
|
|
390
|
+
// length/resolution: { unit: string, value: number }
|
|
391
|
+
const dim = t.value as Record<string, unknown>
|
|
392
|
+
parts.push(`${dim.value}${dim.unit}`)
|
|
393
|
+
} else if (t.type === 'angle') {
|
|
394
|
+
// angle: { type: 'deg' | 'rad' | 'grad' | 'turn', value: number }
|
|
395
|
+
const dim = t.value as Record<string, unknown>
|
|
396
|
+
parts.push(`${dim.value}${dim.type}`)
|
|
397
|
+
} else if (t.type === 'time') {
|
|
398
|
+
// time: { type: 'seconds' | 'milliseconds', value: number }
|
|
399
|
+
const dim = t.value as Record<string, unknown>
|
|
400
|
+
const unit = dim.type === 'milliseconds' ? 'ms' : 's'
|
|
401
|
+
parts.push(`${dim.value}${unit}`)
|
|
349
402
|
} else if (t.type === 'token') {
|
|
350
403
|
const tokenValue = t.value as Record<string, unknown>
|
|
351
404
|
if (tokenValue.type === 'ident') {
|
|
352
405
|
parts.push(tokenValue.value as string)
|
|
353
406
|
} else if (tokenValue.type === 'string') {
|
|
354
407
|
parts.push(`"${tokenValue.value}"`)
|
|
408
|
+
} else if (tokenValue.type === 'number') {
|
|
409
|
+
parts.push(String(tokenValue.value))
|
|
410
|
+
} else if (tokenValue.type === 'percentage') {
|
|
411
|
+
parts.push(`${(tokenValue.value as number) * 100}%`)
|
|
412
|
+
} else if (tokenValue.type === 'dimension') {
|
|
413
|
+
parts.push(`${tokenValue.value}${tokenValue.unit}`)
|
|
414
|
+
} else if (tokenValue.type === 'white-space') {
|
|
415
|
+
parts.push(tokenValue.value as string)
|
|
355
416
|
}
|
|
356
417
|
}
|
|
357
418
|
}
|
|
@@ -448,3 +509,69 @@ function isShorthandValue(value: string): boolean {
|
|
|
448
509
|
function escapeRegex(str: string): string {
|
|
449
510
|
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
450
511
|
}
|
|
512
|
+
|
|
513
|
+
const ANGLE_UNITS = new Set(['deg', 'rad', 'grad', 'turn'])
|
|
514
|
+
const TIME_UNITS = new Set(['s', 'ms'])
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Infers the CSS data type category from a custom property's initial value string.
|
|
518
|
+
* Uses lightningcss to parse the value and inspect the first token's type.
|
|
519
|
+
* Returns a value from CSS_PROPERTIES.CSS_DATA_TYPE.
|
|
520
|
+
*/
|
|
521
|
+
function inferCssDataType(defaultValue: string): string {
|
|
522
|
+
const { CSS_DATA_TYPE } = CSS_PROPERTIES
|
|
523
|
+
let inferredType: string = CSS_DATA_TYPE.string
|
|
524
|
+
|
|
525
|
+
try {
|
|
526
|
+
transform({
|
|
527
|
+
filename: 'input.css',
|
|
528
|
+
code: Buffer.from(`.x { --foo: ${defaultValue}; }`),
|
|
529
|
+
minify: false,
|
|
530
|
+
visitor: {
|
|
531
|
+
Rule: {
|
|
532
|
+
style(rule) {
|
|
533
|
+
for (const declaration of rule.value.declarations?.declarations ?? []) {
|
|
534
|
+
const decl = declaration as LightningDecl
|
|
535
|
+
if (decl.property === 'custom') {
|
|
536
|
+
const tokens = (decl.value as CustomPropertyValue).value
|
|
537
|
+
if (tokens?.length > 0) {
|
|
538
|
+
const firstToken = tokens[0]
|
|
539
|
+
if (firstToken.type === 'color') {
|
|
540
|
+
inferredType = CSS_DATA_TYPE.color
|
|
541
|
+
} else if (firstToken.type === 'length') {
|
|
542
|
+
inferredType = CSS_DATA_TYPE.length
|
|
543
|
+
} else if (firstToken.type === 'angle') {
|
|
544
|
+
inferredType = CSS_DATA_TYPE.angle
|
|
545
|
+
} else if (firstToken.type === 'time') {
|
|
546
|
+
inferredType = CSS_DATA_TYPE.time
|
|
547
|
+
} else if (firstToken.type === 'token') {
|
|
548
|
+
const raw = firstToken.value
|
|
549
|
+
if (raw.type === 'number') {
|
|
550
|
+
inferredType = CSS_DATA_TYPE.number
|
|
551
|
+
} else if (raw.type === 'percentage') {
|
|
552
|
+
inferredType = CSS_DATA_TYPE.percentage
|
|
553
|
+
} else if (raw.type === 'dimension') {
|
|
554
|
+
const unit = raw.unit.toString()
|
|
555
|
+
if (ANGLE_UNITS.has(unit)) {
|
|
556
|
+
inferredType = CSS_DATA_TYPE.angle
|
|
557
|
+
} else if (TIME_UNITS.has(unit)) {
|
|
558
|
+
inferredType = CSS_DATA_TYPE.time
|
|
559
|
+
} else {
|
|
560
|
+
inferredType = CSS_DATA_TYPE.length
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return undefined
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
})
|
|
572
|
+
} catch {
|
|
573
|
+
// Fall back to 'string' if parsing fails
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
return inferredType
|
|
577
|
+
}
|
|
@@ -8,12 +8,13 @@ export function matchCssSelectors(
|
|
|
8
8
|
html: string,
|
|
9
9
|
elements: ExtractedElement[],
|
|
10
10
|
cssInfos: ExtractedCssInfo[],
|
|
11
|
-
): ExtractedElement[] {
|
|
11
|
+
): { elements: ExtractedElement[]; varUsedByTraceId: Map<string, Set<string>> } {
|
|
12
12
|
const $ = cheerio.load(html)
|
|
13
13
|
|
|
14
14
|
// Build traceId -> matches map
|
|
15
15
|
const matchesByTraceId = new Map<string, CssSelectorMatch[]>()
|
|
16
16
|
const customPropsByTraceId = new Map<string, Record<string, string>>()
|
|
17
|
+
const varUsedByTraceId = new Map<string, Set<string>>()
|
|
17
18
|
|
|
18
19
|
for (const cssInfo of cssInfos) {
|
|
19
20
|
const allProps = cssInfo.api.getAllProperties()
|
|
@@ -51,6 +52,15 @@ export function matchCssSelectors(
|
|
|
51
52
|
const existing = matchesByTraceId.get(traceId) ?? []
|
|
52
53
|
existing.push({ selector, properties: regular })
|
|
53
54
|
matchesByTraceId.set(traceId, existing)
|
|
55
|
+
|
|
56
|
+
// Track which CSS custom properties are used (via var()) by this element
|
|
57
|
+
for (const regularProp of regular) {
|
|
58
|
+
for (const varName of extractVarRefs(regularProp.value)) {
|
|
59
|
+
const traceIdSet = varUsedByTraceId.get(varName) ?? new Set()
|
|
60
|
+
traceIdSet.add(traceId)
|
|
61
|
+
varUsedByTraceId.set(varName, traceIdSet)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
54
64
|
}
|
|
55
65
|
|
|
56
66
|
if (Object.keys(custom).length > 0) {
|
|
@@ -65,7 +75,24 @@ export function matchCssSelectors(
|
|
|
65
75
|
}
|
|
66
76
|
}
|
|
67
77
|
|
|
68
|
-
return
|
|
78
|
+
return {
|
|
79
|
+
elements: enrichElements(elements, matchesByTraceId, customPropsByTraceId),
|
|
80
|
+
varUsedByTraceId,
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Extracts all CSS custom property names referenced via var() in a property value string.
|
|
86
|
+
*/
|
|
87
|
+
function extractVarRefs(value: string): string[] {
|
|
88
|
+
const varNames: string[] = []
|
|
89
|
+
const varPattern = /var\(\s*(--[\w-]+)/g
|
|
90
|
+
let varMatch = varPattern.exec(value)
|
|
91
|
+
while (varMatch !== null) {
|
|
92
|
+
varNames.push(varMatch[1])
|
|
93
|
+
varMatch = varPattern.exec(value)
|
|
94
|
+
}
|
|
95
|
+
return varNames
|
|
69
96
|
}
|
|
70
97
|
|
|
71
98
|
function enrichElements(
|
|
@@ -53,4 +53,15 @@ export interface CSSParserAPI {
|
|
|
53
53
|
* @returns DOM-matchable selector string or null
|
|
54
54
|
*/
|
|
55
55
|
getDomSelector: (selector: string) => string | null
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Determines the CSS property type for a custom property based on how it is used.
|
|
59
|
+
* If all usages of varName are within the same CSS property, returns that property name.
|
|
60
|
+
* If usages differ, returns the CSS data type inferred from the initial value
|
|
61
|
+
* ('color', 'length', 'number', or 'string').
|
|
62
|
+
* Returns undefined if the variable is never used via var().
|
|
63
|
+
* @param varName - The CSS variable name (with or without --)
|
|
64
|
+
* @param defaultValue - The initial value string of the custom property
|
|
65
|
+
*/
|
|
66
|
+
getVarPropertyType: (varName: string, defaultValue: string) => string | undefined
|
|
56
67
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as fs from 'node:fs'
|
|
2
2
|
import * as path from 'node:path'
|
|
3
3
|
import ts from 'typescript'
|
|
4
|
-
import {
|
|
4
|
+
import { WIX_TYPE_TO_DATA_TYPE } from '../../../wix-type-to-data-type'
|
|
5
5
|
import type { PropInfo, ResolvedType } from '../types'
|
|
6
6
|
|
|
7
7
|
const MAX_RESOLVE_DEPTH = 30
|
|
8
8
|
|
|
9
|
-
const { WIX_TYPE_TO_DATA_TYPE } = DATA
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* Cache for package name lookups
|
|
13
11
|
*/
|
package/src/manifest-pipeline.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface ExtractedCssInfo {
|
|
|
39
39
|
|
|
40
40
|
export interface ComponentInfoWithCss extends CoupledComponentInfo {
|
|
41
41
|
css: ExtractedCssInfo[]
|
|
42
|
+
varUsedByTraceId: Map<string, Set<string>>
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/** The result of processing a single component through the manifest pipeline. */
|
|
@@ -147,13 +148,15 @@ export function processComponent(
|
|
|
147
148
|
warnings.push(...cssWarnings)
|
|
148
149
|
|
|
149
150
|
// Match CSS selectors to elements
|
|
151
|
+
let varUsedByTraceId = new Map<string, Set<string>>()
|
|
150
152
|
if (html && extractedElements.length > 0 && css.length > 0) {
|
|
151
153
|
try {
|
|
152
|
-
const
|
|
154
|
+
const matchResult = matchCssSelectors(html, extractedElements, css)
|
|
153
155
|
enhancedInfo = {
|
|
154
156
|
...enhancedInfo,
|
|
155
|
-
elements: convertElements(
|
|
157
|
+
elements: convertElements(matchResult.elements),
|
|
156
158
|
}
|
|
159
|
+
varUsedByTraceId = matchResult.varUsedByTraceId
|
|
157
160
|
} catch (error) {
|
|
158
161
|
warnings.push({
|
|
159
162
|
componentName: componentInfo.componentName,
|
|
@@ -168,6 +171,7 @@ export function processComponent(
|
|
|
168
171
|
component: {
|
|
169
172
|
...enhancedInfo,
|
|
170
173
|
css,
|
|
174
|
+
varUsedByTraceId,
|
|
171
175
|
},
|
|
172
176
|
warnings,
|
|
173
177
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DATA } from '@wix/zero-config-schema'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maps @wix/public-schemas type names (PascalCase) to their DATA_TYPE keys.
|
|
5
|
+
* Derived from the exports of @wix/public-schemas.
|
|
6
|
+
*/
|
|
7
|
+
export const WIX_TYPE_TO_DATA_TYPE: Record<string, keyof typeof DATA.DATA_TYPE> = {
|
|
8
|
+
Link: 'link',
|
|
9
|
+
Image: 'image',
|
|
10
|
+
Video: 'video',
|
|
11
|
+
VectorArt: 'vectorArt',
|
|
12
|
+
A11y: 'a11y',
|
|
13
|
+
Audio: 'audio',
|
|
14
|
+
MenuItems: 'menuItems',
|
|
15
|
+
Schema: 'schema',
|
|
16
|
+
Text: 'text',
|
|
17
|
+
TextEnum: 'textEnum',
|
|
18
|
+
NumberType: 'number',
|
|
19
|
+
BooleanValue: 'booleanValue',
|
|
20
|
+
LocalDate: 'localDate',
|
|
21
|
+
LocalTime: 'localTime',
|
|
22
|
+
LocalDateTime: 'localDateTime',
|
|
23
|
+
WebUrl: 'webUrl',
|
|
24
|
+
Email: 'email',
|
|
25
|
+
Phone: 'phone',
|
|
26
|
+
Hostname: 'hostname',
|
|
27
|
+
Regex: 'regex',
|
|
28
|
+
Guid: 'guid',
|
|
29
|
+
RichText: 'richText',
|
|
30
|
+
Container: 'container',
|
|
31
|
+
ArrayItems: 'arrayItems',
|
|
32
|
+
Direction: 'direction',
|
|
33
|
+
}
|
package/dist/schema.d.ts
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
export declare const DATA: {
|
|
2
|
-
DATA_TYPE: {
|
|
3
|
-
readonly UNKNOWN_DataType: "UNKNOWN_DataType";
|
|
4
|
-
readonly text: "text";
|
|
5
|
-
readonly textEnum: "textEnum";
|
|
6
|
-
readonly number: "number";
|
|
7
|
-
readonly booleanValue: "booleanValue";
|
|
8
|
-
readonly a11y: "a11y";
|
|
9
|
-
readonly link: "link";
|
|
10
|
-
readonly image: "image";
|
|
11
|
-
readonly video: "video";
|
|
12
|
-
readonly vectorArt: "vectorArt";
|
|
13
|
-
readonly audio: "audio";
|
|
14
|
-
readonly schema: "schema";
|
|
15
|
-
readonly localDate: "localDate";
|
|
16
|
-
readonly localTime: "localTime";
|
|
17
|
-
readonly localDateTime: "localDateTime";
|
|
18
|
-
readonly webUrl: "webUrl";
|
|
19
|
-
readonly email: "email";
|
|
20
|
-
readonly phone: "phone";
|
|
21
|
-
readonly hostname: "hostname";
|
|
22
|
-
readonly regex: "regex";
|
|
23
|
-
readonly guid: "guid";
|
|
24
|
-
readonly richText: "richText";
|
|
25
|
-
readonly container: "container";
|
|
26
|
-
readonly arrayItems: "arrayItems";
|
|
27
|
-
readonly direction: "direction";
|
|
28
|
-
readonly menuItems: "menuItems";
|
|
29
|
-
readonly data: "data";
|
|
30
|
-
readonly function: "function";
|
|
31
|
-
readonly onClick: "onClick";
|
|
32
|
-
readonly onChange: "onChange";
|
|
33
|
-
readonly onKeyPress: "onKeyPress";
|
|
34
|
-
readonly onKeyUp: "onKeyUp";
|
|
35
|
-
readonly onSubmit: "onSubmit";
|
|
36
|
-
};
|
|
37
|
-
A11Y_ATTRIBUTES: {
|
|
38
|
-
readonly Unknown_AriaAttributes: "Unknown_AriaAttributes";
|
|
39
|
-
readonly tabIndex: "tabIndex";
|
|
40
|
-
readonly ariaLevel: "ariaLevel";
|
|
41
|
-
readonly ariaExpanded: "ariaExpanded";
|
|
42
|
-
readonly ariaDisabled: "ariaDisabled";
|
|
43
|
-
readonly ariaAtomic: "ariaAtomic";
|
|
44
|
-
readonly ariaHidden: "ariaHidden";
|
|
45
|
-
readonly ariaBusy: "ariaBusy";
|
|
46
|
-
readonly multiline: "multiline";
|
|
47
|
-
readonly ariaAutocomplete: "ariaAutocomplete";
|
|
48
|
-
readonly ariaPressed: "ariaPressed";
|
|
49
|
-
readonly ariaHaspopup: "ariaHaspopup";
|
|
50
|
-
readonly ariaRelevant: "ariaRelevant";
|
|
51
|
-
readonly role: "role";
|
|
52
|
-
readonly ariaLive: "ariaLive";
|
|
53
|
-
readonly ariaCurrent: "ariaCurrent";
|
|
54
|
-
readonly ariaLabel: "ariaLabel";
|
|
55
|
-
readonly ariaRoledescription: "ariaRoledescription";
|
|
56
|
-
readonly ariaDescribedby: "ariaDescribedby";
|
|
57
|
-
readonly ariaLabelledby: "ariaLabelledby";
|
|
58
|
-
readonly ariaErrormessage: "ariaErrormessage";
|
|
59
|
-
readonly ariaOwns: "ariaOwns";
|
|
60
|
-
readonly ariaControls: "ariaControls";
|
|
61
|
-
readonly tag: "tag";
|
|
62
|
-
readonly ariaMultiline: "ariaMultiline";
|
|
63
|
-
readonly ariaInvalid: "ariaInvalid";
|
|
64
|
-
};
|
|
65
|
-
LINK_TYPE: {
|
|
66
|
-
readonly UNKNOWN_LinkType: "UNKNOWN_LinkType";
|
|
67
|
-
readonly externalLink: "externalLink";
|
|
68
|
-
readonly anchorLink: "anchorLink";
|
|
69
|
-
readonly emailLink: "emailLink";
|
|
70
|
-
readonly phoneLink: "phoneLink";
|
|
71
|
-
readonly dynamicPageLink: "dynamicPageLink";
|
|
72
|
-
readonly pageLink: "pageLink";
|
|
73
|
-
readonly whatsAppLink: "whatsAppLink";
|
|
74
|
-
readonly documentLink: "documentLink";
|
|
75
|
-
readonly popupLink: "popupLink";
|
|
76
|
-
readonly addressLink: "addressLink";
|
|
77
|
-
readonly edgeAnchorLinks: "edgeAnchorLinks";
|
|
78
|
-
readonly loginToWixLink: "loginToWixLink";
|
|
79
|
-
};
|
|
80
|
-
WIX_TYPE_TO_DATA_TYPE: Record<string, "number" | "function" | "UNKNOWN_DataType" | "text" | "textEnum" | "booleanValue" | "a11y" | "link" | "image" | "video" | "vectorArt" | "audio" | "schema" | "localDate" | "localTime" | "localDateTime" | "webUrl" | "email" | "phone" | "hostname" | "regex" | "guid" | "richText" | "container" | "arrayItems" | "direction" | "menuItems" | "data" | "onClick" | "onChange" | "onKeyPress" | "onKeyUp" | "onSubmit">;
|
|
81
|
-
};
|
|
82
|
-
export declare const MEDIA: {
|
|
83
|
-
VIDEO_CATEGORY: {
|
|
84
|
-
readonly UNKNOWN_VideoCategoryTypes: "UNKNOWN_VideoCategoryTypes";
|
|
85
|
-
readonly VIDEO: "VIDEO";
|
|
86
|
-
readonly VIDEO_TRANSPARENT: "VIDEO_TRANSPARENT";
|
|
87
|
-
readonly VIDEO_OPAQUE: "VIDEO_OPAQUE";
|
|
88
|
-
};
|
|
89
|
-
VECTOR_ART_CATEGORY: {
|
|
90
|
-
readonly UNKNOWN_VectorArtCategoryTypes: "UNKNOWN_VectorArtCategoryTypes";
|
|
91
|
-
readonly SHAPE_ALL: "SHAPE_ALL";
|
|
92
|
-
readonly SHAPE_BASIC: "SHAPE_BASIC";
|
|
93
|
-
readonly SHAPE_ART: "SHAPE_ART";
|
|
94
|
-
readonly ICON_SOCIAL: "ICON_SOCIAL";
|
|
95
|
-
readonly SHAPE_DIVIDERS: "SHAPE_DIVIDERS";
|
|
96
|
-
readonly SHAPE_LOCATION: "SHAPE_LOCATION";
|
|
97
|
-
readonly SHAPE_DOCUMENTS: "SHAPE_DOCUMENTS";
|
|
98
|
-
readonly SHAPE_SOCIAL: "SHAPE_SOCIAL";
|
|
99
|
-
readonly SHAPE_ARROWS: "SHAPE_ARROWS";
|
|
100
|
-
};
|
|
101
|
-
IMAGE_CATEGORY: {
|
|
102
|
-
readonly UNKNOWN_CategoryName: "UNKNOWN_CategoryName";
|
|
103
|
-
readonly IMAGE: "IMAGE";
|
|
104
|
-
readonly IMAGE_BACKGROUND: "IMAGE_BACKGROUND";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
export declare const ELEMENTS: {
|
|
108
|
-
ELEMENT_TYPE: {
|
|
109
|
-
readonly UNKNOWN_ElementType: "UNKNOWN_ElementType";
|
|
110
|
-
readonly inlineElement: "inlineElement";
|
|
111
|
-
readonly refElement: "refElement";
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
export interface DataItem {
|
|
115
|
-
displayName?: string;
|
|
116
|
-
defaultValue?: unknown;
|
|
117
|
-
dataType?: string;
|
|
118
|
-
text?: Record<string, unknown>;
|
|
119
|
-
number?: Record<string, unknown>;
|
|
120
|
-
booleanValue?: unknown;
|
|
121
|
-
textEnum?: {
|
|
122
|
-
options: Array<{
|
|
123
|
-
value: string;
|
|
124
|
-
displayName?: string;
|
|
125
|
-
}>;
|
|
126
|
-
};
|
|
127
|
-
arrayItems?: {
|
|
128
|
-
dataItem?: DataItem;
|
|
129
|
-
};
|
|
130
|
-
data?: {
|
|
131
|
-
items?: Record<string, DataItem>;
|
|
132
|
-
};
|
|
133
|
-
function?: Record<string, unknown>;
|
|
134
|
-
link?: {
|
|
135
|
-
linkTypes?: string[];
|
|
136
|
-
};
|
|
137
|
-
image?: {
|
|
138
|
-
category?: string;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
export interface CssPropertyItem {
|
|
142
|
-
defaultValue?: string;
|
|
143
|
-
}
|
|
144
|
-
export interface CssCustomPropertyItem {
|
|
145
|
-
defaultValue?: string;
|
|
146
|
-
}
|
|
147
|
-
export interface EditorElement {
|
|
148
|
-
selector?: string;
|
|
149
|
-
displayName?: string;
|
|
150
|
-
data?: Record<string, DataItem>;
|
|
151
|
-
elements?: Record<string, ElementItem>;
|
|
152
|
-
cssProperties?: Record<string, CssPropertyItem>;
|
|
153
|
-
cssCustomProperties?: Record<string, CssCustomPropertyItem>;
|
|
154
|
-
}
|
|
155
|
-
export interface ElementItem {
|
|
156
|
-
elementType?: string;
|
|
157
|
-
inlineElement?: {
|
|
158
|
-
selector?: string;
|
|
159
|
-
displayName?: string;
|
|
160
|
-
data?: Record<string, DataItem>;
|
|
161
|
-
cssProperties?: Record<string, CssPropertyItem>;
|
|
162
|
-
cssCustomProperties?: Record<string, CssCustomPropertyItem>;
|
|
163
|
-
elements?: Record<string, ElementItem>;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
export interface EditorReactComponent {
|
|
167
|
-
editorElement?: EditorElement;
|
|
168
|
-
}
|