@webstudio-is/react-sdk 0.65.0 → 0.66.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/app/custom-components/form.ws.js +2 -2
- package/lib/app/custom-components/image.js +7 -13
- package/lib/app/params.js +1 -0
- package/lib/cjs/app/custom-components/form.ws.js +2 -2
- package/lib/cjs/app/custom-components/image.js +3 -12
- package/lib/cjs/app/params.js +1 -0
- package/lib/cjs/components/__generated__/html.props.js +31 -0
- package/lib/cjs/components/blockquote.ws.js +2 -2
- package/lib/cjs/components/body.ws.js +2 -2
- package/lib/cjs/components/bold.ws.js +2 -2
- package/lib/cjs/components/box.ws.js +2 -2
- package/lib/cjs/components/button.ws.js +2 -2
- package/lib/cjs/components/checkbox-field.ws.js +2 -2
- package/lib/cjs/components/checkbox.ws.js +2 -2
- package/lib/cjs/components/code.ws.js +2 -2
- package/lib/cjs/components/component-meta.js +2 -2
- package/lib/cjs/components/components-utils.js +1 -43
- package/lib/cjs/components/components.js +2 -0
- package/lib/cjs/components/error-message.ws.js +2 -2
- package/lib/cjs/components/form.ws.js +2 -2
- package/lib/cjs/components/fragment.ws.js +1 -1
- package/lib/cjs/components/heading.ws.js +2 -2
- package/lib/cjs/components/html.js +80 -0
- package/lib/cjs/components/html.ws.js +43 -0
- package/lib/cjs/components/image.ws.js +2 -2
- package/lib/cjs/components/index.js +7 -53
- package/lib/cjs/components/input.ws.js +2 -2
- package/lib/cjs/components/italic.ws.js +2 -2
- package/lib/cjs/components/label.ws.js +2 -2
- package/lib/cjs/components/link-block.ws.js +2 -2
- package/lib/cjs/components/link.ws.js +2 -2
- package/lib/cjs/components/list-item.ws.js +2 -2
- package/lib/cjs/components/list.ws.js +2 -2
- package/lib/cjs/components/paragraph.ws.js +2 -2
- package/lib/cjs/components/radio-button-field.ws.js +2 -2
- package/lib/cjs/components/radio-button.ws.js +2 -2
- package/lib/cjs/components/separator.ws.js +2 -2
- package/lib/cjs/components/slot.ws.js +2 -2
- package/lib/cjs/components/span.ws.js +2 -2
- package/lib/cjs/components/subscript.ws.js +2 -2
- package/lib/cjs/components/success-message.ws.js +2 -2
- package/lib/cjs/components/superscript.ws.js +2 -2
- package/lib/cjs/components/text-block.ws.js +2 -2
- package/lib/cjs/components/textarea.ws.js +2 -2
- package/lib/cjs/css/css.js +2 -5
- package/lib/cjs/css/normalize.js +1 -1
- package/lib/cjs/css/presets.js +8 -1
- package/lib/cjs/tree/create-elements-tree.js +2 -4
- package/lib/components/__generated__/html.props.js +11 -0
- package/lib/components/blockquote.ws.js +2 -2
- package/lib/components/body.ws.js +2 -2
- package/lib/components/bold.ws.js +2 -2
- package/lib/components/box.ws.js +2 -2
- package/lib/components/button.ws.js +2 -2
- package/lib/components/checkbox-field.ws.js +2 -2
- package/lib/components/checkbox.ws.js +2 -2
- package/lib/components/code.ws.js +2 -2
- package/lib/components/component-meta.js +3 -3
- package/lib/components/components-utils.js +1 -43
- package/lib/components/components.js +2 -0
- package/lib/components/error-message.ws.js +2 -2
- package/lib/components/form.ws.js +2 -2
- package/lib/components/fragment.ws.js +1 -1
- package/lib/components/heading.ws.js +2 -2
- package/lib/components/html.js +65 -0
- package/lib/components/html.ws.js +23 -0
- package/lib/components/image.ws.js +2 -2
- package/lib/components/index.js +7 -53
- package/lib/components/input.ws.js +2 -2
- package/lib/components/italic.ws.js +2 -2
- package/lib/components/label.ws.js +2 -2
- package/lib/components/link-block.ws.js +2 -2
- package/lib/components/link.ws.js +2 -2
- package/lib/components/list-item.ws.js +2 -2
- package/lib/components/list.ws.js +2 -2
- package/lib/components/paragraph.ws.js +2 -2
- package/lib/components/radio-button-field.ws.js +2 -2
- package/lib/components/radio-button.ws.js +2 -2
- package/lib/components/separator.ws.js +2 -2
- package/lib/components/slot.ws.js +2 -2
- package/lib/components/span.ws.js +2 -2
- package/lib/components/subscript.ws.js +2 -2
- package/lib/components/success-message.ws.js +2 -2
- package/lib/components/superscript.ws.js +2 -2
- package/lib/components/text-block.ws.js +2 -2
- package/lib/components/textarea.ws.js +2 -2
- package/lib/css/css.js +2 -5
- package/lib/css/normalize.js +2 -2
- package/lib/css/presets.js +8 -1
- package/lib/tree/create-elements-tree.js +2 -4
- package/lib/types/app/params.d.ts +22 -1
- package/lib/types/components/__generated__/html.props.d.ts +2 -0
- package/lib/types/components/component-meta.d.ts +1785 -10
- package/lib/types/components/components-utils.d.ts +6 -3
- package/lib/types/components/components.d.ts +1 -0
- package/lib/types/components/html.d.ts +7 -0
- package/lib/types/components/html.stories.d.ts +11 -0
- package/lib/types/components/html.ws.d.ts +3 -0
- package/lib/types/components/index.d.ts +2 -2
- package/lib/types/context.d.ts +1 -0
- package/lib/types/css/css.d.ts +2 -0
- package/lib/types/css/presets.d.ts +1 -0
- package/lib/types/tree/create-elements-tree.d.ts +2 -2
- package/package.json +13 -12
- package/src/app/custom-components/form.ws.tsx +2 -2
- package/src/app/custom-components/image.tsx +7 -13
- package/src/app/params.ts +23 -1
- package/src/components/__generated__/html.props.ts +10 -0
- package/src/components/blockquote.ws.tsx +2 -2
- package/src/components/body.ws.tsx +2 -2
- package/src/components/bold.ws.tsx +2 -2
- package/src/components/box.ws.ts +2 -2
- package/src/components/button.ws.tsx +2 -2
- package/src/components/checkbox-field.ws.tsx +2 -2
- package/src/components/checkbox.ws.tsx +2 -2
- package/src/components/code.ws.tsx +2 -2
- package/src/components/component-meta.ts +3 -6
- package/src/components/components-utils.ts +14 -58
- package/src/components/components.ts +1 -0
- package/src/components/error-message.ws.tsx +2 -2
- package/src/components/form.ws.tsx +2 -2
- package/src/components/fragment.ws.ts +1 -1
- package/src/components/heading.ws.tsx +2 -2
- package/src/components/html.stories.tsx +16 -0
- package/src/components/html.tsx +96 -0
- package/src/components/html.ws.ts +22 -0
- package/src/components/image.ws.tsx +2 -2
- package/src/components/index.ts +6 -83
- package/src/components/input.ws.tsx +2 -2
- package/src/components/italic.ws.tsx +2 -2
- package/src/components/label.ws.tsx +2 -2
- package/src/components/link-block.ws.tsx +2 -2
- package/src/components/link.ws.tsx +2 -2
- package/src/components/list-item.ws.tsx +2 -2
- package/src/components/list.ws.tsx +2 -2
- package/src/components/paragraph.ws.tsx +2 -2
- package/src/components/radio-button-field.ws.tsx +2 -2
- package/src/components/radio-button.ws.tsx +2 -2
- package/src/components/separator.ws.tsx +2 -2
- package/src/components/slot.ws.ts +2 -2
- package/src/components/span.ws.tsx +2 -2
- package/src/components/subscript.ws.tsx +2 -2
- package/src/components/success-message.ws.tsx +2 -2
- package/src/components/superscript.ws.tsx +2 -2
- package/src/components/text-block.ws.tsx +2 -2
- package/src/components/textarea.ws.tsx +2 -2
- package/src/context.tsx +1 -0
- package/src/css/css.ts +4 -5
- package/src/css/normalize.ts +2 -2
- package/src/css/presets.ts +7 -0
- package/src/tree/create-elements-tree.tsx +3 -5
- package/lib/cjs/tree/session-storage-polyfill.js +0 -65
- package/lib/tree/session-storage-polyfill.js +0 -45
- package/lib/types/tree/session-storage-polyfill.d.ts +0 -2
- package/src/tree/session-storage-polyfill.tsx +0 -50
|
@@ -19,17 +19,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var components_exports = {};
|
|
20
20
|
__export(components_exports, {
|
|
21
21
|
canAcceptComponent: () => canAcceptComponent,
|
|
22
|
+
defaultMetas: () => defaultMetas,
|
|
23
|
+
defaultPropsMetas: () => defaultPropsMetas,
|
|
22
24
|
getComponentMeta: () => getComponentMeta,
|
|
23
|
-
getComponentPropsMeta: () => getComponentPropsMeta,
|
|
24
25
|
registerComponentMetas: () => registerComponentMetas,
|
|
25
|
-
registerComponentPropsMetas: () => registerComponentPropsMetas,
|
|
26
26
|
registerComponents: () => registerComponents,
|
|
27
27
|
registeredComponents: () => registeredComponents
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(components_exports);
|
|
30
|
-
var import_generate_arg_types = require("@webstudio-is/generate-arg-types");
|
|
31
30
|
var import_slot = require("./slot.ws");
|
|
32
31
|
var import_fragment = require("./fragment.ws");
|
|
32
|
+
var import_html = require("./html.ws");
|
|
33
33
|
var import_body = require("./body.ws");
|
|
34
34
|
var import_box = require("./box.ws");
|
|
35
35
|
var import_text_block = require("./text-block.ws");
|
|
@@ -62,6 +62,7 @@ var import_checkbox_field = require("./checkbox-field.ws");
|
|
|
62
62
|
var import_checkbox = require("./checkbox.ws");
|
|
63
63
|
var import_slot2 = require("./slot.ws");
|
|
64
64
|
var import_fragment2 = require("./fragment.ws");
|
|
65
|
+
var import_html2 = require("./html.ws");
|
|
65
66
|
var import_body2 = require("./body.ws");
|
|
66
67
|
var import_box2 = require("./box.ws");
|
|
67
68
|
var import_text_block2 = require("./text-block.ws");
|
|
@@ -95,6 +96,7 @@ var import_checkbox2 = require("./checkbox.ws");
|
|
|
95
96
|
const defaultMetas = {
|
|
96
97
|
Slot: import_slot.meta,
|
|
97
98
|
Fragment: import_fragment.meta,
|
|
99
|
+
Html: import_html.meta,
|
|
98
100
|
Box: import_box.meta,
|
|
99
101
|
Body: import_body.meta,
|
|
100
102
|
TextBlock: import_text_block.meta,
|
|
@@ -137,9 +139,10 @@ const registerComponentMetas = (overrides) => {
|
|
|
137
139
|
}
|
|
138
140
|
currentMetas = result;
|
|
139
141
|
};
|
|
140
|
-
const
|
|
142
|
+
const defaultPropsMetas = {
|
|
141
143
|
Slot: import_slot2.propsMeta,
|
|
142
144
|
Fragment: import_fragment2.propsMeta,
|
|
145
|
+
Html: import_html2.propsMeta,
|
|
143
146
|
Box: import_box2.propsMeta,
|
|
144
147
|
Body: import_body2.propsMeta,
|
|
145
148
|
TextBlock: import_text_block2.propsMeta,
|
|
@@ -171,59 +174,10 @@ const defaultPropsMetasRaw = {
|
|
|
171
174
|
CheckboxField: import_checkbox_field2.propsMeta,
|
|
172
175
|
Checkbox: import_checkbox2.propsMeta
|
|
173
176
|
};
|
|
174
|
-
const defaultPropsMetas = defaultPropsMetasRaw;
|
|
175
|
-
let registeredPropsMetas = {};
|
|
176
|
-
let currentPropsMetas = void 0;
|
|
177
|
-
const getComponentPropsMeta = (name) => {
|
|
178
|
-
if (currentPropsMetas === void 0) {
|
|
179
|
-
currentPropsMetas = {};
|
|
180
|
-
for (const name2 of Object.keys(defaultPropsMetas)) {
|
|
181
|
-
const props = computeProps(
|
|
182
|
-
defaultPropsMetas[name2],
|
|
183
|
-
registeredPropsMetas[name2] ?? {}
|
|
184
|
-
);
|
|
185
|
-
const initialProps = computeInitialProps(
|
|
186
|
-
props,
|
|
187
|
-
defaultPropsMetas[name2],
|
|
188
|
-
registeredPropsMetas[name2] ?? {}
|
|
189
|
-
);
|
|
190
|
-
currentPropsMetas[name2] = { props, initialProps };
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return currentPropsMetas[name];
|
|
194
|
-
};
|
|
195
|
-
const registerComponentPropsMetas = (metas) => {
|
|
196
|
-
registeredPropsMetas = metas;
|
|
197
|
-
currentPropsMetas = void 0;
|
|
198
|
-
};
|
|
199
177
|
let registeredComponents;
|
|
200
178
|
const registerComponents = (components) => {
|
|
201
179
|
registeredComponents = components;
|
|
202
180
|
};
|
|
203
|
-
const computeProps = (defaults, overrides) => {
|
|
204
|
-
if (overrides) {
|
|
205
|
-
const allNames = (/* @__PURE__ */ new Set([
|
|
206
|
-
...Object.keys(defaults.props ?? {}),
|
|
207
|
-
...Object.keys(overrides?.props ?? {})
|
|
208
|
-
])).values();
|
|
209
|
-
const result = {};
|
|
210
|
-
for (const name of allNames) {
|
|
211
|
-
result[name] = import_generate_arg_types.PropMeta.parse({
|
|
212
|
-
...defaults.props[name],
|
|
213
|
-
...overrides?.props?.[name]
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return result;
|
|
217
|
-
}
|
|
218
|
-
return defaults.props;
|
|
219
|
-
};
|
|
220
|
-
const computeInitialProps = (props, defaults, overrides) => {
|
|
221
|
-
const initialProps = overrides?.initialProps ?? defaults?.initialProps ?? [];
|
|
222
|
-
const requiredProps = props ? Object.entries(props).filter(
|
|
223
|
-
([name, value]) => value?.required && initialProps.includes(name) === false
|
|
224
|
-
).map(([name]) => name) : [];
|
|
225
|
-
return [...initialProps, ...requiredProps];
|
|
226
|
-
};
|
|
227
181
|
const canAcceptComponent = (parentComponent, childComponent) => {
|
|
228
182
|
const parentMeta = getComponentMeta(parentComponent);
|
|
229
183
|
const childMeta = getComponentMeta(childComponent);
|
|
@@ -22,7 +22,7 @@ __export(input_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(input_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_input = require("./__generated__/input.props");
|
|
@@ -33,7 +33,7 @@ const meta = {
|
|
|
33
33
|
category: "forms",
|
|
34
34
|
type: "control",
|
|
35
35
|
label: "Text Input",
|
|
36
|
-
|
|
36
|
+
icon: import_svg.FormTextFieldIcon,
|
|
37
37
|
presetStyle,
|
|
38
38
|
states: [
|
|
39
39
|
...import_component_meta.defaultStates,
|
|
@@ -22,7 +22,7 @@ __export(italic_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(italic_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_italic = require("./__generated__/italic.props");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -38,7 +38,7 @@ const presetStyle = {
|
|
|
38
38
|
const meta = {
|
|
39
39
|
type: "rich-text-child",
|
|
40
40
|
label: "Italic Text",
|
|
41
|
-
|
|
41
|
+
icon: import_svg.TextItalicIcon,
|
|
42
42
|
states: import_component_meta.defaultStates,
|
|
43
43
|
presetStyle
|
|
44
44
|
};
|
|
@@ -22,7 +22,7 @@ __export(label_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(label_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_label = require("./__generated__/label.props");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -36,7 +36,7 @@ const meta = {
|
|
|
36
36
|
category: "forms",
|
|
37
37
|
type: "rich-text",
|
|
38
38
|
label: "Input Label",
|
|
39
|
-
|
|
39
|
+
icon: import_svg.TextBlockIcon,
|
|
40
40
|
states: import_component_meta.defaultStates,
|
|
41
41
|
presetStyle,
|
|
42
42
|
children: [{ type: "text", value: "Form Label" }]
|
|
@@ -22,7 +22,7 @@ __export(link_block_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(link_block_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_link_block = require("./__generated__/link-block.props");
|
|
27
27
|
var import_link = require("./link.ws");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -39,7 +39,7 @@ const meta = {
|
|
|
39
39
|
category: "general",
|
|
40
40
|
type: "container",
|
|
41
41
|
label: "Link Block",
|
|
42
|
-
|
|
42
|
+
icon: import_svg.LinkBlockIcon,
|
|
43
43
|
states: import_link.meta.states,
|
|
44
44
|
presetStyle
|
|
45
45
|
};
|
|
@@ -22,7 +22,7 @@ __export(link_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(link_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_link = require("./__generated__/link.props");
|
|
@@ -43,7 +43,7 @@ const meta = {
|
|
|
43
43
|
category: "general",
|
|
44
44
|
type: "rich-text",
|
|
45
45
|
label: "Link Text",
|
|
46
|
-
|
|
46
|
+
icon: import_svg.LinkIcon,
|
|
47
47
|
presetStyle,
|
|
48
48
|
states: [
|
|
49
49
|
...import_component_meta.defaultStates,
|
|
@@ -22,7 +22,7 @@ __export(list_item_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(list_item_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_list_item = require("./__generated__/list-item.props");
|
|
@@ -34,7 +34,7 @@ const meta = {
|
|
|
34
34
|
type: "rich-text",
|
|
35
35
|
acceptedParents: ["List"],
|
|
36
36
|
label: "List Item",
|
|
37
|
-
|
|
37
|
+
icon: import_svg.ListItemIcon,
|
|
38
38
|
children: [{ type: "text", value: "List Item you can edit" }],
|
|
39
39
|
states: import_component_meta.defaultStates,
|
|
40
40
|
presetStyle
|
|
@@ -22,7 +22,7 @@ __export(list_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(list_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_list = require("./__generated__/list.props");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -62,7 +62,7 @@ const meta = {
|
|
|
62
62
|
category: "typography",
|
|
63
63
|
type: "container",
|
|
64
64
|
label: "List",
|
|
65
|
-
|
|
65
|
+
icon: import_svg.ListIcon,
|
|
66
66
|
states: import_component_meta.defaultStates,
|
|
67
67
|
presetStyle,
|
|
68
68
|
children: []
|
|
@@ -22,7 +22,7 @@ __export(paragraph_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(paragraph_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_paragraph = require("./__generated__/paragraph.props");
|
|
@@ -33,7 +33,7 @@ const meta = {
|
|
|
33
33
|
category: "typography",
|
|
34
34
|
type: "rich-text",
|
|
35
35
|
label: "Paragraph",
|
|
36
|
-
|
|
36
|
+
icon: import_svg.TextAlignLeftIcon,
|
|
37
37
|
children: [{ type: "text", value: "Pragraph you can edit" }],
|
|
38
38
|
states: import_component_meta.defaultStates,
|
|
39
39
|
presetStyle
|
|
@@ -22,7 +22,7 @@ __export(radio_button_field_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(radio_button_field_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_radio_button_field = require("./__generated__/radio-button-field.props");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -36,7 +36,7 @@ const meta = {
|
|
|
36
36
|
category: "forms",
|
|
37
37
|
type: "container",
|
|
38
38
|
label: "Radio",
|
|
39
|
-
|
|
39
|
+
icon: import_svg.RadioCheckedIcon,
|
|
40
40
|
states: import_component_meta.defaultStates,
|
|
41
41
|
presetStyle,
|
|
42
42
|
children: [
|
|
@@ -22,7 +22,7 @@ __export(radio_button_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(radio_button_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_normalize = require("../css/normalize");
|
|
28
28
|
var import_radio_button = require("./__generated__/radio-button.props");
|
|
@@ -38,7 +38,7 @@ const presetStyle = {
|
|
|
38
38
|
const meta = {
|
|
39
39
|
type: "control",
|
|
40
40
|
label: "Radio Input",
|
|
41
|
-
|
|
41
|
+
icon: import_svg.RadioCheckedIcon,
|
|
42
42
|
presetStyle,
|
|
43
43
|
states: [
|
|
44
44
|
...import_component_meta.defaultStates,
|
|
@@ -22,7 +22,7 @@ __export(separator_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(separator_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_separator = require("./__generated__/separator.props");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -59,7 +59,7 @@ const meta = {
|
|
|
59
59
|
category: "general",
|
|
60
60
|
type: "embed",
|
|
61
61
|
label: "Separator",
|
|
62
|
-
|
|
62
|
+
icon: import_svg.DashIcon,
|
|
63
63
|
states: import_component_meta.defaultStates,
|
|
64
64
|
presetStyle,
|
|
65
65
|
children: []
|
|
@@ -22,12 +22,12 @@ __export(slot_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(slot_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
const meta = {
|
|
27
27
|
category: "general",
|
|
28
28
|
type: "container",
|
|
29
29
|
label: "Slot",
|
|
30
|
-
|
|
30
|
+
icon: import_svg.SlotComponentIcon
|
|
31
31
|
};
|
|
32
32
|
const propsMeta = {
|
|
33
33
|
props: {}
|
|
@@ -22,7 +22,7 @@ __export(span_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(span_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_span = require("./__generated__/span.props");
|
|
@@ -32,7 +32,7 @@ const presetStyle = {
|
|
|
32
32
|
const meta = {
|
|
33
33
|
type: "rich-text-child",
|
|
34
34
|
label: "Styled Text",
|
|
35
|
-
|
|
35
|
+
icon: import_svg.PaintBrushIcon,
|
|
36
36
|
states: import_component_meta.defaultStates,
|
|
37
37
|
presetStyle
|
|
38
38
|
};
|
|
@@ -22,7 +22,7 @@ __export(subscript_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(subscript_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_subscript = require("./__generated__/subscript.props");
|
|
@@ -32,7 +32,7 @@ const presetStyle = {
|
|
|
32
32
|
const meta = {
|
|
33
33
|
type: "rich-text-child",
|
|
34
34
|
label: "Subscript Text",
|
|
35
|
-
|
|
35
|
+
icon: import_svg.SubscriptIcon,
|
|
36
36
|
states: import_component_meta.defaultStates,
|
|
37
37
|
presetStyle
|
|
38
38
|
};
|
|
@@ -22,7 +22,7 @@ __export(success_message_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(success_message_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_success_message = require("./__generated__/success-message.props");
|
|
27
27
|
var import_normalize = require("../css/normalize");
|
|
28
28
|
const presetStyle = {
|
|
@@ -31,7 +31,7 @@ const presetStyle = {
|
|
|
31
31
|
const meta = {
|
|
32
32
|
type: "container",
|
|
33
33
|
label: "Success Message",
|
|
34
|
-
|
|
34
|
+
icon: import_svg.BoxIcon,
|
|
35
35
|
presetStyle
|
|
36
36
|
};
|
|
37
37
|
const propsMeta = {
|
|
@@ -22,7 +22,7 @@ __export(superscript_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(superscript_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_superscript = require("./__generated__/superscript.props");
|
|
@@ -32,7 +32,7 @@ const presetStyle = {
|
|
|
32
32
|
const meta = {
|
|
33
33
|
type: "rich-text-child",
|
|
34
34
|
label: "Superscript Text",
|
|
35
|
-
|
|
35
|
+
icon: import_svg.SuperscriptIcon,
|
|
36
36
|
states: import_component_meta.defaultStates,
|
|
37
37
|
presetStyle
|
|
38
38
|
};
|
|
@@ -22,7 +22,7 @@ __export(text_block_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(text_block_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_component_meta = require("./component-meta");
|
|
27
27
|
var import_text_block = require("./__generated__/text-block.props");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
@@ -39,7 +39,7 @@ const meta = {
|
|
|
39
39
|
category: "typography",
|
|
40
40
|
type: "rich-text",
|
|
41
41
|
label: "Text Block",
|
|
42
|
-
|
|
42
|
+
icon: import_svg.TextBlockIcon,
|
|
43
43
|
states: import_component_meta.defaultStates,
|
|
44
44
|
presetStyle,
|
|
45
45
|
children: [{ type: "text", value: "Block of text you can edit" }]
|
|
@@ -22,7 +22,7 @@ __export(textarea_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(textarea_ws_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_component_meta = require("./component-meta");
|
|
28
28
|
var import_textarea = require("./__generated__/textarea.props");
|
|
@@ -37,7 +37,7 @@ const meta = {
|
|
|
37
37
|
category: "forms",
|
|
38
38
|
type: "control",
|
|
39
39
|
label: "Text Area",
|
|
40
|
-
|
|
40
|
+
icon: import_svg.FormTextAreaIcon,
|
|
41
41
|
presetStyle,
|
|
42
42
|
states: [
|
|
43
43
|
...import_component_meta.defaultStates,
|
package/lib/cjs/css/css.js
CHANGED
|
@@ -23,8 +23,6 @@ __export(css_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(css_exports);
|
|
25
25
|
var import_css_engine = require("@webstudio-is/css-engine");
|
|
26
|
-
var import_components_utils = require("../components/components-utils");
|
|
27
|
-
var import_components = require("../components");
|
|
28
26
|
var import_tree = require("../tree");
|
|
29
27
|
var import_global_rules = require("./global-rules");
|
|
30
28
|
var import_style_rules = require("./style-rules");
|
|
@@ -61,9 +59,8 @@ const generateCssText = (data, options) => {
|
|
|
61
59
|
for (const breakpoint of breakpoints.values()) {
|
|
62
60
|
engine.addMediaRule(breakpoint.id, breakpoint);
|
|
63
61
|
}
|
|
64
|
-
for (const component of
|
|
65
|
-
const
|
|
66
|
-
const presetStyle = meta?.presetStyle;
|
|
62
|
+
for (const [component, meta] of data.componentMetas) {
|
|
63
|
+
const presetStyle = meta.presetStyle;
|
|
67
64
|
if (presetStyle === void 0) {
|
|
68
65
|
continue;
|
|
69
66
|
}
|
package/lib/cjs/css/normalize.js
CHANGED
|
@@ -72,7 +72,7 @@ const boxSizing = {
|
|
|
72
72
|
property: "boxSizing",
|
|
73
73
|
value: { type: "keyword", value: "border-box" }
|
|
74
74
|
};
|
|
75
|
-
const baseStyle = [boxSizing, ...import_presets.borders];
|
|
75
|
+
const baseStyle = [boxSizing, ...import_presets.borders, ...import_presets.outline];
|
|
76
76
|
const div = baseStyle;
|
|
77
77
|
const address = baseStyle;
|
|
78
78
|
const article = baseStyle;
|
package/lib/cjs/css/presets.js
CHANGED
|
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var presets_exports = {};
|
|
20
20
|
__export(presets_exports, {
|
|
21
|
-
borders: () => borders
|
|
21
|
+
borders: () => borders,
|
|
22
|
+
outline: () => outline
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(presets_exports);
|
|
24
25
|
const borders = [
|
|
@@ -39,3 +40,9 @@ const borders = [
|
|
|
39
40
|
value: { type: "unit", value: 1, unit: "px" }
|
|
40
41
|
}
|
|
41
42
|
];
|
|
43
|
+
const outline = [
|
|
44
|
+
{
|
|
45
|
+
property: "outlineWidth",
|
|
46
|
+
value: { type: "unit", value: 1, unit: "px" }
|
|
47
|
+
}
|
|
48
|
+
];
|
|
@@ -25,11 +25,10 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_react2 = require("@remix-run/react");
|
|
27
27
|
var import_context = require("../context");
|
|
28
|
-
var import_session_storage_polyfill = require("./session-storage-polyfill");
|
|
29
28
|
const createElementsTree = ({
|
|
29
|
+
renderer,
|
|
30
30
|
instances,
|
|
31
31
|
rootInstanceId,
|
|
32
|
-
sandbox,
|
|
33
32
|
propsByInstanceIdStore,
|
|
34
33
|
assetsStore,
|
|
35
34
|
pagesStore,
|
|
@@ -55,7 +54,6 @@ const createElementsTree = ({
|
|
|
55
54
|
children: [
|
|
56
55
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
57
56
|
children,
|
|
58
|
-
sandbox && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_session_storage_polyfill.SessionStoragePolyfill, {}),
|
|
59
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.ScrollRestoration, {}),
|
|
60
58
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Scripts, {})
|
|
61
59
|
] }, "children")
|
|
@@ -65,7 +63,7 @@ const createElementsTree = ({
|
|
|
65
63
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
64
|
import_context.ReactSdkContext.Provider,
|
|
67
65
|
{
|
|
68
|
-
value: { propsByInstanceIdStore, assetsStore, pagesStore },
|
|
66
|
+
value: { propsByInstanceIdStore, assetsStore, pagesStore, renderer },
|
|
69
67
|
children: root
|
|
70
68
|
}
|
|
71
69
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockquoteIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BlockquoteIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates
|
|
4
4
|
} from "./component-meta";
|
|
@@ -55,7 +55,7 @@ const meta = {
|
|
|
55
55
|
category: "typography",
|
|
56
56
|
type: "rich-text",
|
|
57
57
|
label: "Blockquote",
|
|
58
|
-
|
|
58
|
+
icon: BlockquoteIcon,
|
|
59
59
|
states: defaultStates,
|
|
60
60
|
presetStyle,
|
|
61
61
|
children: [{ type: "text", value: "Blockquote you can edit" }]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BodyIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BodyIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { body } from "../css/normalize";
|
|
3
3
|
import {
|
|
4
4
|
defaultStates
|
|
@@ -34,7 +34,7 @@ const presetStyle = {
|
|
|
34
34
|
const meta = {
|
|
35
35
|
type: "container",
|
|
36
36
|
label: "Body",
|
|
37
|
-
|
|
37
|
+
icon: BodyIcon,
|
|
38
38
|
states: defaultStates,
|
|
39
39
|
presetStyle
|
|
40
40
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoldIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BoldIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates
|
|
4
4
|
} from "./component-meta";
|
|
@@ -10,7 +10,7 @@ const presetStyle = {
|
|
|
10
10
|
const meta = {
|
|
11
11
|
type: "rich-text-child",
|
|
12
12
|
label: "Bold Text",
|
|
13
|
-
|
|
13
|
+
icon: BoldIcon,
|
|
14
14
|
states: defaultStates,
|
|
15
15
|
presetStyle
|
|
16
16
|
};
|
package/lib/components/box.ws.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoxIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BoxIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates
|
|
4
4
|
} from "./component-meta";
|
|
@@ -31,7 +31,7 @@ const meta = {
|
|
|
31
31
|
category: "general",
|
|
32
32
|
type: "container",
|
|
33
33
|
label: "Box",
|
|
34
|
-
|
|
34
|
+
icon: BoxIcon,
|
|
35
35
|
states: defaultStates,
|
|
36
36
|
presetStyle
|
|
37
37
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonElementIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { ButtonElementIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { button } from "../css/normalize";
|
|
3
3
|
import {
|
|
4
4
|
defaultStates
|
|
@@ -11,7 +11,7 @@ const meta = {
|
|
|
11
11
|
category: "forms",
|
|
12
12
|
type: "container",
|
|
13
13
|
label: "Button",
|
|
14
|
-
|
|
14
|
+
icon: ButtonElementIcon,
|
|
15
15
|
presetStyle,
|
|
16
16
|
states: [
|
|
17
17
|
...defaultStates,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxCheckedIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates
|
|
4
4
|
} from "./component-meta";
|
|
@@ -14,7 +14,7 @@ const meta = {
|
|
|
14
14
|
category: "forms",
|
|
15
15
|
type: "container",
|
|
16
16
|
label: "Checkbox",
|
|
17
|
-
|
|
17
|
+
icon: CheckboxCheckedIcon,
|
|
18
18
|
states: defaultStates,
|
|
19
19
|
presetStyle,
|
|
20
20
|
children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxCheckedIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates
|
|
4
4
|
} from "./component-meta";
|
|
@@ -16,7 +16,7 @@ const presetStyle = {
|
|
|
16
16
|
const meta = {
|
|
17
17
|
type: "control",
|
|
18
18
|
label: "Checkbox Input",
|
|
19
|
-
|
|
19
|
+
icon: CheckboxCheckedIcon,
|
|
20
20
|
presetStyle,
|
|
21
21
|
states: [
|
|
22
22
|
...defaultStates,
|