@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
package/lib/tree/root.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/tree/root.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/tree/root.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,oBAAY,IAAI,GAAG;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC5B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CACtB,CAAC;AAEF,aAAK,SAAS,GAAG;IACf,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC;CAC7E,CAAC;AAEF,eAAO,MAAM,YAAY,yBAGtB,SAAS,KAAG,WAAW,GAAG,IAS5B,CAAC"}
|
package/lib/tree/root.js
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InstanceRoot =
|
|
3
|
+
exports.InstanceRoot = void 0;
|
|
4
4
|
const user_props_1 = require("../user-props/");
|
|
5
|
-
const stitches_1 = require("../stitches");
|
|
6
5
|
const create_elements_tree_1 = require("./create-elements-tree");
|
|
7
6
|
const wrapper_component_1 = require("./wrapper-component");
|
|
8
|
-
exports.globalStyles = (0, stitches_1.globalCss)({
|
|
9
|
-
html: {
|
|
10
|
-
height: "100%",
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
7
|
const InstanceRoot = ({ data, Component, }) => {
|
|
14
8
|
if (data.tree === null) {
|
|
15
9
|
throw new Error("Tree is null");
|
|
16
10
|
}
|
|
17
|
-
(0, stitches_1.setBreakpoints)(data.breakpoints);
|
|
18
|
-
(0, exports.globalStyles)();
|
|
19
11
|
(0, user_props_1.useAllUserProps)(data.props);
|
|
20
12
|
return (0, create_elements_tree_1.createElementsTree)({
|
|
21
13
|
instance: data.tree.root,
|
|
22
|
-
breakpoints: data.breakpoints,
|
|
23
14
|
Component: Component ?? wrapper_component_1.WrapperComponent,
|
|
24
15
|
});
|
|
25
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-storage-polyfill.d.ts","sourceRoot":"","sources":["../../src/tree/session-storage-polyfill.tsx"],"names":[],"mappings":"AA4CA,eAAO,MAAM,sBAAsB,mBAKlC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionStoragePolyfill = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// This is a temporary work around for https://github.com/remix-run/remix/issues/3659
|
|
6
|
+
// The code is based on this discussion https://bugs.chromium.org/p/chromium/issues/detail?id=357625
|
|
7
|
+
const polyfill = function () {
|
|
8
|
+
try {
|
|
9
|
+
const key = "__session_storage_availability_test__";
|
|
10
|
+
sessionStorage.setItem(key, "test"); // test
|
|
11
|
+
sessionStorage.removeItem(key); // cleanup
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
alert('It looks like you have disabled cookies in your browser. Webstudio designer may not work properly.\n\nTo enable cookies, go to "Setting" > "Privacy and security" > "Cookies and other site data", and make sure neither "Block all cookies" nor "Block third-party cookies" are selected.\n\nRead more at https://support.google.com/chrome/answer/95647');
|
|
15
|
+
const data = new Map();
|
|
16
|
+
Object.defineProperty(window, "sessionStorage", {
|
|
17
|
+
value: {
|
|
18
|
+
setItem: (key, val) => {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.warn(`Session storage is unavailable due to Error "${error.message}". A polyfill is used to set value of "${key}". The value will be lost when the page is reloaded.`);
|
|
21
|
+
data.set(key, String(val));
|
|
22
|
+
},
|
|
23
|
+
getItem: (key) => {
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
console.warn(`Session storage is unavailable due to Error "${error.message}". A polyfill is used to get value of "${key}". The value will be undefined if the page was reloaded after it was set.`);
|
|
26
|
+
return data.get(key);
|
|
27
|
+
},
|
|
28
|
+
removeItem: (key) => {
|
|
29
|
+
data.delete(key);
|
|
30
|
+
},
|
|
31
|
+
clear: () => {
|
|
32
|
+
data.clear();
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}.toString();
|
|
38
|
+
const SessionStoragePolyfill = () => ((0, jsx_runtime_1.jsx)("script", { dangerouslySetInnerHTML: { __html: `(${polyfill})()` }, suppressHydrationWarning: true }));
|
|
39
|
+
exports.SessionStoragePolyfill = SessionStoragePolyfill;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Instance } from "../db";
|
|
2
|
-
import { type CSS } from "../stitches";
|
|
3
2
|
import type { OnChangeChildren } from "./create-elements-tree";
|
|
4
3
|
export declare const renderWrapperComponentChildren: (children: Array<JSX.Element | string> | undefined) => Array<JSX.Element | string | Array<JSX.Element | string>> | undefined;
|
|
5
|
-
|
|
4
|
+
declare type WrapperComponentProps = {
|
|
6
5
|
instance: Instance;
|
|
7
|
-
css: CSS;
|
|
8
6
|
children: Array<JSX.Element | string>;
|
|
9
7
|
onChangeChildren?: OnChangeChildren;
|
|
10
8
|
};
|
|
11
|
-
export declare const WrapperComponent: ({ instance,
|
|
9
|
+
export declare const WrapperComponent: ({ instance, onChangeChildren, children, ...rest }: WrapperComponentProps) => JSX.Element;
|
|
10
|
+
export declare const idAttribute = "data-ws-id";
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=wrapper-component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper-component.d.ts","sourceRoot":"","sources":["../../src/tree/wrapper-component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,
|
|
1
|
+
{"version":3,"file":"wrapper-component.d.ts","sourceRoot":"","sources":["../../src/tree/wrapper-component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAY/D,eAAO,MAAM,8BAA8B,aAC/B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,SAAS,KAChD,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,GAAG,SAO9D,CAAC;AAEF,aAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAK1B,qBAAqB,gBAOvB,CAAC;AAEF,eAAO,MAAM,WAAW,eAAe,CAAC"}
|
|
@@ -23,12 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.WrapperComponent = exports.renderWrapperComponentChildren = void 0;
|
|
26
|
+
exports.idAttribute = exports.WrapperComponent = exports.renderWrapperComponentChildren = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = require("react");
|
|
29
29
|
const components = __importStar(require("../components"));
|
|
30
30
|
const use_user_props_1 = require("../user-props/use-user-props");
|
|
31
|
-
const stitches_1 = require("../stitches");
|
|
32
31
|
const renderText = (text) => {
|
|
33
32
|
const lines = text.split("\n");
|
|
34
33
|
return lines.map((line, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [line, index < lines.length - 1 ? (0, jsx_runtime_1.jsx)("br", {}) : null] }, index)));
|
|
@@ -43,11 +42,12 @@ const renderWrapperComponentChildren = (children) => {
|
|
|
43
42
|
});
|
|
44
43
|
};
|
|
45
44
|
exports.renderWrapperComponentChildren = renderWrapperComponentChildren;
|
|
46
|
-
const WrapperComponent = ({ instance,
|
|
45
|
+
const WrapperComponent = ({ instance, onChangeChildren, // prevent it from passing to sdk component
|
|
47
46
|
children, ...rest }) => {
|
|
48
|
-
const className = (0, react_1.useMemo)(() => (0, stitches_1.css)(css)(), [css]);
|
|
49
47
|
const { Component } = components[instance.component];
|
|
50
48
|
const userProps = (0, use_user_props_1.useUserProps)(instance.id);
|
|
51
|
-
|
|
49
|
+
const props = { ...userProps, ...rest, [exports.idAttribute]: instance.id };
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, children: (0, exports.renderWrapperComponentChildren)(children) }));
|
|
52
51
|
};
|
|
53
52
|
exports.WrapperComponent = WrapperComponent;
|
|
53
|
+
exports.idAttribute = "data-ws-id";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UserProp: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
4
|
prop: z.ZodString;
|
|
5
5
|
value: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
|
|
@@ -15,7 +15,8 @@ export declare const UserPropSchema: z.ZodObject<{
|
|
|
15
15
|
id: string;
|
|
16
16
|
prop: string;
|
|
17
17
|
}>;
|
|
18
|
-
export declare
|
|
18
|
+
export declare type UserProp = z.infer<typeof UserProp>;
|
|
19
|
+
export declare const UserProps: z.ZodArray<z.ZodObject<{
|
|
19
20
|
id: z.ZodString;
|
|
20
21
|
prop: z.ZodString;
|
|
21
22
|
value: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/user-props/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/user-props/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;EAKnB,CAAC;AAEH,oBAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;WAAoB,CAAC"}
|
package/lib/user-props/schema.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UserProps = exports.UserProp = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.
|
|
5
|
+
exports.UserProp = zod_1.z.object({
|
|
6
6
|
id: zod_1.z.string(),
|
|
7
7
|
prop: zod_1.z.string(),
|
|
8
8
|
value: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]),
|
|
9
9
|
required: zod_1.z.optional(zod_1.z.boolean()),
|
|
10
10
|
});
|
|
11
|
-
exports.
|
|
11
|
+
exports.UserProps = zod_1.z.array(exports.UserProp);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import type { InstanceProps, Instance } from "../db";
|
|
3
|
-
import {
|
|
4
|
-
export declare type UserProp = z.infer<typeof UserPropSchema>;
|
|
2
|
+
import { UserProp } from "./schema";
|
|
5
3
|
export declare type UserPropsUpdates = {
|
|
6
4
|
treeId: InstanceProps["treeId"];
|
|
7
5
|
propsId: InstanceProps["id"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/user-props/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/user-props/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,oBAAY,gBAAgB,GAAG;IAC7B,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC1B,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-user-props.d.ts","sourceRoot":"","sources":["../../src/user-props/use-user-props.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-user-props.d.ts","sourceRoot":"","sources":["../../src/user-props/use-user-props.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,aAAK,SAAS,GAAG;IAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,eAAgB,QAAQ,CAAC,IAAI,CAAC,cAuBtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"dev": "tsup
|
|
9
|
-
"build": "yarn build:
|
|
10
|
-
"build:mdn-data": "tsx ./bin/mdn-data.ts ./src/css",
|
|
8
|
+
"dev": "tsup --watch",
|
|
9
|
+
"build": "yarn build:lib",
|
|
11
10
|
"build:args": "tsx ./bin/generate-arg-types.ts './src/components/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx'",
|
|
12
11
|
"typecheck": "tsc --noEmit",
|
|
13
|
-
"build:lib": "rm -fr lib && tsc",
|
|
12
|
+
"build:lib": "rm -fr lib tsconfig.tsbuildinfo && tsc",
|
|
14
13
|
"test": "jest",
|
|
15
14
|
"lint": "eslint ./src --ext .ts,.tsx --max-warnings 0",
|
|
16
15
|
"checks": "yarn typecheck && yarn lint && yarn test",
|
|
@@ -23,6 +22,7 @@
|
|
|
23
22
|
"@esbuild-kit/esm-loader": "^2.4.2",
|
|
24
23
|
"@remix-run/react": "^1.2.3",
|
|
25
24
|
"@remix-run/server-runtime": "^1.2.3",
|
|
25
|
+
"remix-utils": "^4.1.0",
|
|
26
26
|
"@storybook/addon-actions": "^6.5.6",
|
|
27
27
|
"@storybook/addon-essentials": "^6.5.6",
|
|
28
28
|
"@storybook/addon-interactions": "^6.5.6",
|
|
@@ -31,39 +31,40 @@
|
|
|
31
31
|
"@storybook/manager-webpack4": "^6.5.6",
|
|
32
32
|
"@storybook/react": "^6.5.6",
|
|
33
33
|
"@storybook/testing-library": "^0.0.11",
|
|
34
|
-
"@types/css-tree": "^1.0.7",
|
|
35
34
|
"@types/fs-extra": "^9.0.13",
|
|
36
35
|
"@types/node": "^17.0.21",
|
|
37
36
|
"@webstudio-is/jest-config": "*",
|
|
38
37
|
"@webstudio-is/prisma-client": "*",
|
|
39
38
|
"babel-loader": "^8.2.5",
|
|
40
|
-
"camelcase": "^6.3.0",
|
|
41
|
-
"css-tree": "^2.1.0",
|
|
42
39
|
"esbuild": "^0.14.25",
|
|
43
40
|
"esbuild-node-externals": "^1.4.1",
|
|
44
|
-
"mdn-data": "2.0.23",
|
|
45
41
|
"react": "^17.0.2",
|
|
46
42
|
"react-docgen-typescript": "^2.2.2",
|
|
47
43
|
"react-dom": "^17.0.2",
|
|
48
44
|
"tsup": "^6.1.3",
|
|
49
45
|
"tsx": "^3.9.0",
|
|
50
|
-
"typescript": "4.7.4"
|
|
46
|
+
"typescript": "4.7.4",
|
|
47
|
+
"zod": "^3.19.1"
|
|
51
48
|
},
|
|
52
49
|
"peerDependencies": {
|
|
53
50
|
"@remix-run/react": "^1.2.3",
|
|
54
51
|
"@remix-run/server-runtime": "^1.2.3",
|
|
52
|
+
"remix-utils": "^4.1.0",
|
|
55
53
|
"@storybook/react": "^6.5.6",
|
|
56
54
|
"react": "^17.0.2",
|
|
57
|
-
"react-dom": "^17.0.2"
|
|
55
|
+
"react-dom": "^17.0.2",
|
|
56
|
+
"zod": "^3.19.1"
|
|
58
57
|
},
|
|
59
58
|
"dependencies": {
|
|
60
|
-
"@
|
|
59
|
+
"@webstudio-is/asset-uploader": "^*",
|
|
60
|
+
"@webstudio-is/fonts": "*",
|
|
61
61
|
"@webstudio-is/icons": "*",
|
|
62
|
+
"@webstudio-is/css-data": "*",
|
|
62
63
|
"@webstudio-is/jest-config": "*",
|
|
63
64
|
"immer": "^9.0.12",
|
|
64
65
|
"mitt": "^3.0.0",
|
|
65
66
|
"react-nano-state": "^0.4.0",
|
|
66
|
-
"
|
|
67
|
+
"warn-once": "^0.1.1"
|
|
67
68
|
},
|
|
68
69
|
"main": "lib/index.js",
|
|
69
70
|
"types": "lib/index.d.ts",
|
|
@@ -73,5 +74,13 @@
|
|
|
73
74
|
"!*.test.*"
|
|
74
75
|
],
|
|
75
76
|
"license": "MIT",
|
|
76
|
-
"private": false
|
|
77
|
+
"private": false,
|
|
78
|
+
"sideEffects": false,
|
|
79
|
+
"tsup": {
|
|
80
|
+
"entry": [
|
|
81
|
+
"src/index.ts"
|
|
82
|
+
],
|
|
83
|
+
"format": "cjs",
|
|
84
|
+
"outDir": "lib"
|
|
85
|
+
}
|
|
77
86
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/canvas/canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxE;;GAEG;AACH,eAAO,MAAM,IAAI;YAGP,oBAAoB;iBAgB7B,CAAC"}
|
package/lib/canvas/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canvas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|