@webstudio-is/sdk 0.210.0 → 0.213.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/lib/core-templates.js +32 -25
- package/lib/index.js +86 -25
- package/lib/runtime.js +15 -1
- package/lib/types/core-metas.d.ts +211 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/runtime.d.ts +4 -0
- package/lib/types/schema/animation-schema.d.ts +909 -0
- package/lib/types/schema/component-meta.d.ts +107 -24
- package/lib/types/schema/instances.d.ts +24 -18
- package/lib/types/schema/pages.d.ts +1 -0
- package/lib/types/schema/prop-meta.d.ts +24 -0
- package/lib/types/schema/props.d.ts +695 -3
- package/lib/types/schema/webstudio.d.ts +419 -0
- package/package.json +6 -6
package/lib/core-templates.js
CHANGED
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
ListViewIcon,
|
|
14
14
|
PaintBrushIcon,
|
|
15
15
|
SettingsIcon,
|
|
16
|
-
AddTemplateInstanceIcon
|
|
16
|
+
AddTemplateInstanceIcon,
|
|
17
|
+
HtmlElementIcon
|
|
17
18
|
} from "@webstudio-is/icons/svg";
|
|
18
19
|
|
|
19
20
|
// src/__generated__/normalize.css.ts
|
|
@@ -48,6 +49,15 @@ var rootMeta = {
|
|
|
48
49
|
var rootPropsMeta = {
|
|
49
50
|
props: {}
|
|
50
51
|
};
|
|
52
|
+
var elementComponent = "ws:element";
|
|
53
|
+
var elementMeta = {
|
|
54
|
+
type: "container",
|
|
55
|
+
label: "Element",
|
|
56
|
+
icon: HtmlElementIcon
|
|
57
|
+
};
|
|
58
|
+
var elementPropsMeta = {
|
|
59
|
+
props: {}
|
|
60
|
+
};
|
|
51
61
|
var collectionComponent = "ws:collection";
|
|
52
62
|
var collectionMeta = {
|
|
53
63
|
type: "container",
|
|
@@ -69,12 +79,12 @@ var descendantMeta = {
|
|
|
69
79
|
type: "control",
|
|
70
80
|
label: "Descendant",
|
|
71
81
|
icon: PaintBrushIcon,
|
|
82
|
+
contentModel: {
|
|
83
|
+
category: "none",
|
|
84
|
+
children: ["empty"]
|
|
85
|
+
},
|
|
72
86
|
// @todo infer possible presets
|
|
73
|
-
presetStyle: {}
|
|
74
|
-
constraints: {
|
|
75
|
-
relation: "parent",
|
|
76
|
-
component: { $in: ["HtmlEmbed", "MarkdownEmbed"] }
|
|
77
|
-
}
|
|
87
|
+
presetStyle: {}
|
|
78
88
|
};
|
|
79
89
|
var descendantPropsMeta = {
|
|
80
90
|
props: {
|
|
@@ -109,9 +119,9 @@ var blockTemplateComponent = "ws:block-template";
|
|
|
109
119
|
var blockTemplateMeta = {
|
|
110
120
|
type: "container",
|
|
111
121
|
icon: AddTemplateInstanceIcon,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
contentModel: {
|
|
123
|
+
category: "none",
|
|
124
|
+
children: ["instance"]
|
|
115
125
|
}
|
|
116
126
|
};
|
|
117
127
|
var blockTemplatePropsMeta = {
|
|
@@ -121,22 +131,18 @@ var blockMeta = {
|
|
|
121
131
|
type: "container",
|
|
122
132
|
label: "Content Block",
|
|
123
133
|
icon: ContentBlockIcon,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
{
|
|
130
|
-
relation: "child",
|
|
131
|
-
component: { $eq: blockTemplateComponent }
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
+
contentModel: {
|
|
135
|
+
category: "instance",
|
|
136
|
+
children: [blockTemplateComponent, "instance"]
|
|
137
|
+
// @todo prevent deleting block template
|
|
138
|
+
}
|
|
134
139
|
};
|
|
135
140
|
var blockPropsMeta = {
|
|
136
141
|
props: {}
|
|
137
142
|
};
|
|
138
143
|
var coreMetas = {
|
|
139
144
|
[rootComponent]: rootMeta,
|
|
145
|
+
[elementComponent]: elementMeta,
|
|
140
146
|
[collectionComponent]: collectionMeta,
|
|
141
147
|
[descendantComponent]: descendantMeta,
|
|
142
148
|
[blockComponent]: blockMeta,
|
|
@@ -144,6 +150,7 @@ var coreMetas = {
|
|
|
144
150
|
};
|
|
145
151
|
var corePropsMetas = {
|
|
146
152
|
[rootComponent]: rootPropsMeta,
|
|
153
|
+
[elementComponent]: elementPropsMeta,
|
|
147
154
|
[collectionComponent]: collectionPropsMeta,
|
|
148
155
|
[descendantComponent]: descendantPropsMeta,
|
|
149
156
|
[blockComponent]: blockPropsMeta,
|
|
@@ -175,12 +182,12 @@ var blockMeta2 = {
|
|
|
175
182
|
template: /* @__PURE__ */ jsxs(ws.block, { children: [
|
|
176
183
|
/* @__PURE__ */ jsxs(BlockTemplate, { "ws:label": "Templates", children: [
|
|
177
184
|
/* @__PURE__ */ jsx($.Paragraph, {}),
|
|
178
|
-
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 1", tag: "h1" }),
|
|
179
|
-
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 2", tag: "h2" }),
|
|
180
|
-
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 3", tag: "h3" }),
|
|
181
|
-
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 4", tag: "h4" }),
|
|
182
|
-
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 5", tag: "h5" }),
|
|
183
|
-
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 6", tag: "h6" }),
|
|
185
|
+
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 1", "ws:tag": "h1" }),
|
|
186
|
+
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 2", "ws:tag": "h2" }),
|
|
187
|
+
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 3", "ws:tag": "h3" }),
|
|
188
|
+
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 4", "ws:tag": "h4" }),
|
|
189
|
+
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 5", "ws:tag": "h5" }),
|
|
190
|
+
/* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 6", "ws:tag": "h6" }),
|
|
184
191
|
/* @__PURE__ */ jsx($.List, { "ws:label": "List (Unordered)", children: /* @__PURE__ */ jsx($.ListItem, {}) }),
|
|
185
192
|
/* @__PURE__ */ jsx($.List, { "ws:label": "List (Ordered)", ordered: true, children: /* @__PURE__ */ jsx($.ListItem, {}) }),
|
|
186
193
|
/* @__PURE__ */ jsx($.Link, {}),
|
package/lib/index.js
CHANGED
|
@@ -88,10 +88,7 @@ var HomePage = z2.object({
|
|
|
88
88
|
...commonPageFields,
|
|
89
89
|
path: HomePagePath
|
|
90
90
|
});
|
|
91
|
-
var
|
|
92
|
-
(path) => path === "" || path.startsWith("/"),
|
|
93
|
-
"Must start with a / or a full URL e.g. https://website.org"
|
|
94
|
-
).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
|
|
91
|
+
var DefaultPagePage = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
|
|
95
92
|
(path) => /^[-_a-z0-9*:?\\/.]*$/.test(path),
|
|
96
93
|
"Only a-z, 0-9, -, _, /, :, ?, . and * are allowed"
|
|
97
94
|
).refine(
|
|
@@ -104,6 +101,14 @@ var PagePath = z2.string().refine((path) => path !== "", "Can't be empty").refin
|
|
|
104
101
|
(path) => path !== "/build" && path.startsWith("/build/") === false,
|
|
105
102
|
"/build prefix is reserved for the system"
|
|
106
103
|
);
|
|
104
|
+
var PagePath = DefaultPagePage.refine(
|
|
105
|
+
(path) => path === "" || path.startsWith("/"),
|
|
106
|
+
"Must start with a / or a full URL e.g. https://website.org"
|
|
107
|
+
);
|
|
108
|
+
var OldPagePath = DefaultPagePage.refine(
|
|
109
|
+
(path) => path === "" || path.startsWith("/"),
|
|
110
|
+
"Must start with a / and it must be full path e.g. /project/id"
|
|
111
|
+
);
|
|
107
112
|
var Page = z2.object({
|
|
108
113
|
...commonPageFields,
|
|
109
114
|
path: PagePath
|
|
@@ -167,6 +172,7 @@ var Instance = z3.object({
|
|
|
167
172
|
type: z3.literal("instance"),
|
|
168
173
|
id: InstanceId,
|
|
169
174
|
component: z3.string(),
|
|
175
|
+
tag: z3.string().optional(),
|
|
170
176
|
label: z3.string().optional(),
|
|
171
177
|
children: z3.array(InstanceChild)
|
|
172
178
|
});
|
|
@@ -350,6 +356,23 @@ var rangeUnitValueSchema = z6.union([
|
|
|
350
356
|
z6.object({
|
|
351
357
|
type: z6.literal("unparsed"),
|
|
352
358
|
value: z6.string()
|
|
359
|
+
}),
|
|
360
|
+
z6.object({
|
|
361
|
+
type: z6.literal("var"),
|
|
362
|
+
value: z6.string()
|
|
363
|
+
})
|
|
364
|
+
]);
|
|
365
|
+
var TIME_UNITS = ["ms", "s"];
|
|
366
|
+
var timeUnitSchema = literalUnion(TIME_UNITS);
|
|
367
|
+
var durationUnitValueSchema = z6.union([
|
|
368
|
+
z6.object({
|
|
369
|
+
type: z6.literal("unit"),
|
|
370
|
+
value: z6.number(),
|
|
371
|
+
unit: timeUnitSchema
|
|
372
|
+
}),
|
|
373
|
+
z6.object({
|
|
374
|
+
type: z6.literal("var"),
|
|
375
|
+
value: z6.string()
|
|
353
376
|
})
|
|
354
377
|
]);
|
|
355
378
|
var insetUnitValueSchema = z6.union([
|
|
@@ -371,8 +394,9 @@ var keyframeEffectOptionsSchema = z6.object({
|
|
|
371
394
|
z6.literal("forwards"),
|
|
372
395
|
z6.literal("backwards"),
|
|
373
396
|
z6.literal("both")
|
|
374
|
-
]).optional()
|
|
397
|
+
]).optional(),
|
|
375
398
|
// FillMode
|
|
399
|
+
duration: durationUnitValueSchema.optional()
|
|
376
400
|
});
|
|
377
401
|
var scrollNamedRangeSchema = z6.union([
|
|
378
402
|
z6.literal("start"),
|
|
@@ -654,6 +678,13 @@ var common = {
|
|
|
654
678
|
description: z14.string().optional(),
|
|
655
679
|
required: z14.boolean()
|
|
656
680
|
};
|
|
681
|
+
var Tag = z14.object({
|
|
682
|
+
...common,
|
|
683
|
+
control: z14.literal("tag"),
|
|
684
|
+
type: z14.literal("string"),
|
|
685
|
+
defaultValue: z14.undefined().optional(),
|
|
686
|
+
options: z14.array(z14.string())
|
|
687
|
+
});
|
|
657
688
|
var Number = z14.object({
|
|
658
689
|
...common,
|
|
659
690
|
control: z14.literal("number"),
|
|
@@ -797,6 +828,7 @@ var AnimationAction = z14.object({
|
|
|
797
828
|
defaultValue: z14.undefined().optional()
|
|
798
829
|
});
|
|
799
830
|
var PropMeta = z14.union([
|
|
831
|
+
Tag,
|
|
800
832
|
Number,
|
|
801
833
|
Range,
|
|
802
834
|
Text,
|
|
@@ -949,6 +981,23 @@ var defaultStates = [
|
|
|
949
981
|
{ selector: ":focus-visible", label: "Focus Visible" },
|
|
950
982
|
{ selector: ":focus-within", label: "Focus Within" }
|
|
951
983
|
];
|
|
984
|
+
var ContentModel = z16.object({
|
|
985
|
+
/*
|
|
986
|
+
* instance - accepted by any parent with "instance" in children categories
|
|
987
|
+
* none - accepted by parents with this component name in children categories
|
|
988
|
+
*/
|
|
989
|
+
category: z16.union([z16.literal("instance"), z16.literal("none")]),
|
|
990
|
+
/**
|
|
991
|
+
* transparent - pass through possible children from parent
|
|
992
|
+
* rich-text - can be edited as rich text
|
|
993
|
+
* instance - other instances accepted
|
|
994
|
+
* empty - no children accepted
|
|
995
|
+
* ComponentName - accept specific components with none category
|
|
996
|
+
*/
|
|
997
|
+
children: z16.array(
|
|
998
|
+
z16.string()
|
|
999
|
+
)
|
|
1000
|
+
});
|
|
952
1001
|
var WsComponentMeta = z16.object({
|
|
953
1002
|
category: z16.enum(componentCategories).optional(),
|
|
954
1003
|
// container - can accept other components with dnd or be edited as text
|
|
@@ -962,6 +1011,7 @@ var WsComponentMeta = z16.object({
|
|
|
962
1011
|
*/
|
|
963
1012
|
placeholder: z16.string().optional(),
|
|
964
1013
|
constraints: Matchers.optional(),
|
|
1014
|
+
contentModel: ContentModel.optional(),
|
|
965
1015
|
// when this field is specified component receives
|
|
966
1016
|
// prop with index of same components withiin specified ancestor
|
|
967
1017
|
// important to automatically enumerate collections without
|
|
@@ -981,7 +1031,8 @@ import {
|
|
|
981
1031
|
ListViewIcon,
|
|
982
1032
|
PaintBrushIcon,
|
|
983
1033
|
SettingsIcon,
|
|
984
|
-
AddTemplateInstanceIcon
|
|
1034
|
+
AddTemplateInstanceIcon,
|
|
1035
|
+
HtmlElementIcon
|
|
985
1036
|
} from "@webstudio-is/icons/svg";
|
|
986
1037
|
|
|
987
1038
|
// src/__generated__/normalize.css.ts
|
|
@@ -1016,6 +1067,15 @@ var rootMeta = {
|
|
|
1016
1067
|
var rootPropsMeta = {
|
|
1017
1068
|
props: {}
|
|
1018
1069
|
};
|
|
1070
|
+
var elementComponent = "ws:element";
|
|
1071
|
+
var elementMeta = {
|
|
1072
|
+
type: "container",
|
|
1073
|
+
label: "Element",
|
|
1074
|
+
icon: HtmlElementIcon
|
|
1075
|
+
};
|
|
1076
|
+
var elementPropsMeta = {
|
|
1077
|
+
props: {}
|
|
1078
|
+
};
|
|
1019
1079
|
var portalComponent = "Slot";
|
|
1020
1080
|
var collectionComponent = "ws:collection";
|
|
1021
1081
|
var collectionMeta = {
|
|
@@ -1038,12 +1098,12 @@ var descendantMeta = {
|
|
|
1038
1098
|
type: "control",
|
|
1039
1099
|
label: "Descendant",
|
|
1040
1100
|
icon: PaintBrushIcon,
|
|
1101
|
+
contentModel: {
|
|
1102
|
+
category: "none",
|
|
1103
|
+
children: ["empty"]
|
|
1104
|
+
},
|
|
1041
1105
|
// @todo infer possible presets
|
|
1042
|
-
presetStyle: {}
|
|
1043
|
-
constraints: {
|
|
1044
|
-
relation: "parent",
|
|
1045
|
-
component: { $in: ["HtmlEmbed", "MarkdownEmbed"] }
|
|
1046
|
-
}
|
|
1106
|
+
presetStyle: {}
|
|
1047
1107
|
};
|
|
1048
1108
|
var descendantPropsMeta = {
|
|
1049
1109
|
props: {
|
|
@@ -1078,9 +1138,9 @@ var blockTemplateComponent = "ws:block-template";
|
|
|
1078
1138
|
var blockTemplateMeta = {
|
|
1079
1139
|
type: "container",
|
|
1080
1140
|
icon: AddTemplateInstanceIcon,
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1141
|
+
contentModel: {
|
|
1142
|
+
category: "none",
|
|
1143
|
+
children: ["instance"]
|
|
1084
1144
|
}
|
|
1085
1145
|
};
|
|
1086
1146
|
var blockTemplatePropsMeta = {
|
|
@@ -1090,22 +1150,18 @@ var blockMeta = {
|
|
|
1090
1150
|
type: "container",
|
|
1091
1151
|
label: "Content Block",
|
|
1092
1152
|
icon: ContentBlockIcon,
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
{
|
|
1099
|
-
relation: "child",
|
|
1100
|
-
component: { $eq: blockTemplateComponent }
|
|
1101
|
-
}
|
|
1102
|
-
]
|
|
1153
|
+
contentModel: {
|
|
1154
|
+
category: "instance",
|
|
1155
|
+
children: [blockTemplateComponent, "instance"]
|
|
1156
|
+
// @todo prevent deleting block template
|
|
1157
|
+
}
|
|
1103
1158
|
};
|
|
1104
1159
|
var blockPropsMeta = {
|
|
1105
1160
|
props: {}
|
|
1106
1161
|
};
|
|
1107
1162
|
var coreMetas = {
|
|
1108
1163
|
[rootComponent]: rootMeta,
|
|
1164
|
+
[elementComponent]: elementMeta,
|
|
1109
1165
|
[collectionComponent]: collectionMeta,
|
|
1110
1166
|
[descendantComponent]: descendantMeta,
|
|
1111
1167
|
[blockComponent]: blockMeta,
|
|
@@ -1113,12 +1169,13 @@ var coreMetas = {
|
|
|
1113
1169
|
};
|
|
1114
1170
|
var corePropsMetas = {
|
|
1115
1171
|
[rootComponent]: rootPropsMeta,
|
|
1172
|
+
[elementComponent]: elementPropsMeta,
|
|
1116
1173
|
[collectionComponent]: collectionPropsMeta,
|
|
1117
1174
|
[descendantComponent]: descendantPropsMeta,
|
|
1118
1175
|
[blockComponent]: blockPropsMeta,
|
|
1119
1176
|
[blockTemplateComponent]: blockTemplatePropsMeta
|
|
1120
1177
|
};
|
|
1121
|
-
var isCoreComponent = (component) => component === rootComponent || component === collectionComponent || component === descendantComponent || component === blockComponent || component === blockTemplateComponent;
|
|
1178
|
+
var isCoreComponent = (component) => component === rootComponent || component === elementComponent || component === collectionComponent || component === descendantComponent || component === blockComponent || component === blockTemplateComponent;
|
|
1122
1179
|
|
|
1123
1180
|
// src/instances-utils.ts
|
|
1124
1181
|
var ROOT_INSTANCE_ID = ":root";
|
|
@@ -2131,6 +2188,7 @@ export {
|
|
|
2131
2188
|
Breakpoints,
|
|
2132
2189
|
CompilerSettings,
|
|
2133
2190
|
ComponentState,
|
|
2191
|
+
ContentModel,
|
|
2134
2192
|
DataSource,
|
|
2135
2193
|
DataSourceVariableValue,
|
|
2136
2194
|
DataSources,
|
|
@@ -2154,6 +2212,7 @@ export {
|
|
|
2154
2212
|
MatcherOperation,
|
|
2155
2213
|
MatcherRelation,
|
|
2156
2214
|
Matchers,
|
|
2215
|
+
OldPagePath,
|
|
2157
2216
|
PageName,
|
|
2158
2217
|
PagePath,
|
|
2159
2218
|
PageRedirect,
|
|
@@ -2199,6 +2258,8 @@ export {
|
|
|
2199
2258
|
defaultStates,
|
|
2200
2259
|
descendantComponent,
|
|
2201
2260
|
documentTypes,
|
|
2261
|
+
durationUnitValueSchema,
|
|
2262
|
+
elementComponent,
|
|
2202
2263
|
encodeDataVariableId as encodeDataSourceVariable,
|
|
2203
2264
|
encodeDataVariableId,
|
|
2204
2265
|
executeExpression,
|
package/lib/runtime.js
CHANGED
|
@@ -89,13 +89,27 @@ var isPlainObject = (value) => {
|
|
|
89
89
|
// src/form-fields.ts
|
|
90
90
|
var formIdFieldName = `ws--form-id`;
|
|
91
91
|
var formBotFieldName = `ws--form-bot`;
|
|
92
|
+
|
|
93
|
+
// src/runtime.ts
|
|
94
|
+
var tagProperty = "data-ws-tag";
|
|
95
|
+
var getTagFromProps = (props) => {
|
|
96
|
+
return props[tagProperty];
|
|
97
|
+
};
|
|
98
|
+
var indexProperty = "data-ws-index";
|
|
99
|
+
var getIndexWithinAncestorFromProps = (props) => {
|
|
100
|
+
return props[indexProperty];
|
|
101
|
+
};
|
|
92
102
|
export {
|
|
93
103
|
createJsonStringifyProxy,
|
|
94
104
|
formBotFieldName,
|
|
95
105
|
formIdFieldName,
|
|
106
|
+
getIndexWithinAncestorFromProps,
|
|
107
|
+
getTagFromProps,
|
|
108
|
+
indexProperty,
|
|
96
109
|
isLocalResource,
|
|
97
110
|
isPlainObject,
|
|
98
111
|
loadResource,
|
|
99
112
|
loadResources,
|
|
100
|
-
sitemapResourceUrl
|
|
113
|
+
sitemapResourceUrl,
|
|
114
|
+
tagProperty
|
|
101
115
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WsComponentMeta } from "./schema/component-meta";
|
|
2
2
|
export declare const rootComponent = "ws:root";
|
|
3
|
+
export declare const elementComponent = "ws:element";
|
|
3
4
|
export declare const portalComponent = "Slot";
|
|
4
5
|
export declare const collectionComponent = "ws:collection";
|
|
5
6
|
export declare const descendantComponent = "ws:descendant";
|
|
@@ -8,6 +9,7 @@ export declare const blockTemplateComponent = "ws:block-template";
|
|
|
8
9
|
export declare const blockTemplateMeta: WsComponentMeta;
|
|
9
10
|
export declare const coreMetas: {
|
|
10
11
|
"ws:root": WsComponentMeta;
|
|
12
|
+
"ws:element": WsComponentMeta;
|
|
11
13
|
"ws:collection": WsComponentMeta;
|
|
12
14
|
"ws:descendant": WsComponentMeta;
|
|
13
15
|
"ws:block": WsComponentMeta;
|
|
@@ -16,6 +18,182 @@ export declare const coreMetas: {
|
|
|
16
18
|
export declare const corePropsMetas: {
|
|
17
19
|
"ws:root": {
|
|
18
20
|
props: Record<string, {
|
|
21
|
+
options: string[];
|
|
22
|
+
type: "string";
|
|
23
|
+
required: boolean;
|
|
24
|
+
control: "tag";
|
|
25
|
+
label?: string | undefined;
|
|
26
|
+
defaultValue?: undefined;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
} | {
|
|
29
|
+
type: "number";
|
|
30
|
+
required: boolean;
|
|
31
|
+
control: "number";
|
|
32
|
+
label?: string | undefined;
|
|
33
|
+
defaultValue?: number | undefined;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
} | {
|
|
36
|
+
type: "number";
|
|
37
|
+
required: boolean;
|
|
38
|
+
control: "range";
|
|
39
|
+
label?: string | undefined;
|
|
40
|
+
defaultValue?: number | undefined;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: "string";
|
|
44
|
+
required: boolean;
|
|
45
|
+
control: "text";
|
|
46
|
+
label?: string | undefined;
|
|
47
|
+
defaultValue?: string | undefined;
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
rows?: number | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
type: "resource";
|
|
52
|
+
required: boolean;
|
|
53
|
+
control: "resource";
|
|
54
|
+
label?: string | undefined;
|
|
55
|
+
defaultValue?: string | undefined;
|
|
56
|
+
description?: string | undefined;
|
|
57
|
+
} | {
|
|
58
|
+
type: "string";
|
|
59
|
+
required: boolean;
|
|
60
|
+
control: "code";
|
|
61
|
+
language: "html" | "markdown";
|
|
62
|
+
label?: string | undefined;
|
|
63
|
+
defaultValue?: string | undefined;
|
|
64
|
+
description?: string | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
type: "string";
|
|
67
|
+
required: boolean;
|
|
68
|
+
control: "codetext";
|
|
69
|
+
label?: string | undefined;
|
|
70
|
+
defaultValue?: string | undefined;
|
|
71
|
+
description?: string | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
type: "string";
|
|
74
|
+
required: boolean;
|
|
75
|
+
control: "color";
|
|
76
|
+
label?: string | undefined;
|
|
77
|
+
defaultValue?: string | undefined;
|
|
78
|
+
description?: string | undefined;
|
|
79
|
+
} | {
|
|
80
|
+
type: "boolean";
|
|
81
|
+
required: boolean;
|
|
82
|
+
control: "boolean";
|
|
83
|
+
label?: string | undefined;
|
|
84
|
+
defaultValue?: boolean | undefined;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
options: string[];
|
|
88
|
+
type: "string";
|
|
89
|
+
required: boolean;
|
|
90
|
+
control: "radio";
|
|
91
|
+
label?: string | undefined;
|
|
92
|
+
defaultValue?: string | undefined;
|
|
93
|
+
description?: string | undefined;
|
|
94
|
+
} | {
|
|
95
|
+
options: string[];
|
|
96
|
+
type: "string";
|
|
97
|
+
required: boolean;
|
|
98
|
+
control: "inline-radio";
|
|
99
|
+
label?: string | undefined;
|
|
100
|
+
defaultValue?: string | undefined;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
} | {
|
|
103
|
+
options: string[];
|
|
104
|
+
type: "string";
|
|
105
|
+
required: boolean;
|
|
106
|
+
control: "select";
|
|
107
|
+
label?: string | undefined;
|
|
108
|
+
defaultValue?: string | undefined;
|
|
109
|
+
description?: string | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
options: string[];
|
|
112
|
+
type: "string[]";
|
|
113
|
+
required: boolean;
|
|
114
|
+
control: "check";
|
|
115
|
+
label?: string | undefined;
|
|
116
|
+
defaultValue?: string[] | undefined;
|
|
117
|
+
description?: string | undefined;
|
|
118
|
+
} | {
|
|
119
|
+
options: string[];
|
|
120
|
+
type: "string[]";
|
|
121
|
+
required: boolean;
|
|
122
|
+
control: "inline-check";
|
|
123
|
+
label?: string | undefined;
|
|
124
|
+
defaultValue?: string[] | undefined;
|
|
125
|
+
description?: string | undefined;
|
|
126
|
+
} | {
|
|
127
|
+
options: string[];
|
|
128
|
+
type: "string[]";
|
|
129
|
+
required: boolean;
|
|
130
|
+
control: "multi-select";
|
|
131
|
+
label?: string | undefined;
|
|
132
|
+
defaultValue?: string[] | undefined;
|
|
133
|
+
description?: string | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
type: "string";
|
|
136
|
+
required: boolean;
|
|
137
|
+
control: "file";
|
|
138
|
+
label?: string | undefined;
|
|
139
|
+
defaultValue?: string | undefined;
|
|
140
|
+
description?: string | undefined;
|
|
141
|
+
accept?: string | undefined;
|
|
142
|
+
} | {
|
|
143
|
+
type: "string";
|
|
144
|
+
required: boolean;
|
|
145
|
+
control: "url";
|
|
146
|
+
label?: string | undefined;
|
|
147
|
+
defaultValue?: string | undefined;
|
|
148
|
+
description?: string | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
type: "json";
|
|
151
|
+
required: boolean;
|
|
152
|
+
control: "json";
|
|
153
|
+
label?: string | undefined;
|
|
154
|
+
defaultValue?: unknown;
|
|
155
|
+
description?: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
type: "string";
|
|
158
|
+
required: boolean;
|
|
159
|
+
control: "date";
|
|
160
|
+
label?: string | undefined;
|
|
161
|
+
defaultValue?: string | undefined;
|
|
162
|
+
description?: string | undefined;
|
|
163
|
+
} | {
|
|
164
|
+
type: "action";
|
|
165
|
+
required: boolean;
|
|
166
|
+
control: "action";
|
|
167
|
+
label?: string | undefined;
|
|
168
|
+
defaultValue?: undefined;
|
|
169
|
+
description?: string | undefined;
|
|
170
|
+
} | {
|
|
171
|
+
type: "string";
|
|
172
|
+
required: boolean;
|
|
173
|
+
control: "textContent";
|
|
174
|
+
label?: string | undefined;
|
|
175
|
+
defaultValue?: string | undefined;
|
|
176
|
+
description?: string | undefined;
|
|
177
|
+
} | {
|
|
178
|
+
type: "animationAction";
|
|
179
|
+
required: boolean;
|
|
180
|
+
control: "animationAction";
|
|
181
|
+
label?: string | undefined;
|
|
182
|
+
defaultValue?: undefined;
|
|
183
|
+
description?: string | undefined;
|
|
184
|
+
}>;
|
|
185
|
+
initialProps?: string[] | undefined;
|
|
186
|
+
};
|
|
187
|
+
"ws:element": {
|
|
188
|
+
props: Record<string, {
|
|
189
|
+
options: string[];
|
|
190
|
+
type: "string";
|
|
191
|
+
required: boolean;
|
|
192
|
+
control: "tag";
|
|
193
|
+
label?: string | undefined;
|
|
194
|
+
defaultValue?: undefined;
|
|
195
|
+
description?: string | undefined;
|
|
196
|
+
} | {
|
|
19
197
|
type: "number";
|
|
20
198
|
required: boolean;
|
|
21
199
|
control: "number";
|
|
@@ -176,6 +354,14 @@ export declare const corePropsMetas: {
|
|
|
176
354
|
};
|
|
177
355
|
"ws:collection": {
|
|
178
356
|
props: Record<string, {
|
|
357
|
+
options: string[];
|
|
358
|
+
type: "string";
|
|
359
|
+
required: boolean;
|
|
360
|
+
control: "tag";
|
|
361
|
+
label?: string | undefined;
|
|
362
|
+
defaultValue?: undefined;
|
|
363
|
+
description?: string | undefined;
|
|
364
|
+
} | {
|
|
179
365
|
type: "number";
|
|
180
366
|
required: boolean;
|
|
181
367
|
control: "number";
|
|
@@ -336,6 +522,14 @@ export declare const corePropsMetas: {
|
|
|
336
522
|
};
|
|
337
523
|
"ws:descendant": {
|
|
338
524
|
props: Record<string, {
|
|
525
|
+
options: string[];
|
|
526
|
+
type: "string";
|
|
527
|
+
required: boolean;
|
|
528
|
+
control: "tag";
|
|
529
|
+
label?: string | undefined;
|
|
530
|
+
defaultValue?: undefined;
|
|
531
|
+
description?: string | undefined;
|
|
532
|
+
} | {
|
|
339
533
|
type: "number";
|
|
340
534
|
required: boolean;
|
|
341
535
|
control: "number";
|
|
@@ -496,6 +690,14 @@ export declare const corePropsMetas: {
|
|
|
496
690
|
};
|
|
497
691
|
"ws:block": {
|
|
498
692
|
props: Record<string, {
|
|
693
|
+
options: string[];
|
|
694
|
+
type: "string";
|
|
695
|
+
required: boolean;
|
|
696
|
+
control: "tag";
|
|
697
|
+
label?: string | undefined;
|
|
698
|
+
defaultValue?: undefined;
|
|
699
|
+
description?: string | undefined;
|
|
700
|
+
} | {
|
|
499
701
|
type: "number";
|
|
500
702
|
required: boolean;
|
|
501
703
|
control: "number";
|
|
@@ -656,6 +858,14 @@ export declare const corePropsMetas: {
|
|
|
656
858
|
};
|
|
657
859
|
"ws:block-template": {
|
|
658
860
|
props: Record<string, {
|
|
861
|
+
options: string[];
|
|
862
|
+
type: "string";
|
|
863
|
+
required: boolean;
|
|
864
|
+
control: "tag";
|
|
865
|
+
label?: string | undefined;
|
|
866
|
+
defaultValue?: undefined;
|
|
867
|
+
description?: string | undefined;
|
|
868
|
+
} | {
|
|
659
869
|
type: "number";
|
|
660
870
|
required: boolean;
|
|
661
871
|
control: "number";
|
|
@@ -815,4 +1025,4 @@ export declare const corePropsMetas: {
|
|
|
815
1025
|
initialProps?: string[] | undefined;
|
|
816
1026
|
};
|
|
817
1027
|
};
|
|
818
|
-
export declare const isCoreComponent: (component: string) => component is "ws:root" | "ws:collection" | "ws:descendant" | "ws:block" | "ws:block-template";
|
|
1028
|
+
export declare const isCoreComponent: (component: string) => component is "ws:root" | "ws:element" | "ws:collection" | "ws:descendant" | "ws:block" | "ws:block-template";
|
package/lib/types/index.d.ts
CHANGED
|
@@ -22,5 +22,5 @@ export * from "./resources-generator";
|
|
|
22
22
|
export * from "./page-meta-generator";
|
|
23
23
|
export * from "./url-pattern";
|
|
24
24
|
export * from "./css";
|
|
25
|
-
export type { AnimationAction, AnimationActionScroll, AnimationActionView, AnimationKeyframe, KeyframeStyles, RangeUnit, RangeUnitValue, ScrollNamedRange, ScrollRangeValue, ViewNamedRange, ViewRangeValue, ScrollAnimation, ViewAnimation, InsetUnitValue, } from "./schema/animation-schema";
|
|
26
|
-
export { animationActionSchema, scrollAnimationSchema, viewAnimationSchema, rangeUnitValueSchema, animationKeyframeSchema, insetUnitValueSchema, RANGE_UNITS, } from "./schema/animation-schema";
|
|
25
|
+
export type { AnimationAction, AnimationActionScroll, AnimationActionView, AnimationKeyframe, KeyframeStyles, RangeUnit, RangeUnitValue, ScrollNamedRange, ScrollRangeValue, ViewNamedRange, ViewRangeValue, ScrollAnimation, ViewAnimation, InsetUnitValue, DurationUnitValue, TimeUnit, } from "./schema/animation-schema";
|
|
26
|
+
export { animationActionSchema, scrollAnimationSchema, viewAnimationSchema, rangeUnitValueSchema, animationKeyframeSchema, insetUnitValueSchema, durationUnitValueSchema, RANGE_UNITS, } from "./schema/animation-schema";
|
package/lib/types/runtime.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export * from "./resource-loader";
|
|
2
2
|
export * from "./to-string";
|
|
3
3
|
export * from "./form-fields";
|
|
4
|
+
export declare const tagProperty = "data-ws-tag";
|
|
5
|
+
export declare const getTagFromProps: (props: Record<string, unknown>) => string | undefined;
|
|
6
|
+
export declare const indexProperty: "data-ws-index";
|
|
7
|
+
export declare const getIndexWithinAncestorFromProps: (props: Record<string, unknown>) => string | undefined;
|