@webstudio-is/react-sdk 0.6.1 → 0.7.1
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/arg-types/utils.d.ts +1 -8
- package/lib/arg-types/utils.d.ts.map +1 -1
- package/lib/arg-types/utils.js +18 -7
- package/lib/component-utils/image.d.ts +107 -0
- package/lib/component-utils/image.d.ts.map +1 -0
- package/lib/component-utils/image.js +198 -0
- package/lib/component-utils/image.test.d.ts +2 -0
- package/lib/component-utils/image.test.d.ts.map +1 -0
- package/lib/component-utils/image.test.js +132 -0
- package/lib/components/body.props.json +8 -37
- package/lib/components/bold.props.json +8 -37
- package/lib/components/box.props.json +9 -40
- package/lib/components/button.props.json +10 -45
- package/lib/components/component-type.d.ts +2 -2
- package/lib/components/component-type.d.ts.map +1 -1
- package/lib/components/component-type.js +2 -2
- package/lib/components/form.props.json +8 -37
- package/lib/components/heading.props.json +10 -48
- package/lib/components/image-dev.stories.d.ts +36 -0
- package/lib/components/image-dev.stories.d.ts.map +1 -0
- package/lib/components/image-dev.stories.js +102 -0
- package/lib/components/image.d.ts +11 -0
- package/lib/components/image.d.ts.map +1 -0
- package/lib/components/image.js +52 -0
- package/lib/components/image.props.json +2578 -0
- package/lib/components/image.stories.d.ts +14 -0
- package/lib/components/image.stories.d.ts.map +1 -0
- package/lib/components/image.stories.js +17 -0
- package/lib/components/image.ws.d.ts +5 -0
- package/lib/components/image.ws.d.ts.map +1 -0
- package/lib/components/image.ws.js +29 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +9 -1
- package/lib/components/index.test.js +1 -1
- package/lib/components/input.props.json +9 -46
- package/lib/components/italic.props.json +8 -37
- package/lib/components/link.d.ts +1 -1
- package/lib/components/link.props.json +9 -40
- package/lib/components/link.stories.d.ts +2 -2
- package/lib/components/meta.d.ts +4 -0
- package/lib/components/meta.d.ts.map +1 -1
- package/lib/components/meta.js +9 -1
- package/lib/components/paragraph.props.json +8 -37
- package/lib/components/span.d.ts +3 -0
- package/lib/components/span.d.ts.map +1 -0
- package/lib/components/span.js +8 -0
- package/lib/components/span.props.json +2205 -0
- package/lib/components/span.stories.d.ts +6 -0
- package/lib/components/span.stories.d.ts.map +1 -0
- package/lib/components/span.stories.js +19 -0
- package/lib/components/span.ws.d.ts +5 -0
- package/lib/components/span.ws.d.ts.map +1 -0
- package/lib/components/span.ws.js +14 -0
- package/lib/components/subscript.d.ts +3 -0
- package/lib/components/subscript.d.ts.map +1 -0
- package/lib/components/subscript.js +8 -0
- package/lib/components/subscript.props.json +2205 -0
- package/lib/components/subscript.stories.d.ts +6 -0
- package/lib/components/subscript.stories.d.ts.map +1 -0
- package/lib/components/subscript.stories.js +19 -0
- package/lib/components/subscript.ws.d.ts +5 -0
- package/lib/components/subscript.ws.d.ts.map +1 -0
- package/lib/components/subscript.ws.js +14 -0
- package/lib/components/superscript.d.ts +3 -0
- package/lib/components/superscript.d.ts.map +1 -0
- package/lib/components/superscript.js +8 -0
- package/lib/components/superscript.props.json +2205 -0
- package/lib/components/superscript.stories.d.ts +6 -0
- package/lib/components/superscript.stories.d.ts.map +1 -0
- package/lib/components/superscript.stories.js +19 -0
- package/lib/components/superscript.ws.d.ts +5 -0
- package/lib/components/superscript.ws.d.ts.map +1 -0
- package/lib/components/superscript.ws.js +14 -0
- package/lib/components/text-block.props.json +8 -37
- package/lib/css/breakpoints.d.ts +1 -1
- package/lib/css/breakpoints.d.ts.map +1 -1
- package/lib/css/categories.d.ts +5 -5
- package/lib/css/get-browser-style.d.ts +1 -1
- package/lib/css/get-browser-style.d.ts.map +1 -1
- package/lib/css/get-browser-style.js +10 -5
- package/lib/css/index.d.ts +0 -5
- package/lib/css/index.d.ts.map +1 -1
- package/lib/css/index.js +0 -5
- package/lib/db/instance.d.ts +2 -2
- package/lib/db/instance.d.ts.map +1 -1
- package/lib/db/instance.js +5 -5
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/pubsub/create.d.ts +1 -0
- package/lib/pubsub/create.d.ts.map +1 -1
- package/lib/pubsub/create.js +8 -0
- package/lib/remix/handle-request.server.d.ts +3 -0
- package/lib/remix/handle-request.server.d.ts.map +1 -0
- package/lib/remix/handle-request.server.js +15 -0
- package/lib/remix/index.d.ts +3 -0
- package/lib/remix/index.d.ts.map +1 -0
- package/lib/{canvas → remix}/index.js +2 -1
- package/lib/{canvas/canvas.d.ts → remix/root.d.ts} +1 -1
- package/lib/remix/root.d.ts.map +1 -0
- package/lib/{canvas/canvas.js → remix/root.js} +2 -2
- package/lib/tree/create-elements-tree.d.ts +7 -11
- package/lib/tree/create-elements-tree.d.ts.map +1 -1
- package/lib/tree/create-elements-tree.js +5 -10
- package/lib/tree/root.d.ts +6 -4
- package/lib/tree/root.d.ts.map +1 -1
- package/lib/tree/root.js +1 -10
- package/lib/tree/session-storage-polyfill.d.ts +2 -0
- package/lib/tree/session-storage-polyfill.d.ts.map +1 -0
- package/lib/tree/session-storage-polyfill.js +39 -0
- package/lib/tree/wrapper-component.d.ts +4 -4
- package/lib/tree/wrapper-component.d.ts.map +1 -1
- package/lib/tree/wrapper-component.js +5 -5
- package/lib/user-props/schema.d.ts +3 -2
- package/lib/user-props/schema.d.ts.map +1 -1
- package/lib/user-props/schema.js +3 -3
- package/lib/user-props/types.d.ts +1 -3
- package/lib/user-props/types.d.ts.map +1 -1
- package/lib/user-props/use-user-props.d.ts +1 -1
- package/lib/user-props/use-user-props.d.ts.map +1 -1
- package/package.json +23 -14
- package/lib/canvas/canvas.d.ts.map +0 -1
- package/lib/canvas/index.d.ts +0 -2
- package/lib/canvas/index.d.ts.map +0 -1
- package/lib/css/keyword-values.d.ts +0 -302
- package/lib/css/keyword-values.d.ts.map +0 -1
- package/lib/css/keyword-values.js +0 -7372
- package/lib/css/properties.d.ts +0 -3199
- package/lib/css/properties.d.ts.map +0 -1
- package/lib/css/properties.js +0 -3202
- package/lib/css/schema.d.ts +0 -151
- package/lib/css/schema.d.ts.map +0 -1
- package/lib/css/schema.js +0 -38
- package/lib/css/types.d.ts +0 -15
- package/lib/css/types.d.ts.map +0 -1
- package/lib/css/types.js +0 -2
- package/lib/css/units.d.ts +0 -2
- package/lib/css/units.d.ts.map +0 -1
- package/lib/css/units.js +0 -35
- package/lib/stitches/critical-css.d.ts +0 -4
- package/lib/stitches/critical-css.d.ts.map +0 -1
- package/lib/stitches/critical-css.js +0 -12
- package/lib/stitches/css.d.ts +0 -9
- package/lib/stitches/css.d.ts.map +0 -1
- package/lib/stitches/css.js +0 -33
- package/lib/stitches/index.d.ts +0 -4
- package/lib/stitches/index.d.ts.map +0 -1
- package/lib/stitches/index.js +0 -19
- package/lib/stitches/to-css.d.ts +0 -8
- package/lib/stitches/to-css.d.ts.map +0 -1
- package/lib/stitches/to-css.js +0 -43
- package/lib/stitches/to-css.test.d.ts +0 -2
- package/lib/stitches/to-css.test.d.ts.map +0 -1
- package/lib/stitches/to-css.test.js +0 -63
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Superscript: ComponentStory<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
6
|
+
//# sourceMappingURL=superscript.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superscript.stories.d.ts","sourceRoot":"","sources":["../../src/components/superscript.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;AAItE,wBAIgD;AAMhD,eAAO,MAAM,WAAW,sQAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Superscript = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const superscript_1 = require("./superscript");
|
|
9
|
+
const superscript_props_json_1 = __importDefault(require("./superscript.props.json"));
|
|
10
|
+
exports.default = {
|
|
11
|
+
title: "Components/Superscript",
|
|
12
|
+
component: superscript_1.Superscript,
|
|
13
|
+
argTypes: superscript_props_json_1.default,
|
|
14
|
+
};
|
|
15
|
+
const Template = (args) => ((0, jsx_runtime_1.jsx)(superscript_1.Superscript, { ...args }));
|
|
16
|
+
exports.Superscript = Template.bind({});
|
|
17
|
+
exports.Superscript.args = {
|
|
18
|
+
children: "some superscript text",
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superscript.ws.d.ts","sourceRoot":"","sources":["../../src/components/superscript.ws.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,OAAO,WAAW,CAQ7C,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const icons_1 = require("@webstudio-is/icons");
|
|
4
|
+
const superscript_1 = require("./superscript");
|
|
5
|
+
const meta = {
|
|
6
|
+
Icon: icons_1.SuperscriptIcon,
|
|
7
|
+
Component: superscript_1.Superscript,
|
|
8
|
+
canAcceptChildren: false,
|
|
9
|
+
isContentEditable: false,
|
|
10
|
+
label: "Superscript Text",
|
|
11
|
+
isInlineOnly: true,
|
|
12
|
+
isListed: false,
|
|
13
|
+
};
|
|
14
|
+
exports.default = meta;
|
|
@@ -447,10 +447,7 @@
|
|
|
447
447
|
"control": {
|
|
448
448
|
"type": "radio"
|
|
449
449
|
},
|
|
450
|
-
"options": [
|
|
451
|
-
"yes",
|
|
452
|
-
"no"
|
|
453
|
-
]
|
|
450
|
+
"options": ["yes", "no"]
|
|
454
451
|
},
|
|
455
452
|
"radioGroup": {
|
|
456
453
|
"defaultValue": null,
|
|
@@ -739,6 +736,7 @@
|
|
|
739
736
|
}
|
|
740
737
|
},
|
|
741
738
|
"color": {
|
|
739
|
+
"defaultValue": null,
|
|
742
740
|
"description": "",
|
|
743
741
|
"name": "color",
|
|
744
742
|
"parent": {
|
|
@@ -943,10 +941,7 @@
|
|
|
943
941
|
"control": {
|
|
944
942
|
"type": "radio"
|
|
945
943
|
},
|
|
946
|
-
"options": [
|
|
947
|
-
"on",
|
|
948
|
-
"off"
|
|
949
|
-
]
|
|
944
|
+
"options": ["on", "off"]
|
|
950
945
|
},
|
|
951
946
|
"inputMode": {
|
|
952
947
|
"defaultValue": null,
|
|
@@ -1109,12 +1104,7 @@
|
|
|
1109
1104
|
"control": {
|
|
1110
1105
|
"type": "radio"
|
|
1111
1106
|
},
|
|
1112
|
-
"options": [
|
|
1113
|
-
"list",
|
|
1114
|
-
"none",
|
|
1115
|
-
"inline",
|
|
1116
|
-
"both"
|
|
1117
|
-
]
|
|
1107
|
+
"options": ["list", "none", "inline", "both"]
|
|
1118
1108
|
},
|
|
1119
1109
|
"aria-busy": {
|
|
1120
1110
|
"defaultValue": null,
|
|
@@ -1378,14 +1368,7 @@
|
|
|
1378
1368
|
"control": {
|
|
1379
1369
|
"type": "select"
|
|
1380
1370
|
},
|
|
1381
|
-
"options": [
|
|
1382
|
-
"link",
|
|
1383
|
-
"none",
|
|
1384
|
-
"copy",
|
|
1385
|
-
"execute",
|
|
1386
|
-
"move",
|
|
1387
|
-
"popup"
|
|
1388
|
-
]
|
|
1371
|
+
"options": ["link", "none", "copy", "execute", "move", "popup"]
|
|
1389
1372
|
},
|
|
1390
1373
|
"aria-errormessage": {
|
|
1391
1374
|
"defaultValue": null,
|
|
@@ -1662,11 +1645,7 @@
|
|
|
1662
1645
|
"control": {
|
|
1663
1646
|
"type": "radio"
|
|
1664
1647
|
},
|
|
1665
|
-
"options": [
|
|
1666
|
-
"off",
|
|
1667
|
-
"assertive",
|
|
1668
|
-
"polite"
|
|
1669
|
-
]
|
|
1648
|
+
"options": ["off", "assertive", "polite"]
|
|
1670
1649
|
},
|
|
1671
1650
|
"aria-modal": {
|
|
1672
1651
|
"defaultValue": null,
|
|
@@ -1764,10 +1743,7 @@
|
|
|
1764
1743
|
"control": {
|
|
1765
1744
|
"type": "radio"
|
|
1766
1745
|
},
|
|
1767
|
-
"options": [
|
|
1768
|
-
"horizontal",
|
|
1769
|
-
"vertical"
|
|
1770
|
-
]
|
|
1746
|
+
"options": ["horizontal", "vertical"]
|
|
1771
1747
|
},
|
|
1772
1748
|
"aria-owns": {
|
|
1773
1749
|
"defaultValue": null,
|
|
@@ -2136,12 +2112,7 @@
|
|
|
2136
2112
|
"control": {
|
|
2137
2113
|
"type": "radio"
|
|
2138
2114
|
},
|
|
2139
|
-
"options": [
|
|
2140
|
-
"none",
|
|
2141
|
-
"ascending",
|
|
2142
|
-
"descending",
|
|
2143
|
-
"other"
|
|
2144
|
-
]
|
|
2115
|
+
"options": ["none", "ascending", "descending", "other"]
|
|
2145
2116
|
},
|
|
2146
2117
|
"aria-valuemax": {
|
|
2147
2118
|
"defaultValue": null,
|
package/lib/css/breakpoints.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Breakpoint } from "@webstudio-is/css-data";
|
|
2
2
|
export declare type BaseBreakpoint = Pick<Breakpoint, "label" | "minWidth">;
|
|
3
3
|
export declare const initialBreakpoints: Array<BaseBreakpoint>;
|
|
4
4
|
//# sourceMappingURL=breakpoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/css/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/css/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,oBAAY,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,cAAc,CAKpD,CAAC"}
|
package/lib/css/categories.d.ts
CHANGED
|
@@ -56,11 +56,6 @@ export declare const categories: {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
export declare const propertyCategoryMap: {
|
|
59
|
-
clip: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
60
|
-
top: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
61
|
-
filter: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
62
|
-
float: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
63
|
-
minWidth: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
64
59
|
accentColor: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
65
60
|
alignContent: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
66
61
|
alignItems: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
@@ -145,6 +140,7 @@ export declare const propertyCategoryMap: {
|
|
|
145
140
|
captionSide: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
146
141
|
caretColor: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
147
142
|
clear: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
143
|
+
clip: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
148
144
|
clipPath: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
149
145
|
color: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
150
146
|
colorAdjust: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
@@ -167,11 +163,13 @@ export declare const propertyCategoryMap: {
|
|
|
167
163
|
direction: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
168
164
|
display: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
169
165
|
emptyCells: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
166
|
+
filter: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
170
167
|
flexBasis: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
171
168
|
flexDirection: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
172
169
|
flexGrow: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
173
170
|
flexShrink: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
174
171
|
flexWrap: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
172
|
+
float: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
175
173
|
fontFamily: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
176
174
|
fontFeatureSettings: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
177
175
|
fontKerning: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
@@ -268,6 +266,7 @@ export declare const propertyCategoryMap: {
|
|
|
268
266
|
minBlockSize: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
269
267
|
minHeight: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
270
268
|
minInlineSize: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
269
|
+
minWidth: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
271
270
|
mixBlendMode: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
272
271
|
objectFit: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
273
272
|
objectPosition: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
@@ -380,6 +379,7 @@ export declare const propertyCategoryMap: {
|
|
|
380
379
|
textTransform: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
381
380
|
textUnderlineOffset: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
382
381
|
textUnderlinePosition: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
382
|
+
top: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
383
383
|
touchAction: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
384
384
|
transform: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
385
385
|
transformBox: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-browser-style.d.ts","sourceRoot":"","sources":["../../src/css/get-browser-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-browser-style.d.ts","sourceRoot":"","sources":["../../src/css/get-browser-style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,KAAK,EAGN,MAAM,wBAAwB,CAAC;AA4BhC,eAAO,MAAM,eAAe,aAAc,OAAO,KAAG,KAiBnD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBrowserStyle = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const unitRegex = new RegExp(`${
|
|
4
|
+
const detect_font_1 = require("detect-font");
|
|
5
|
+
const css_data_1 = require("@webstudio-is/css-data");
|
|
6
|
+
const unitRegex = new RegExp(`${css_data_1.units.join("|")}`);
|
|
7
7
|
// @todo use a parser
|
|
8
8
|
const parseValue = (property, value) => {
|
|
9
9
|
const number = parseFloat(value);
|
|
@@ -17,7 +17,7 @@ const parseValue = (property, value) => {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
if (number === 0) {
|
|
20
|
-
return
|
|
20
|
+
return css_data_1.properties[property].initial;
|
|
21
21
|
}
|
|
22
22
|
return {
|
|
23
23
|
type: "unit",
|
|
@@ -31,13 +31,18 @@ const getBrowserStyle = (element) => {
|
|
|
31
31
|
return browserStyle;
|
|
32
32
|
let knownProperty;
|
|
33
33
|
const computedStyle = getComputedStyle(element);
|
|
34
|
-
for (knownProperty in
|
|
34
|
+
for (knownProperty in css_data_1.properties) {
|
|
35
35
|
if (knownProperty in computedStyle === false)
|
|
36
36
|
continue;
|
|
37
37
|
// Typescript doesn't know we can access CSSStyleDeclaration properties by keys
|
|
38
38
|
const computedValue = computedStyle[knownProperty];
|
|
39
39
|
browserStyle[knownProperty] = parseValue(knownProperty, computedValue);
|
|
40
40
|
}
|
|
41
|
+
// We need a single font-family that is actually rendered. Computed style will return a list of potential fonts.
|
|
42
|
+
browserStyle.fontFamily = {
|
|
43
|
+
type: "fontFamily",
|
|
44
|
+
value: [(0, detect_font_1.detectFont)(element)],
|
|
45
|
+
};
|
|
41
46
|
return browserStyle;
|
|
42
47
|
};
|
|
43
48
|
exports.getBrowserStyle = getBrowserStyle;
|
package/lib/css/index.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export * from "./properties";
|
|
2
|
-
export * from "./units";
|
|
3
|
-
export * from "./types";
|
|
4
1
|
export * from "./get-browser-style";
|
|
5
2
|
export * from "./categories";
|
|
6
|
-
export * from "./keyword-values";
|
|
7
3
|
export * from "./breakpoints";
|
|
8
|
-
export * from "./schema";
|
|
9
4
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/css/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/css/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/css/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
package/lib/css/index.js
CHANGED
|
@@ -14,11 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./properties"), exports);
|
|
18
|
-
__exportStar(require("./units"), exports);
|
|
19
|
-
__exportStar(require("./types"), exports);
|
|
20
17
|
__exportStar(require("./get-browser-style"), exports);
|
|
21
18
|
__exportStar(require("./categories"), exports);
|
|
22
|
-
__exportStar(require("./keyword-values"), exports);
|
|
23
19
|
__exportStar(require("./breakpoints"), exports);
|
|
24
|
-
__exportStar(require("./schema"), exports);
|
package/lib/db/instance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CssRule } from "@webstudio-is/css-data";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import * as components from "../components";
|
|
3
|
-
import { type CssRule } from "../css";
|
|
4
4
|
export declare type BaseInstance = {
|
|
5
5
|
id: string;
|
|
6
6
|
component: keyof typeof components;
|
|
@@ -10,5 +10,5 @@ export declare type Instance = BaseInstance & {
|
|
|
10
10
|
children: Array<Instance | string>;
|
|
11
11
|
};
|
|
12
12
|
export declare const toBaseInstance: (instance: Instance) => BaseInstance;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const Instance: z.ZodType<Instance, z.ZodTypeDef, Instance>;
|
|
14
14
|
//# sourceMappingURL=instance.d.ts.map
|
package/lib/db/instance.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/db/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/db/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAI5C,oBAAY,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,OAAO,UAAU,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AAEF,oBAAY,QAAQ,GAAG,YAAY,GAAG;IACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,QAAQ,KAAG,YAMnD,CAAC;AAEF,eAAO,MAAM,QAAQ,6CASG,CAAC"}
|
package/lib/db/instance.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Instance = exports.toBaseInstance = void 0;
|
|
4
|
+
const css_data_1 = require("@webstudio-is/css-data");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
|
-
const css_1 = require("../css");
|
|
6
6
|
const toBaseInstance = (instance) => {
|
|
7
7
|
return {
|
|
8
8
|
id: instance.id,
|
|
@@ -11,11 +11,11 @@ const toBaseInstance = (instance) => {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
exports.toBaseInstance = toBaseInstance;
|
|
14
|
-
exports.
|
|
14
|
+
exports.Instance = zod_1.z.lazy(() => zod_1.z.object({
|
|
15
15
|
id: zod_1.z.string(),
|
|
16
16
|
component: zod_1.z.string(),
|
|
17
|
-
children: zod_1.z.array(zod_1.z.union([exports.
|
|
18
|
-
cssRules: zod_1.z.array(
|
|
17
|
+
children: zod_1.z.array(zod_1.z.union([exports.Instance, zod_1.z.string()])),
|
|
18
|
+
cssRules: zod_1.z.array(css_data_1.CssRule),
|
|
19
19
|
})
|
|
20
20
|
// @todo can't figure out how to make component to be z.enum(Object.keys(components))
|
|
21
21
|
);
|
package/lib/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export * from "./css";
|
|
2
2
|
export * from "./tree";
|
|
3
|
-
export * from "./stitches";
|
|
4
3
|
export * as components from "./components";
|
|
5
4
|
export * as componentsMeta from "./components/meta";
|
|
6
5
|
export * from "./user-props";
|
|
7
6
|
export * from "./pubsub";
|
|
8
7
|
export * from "./db";
|
|
9
|
-
export * from "./
|
|
8
|
+
export * from "./remix";
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -29,10 +29,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.componentsMeta = exports.components = void 0;
|
|
30
30
|
__exportStar(require("./css"), exports);
|
|
31
31
|
__exportStar(require("./tree"), exports);
|
|
32
|
-
__exportStar(require("./stitches"), exports);
|
|
33
32
|
exports.components = __importStar(require("./components"));
|
|
34
33
|
exports.componentsMeta = __importStar(require("./components/meta"));
|
|
35
34
|
__exportStar(require("./user-props"), exports);
|
|
36
35
|
__exportStar(require("./pubsub"), exports);
|
|
37
36
|
__exportStar(require("./db"), exports);
|
|
38
|
-
__exportStar(require("./
|
|
37
|
+
__exportStar(require("./remix"), exports);
|
package/lib/pubsub/create.d.ts
CHANGED
|
@@ -24,5 +24,6 @@ export declare const createPubsub: <PublishMap>() => {
|
|
|
24
24
|
* To subscribe a message event on the current window.
|
|
25
25
|
*/
|
|
26
26
|
useSubscribe<Type_2 extends keyof PublishMap>(type: Type_2, onAction: (payload: PublishMap[Type_2]) => void): void;
|
|
27
|
+
useSubscribeAll(onAction: <Type_3 extends keyof PublishMap>(type: Type_3, payload: PublishMap[Type_3]) => void): void;
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/pubsub/create.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,YAAY;IA0BrB;;OAEG;;;;;;;;IAMH;;OAEG;;;;;;;;IAeH;;OAEG;2GAGwC,IAAI;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/pubsub/create.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,YAAY;IA0BrB;;OAEG;;;;;;;;IAMH;;OAEG;;;;;;;;IAeH;;OAEG;2GAGwC,IAAI;8GAcxC,IAAI;CAUd,CAAC"}
|
package/lib/pubsub/create.js
CHANGED
|
@@ -53,6 +53,14 @@ const createPubsub = () => {
|
|
|
53
53
|
};
|
|
54
54
|
}, [type, onAction]);
|
|
55
55
|
},
|
|
56
|
+
useSubscribeAll(onAction) {
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
emitter.on("*", onAction);
|
|
59
|
+
return () => {
|
|
60
|
+
emitter.off("*", onAction);
|
|
61
|
+
};
|
|
62
|
+
}, [onAction]);
|
|
63
|
+
},
|
|
56
64
|
};
|
|
57
65
|
};
|
|
58
66
|
exports.createPubsub = createPubsub;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-request.server.d.ts","sourceRoot":"","sources":["../../src/remix/handle-request.server.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,eAAO,MAAM,aAAa,YACf,OAAO,sBACI,MAAM,mBACT,OAAO,gBACV,YAAY,aAY3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleRequest = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const server_1 = require("react-dom/server");
|
|
6
|
+
const react_1 = require("@remix-run/react");
|
|
7
|
+
const handleRequest = (request, responseStatusCode, responseHeaders, remixContext) => {
|
|
8
|
+
const markup = (0, server_1.renderToString)((0, jsx_runtime_1.jsx)(react_1.RemixServer, { context: remixContext, url: request.url }));
|
|
9
|
+
responseHeaders.set("Content-Type", "text/html");
|
|
10
|
+
return new Response(`<!DOCTYPE html>${markup}`, {
|
|
11
|
+
status: responseStatusCode,
|
|
12
|
+
headers: responseHeaders,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.handleRequest = handleRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remix/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC"}
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./root"), exports);
|
|
18
|
+
__exportStar(require("./handle-request.server"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/remix/root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxE;;GAEG;AACH,eAAO,MAAM,IAAI;YAGP,oBAAoB;iBAiB7B,CAAC"}
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Root = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@remix-run/react");
|
|
6
|
-
const
|
|
6
|
+
const remix_utils_1 = require("remix-utils");
|
|
7
7
|
/**
|
|
8
8
|
* We are using Outlet prop from index layout when user renders site from a subdomain.
|
|
9
9
|
*/
|
|
10
10
|
const Root = ({ Outlet = react_1.Outlet, }) => {
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)("html", { lang: "en", children: [(0, jsx_runtime_1.jsxs)("head", { children: [(0, jsx_runtime_1.jsx)("meta", { charSet: "utf-8" }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)("link", { rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)(react_1.Meta, {}), (0, jsx_runtime_1.jsx)(
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("html", { lang: "en", children: [(0, jsx_runtime_1.jsxs)("head", { children: [(0, jsx_runtime_1.jsx)("meta", { charSet: "utf-8" }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)("link", { rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" }), (0, jsx_runtime_1.jsx)(react_1.Meta, {}), (0, jsx_runtime_1.jsx)(remix_utils_1.DynamicLinks, {}), (0, jsx_runtime_1.jsx)(react_1.Links, {})] }), (0, jsx_runtime_1.jsx)(Outlet, {})] }));
|
|
12
12
|
};
|
|
13
13
|
exports.Root = Root;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
1
2
|
import type { Instance } from "../db";
|
|
2
|
-
import
|
|
3
|
-
import { type WrapperComponentProps } from "./wrapper-component";
|
|
3
|
+
import { WrapperComponent } from "./wrapper-component";
|
|
4
4
|
export declare type ChildrenUpdates = Array<string | {
|
|
5
|
-
id: Instance["id"];
|
|
6
|
-
text: string;
|
|
7
|
-
} | {
|
|
8
|
-
id: Instance["id"];
|
|
9
|
-
text: string;
|
|
5
|
+
id: undefined | Instance["id"];
|
|
10
6
|
component: Instance["component"];
|
|
11
|
-
|
|
7
|
+
children: ChildrenUpdates;
|
|
12
8
|
}>;
|
|
13
9
|
export declare type OnChangeChildren = (change: {
|
|
14
10
|
instanceId: Instance["id"];
|
|
15
11
|
updates: ChildrenUpdates;
|
|
16
12
|
}) => void;
|
|
17
|
-
export declare const createElementsTree: ({
|
|
13
|
+
export declare const createElementsTree: ({ sandbox, instance, Component, onChangeChildren, }: {
|
|
14
|
+
sandbox?: boolean | undefined;
|
|
18
15
|
instance: Instance;
|
|
19
|
-
|
|
20
|
-
Component: (props: WrapperComponentProps) => JSX.Element;
|
|
16
|
+
Component: (props: ComponentProps<typeof WrapperComponent>) => JSX.Element;
|
|
21
17
|
onChangeChildren?: OnChangeChildren | undefined;
|
|
22
18
|
}) => JSX.Element;
|
|
23
19
|
//# sourceMappingURL=create-elements-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-elements-tree.d.ts","sourceRoot":"","sources":["../../src/tree/create-elements-tree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-elements-tree.d.ts","sourceRoot":"","sources":["../../src/tree/create-elements-tree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,oBAAY,eAAe,GAAG,KAAK,CAC/B,MAAM,GACN;IACE,EAAE,EAAE,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CACJ,CAAC;AAEF,oBAAY,gBAAgB,GAAG,CAAC,MAAM,EAAE;IACtC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;CAC1B,KAAK,IAAI,CAAC;AAEX,eAAO,MAAM,kBAAkB;;cAOnB,QAAQ;uBACC,eAAe,uBAAuB,CAAC,KAAK,WAAW;;iBAqB3E,CAAC"}
|
|
@@ -3,27 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createElementsTree = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const stitches_1 = require("../stitches");
|
|
7
6
|
const react_2 = require("@remix-run/react");
|
|
8
|
-
const
|
|
7
|
+
const session_storage_polyfill_1 = require("./session-storage-polyfill");
|
|
8
|
+
const createElementsTree = ({ sandbox, instance, Component, onChangeChildren, }) => {
|
|
9
9
|
const children = createInstanceChildrenElements({
|
|
10
10
|
Component,
|
|
11
11
|
children: instance.children,
|
|
12
|
-
breakpoints,
|
|
13
12
|
onChangeChildren,
|
|
14
13
|
});
|
|
15
14
|
const body = createInstanceElement({
|
|
16
15
|
Component,
|
|
17
16
|
instance,
|
|
18
17
|
children: [
|
|
19
|
-
(0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [children, (0, jsx_runtime_1.jsx)(react_2.ScrollRestoration, {}), (0, jsx_runtime_1.jsx)(react_2.Scripts, {})] }, "children"),
|
|
18
|
+
(0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [children, sandbox && (0, jsx_runtime_1.jsx)(session_storage_polyfill_1.SessionStoragePolyfill, {}), (0, jsx_runtime_1.jsx)(react_2.ScrollRestoration, {}), (0, jsx_runtime_1.jsx)(react_2.Scripts, {})] }, "children"),
|
|
20
19
|
],
|
|
21
|
-
breakpoints,
|
|
22
20
|
});
|
|
23
21
|
return body;
|
|
24
22
|
};
|
|
25
23
|
exports.createElementsTree = createElementsTree;
|
|
26
|
-
const createInstanceChildrenElements = ({ children,
|
|
24
|
+
const createInstanceChildrenElements = ({ children, Component, onChangeChildren, }) => {
|
|
27
25
|
const elements = [];
|
|
28
26
|
for (const child of children) {
|
|
29
27
|
if (typeof child === "string") {
|
|
@@ -32,13 +30,11 @@ const createInstanceChildrenElements = ({ children, breakpoints, Component, onCh
|
|
|
32
30
|
}
|
|
33
31
|
const children = createInstanceChildrenElements({
|
|
34
32
|
children: child.children,
|
|
35
|
-
breakpoints,
|
|
36
33
|
Component,
|
|
37
34
|
onChangeChildren,
|
|
38
35
|
});
|
|
39
36
|
const element = createInstanceElement({
|
|
40
37
|
instance: child,
|
|
41
|
-
breakpoints,
|
|
42
38
|
Component,
|
|
43
39
|
onChangeChildren,
|
|
44
40
|
children,
|
|
@@ -47,11 +43,10 @@ const createInstanceChildrenElements = ({ children, breakpoints, Component, onCh
|
|
|
47
43
|
}
|
|
48
44
|
return elements;
|
|
49
45
|
};
|
|
50
|
-
const createInstanceElement = ({ Component, instance, children = [],
|
|
46
|
+
const createInstanceElement = ({ Component, instance, children = [], onChangeChildren, }) => {
|
|
51
47
|
const props = {
|
|
52
48
|
instance,
|
|
53
49
|
children,
|
|
54
|
-
css: (0, stitches_1.toCss)(instance.cssRules, breakpoints),
|
|
55
50
|
key: instance.id,
|
|
56
51
|
onChangeChildren,
|
|
57
52
|
};
|
package/lib/tree/root.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { Tree, InstanceProps } from "../db";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { WrapperComponent } from "./wrapper-component";
|
|
3
|
+
import type { Asset } from "@webstudio-is/asset-uploader";
|
|
4
|
+
import { type ComponentProps } from "react";
|
|
5
|
+
import type { Breakpoint } from "@webstudio-is/css-data";
|
|
4
6
|
export declare type Data = {
|
|
5
7
|
tree: Tree | null;
|
|
6
8
|
breakpoints: Array<Breakpoint>;
|
|
7
9
|
props: Array<InstanceProps>;
|
|
10
|
+
assets: Array<Asset>;
|
|
8
11
|
};
|
|
9
|
-
export declare const globalStyles: () => string;
|
|
10
12
|
declare type RootProps = {
|
|
11
13
|
data: Data;
|
|
12
|
-
Component?: (props:
|
|
14
|
+
Component?: (props: ComponentProps<typeof WrapperComponent>) => JSX.Element;
|
|
13
15
|
};
|
|
14
16
|
export declare const InstanceRoot: ({ data, Component, }: RootProps) => JSX.Element | null;
|
|
15
17
|
export {};
|