@webstudio-is/react-sdk 0.7.1 → 0.7.3
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 +4 -11
- package/lib/arg-types/utils.d.ts.map +1 -1
- package/lib/arg-types/utils.js +22 -31
- package/lib/cjs/arg-types/utils.cjs +88 -0
- package/lib/cjs/arg-types/utils.d.ts +10 -0
- package/lib/cjs/arg-types/utils.d.ts.map +1 -0
- package/lib/cjs/components/body.cjs +8 -0
- package/lib/cjs/components/body.d.ts +3 -0
- package/lib/cjs/components/body.d.ts.map +1 -0
- package/lib/cjs/components/body.props.json +491 -0
- package/lib/cjs/components/body.stories.cjs +11 -0
- package/lib/cjs/components/body.stories.d.ts +7 -0
- package/lib/cjs/components/body.stories.d.ts.map +1 -0
- package/lib/cjs/components/body.ws.cjs +64 -0
- package/lib/cjs/components/body.ws.d.ts +5 -0
- package/lib/cjs/components/body.ws.d.ts.map +1 -0
- package/lib/cjs/components/bold.cjs +8 -0
- package/lib/cjs/components/bold.d.ts +3 -0
- package/lib/cjs/components/bold.d.ts.map +1 -0
- package/lib/cjs/components/bold.props.json +491 -0
- package/lib/cjs/components/bold.stories.cjs +14 -0
- package/lib/cjs/components/bold.stories.d.ts +6 -0
- package/lib/cjs/components/bold.stories.d.ts.map +1 -0
- package/lib/cjs/components/bold.ws.cjs +14 -0
- package/lib/cjs/components/bold.ws.d.ts +5 -0
- package/lib/cjs/components/bold.ws.d.ts.map +1 -0
- package/lib/cjs/components/box.cjs +9 -0
- package/lib/cjs/components/box.d.ts +8 -0
- package/lib/cjs/components/box.d.ts.map +1 -0
- package/lib/cjs/components/box.props.json +508 -0
- package/lib/cjs/components/box.stories.cjs +12 -0
- package/lib/cjs/components/box.stories.d.ts +10 -0
- package/lib/cjs/components/box.stories.d.ts.map +1 -0
- package/lib/cjs/components/box.ws.cjs +21 -0
- package/lib/cjs/components/box.ws.d.ts +5 -0
- package/lib/cjs/components/box.ws.d.ts.map +1 -0
- package/lib/cjs/components/button.cjs +11 -0
- package/lib/cjs/components/button.d.ts +3 -0
- package/lib/cjs/components/button.d.ts.map +1 -0
- package/lib/cjs/components/button.props.json +547 -0
- package/lib/cjs/components/button.stories.cjs +14 -0
- package/lib/cjs/components/button.stories.d.ts +6 -0
- package/lib/cjs/components/button.stories.d.ts.map +1 -0
- package/lib/cjs/components/button.ws.cjs +15 -0
- package/lib/cjs/components/button.ws.d.ts +5 -0
- package/lib/cjs/components/button.ws.d.ts.map +1 -0
- package/lib/cjs/components/component-type.cjs +28 -0
- package/lib/cjs/components/component-type.d.ts +17 -0
- package/lib/cjs/components/component-type.d.ts.map +1 -0
- package/lib/cjs/components/form.cjs +8 -0
- package/lib/cjs/components/form.d.ts +3 -0
- package/lib/cjs/components/form.d.ts.map +1 -0
- package/lib/cjs/components/form.props.json +531 -0
- package/lib/cjs/components/form.stories.cjs +12 -0
- package/lib/cjs/components/form.stories.d.ts +6 -0
- package/lib/cjs/components/form.stories.d.ts.map +1 -0
- package/lib/cjs/components/form.ws.cjs +26 -0
- package/lib/cjs/components/form.ws.d.ts +5 -0
- package/lib/cjs/components/form.ws.d.ts.map +1 -0
- package/lib/cjs/components/heading.cjs +9 -0
- package/lib/cjs/components/heading.d.ts +8 -0
- package/lib/cjs/components/heading.d.ts.map +1 -0
- package/lib/cjs/components/heading.props.json +497 -0
- package/lib/cjs/components/heading.stories.cjs +14 -0
- package/lib/cjs/components/heading.stories.d.ts +10 -0
- package/lib/cjs/components/heading.stories.d.ts.map +1 -0
- package/lib/cjs/components/heading.ws.cjs +15 -0
- package/lib/cjs/components/heading.ws.d.ts +5 -0
- package/lib/cjs/components/heading.ws.d.ts.map +1 -0
- package/lib/cjs/components/image.cjs +40 -0
- package/lib/cjs/components/image.d.ts +3 -0
- package/lib/cjs/components/image.d.ts.map +1 -0
- package/lib/cjs/components/image.props.json +575 -0
- package/lib/cjs/components/image.stories.cjs +12 -0
- package/lib/cjs/components/image.stories.d.ts +6 -0
- package/lib/cjs/components/image.stories.d.ts.map +1 -0
- package/lib/cjs/components/image.ws.cjs +29 -0
- package/lib/cjs/components/image.ws.d.ts +5 -0
- package/lib/cjs/components/image.ws.d.ts.map +1 -0
- package/lib/cjs/components/index.cjs +36 -0
- package/lib/cjs/components/index.d.ts +16 -0
- package/lib/cjs/components/index.d.ts.map +1 -0
- package/lib/cjs/components/index.test.cjs +33 -0
- package/lib/cjs/components/index.test.d.ts +2 -0
- package/lib/cjs/components/index.test.d.ts.map +1 -0
- package/lib/cjs/components/input.cjs +8 -0
- package/lib/cjs/components/input.d.ts +3 -0
- package/lib/cjs/components/input.d.ts.map +1 -0
- package/lib/cjs/components/input.props.json +657 -0
- package/lib/cjs/components/input.stories.cjs +12 -0
- package/lib/cjs/components/input.stories.d.ts +6 -0
- package/lib/cjs/components/input.stories.d.ts.map +1 -0
- package/lib/cjs/components/input.ws.cjs +14 -0
- package/lib/cjs/components/input.ws.d.ts +5 -0
- package/lib/cjs/components/input.ws.d.ts.map +1 -0
- package/lib/cjs/components/italic.cjs +8 -0
- package/lib/cjs/components/italic.d.ts +3 -0
- package/lib/cjs/components/italic.d.ts.map +1 -0
- package/lib/cjs/components/italic.props.json +491 -0
- package/lib/cjs/components/italic.stories.cjs +14 -0
- package/lib/cjs/components/italic.stories.d.ts +6 -0
- package/lib/cjs/components/italic.stories.d.ts.map +1 -0
- package/lib/cjs/components/italic.ws.cjs +14 -0
- package/lib/cjs/components/italic.ws.d.ts +5 -0
- package/lib/cjs/components/italic.ws.d.ts.map +1 -0
- package/lib/cjs/components/link.cjs +8 -0
- package/lib/cjs/components/link.d.ts +8 -0
- package/lib/cjs/components/link.d.ts.map +1 -0
- package/lib/cjs/components/link.props.json +547 -0
- package/lib/cjs/components/link.stories.cjs +14 -0
- package/lib/cjs/components/link.stories.d.ts +10 -0
- package/lib/cjs/components/link.stories.d.ts.map +1 -0
- package/lib/cjs/components/link.ws.cjs +27 -0
- package/lib/cjs/components/link.ws.d.ts +5 -0
- package/lib/cjs/components/link.ws.d.ts.map +1 -0
- package/lib/cjs/components/meta.cjs +40 -0
- package/lib/cjs/components/meta.d.ts +7479 -0
- package/lib/cjs/components/meta.d.ts.map +1 -0
- package/lib/cjs/components/paragraph.cjs +8 -0
- package/lib/cjs/components/paragraph.d.ts +3 -0
- package/lib/cjs/components/paragraph.d.ts.map +1 -0
- package/lib/cjs/components/paragraph.props.json +491 -0
- package/lib/cjs/components/paragraph.stories.cjs +14 -0
- package/lib/cjs/components/paragraph.stories.d.ts +6 -0
- package/lib/cjs/components/paragraph.stories.d.ts.map +1 -0
- package/lib/cjs/components/paragraph.ws.cjs +15 -0
- package/lib/cjs/components/paragraph.ws.d.ts +5 -0
- package/lib/cjs/components/paragraph.ws.d.ts.map +1 -0
- package/lib/cjs/components/span.cjs +8 -0
- package/lib/cjs/components/span.d.ts +3 -0
- package/lib/cjs/components/span.d.ts.map +1 -0
- package/lib/cjs/components/span.props.json +491 -0
- package/lib/cjs/components/span.stories.cjs +14 -0
- package/lib/cjs/components/span.stories.d.ts +6 -0
- package/lib/cjs/components/span.stories.d.ts.map +1 -0
- package/lib/cjs/components/span.ws.cjs +14 -0
- package/lib/cjs/components/span.ws.d.ts +5 -0
- package/lib/cjs/components/span.ws.d.ts.map +1 -0
- package/lib/cjs/components/subscript.cjs +8 -0
- package/lib/cjs/components/subscript.d.ts +3 -0
- package/lib/cjs/components/subscript.d.ts.map +1 -0
- package/lib/cjs/components/subscript.props.json +491 -0
- package/lib/cjs/components/subscript.stories.cjs +14 -0
- package/lib/cjs/components/subscript.stories.d.ts +6 -0
- package/lib/cjs/components/subscript.stories.d.ts.map +1 -0
- package/lib/cjs/components/subscript.ws.cjs +14 -0
- package/lib/cjs/components/subscript.ws.d.ts +5 -0
- package/lib/cjs/components/subscript.ws.d.ts.map +1 -0
- package/lib/cjs/components/superscript.cjs +8 -0
- package/lib/cjs/components/superscript.d.ts +3 -0
- package/lib/cjs/components/superscript.d.ts.map +1 -0
- package/lib/cjs/components/superscript.props.json +491 -0
- package/lib/cjs/components/superscript.stories.cjs +14 -0
- package/lib/cjs/components/superscript.stories.d.ts +6 -0
- package/lib/cjs/components/superscript.stories.d.ts.map +1 -0
- package/lib/cjs/components/superscript.ws.cjs +14 -0
- package/lib/cjs/components/superscript.ws.d.ts +5 -0
- package/lib/cjs/components/superscript.ws.d.ts.map +1 -0
- package/lib/cjs/components/text-block.cjs +8 -0
- package/lib/cjs/components/text-block.d.ts +3 -0
- package/lib/cjs/components/text-block.d.ts.map +1 -0
- package/lib/cjs/components/text-block.props.json +491 -0
- package/lib/cjs/components/text-block.stories.cjs +14 -0
- package/lib/cjs/components/text-block.stories.d.ts +6 -0
- package/lib/cjs/components/text-block.stories.d.ts.map +1 -0
- package/lib/cjs/components/text-block.ws.cjs +23 -0
- package/lib/cjs/components/text-block.ws.d.ts +5 -0
- package/lib/cjs/components/text-block.ws.d.ts.map +1 -0
- package/lib/cjs/css/breakpoints.cjs +9 -0
- package/lib/cjs/css/breakpoints.d.ts +4 -0
- package/lib/cjs/css/breakpoints.d.ts.map +1 -0
- package/lib/cjs/css/categories.cjs +229 -0
- package/lib/cjs/css/categories.d.ts +408 -0
- package/lib/cjs/css/categories.d.ts.map +1 -0
- package/lib/cjs/css/get-browser-style.cjs +48 -0
- package/lib/cjs/css/get-browser-style.d.ts +3 -0
- package/lib/cjs/css/get-browser-style.d.ts.map +1 -0
- package/lib/cjs/css/index.cjs +19 -0
- package/lib/cjs/css/index.d.ts +4 -0
- package/lib/cjs/css/index.d.ts.map +1 -0
- package/lib/cjs/db/index.cjs +18 -0
- package/lib/cjs/db/index.d.ts +3 -0
- package/lib/cjs/db/index.d.ts.map +1 -0
- package/lib/cjs/db/instance.cjs +21 -0
- package/lib/cjs/db/instance.d.ts +14 -0
- package/lib/cjs/db/instance.d.ts.map +1 -0
- package/lib/cjs/db/types.cjs +2 -0
- package/lib/cjs/db/types.d.ts +17 -0
- package/lib/cjs/db/types.d.ts.map +1 -0
- package/lib/cjs/index.cjs +37 -0
- package/lib/cjs/index.d.ts +9 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/pubsub/create.cjs +66 -0
- package/lib/cjs/pubsub/create.d.ts +29 -0
- package/lib/cjs/pubsub/create.d.ts.map +1 -0
- package/lib/cjs/pubsub/index.cjs +17 -0
- package/lib/cjs/pubsub/index.d.ts +2 -0
- package/lib/cjs/pubsub/index.d.ts.map +1 -0
- package/lib/cjs/remix/handle-request.server.cjs +15 -0
- package/lib/cjs/remix/handle-request.server.d.ts +3 -0
- package/lib/cjs/remix/handle-request.server.d.ts.map +1 -0
- package/lib/cjs/remix/index.cjs +18 -0
- package/lib/cjs/remix/index.d.ts +3 -0
- package/lib/cjs/remix/index.d.ts.map +1 -0
- package/lib/cjs/remix/root.cjs +13 -0
- package/lib/cjs/remix/root.d.ts +8 -0
- package/lib/cjs/remix/root.d.ts.map +1 -0
- package/lib/cjs/tree/create-elements-tree.cjs +54 -0
- package/lib/cjs/tree/create-elements-tree.d.ts +19 -0
- package/lib/cjs/tree/create-elements-tree.d.ts.map +1 -0
- package/lib/cjs/tree/index.cjs +19 -0
- package/lib/cjs/tree/index.d.ts +4 -0
- package/lib/cjs/tree/index.d.ts.map +1 -0
- package/lib/cjs/tree/root.cjs +17 -0
- package/lib/cjs/tree/root.d.ts +18 -0
- package/lib/cjs/tree/root.d.ts.map +1 -0
- package/lib/cjs/tree/session-storage-polyfill.cjs +39 -0
- package/lib/cjs/tree/session-storage-polyfill.d.ts +2 -0
- package/lib/cjs/tree/session-storage-polyfill.d.ts.map +1 -0
- package/lib/cjs/tree/wrapper-component.cjs +53 -0
- package/lib/cjs/tree/wrapper-component.d.ts +12 -0
- package/lib/cjs/tree/wrapper-component.d.ts.map +1 -0
- package/lib/cjs/user-props/all-user-props.cjs +21 -0
- package/lib/cjs/user-props/all-user-props.d.ts +8 -0
- package/lib/cjs/user-props/all-user-props.d.ts.map +1 -0
- package/lib/cjs/user-props/index.cjs +20 -0
- package/lib/cjs/user-props/index.d.ts +5 -0
- package/lib/cjs/user-props/index.d.ts.map +1 -0
- package/lib/cjs/user-props/schema.cjs +33 -0
- package/lib/cjs/user-props/schema.d.ts +72 -0
- package/lib/cjs/user-props/schema.d.ts.map +1 -0
- package/lib/cjs/user-props/types.cjs +2 -0
- package/lib/cjs/user-props/types.d.ts +13 -0
- package/lib/cjs/user-props/types.d.ts.map +1 -0
- package/lib/cjs/user-props/use-user-props.cjs +33 -0
- package/lib/cjs/user-props/use-user-props.d.ts +12 -0
- package/lib/cjs/user-props/use-user-props.d.ts.map +1 -0
- package/lib/components/body.js +4 -7
- package/lib/components/body.props.json +103 -1817
- package/lib/components/body.stories.d.ts +2 -2
- package/lib/components/body.stories.d.ts.map +1 -1
- package/lib/components/body.stories.js +5 -14
- package/lib/components/body.ws.js +5 -7
- package/lib/components/bold.d.ts +2 -2
- package/lib/components/bold.d.ts.map +1 -1
- package/lib/components/bold.js +4 -7
- package/lib/components/bold.props.json +103 -1817
- package/lib/components/bold.stories.d.ts +3 -3
- package/lib/components/bold.stories.d.ts.map +1 -1
- package/lib/components/bold.stories.js +7 -15
- package/lib/components/bold.ws.js +5 -7
- package/lib/components/box.js +4 -7
- package/lib/components/box.props.json +106 -1866
- package/lib/components/box.stories.d.ts +5 -5
- package/lib/components/box.stories.d.ts.map +1 -1
- package/lib/components/box.stories.js +7 -15
- package/lib/components/box.ws.js +5 -7
- package/lib/components/button.d.ts +2 -2
- package/lib/components/button.d.ts.map +1 -1
- package/lib/components/button.js +5 -8
- package/lib/components/button.props.json +115 -2028
- package/lib/components/button.stories.d.ts +3 -3
- package/lib/components/button.stories.d.ts.map +1 -1
- package/lib/components/button.stories.js +7 -15
- package/lib/components/button.ws.js +5 -7
- package/lib/components/component-type.js +11 -14
- package/lib/components/form.d.ts +2 -2
- package/lib/components/form.d.ts.map +1 -1
- package/lib/components/form.js +4 -7
- package/lib/components/form.props.json +111 -1961
- package/lib/components/form.stories.d.ts +3 -3
- package/lib/components/form.stories.d.ts.map +1 -1
- package/lib/components/form.stories.js +7 -15
- package/lib/components/form.ws.js +5 -7
- package/lib/components/heading.js +4 -7
- package/lib/components/heading.props.json +105 -1853
- package/lib/components/heading.stories.d.ts +5 -5
- package/lib/components/heading.stories.d.ts.map +1 -1
- package/lib/components/heading.stories.js +7 -15
- package/lib/components/heading.ws.js +5 -7
- package/lib/components/image.d.ts +2 -10
- package/lib/components/image.d.ts.map +1 -1
- package/lib/components/image.js +6 -21
- package/lib/components/image.props.json +122 -2125
- package/lib/components/image.stories.d.ts +3 -11
- package/lib/components/image.stories.d.ts.map +1 -1
- package/lib/components/image.stories.js +7 -15
- package/lib/components/image.ws.js +5 -7
- package/lib/components/index.js +15 -36
- package/lib/components/index.test.js +3 -28
- package/lib/components/input.d.ts +2 -2
- package/lib/components/input.d.ts.map +1 -1
- package/lib/components/input.js +4 -7
- package/lib/components/input.props.json +137 -2436
- package/lib/components/input.stories.d.ts +3 -3
- package/lib/components/input.stories.d.ts.map +1 -1
- package/lib/components/input.stories.js +7 -15
- package/lib/components/input.ws.js +5 -7
- package/lib/components/italic.d.ts +2 -2
- package/lib/components/italic.d.ts.map +1 -1
- package/lib/components/italic.js +4 -7
- package/lib/components/italic.props.json +103 -1817
- package/lib/components/italic.stories.d.ts +3 -3
- package/lib/components/italic.stories.d.ts.map +1 -1
- package/lib/components/italic.stories.js +7 -15
- package/lib/components/italic.ws.js +5 -7
- package/lib/components/link.d.ts +2 -2
- package/lib/components/link.d.ts.map +1 -1
- package/lib/components/link.js +4 -7
- package/lib/components/link.props.json +114 -2007
- package/lib/components/link.stories.d.ts +5 -5
- package/lib/components/link.stories.d.ts.map +1 -1
- package/lib/components/link.stories.js +7 -15
- package/lib/components/link.ws.js +5 -7
- package/lib/components/meta.d.ts +7478 -15
- package/lib/components/meta.d.ts.map +1 -1
- package/lib/components/meta.js +33 -35
- package/lib/components/paragraph.d.ts +2 -2
- package/lib/components/paragraph.d.ts.map +1 -1
- package/lib/components/paragraph.js +4 -7
- package/lib/components/paragraph.props.json +103 -1817
- package/lib/components/paragraph.stories.d.ts +3 -3
- package/lib/components/paragraph.stories.d.ts.map +1 -1
- package/lib/components/paragraph.stories.js +7 -15
- package/lib/components/paragraph.ws.js +5 -7
- package/lib/components/span.js +4 -7
- package/lib/components/span.props.json +103 -1817
- package/lib/components/span.stories.d.ts.map +1 -1
- package/lib/components/span.stories.js +7 -15
- package/lib/components/span.ws.js +5 -7
- package/lib/components/subscript.js +4 -7
- package/lib/components/subscript.props.json +103 -1817
- package/lib/components/subscript.stories.d.ts +3 -3
- package/lib/components/subscript.stories.d.ts.map +1 -1
- package/lib/components/subscript.stories.js +7 -15
- package/lib/components/subscript.ws.js +5 -7
- package/lib/components/superscript.js +4 -7
- package/lib/components/superscript.props.json +103 -1817
- package/lib/components/superscript.stories.d.ts.map +1 -1
- package/lib/components/superscript.stories.js +7 -15
- package/lib/components/superscript.ws.js +5 -7
- package/lib/components/text-block.d.ts +2 -2
- package/lib/components/text-block.d.ts.map +1 -1
- package/lib/components/text-block.js +4 -7
- package/lib/components/text-block.props.json +103 -1817
- package/lib/components/text-block.stories.d.ts +3 -3
- package/lib/components/text-block.stories.d.ts.map +1 -1
- package/lib/components/text-block.stories.js +7 -15
- package/lib/components/text-block.ws.js +5 -7
- package/lib/css/breakpoints.js +1 -4
- package/lib/css/categories.js +5 -8
- package/lib/css/get-browser-style.js +7 -11
- package/lib/css/index.js +3 -19
- package/lib/db/index.js +2 -18
- package/lib/db/instance.js +8 -12
- package/lib/db/types.d.ts +6 -0
- package/lib/db/types.d.ts.map +1 -1
- package/lib/db/types.js +1 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -37
- package/lib/pubsub/create.js +8 -15
- package/lib/pubsub/index.js +1 -17
- package/lib/remix/handle-request.server.js +5 -9
- package/lib/remix/index.js +2 -18
- package/lib/remix/root.js +5 -9
- package/lib/tree/create-elements-tree.js +7 -11
- package/lib/tree/index.js +3 -19
- package/lib/tree/root.js +7 -11
- package/lib/tree/session-storage-polyfill.js +2 -6
- package/lib/tree/wrapper-component.js +11 -39
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/user-props/all-user-props.js +7 -11
- package/lib/user-props/index.js +4 -20
- package/lib/user-props/schema.d.ts +41 -4
- package/lib/user-props/schema.d.ts.map +1 -1
- package/lib/user-props/schema.js +29 -10
- package/lib/user-props/types.js +1 -2
- package/lib/user-props/use-user-props.d.ts.map +1 -1
- package/lib/user-props/use-user-props.js +7 -11
- package/package.json +15 -9
- package/lib/component-utils/image.d.ts +0 -107
- package/lib/component-utils/image.d.ts.map +0 -1
- package/lib/component-utils/image.js +0 -198
- package/lib/component-utils/image.test.d.ts +0 -2
- package/lib/component-utils/image.test.d.ts.map +0 -1
- package/lib/component-utils/image.test.js +0 -132
- package/lib/components/image-dev.stories.d.ts +0 -36
- package/lib/components/image-dev.stories.d.ts.map +0 -1
- package/lib/components/image-dev.stories.js +0 -102
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
declare const _default: ComponentMeta<
|
|
3
|
+
declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const TextBlock: ComponentStory<
|
|
5
|
+
export declare const TextBlock: ComponentStory<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
6
6
|
//# sourceMappingURL=text-block.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-block.stories.d.ts","sourceRoot":"","sources":["../../src/components/text-block.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"text-block.stories.d.ts","sourceRoot":"","sources":["../../src/components/text-block.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;AAGtE,wBAG8C;AAM9C,eAAO,MAAM,SAAS,kRAAoB,CAAC"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TextBlock = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const text_block_1 = require("./text-block");
|
|
9
|
-
const text_block_props_json_1 = __importDefault(require("./text-block.props.json"));
|
|
10
|
-
exports.default = {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextBlock as TextBlockPrimitive } from "./text-block";
|
|
3
|
+
export default {
|
|
11
4
|
title: "Components/TextBlock",
|
|
12
|
-
component:
|
|
13
|
-
argTypes: text_block_props_json_1.default,
|
|
5
|
+
component: TextBlockPrimitive,
|
|
14
6
|
};
|
|
15
|
-
const Template = (args) => ((
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const Template = (args) => (_jsx(TextBlockPrimitive, { ...args }));
|
|
8
|
+
export const TextBlock = Template.bind({});
|
|
9
|
+
TextBlock.args = {
|
|
18
10
|
children: "text",
|
|
19
11
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const icons_1 = require("@webstudio-is/icons");
|
|
4
|
-
const text_block_1 = require("./text-block");
|
|
1
|
+
import { TextIcon } from "@webstudio-is/icons";
|
|
2
|
+
import { TextBlock } from "./text-block";
|
|
5
3
|
const defaultStyle = {
|
|
6
4
|
minHeight: {
|
|
7
5
|
type: "unit",
|
|
@@ -10,8 +8,8 @@ const defaultStyle = {
|
|
|
10
8
|
},
|
|
11
9
|
};
|
|
12
10
|
const meta = {
|
|
13
|
-
Icon:
|
|
14
|
-
Component:
|
|
11
|
+
Icon: TextIcon,
|
|
12
|
+
Component: TextBlock,
|
|
15
13
|
defaultStyle,
|
|
16
14
|
canAcceptChildren: false,
|
|
17
15
|
isContentEditable: true,
|
|
@@ -20,4 +18,4 @@ const meta = {
|
|
|
20
18
|
label: "Text Block",
|
|
21
19
|
children: ["Block of text you can edit"],
|
|
22
20
|
};
|
|
23
|
-
|
|
21
|
+
export default meta;
|
package/lib/css/breakpoints.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialBreakpoints = void 0;
|
|
4
|
-
exports.initialBreakpoints = [
|
|
1
|
+
export const initialBreakpoints = [
|
|
5
2
|
{ label: "Mobile", minWidth: 360 },
|
|
6
3
|
{ label: "Tablet", minWidth: 768 },
|
|
7
4
|
{ label: "Laptop", minWidth: 1024 },
|
package/lib/css/categories.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.propertyCategoryMap = exports.categories = void 0;
|
|
4
1
|
const layout = [
|
|
5
2
|
"display",
|
|
6
3
|
// Flex
|
|
@@ -182,7 +179,7 @@ const other = [
|
|
|
182
179
|
"userSelect",
|
|
183
180
|
"pointerEvents",
|
|
184
181
|
];
|
|
185
|
-
|
|
182
|
+
export const categories = {
|
|
186
183
|
layout: {
|
|
187
184
|
label: "Layout",
|
|
188
185
|
properties: layout,
|
|
@@ -219,11 +216,11 @@ exports.categories = {
|
|
|
219
216
|
},
|
|
220
217
|
other: { label: "Other", properties: other, moreFrom: "" },
|
|
221
218
|
};
|
|
222
|
-
|
|
219
|
+
export const propertyCategoryMap = {};
|
|
223
220
|
let category;
|
|
224
|
-
for (category in
|
|
225
|
-
for (const property of
|
|
221
|
+
for (category in categories) {
|
|
222
|
+
for (const property of categories[category].properties) {
|
|
226
223
|
// We are widening the type here
|
|
227
|
-
|
|
224
|
+
propertyCategoryMap[property] = category;
|
|
228
225
|
}
|
|
229
226
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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("|")}`);
|
|
1
|
+
import { detectFont } from "detect-font";
|
|
2
|
+
import { properties, units } from "@webstudio-is/css-data";
|
|
3
|
+
const unitRegex = new RegExp(`${units.join("|")}`);
|
|
7
4
|
// @todo use a parser
|
|
8
5
|
const parseValue = (property, value) => {
|
|
9
6
|
const number = parseFloat(value);
|
|
@@ -17,7 +14,7 @@ const parseValue = (property, value) => {
|
|
|
17
14
|
};
|
|
18
15
|
}
|
|
19
16
|
if (number === 0) {
|
|
20
|
-
return
|
|
17
|
+
return properties[property].initial;
|
|
21
18
|
}
|
|
22
19
|
return {
|
|
23
20
|
type: "unit",
|
|
@@ -25,13 +22,13 @@ const parseValue = (property, value) => {
|
|
|
25
22
|
value: number,
|
|
26
23
|
};
|
|
27
24
|
};
|
|
28
|
-
const getBrowserStyle = (element) => {
|
|
25
|
+
export const getBrowserStyle = (element) => {
|
|
29
26
|
const browserStyle = {};
|
|
30
27
|
if (element === undefined)
|
|
31
28
|
return browserStyle;
|
|
32
29
|
let knownProperty;
|
|
33
30
|
const computedStyle = getComputedStyle(element);
|
|
34
|
-
for (knownProperty in
|
|
31
|
+
for (knownProperty in properties) {
|
|
35
32
|
if (knownProperty in computedStyle === false)
|
|
36
33
|
continue;
|
|
37
34
|
// Typescript doesn't know we can access CSSStyleDeclaration properties by keys
|
|
@@ -41,8 +38,7 @@ const getBrowserStyle = (element) => {
|
|
|
41
38
|
// We need a single font-family that is actually rendered. Computed style will return a list of potential fonts.
|
|
42
39
|
browserStyle.fontFamily = {
|
|
43
40
|
type: "fontFamily",
|
|
44
|
-
value: [
|
|
41
|
+
value: [detectFont(element)],
|
|
45
42
|
};
|
|
46
43
|
return browserStyle;
|
|
47
44
|
};
|
|
48
|
-
exports.getBrowserStyle = getBrowserStyle;
|
package/lib/css/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-browser-style"), exports);
|
|
18
|
-
__exportStar(require("./categories"), exports);
|
|
19
|
-
__exportStar(require("./breakpoints"), exports);
|
|
1
|
+
export * from "./get-browser-style";
|
|
2
|
+
export * from "./categories";
|
|
3
|
+
export * from "./breakpoints";
|
package/lib/db/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
18
|
-
__exportStar(require("./instance"), exports);
|
|
1
|
+
export * from "./types";
|
|
2
|
+
export * from "./instance";
|
package/lib/db/instance.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const css_data_1 = require("@webstudio-is/css-data");
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
|
-
const toBaseInstance = (instance) => {
|
|
1
|
+
import { CssRule } from "@webstudio-is/css-data";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const toBaseInstance = (instance) => {
|
|
7
4
|
return {
|
|
8
5
|
id: instance.id,
|
|
9
6
|
component: instance.component,
|
|
10
7
|
cssRules: instance.cssRules,
|
|
11
8
|
};
|
|
12
9
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
cssRules: zod_1.z.array(css_data_1.CssRule),
|
|
10
|
+
export const Instance = z.lazy(() => z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
component: z.string(),
|
|
13
|
+
children: z.array(z.union([Instance, z.string()])),
|
|
14
|
+
cssRules: z.array(CssRule),
|
|
19
15
|
})
|
|
20
16
|
// @todo can't figure out how to make component to be z.enum(Object.keys(components))
|
|
21
17
|
);
|
package/lib/db/types.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ export declare type Tree = {
|
|
|
5
5
|
id: string;
|
|
6
6
|
root: Instance;
|
|
7
7
|
};
|
|
8
|
+
export declare type Props = {
|
|
9
|
+
props: string;
|
|
10
|
+
id: string;
|
|
11
|
+
instanceId: string;
|
|
12
|
+
treeId: string;
|
|
13
|
+
};
|
|
8
14
|
export declare type InstanceProps = Omit<DbInstanceProps, "props"> & {
|
|
9
15
|
props: Array<UserProp>;
|
|
10
16
|
};
|
package/lib/db/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/db/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IAC3D,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CACxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/db/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,oBAAY,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IAC3D,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CACxB,CAAC"}
|
package/lib/db/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./css";
|
|
2
2
|
export * from "./tree";
|
|
3
3
|
export * as components from "./components";
|
|
4
|
-
export *
|
|
4
|
+
export * from "./components/meta";
|
|
5
5
|
export * from "./user-props";
|
|
6
6
|
export * from "./pubsub";
|
|
7
7
|
export * from "./db";
|
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,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,
|
|
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,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.componentsMeta = exports.components = void 0;
|
|
30
|
-
__exportStar(require("./css"), exports);
|
|
31
|
-
__exportStar(require("./tree"), exports);
|
|
32
|
-
exports.components = __importStar(require("./components"));
|
|
33
|
-
exports.componentsMeta = __importStar(require("./components/meta"));
|
|
34
|
-
__exportStar(require("./user-props"), exports);
|
|
35
|
-
__exportStar(require("./pubsub"), exports);
|
|
36
|
-
__exportStar(require("./db"), exports);
|
|
37
|
-
__exportStar(require("./remix"), exports);
|
|
1
|
+
export * from "./css";
|
|
2
|
+
export * from "./tree";
|
|
3
|
+
export * as components from "./components";
|
|
4
|
+
export * from "./components/meta";
|
|
5
|
+
export * from "./user-props";
|
|
6
|
+
export * from "./pubsub";
|
|
7
|
+
export * from "./db";
|
|
8
|
+
export * from "./remix";
|
package/lib/pubsub/create.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createPubsub = void 0;
|
|
7
|
-
const mitt_1 = __importDefault(require("mitt"));
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const createPubsub = () => {
|
|
1
|
+
import mitt from "mitt";
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
|
+
export const createPubsub = () => {
|
|
10
4
|
// `mitt` has a somewhat annoying overload for `*` type that makes it hard to wrap in a generic context
|
|
11
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
const emitter = (
|
|
6
|
+
const emitter = mitt();
|
|
13
7
|
if (typeof window === "object") {
|
|
14
8
|
window.addEventListener("message", (event) => {
|
|
15
9
|
// @todo this has no type safety built in, could be anything from any source.
|
|
@@ -32,8 +26,8 @@ const createPubsub = () => {
|
|
|
32
26
|
* To publish a postMessage event on the iframe and parent window from the parent window.
|
|
33
27
|
*/
|
|
34
28
|
usePublish() {
|
|
35
|
-
const iframeRef =
|
|
36
|
-
const publishCallback =
|
|
29
|
+
const iframeRef = useRef(null);
|
|
30
|
+
const publishCallback = useCallback((action) => {
|
|
37
31
|
const element = iframeRef.current;
|
|
38
32
|
if (element?.contentWindow == null)
|
|
39
33
|
return;
|
|
@@ -46,7 +40,7 @@ const createPubsub = () => {
|
|
|
46
40
|
* To subscribe a message event on the current window.
|
|
47
41
|
*/
|
|
48
42
|
useSubscribe(type, onAction) {
|
|
49
|
-
|
|
43
|
+
useEffect(() => {
|
|
50
44
|
emitter.on(type, onAction);
|
|
51
45
|
return () => {
|
|
52
46
|
emitter.off(type, onAction);
|
|
@@ -54,7 +48,7 @@ const createPubsub = () => {
|
|
|
54
48
|
}, [type, onAction]);
|
|
55
49
|
},
|
|
56
50
|
useSubscribeAll(onAction) {
|
|
57
|
-
|
|
51
|
+
useEffect(() => {
|
|
58
52
|
emitter.on("*", onAction);
|
|
59
53
|
return () => {
|
|
60
54
|
emitter.off("*", onAction);
|
|
@@ -63,4 +57,3 @@ const createPubsub = () => {
|
|
|
63
57
|
},
|
|
64
58
|
};
|
|
65
59
|
};
|
|
66
|
-
exports.createPubsub = createPubsub;
|
package/lib/pubsub/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create"), exports);
|
|
1
|
+
export * from "./create";
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
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 }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { renderToString } from "react-dom/server";
|
|
3
|
+
import { RemixServer } from "@remix-run/react";
|
|
4
|
+
export const handleRequest = (request, responseStatusCode, responseHeaders, remixContext) => {
|
|
5
|
+
const markup = renderToString(_jsx(RemixServer, { context: remixContext, url: request.url }));
|
|
9
6
|
responseHeaders.set("Content-Type", "text/html");
|
|
10
7
|
return new Response(`<!DOCTYPE html>${markup}`, {
|
|
11
8
|
status: responseStatusCode,
|
|
12
9
|
headers: responseHeaders,
|
|
13
10
|
});
|
|
14
11
|
};
|
|
15
|
-
exports.handleRequest = handleRequest;
|
package/lib/remix/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./root"), exports);
|
|
18
|
-
__exportStar(require("./handle-request.server"), exports);
|
|
1
|
+
export * from "./root";
|
|
2
|
+
export * from "./handle-request.server";
|
package/lib/remix/root.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("@remix-run/react");
|
|
6
|
-
const remix_utils_1 = require("remix-utils");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Links, Meta, Outlet as DefaultOutlet } from "@remix-run/react";
|
|
3
|
+
import { DynamicLinks } from "remix-utils";
|
|
7
4
|
/**
|
|
8
5
|
* We are using Outlet prop from index layout when user renders site from a subdomain.
|
|
9
6
|
*/
|
|
10
|
-
const Root = ({ Outlet =
|
|
11
|
-
return ((
|
|
7
|
+
export const Root = ({ Outlet = DefaultOutlet, }) => {
|
|
8
|
+
return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }), _jsx("link", { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }), _jsx("link", { rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" }), _jsx(Meta, {}), _jsx(DynamicLinks, {}), _jsx(Links, {})] }), _jsx(Outlet, {})] }));
|
|
12
9
|
};
|
|
13
|
-
exports.Root = Root;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const react_2 = require("@remix-run/react");
|
|
7
|
-
const session_storage_polyfill_1 = require("./session-storage-polyfill");
|
|
8
|
-
const createElementsTree = ({ sandbox, instance, Component, onChangeChildren, }) => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Scripts, ScrollRestoration } from "@remix-run/react";
|
|
4
|
+
import { SessionStoragePolyfill } from "./session-storage-polyfill";
|
|
5
|
+
export const createElementsTree = ({ sandbox, instance, Component, onChangeChildren, }) => {
|
|
9
6
|
const children = createInstanceChildrenElements({
|
|
10
7
|
Component,
|
|
11
8
|
children: instance.children,
|
|
@@ -15,12 +12,11 @@ const createElementsTree = ({ sandbox, instance, Component, onChangeChildren, })
|
|
|
15
12
|
Component,
|
|
16
13
|
instance,
|
|
17
14
|
children: [
|
|
18
|
-
(
|
|
15
|
+
_jsxs(Fragment, { children: [children, sandbox && _jsx(SessionStoragePolyfill, {}), _jsx(ScrollRestoration, {}), _jsx(Scripts, {})] }, "children"),
|
|
19
16
|
],
|
|
20
17
|
});
|
|
21
18
|
return body;
|
|
22
19
|
};
|
|
23
|
-
exports.createElementsTree = createElementsTree;
|
|
24
20
|
const createInstanceChildrenElements = ({ children, Component, onChangeChildren, }) => {
|
|
25
21
|
const elements = [];
|
|
26
22
|
for (const child of children) {
|
|
@@ -50,5 +46,5 @@ const createInstanceElement = ({ Component, instance, children = [], onChangeChi
|
|
|
50
46
|
key: instance.id,
|
|
51
47
|
onChangeChildren,
|
|
52
48
|
};
|
|
53
|
-
return (
|
|
49
|
+
return _jsx(Component, { ...props });
|
|
54
50
|
};
|
package/lib/tree/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create-elements-tree"), exports);
|
|
18
|
-
__exportStar(require("./root"), exports);
|
|
19
|
-
__exportStar(require("./wrapper-component"), exports);
|
|
1
|
+
export * from "./create-elements-tree";
|
|
2
|
+
export * from "./root";
|
|
3
|
+
export * from "./wrapper-component";
|
package/lib/tree/root.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const create_elements_tree_1 = require("./create-elements-tree");
|
|
6
|
-
const wrapper_component_1 = require("./wrapper-component");
|
|
7
|
-
const InstanceRoot = ({ data, Component, }) => {
|
|
1
|
+
import { useAllUserProps } from "../user-props/";
|
|
2
|
+
import { createElementsTree } from "./create-elements-tree";
|
|
3
|
+
import { WrapperComponent } from "./wrapper-component";
|
|
4
|
+
export const InstanceRoot = ({ data, Component, }) => {
|
|
8
5
|
if (data.tree === null) {
|
|
9
6
|
throw new Error("Tree is null");
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
return
|
|
8
|
+
useAllUserProps(data.props);
|
|
9
|
+
return createElementsTree({
|
|
13
10
|
instance: data.tree.root,
|
|
14
|
-
Component: Component ??
|
|
11
|
+
Component: Component ?? WrapperComponent,
|
|
15
12
|
});
|
|
16
13
|
};
|
|
17
|
-
exports.InstanceRoot = InstanceRoot;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionStoragePolyfill = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
2
|
// This is a temporary work around for https://github.com/remix-run/remix/issues/3659
|
|
6
3
|
// The code is based on this discussion https://bugs.chromium.org/p/chromium/issues/detail?id=357625
|
|
7
4
|
const polyfill = function () {
|
|
@@ -35,5 +32,4 @@ const polyfill = function () {
|
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
34
|
}.toString();
|
|
38
|
-
const SessionStoragePolyfill = () => ((
|
|
39
|
-
exports.SessionStoragePolyfill = SessionStoragePolyfill;
|
|
35
|
+
export const SessionStoragePolyfill = () => (_jsx("script", { dangerouslySetInnerHTML: { __html: `(${polyfill})()` }, suppressHydrationWarning: true }));
|