@makeswift/runtime 0.8.10 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Box.cjs.js +6 -4
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +6 -4
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +6 -4
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +6 -4
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +9 -7
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +9 -7
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +6 -4
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +6 -4
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +6 -4
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +6 -4
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +6 -4
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +6 -4
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +6 -4
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +6 -4
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +6 -4
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +6 -4
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +8 -6
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +7 -5
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +6 -4
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +6 -4
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +51 -34
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +23 -6
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +72 -67
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +18 -13
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +136 -91
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +82 -37
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +6 -4
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +6 -4
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +6 -4
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +6 -4
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +7 -5
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +7 -5
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +6 -4
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +6 -4
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js +16 -1
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +14 -2
- package/dist/actions.es.js.map +1 -1
- package/dist/builder.cjs.js +7 -2
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +7 -2
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +8 -6
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +8 -6
- package/dist/components.es.js.map +1 -1
- package/dist/constants.cjs.js +0 -408
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +1 -372
- package/dist/constants.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +84 -41
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +44 -1
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +58 -50
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +8 -3
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +534 -495
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +372 -0
- package/dist/index.cjs10.js.map +1 -0
- package/dist/index.cjs2.js +10 -8
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +2 -480
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +6 -7
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +17 -39
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs8.js +14 -180
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs9.js +191 -265
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.es.js +299 -260
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +365 -0
- package/dist/index.es10.js.map +1 -0
- package/dist/index.es2.js +5 -3
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es5.js +3 -471
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +4 -5
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +17 -37
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es8.js +13 -175
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es9.js +188 -262
- package/dist/index.es9.js.map +1 -1
- package/dist/leaf.cjs.js +4 -4
- package/dist/leaf.cjs.js.map +1 -1
- package/dist/leaf.es.js +1 -1
- package/dist/leaf.es.js.map +1 -1
- package/dist/main.cjs.js +8 -4
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +6 -5
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +6 -4
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +6 -4
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +11 -7
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +7 -3
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/{descriptors.cjs.js → react-page.cjs.js} +1559 -102
- package/dist/react-page.cjs.js.map +1 -0
- package/dist/{descriptors.es.js → react-page.es.js} +1469 -80
- package/dist/react-page.es.js.map +1 -0
- package/dist/react.cjs.js +6 -4
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +6 -4
- package/dist/react.es.js.map +1 -1
- package/dist/slate.cjs.js +17 -11
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +7 -5
- package/dist/slate.es.js.map +1 -1
- package/dist/state/breakpoints.cjs.js.map +1 -1
- package/dist/state/breakpoints.es.js.map +1 -1
- package/dist/text-input.cjs.js +0 -6
- package/dist/text-input.cjs.js.map +1 -1
- package/dist/text-input.es.js +1 -5
- package/dist/text-input.es.js.map +1 -1
- package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
- package/dist/types/src/api/graphql/generated/types.d.ts +36 -44
- package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
- package/dist/types/src/api/graphql/types.d.ts +2 -2
- package/dist/types/src/api/graphql/types.d.ts.map +1 -1
- package/dist/types/src/api/react.d.ts +3 -3
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/control-serialization.d.ts +66 -66
- package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +5 -0
- package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -0
- package/dist/types/src/builder/serialization/controls/types.d.ts +3 -3
- package/dist/types/src/builder/serialization/controls/types.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/function-serialization.d.ts +4 -4
- package/dist/types/src/builder/serialization/function-serialization.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/animations.d.ts +1 -1
- package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/constants.d.ts +1 -1
- package/dist/types/src/components/builtin/Box/constants.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/Button.d.ts +3 -3
- package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/contants.d.ts +1 -1
- package/dist/types/src/components/builtin/Button/contants.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +1 -1
- package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +1 -1
- package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Divider/Divider.d.ts +2 -2
- package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Embed/Embed.d.ts +1 -1
- package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Embed/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/Form.d.ts +2 -2
- package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +2 -2
- package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +2 -2
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/context/FormContext.d.ts +5 -5
- package/dist/types/src/components/builtin/Form/context/FormContext.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/types.d.ts +13 -13
- package/dist/types/src/components/builtin/Form/types.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Image/Image.d.ts +1 -1
- package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +1 -1
- package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +3 -3
- package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +3 -3
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Root/Root.d.ts +1 -1
- package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +1 -1
- package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +1 -1
- package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +3 -3
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/Text.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +2 -2
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +5 -5
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Video/Video.d.ts +1 -1
- package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -1
- package/dist/types/src/components/hooks/useBackgrounds.d.ts +8 -8
- package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
- package/dist/types/src/components/hooks/useBorder.d.ts +3 -3
- package/dist/types/src/components/hooks/useBorder.d.ts.map +1 -1
- package/dist/types/src/components/hooks/useBoxShadow.d.ts +3 -3
- package/dist/types/src/components/hooks/useBoxShadow.d.ts.map +1 -1
- package/dist/types/src/components/page/BodySnippet.d.ts +1 -1
- package/dist/types/src/components/page/BodySnippet.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts +1 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts +1 -1
- package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -1
- package/dist/types/src/components/shared/GutterContainer/index.d.ts +2 -2
- package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/Link/index.d.ts +1 -1
- package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/grid-item.d.ts +2 -2
- package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
- package/dist/types/src/components/utils/drop-first.d.ts +1 -1
- package/dist/types/src/components/utils/drop-first.d.ts.map +1 -1
- package/dist/types/src/components/utils/types.d.ts +2 -2
- package/dist/types/src/components/utils/types.d.ts.map +1 -1
- package/dist/types/src/controls/checkbox.d.ts +3 -3
- package/dist/types/src/controls/checkbox.d.ts.map +1 -1
- package/dist/types/src/controls/color.d.ts +3 -3
- package/dist/types/src/controls/color.d.ts.map +1 -1
- package/dist/types/src/controls/combobox.d.ts +5 -5
- package/dist/types/src/controls/combobox.d.ts.map +1 -1
- package/dist/types/src/controls/control.d.ts +6 -4
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/image.d.ts +4 -4
- package/dist/types/src/controls/image.d.ts.map +1 -1
- package/dist/types/src/controls/link.d.ts +8 -8
- package/dist/types/src/controls/link.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +6 -6
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/number.d.ts +3 -3
- package/dist/types/src/controls/number.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/dto-types.d.ts +4 -4
- package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts +11 -11
- package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +39 -18
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/select.d.ts +5 -5
- package/dist/types/src/controls/select.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +5 -5
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/slot.d.ts +17 -8
- package/dist/types/src/controls/slot.d.ts.map +1 -1
- package/dist/types/src/controls/style.d.ts +18 -18
- package/dist/types/src/controls/style.d.ts.map +1 -1
- package/dist/types/src/controls/text-area.d.ts +3 -3
- package/dist/types/src/controls/text-area.d.ts.map +1 -1
- package/dist/types/src/controls/text-input.d.ts +3 -3
- package/dist/types/src/controls/text-input.d.ts.map +1 -1
- package/dist/types/src/controls/types.d.ts +5 -5
- package/dist/types/src/controls/types.d.ts.map +1 -1
- package/dist/types/src/css/border-radius.d.ts +2 -2
- package/dist/types/src/css/border-radius.d.ts.map +1 -1
- package/dist/types/src/css/border.d.ts +2 -2
- package/dist/types/src/css/border.d.ts.map +1 -1
- package/dist/types/src/css/length-percentage.d.ts +2 -2
- package/dist/types/src/css/length-percentage.d.ts.map +1 -1
- package/dist/types/src/css/length.d.ts +1 -1
- package/dist/types/src/css/length.d.ts.map +1 -1
- package/dist/types/src/css/margin.d.ts +2 -2
- package/dist/types/src/css/margin.d.ts.map +1 -1
- package/dist/types/src/css/padding.d.ts +2 -2
- package/dist/types/src/css/padding.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/element-tree.d.ts +3 -3
- package/dist/types/src/next/api-handler/handlers/element-tree.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/fonts.d.ts +5 -5
- package/dist/types/src/next/api-handler/handlers/fonts.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts +6 -4
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts +2 -2
- package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/revalidate.d.ts +3 -3
- package/dist/types/src/next/api-handler/handlers/revalidate.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/index.d.ts +5 -4
- package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts +15 -15
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/dynamic.d.ts +4 -4
- package/dist/types/src/next/dynamic.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts +10 -7
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/dist/types/src/next/preview-mode.d.ts +18 -4
- package/dist/types/src/next/preview-mode.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +179 -179
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/instances.d.ts +17 -17
- package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +1 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +1 -1
- package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/render-hook.d.ts +1 -1
- package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/checkbox.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/color.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/color.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/combobox.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/combobox.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/image.d.ts +3 -3
- package/dist/types/src/runtimes/react/controls/image.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/link.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/link.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/list.d.ts +3 -3
- package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/number.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +3 -3
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -4
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/select.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/select.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/shape.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/slot.d.ts +4 -4
- package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/style.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/text-area.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/text-input.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls.d.ts +8 -8
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/element-imperative-handle.d.ts +1 -1
- package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/find-dom-node.d.ts +1 -1
- package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts +10 -8
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/constants.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/dedent.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/indent.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts +56 -2
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
- package/dist/types/src/slate/{ListPlugin → BlockPlugin}/toggleList.d.ts +2 -2
- package/dist/types/src/slate/BlockPlugin/toggleList.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/types.d.ts +3 -3
- package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
- package/dist/types/src/slate/{ListPlugin → BlockPlugin}/unwrapList.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapList.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/utils/filterForSubtreeRoots.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/utils/getSelectedListItems.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/utils/location.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
- package/dist/types/src/slate/{ListPlugin → BlockPlugin}/wrapList.d.ts +2 -2
- package/dist/types/src/slate/BlockPlugin/wrapList.d.ts.map +1 -0
- package/dist/types/src/slate/BuilderPlugin/index.d.ts +1 -1
- package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -2
- package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +2 -2
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +2 -2
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/index.d.ts +1 -1
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/selectors.d.ts +1 -1
- package/dist/types/src/slate/selectors.d.ts.map +1 -1
- package/dist/types/{types/slate.d.ts → src/slate/types.d.ts} +42 -35
- package/dist/types/src/slate/types.d.ts.map +1 -0
- package/dist/types/src/slate/utils/editor.d.ts +1 -1
- package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
- package/dist/types/src/slate/utils/element.d.ts +1 -2
- package/dist/types/src/slate/utils/element.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +66 -41
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/makeswift-api-client.d.ts +5 -5
- package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
- package/dist/types/src/state/modules/api-resources.d.ts +2 -2
- package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
- package/dist/types/src/state/modules/box-models.d.ts +2 -2
- package/dist/types/src/state/modules/box-models.d.ts.map +1 -1
- package/dist/types/src/state/modules/breakpoints.d.ts +9 -9
- package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -1
- package/dist/types/src/state/modules/builder-edit-mode.d.ts +2 -2
- package/dist/types/src/state/modules/builder-edit-mode.d.ts.map +1 -1
- package/dist/types/src/state/modules/components-meta.d.ts +27 -3
- package/dist/types/src/state/modules/components-meta.d.ts.map +1 -1
- package/dist/types/src/state/modules/element-imperative-handles.d.ts +1 -1
- package/dist/types/src/state/modules/element-imperative-handles.d.ts.map +1 -1
- package/dist/types/src/state/modules/is-in-builder.d.ts +1 -1
- package/dist/types/src/state/modules/is-in-builder.d.ts.map +1 -1
- package/dist/types/src/state/modules/is-preview.d.ts +1 -1
- package/dist/types/src/state/modules/is-preview.d.ts.map +1 -1
- package/dist/types/src/state/modules/locales.d.ts +16 -0
- package/dist/types/src/state/modules/locales.d.ts.map +1 -0
- package/dist/types/src/state/modules/pointer.d.ts +2 -2
- package/dist/types/src/state/modules/pointer.d.ts.map +1 -1
- package/dist/types/src/state/modules/prop-controller-handles.d.ts +1 -1
- package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
- package/dist/types/src/state/modules/prop-controllers.d.ts +1 -1
- package/dist/types/src/state/modules/prop-controllers.d.ts.map +1 -1
- package/dist/types/src/state/modules/react-components.d.ts +2 -2
- package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
- package/dist/types/src/state/modules/read-only-documents.d.ts +7 -7
- package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -1
- package/dist/types/src/state/modules/read-write-documents.d.ts +1 -1
- package/dist/types/src/state/modules/read-write-documents.d.ts.map +1 -1
- package/dist/types/src/state/react-builder-preview.d.ts +7 -6
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +15 -7
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/dist/types/src/state/react-page.test.d.ts +3 -0
- package/dist/types/src/state/react-page.test.d.ts.map +1 -0
- package/dist/types/src/utils/isErrorWithMessage.d.ts +1 -1
- package/dist/types/src/utils/isErrorWithMessage.d.ts.map +1 -1
- package/package.json +8 -4
- package/dist/descriptors.cjs.js.map +0 -1
- package/dist/descriptors.es.js.map +0 -1
- package/dist/element.cjs.js +0 -55
- package/dist/element.cjs.js.map +0 -1
- package/dist/element.es.js +0 -54
- package/dist/element.es.js.map +0 -1
- package/dist/introspection.cjs.js +0 -329
- package/dist/introspection.cjs.js.map +0 -1
- package/dist/introspection.es.js +0 -315
- package/dist/introspection.es.js.map +0 -1
- package/dist/slate.cjs2.js +0 -46
- package/dist/slate.cjs2.js.map +0 -1
- package/dist/slate.es2.js +0 -44
- package/dist/slate.es2.js.map +0 -1
- package/dist/types/src/slate/ListPlugin/constants.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/dedent.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/indent.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/index.d.ts +0 -17
- package/dist/types/src/slate/ListPlugin/index.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/utils/filterForSubtreeRoots.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/utils/location.d.ts.map +0 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +0 -1
- package/dist/types/types/slate.d.ts.map +0 -1
- /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/constants.d.ts +0 -0
- /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/dedent.d.ts +0 -0
- /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/indent.d.ts +0 -0
- /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/filterForSubtreeRoots.d.ts +0 -0
- /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/getSelectedListItems.d.ts +0 -0
- /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/location.d.ts +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -35,31 +35,33 @@ var __publicField = (obj, key, value) => {
|
|
|
35
35
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
36
36
|
return value;
|
|
37
37
|
};
|
|
38
|
-
var
|
|
38
|
+
var _e;
|
|
39
39
|
var React = require("react");
|
|
40
40
|
var withSelector = require("use-sync-external-store/shim/with-selector");
|
|
41
41
|
var dynamic = require("next/dynamic");
|
|
42
|
-
var
|
|
42
|
+
var reactPage = require("./react-page.cjs.js");
|
|
43
43
|
var actions = require("./actions.cjs.js");
|
|
44
44
|
var css = require("@emotion/css");
|
|
45
45
|
var serialize = require("@emotion/serialize");
|
|
46
46
|
var utils = require("@emotion/utils");
|
|
47
47
|
var jsxRuntime = require("react/jsx-runtime");
|
|
48
|
-
var descriptors = require("./descriptors.cjs.js");
|
|
49
48
|
var textInput = require("./text-input.cjs.js");
|
|
50
49
|
var combobox = require("./combobox.cjs.js");
|
|
50
|
+
require("slate");
|
|
51
|
+
var state_breakpoints = require("./state/breakpoints.cjs.js");
|
|
52
|
+
require("is-hotkey");
|
|
53
|
+
require("slate-react");
|
|
51
54
|
var shim = require("use-sync-external-store/shim");
|
|
52
55
|
var redux = require("redux");
|
|
53
56
|
var thunk = require("redux-thunk");
|
|
54
57
|
var types = require("./types.cjs.js");
|
|
55
|
-
var introspection = require("./introspection.cjs.js");
|
|
56
|
-
var state_breakpoints = require("./state/breakpoints.cjs.js");
|
|
57
58
|
var boxModels = require("./box-models.cjs.js");
|
|
58
59
|
var ColorHelper = require("color");
|
|
59
60
|
var scrollIntoView = require("scroll-into-view-if-needed");
|
|
60
61
|
var reactDom = require("react-dom");
|
|
61
62
|
var parse = require("html-react-parser");
|
|
62
63
|
var Head = require("next/head");
|
|
64
|
+
var zod = require("zod");
|
|
63
65
|
var createEmotionServer = require("@emotion/server/create-instance");
|
|
64
66
|
var NextDocument = require("next/document");
|
|
65
67
|
var Cors = require("cors");
|
|
@@ -67,6 +69,7 @@ var pathToRegexp = require("path-to-regexp");
|
|
|
67
69
|
var cookie = require("cookie");
|
|
68
70
|
var httpProxy = require("http-proxy");
|
|
69
71
|
var setCookieParser = require("set-cookie-parser");
|
|
72
|
+
var constants = require("./constants.cjs.js");
|
|
70
73
|
var uuid = require("uuid");
|
|
71
74
|
var ipsum = require("corporate-ipsum");
|
|
72
75
|
function _interopDefaultLegacy(e) {
|
|
@@ -103,6 +106,43 @@ var createEmotionServer__default = /* @__PURE__ */ _interopDefaultLegacy(createE
|
|
|
103
106
|
var NextDocument__default = /* @__PURE__ */ _interopDefaultLegacy(NextDocument);
|
|
104
107
|
var Cors__default = /* @__PURE__ */ _interopDefaultLegacy(Cors);
|
|
105
108
|
var ipsum__default = /* @__PURE__ */ _interopDefaultLegacy(ipsum);
|
|
109
|
+
function is(x, y) {
|
|
110
|
+
if (x === y)
|
|
111
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
112
|
+
return x !== x && y !== y;
|
|
113
|
+
}
|
|
114
|
+
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
115
|
+
const shallowEqual = (a, b) => {
|
|
116
|
+
if (is(a, b))
|
|
117
|
+
return true;
|
|
118
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
119
|
+
return false;
|
|
120
|
+
const keysA = Object.keys(a);
|
|
121
|
+
const keysB = Object.keys(b);
|
|
122
|
+
if (keysA.length !== keysB.length)
|
|
123
|
+
return false;
|
|
124
|
+
for (let i = 0; i < keysA.length; i += 1) {
|
|
125
|
+
if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
};
|
|
130
|
+
const { hasOwnProperty } = Object.prototype;
|
|
131
|
+
const deepEqual = (a, b) => {
|
|
132
|
+
if (shallowEqual(a, b))
|
|
133
|
+
return true;
|
|
134
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
135
|
+
return false;
|
|
136
|
+
const keysA = Object.keys(a);
|
|
137
|
+
const keysB = Object.keys(b);
|
|
138
|
+
if (keysA.length !== keysB.length)
|
|
139
|
+
return false;
|
|
140
|
+
for (let i = 0; i < keysA.length; i += 1) {
|
|
141
|
+
if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
};
|
|
106
146
|
const SCRIPT_TAG = "script";
|
|
107
147
|
function BodySnippet({
|
|
108
148
|
code,
|
|
@@ -147,43 +187,6 @@ function BodySnippet({
|
|
|
147
187
|
}, [code, cleanup]);
|
|
148
188
|
return null;
|
|
149
189
|
}
|
|
150
|
-
function is(x, y) {
|
|
151
|
-
if (x === y)
|
|
152
|
-
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
153
|
-
return x !== x && y !== y;
|
|
154
|
-
}
|
|
155
|
-
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
156
|
-
const shallowEqual = (a, b) => {
|
|
157
|
-
if (is(a, b))
|
|
158
|
-
return true;
|
|
159
|
-
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
160
|
-
return false;
|
|
161
|
-
const keysA = Object.keys(a);
|
|
162
|
-
const keysB = Object.keys(b);
|
|
163
|
-
if (keysA.length !== keysB.length)
|
|
164
|
-
return false;
|
|
165
|
-
for (let i = 0; i < keysA.length; i += 1) {
|
|
166
|
-
if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
return true;
|
|
170
|
-
};
|
|
171
|
-
const { hasOwnProperty } = Object.prototype;
|
|
172
|
-
const deepEqual = (a, b) => {
|
|
173
|
-
if (shallowEqual(a, b))
|
|
174
|
-
return true;
|
|
175
|
-
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
176
|
-
return false;
|
|
177
|
-
const keysA = Object.keys(a);
|
|
178
|
-
const keysB = Object.keys(b);
|
|
179
|
-
if (keysA.length !== keysB.length)
|
|
180
|
-
return false;
|
|
181
|
-
for (let i = 0; i < keysA.length; i += 1) {
|
|
182
|
-
if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
return true;
|
|
186
|
-
};
|
|
187
190
|
function getInitialState(serializedState = {
|
|
188
191
|
Swatch: [],
|
|
189
192
|
File: [],
|
|
@@ -312,15 +315,6 @@ class GraphQLClient {
|
|
|
312
315
|
return body.data;
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
|
-
const SwatchFragment = `
|
|
316
|
-
fragment Swatch on Swatch {
|
|
317
|
-
__typename
|
|
318
|
-
id
|
|
319
|
-
hue
|
|
320
|
-
saturation
|
|
321
|
-
lightness
|
|
322
|
-
}
|
|
323
|
-
`;
|
|
324
318
|
const FileFragment = `
|
|
325
319
|
fragment File on File {
|
|
326
320
|
__typename
|
|
@@ -404,16 +398,7 @@ const TableFragment = `
|
|
|
404
398
|
}
|
|
405
399
|
`;
|
|
406
400
|
const IntrospectedResourcesQuery = `
|
|
407
|
-
query IntrospectedResources(
|
|
408
|
-
$swatchIds: [ID!]!
|
|
409
|
-
$fileIds: [ID!]!
|
|
410
|
-
$pageIds: [ID!]!
|
|
411
|
-
$tableIds: [ID!]!
|
|
412
|
-
) {
|
|
413
|
-
swatches(ids: $swatchIds) {
|
|
414
|
-
...Swatch
|
|
415
|
-
}
|
|
416
|
-
|
|
401
|
+
query IntrospectedResources($fileIds: [ID!]!, $pageIds: [ID!]!, $tableIds: [ID!]!) {
|
|
417
402
|
files(ids: $fileIds) {
|
|
418
403
|
...File
|
|
419
404
|
}
|
|
@@ -427,20 +412,10 @@ const IntrospectedResourcesQuery = `
|
|
|
427
412
|
}
|
|
428
413
|
}
|
|
429
414
|
|
|
430
|
-
${SwatchFragment}
|
|
431
415
|
${FileFragment}
|
|
432
416
|
${PagePathnameSliceFragment}
|
|
433
417
|
${TableFragment}
|
|
434
418
|
`;
|
|
435
|
-
const SwatchQuery = `
|
|
436
|
-
query Swatch($swatchId: ID!) {
|
|
437
|
-
swatch(id: $swatchId) {
|
|
438
|
-
...Swatch
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
${SwatchFragment}
|
|
443
|
-
`;
|
|
444
419
|
const FileQuery = `
|
|
445
420
|
query File($fileId: ID!) {
|
|
446
421
|
file(id: $fileId) {
|
|
@@ -770,7 +745,7 @@ function Page$1({
|
|
|
770
745
|
return null;
|
|
771
746
|
}))]
|
|
772
747
|
}), /* @__PURE__ */ jsxRuntime.jsx(DocumentReference, {
|
|
773
|
-
documentReference:
|
|
748
|
+
documentReference: reactPage.createDocumentReference(page.id)
|
|
774
749
|
}), filteredSnippets.filter((snippet) => snippet.location === SnippetLocation.Body).map((snippet) => /* @__PURE__ */ jsxRuntime.jsx(BodySnippet, {
|
|
775
750
|
code: snippet.code,
|
|
776
751
|
cleanup: snippet.cleanup
|
|
@@ -789,12 +764,120 @@ function useCachedSite(siteId) {
|
|
|
789
764
|
const site = shim.useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
|
|
790
765
|
return site;
|
|
791
766
|
}
|
|
767
|
+
const makeswiftSiteVersionSchema = zod.z.enum(["Live", "Working"]);
|
|
768
|
+
const MakeswiftSiteVersion = makeswiftSiteVersionSchema.Enum;
|
|
769
|
+
const makeswiftPreviewDataSchema = zod.z.object({
|
|
770
|
+
makeswift: zod.z.literal(true),
|
|
771
|
+
unstable_siteVersion: makeswiftSiteVersionSchema
|
|
772
|
+
});
|
|
773
|
+
function getMakeswiftSiteVersion(previewData) {
|
|
774
|
+
const result = makeswiftPreviewDataSchema.safeParse(previewData);
|
|
775
|
+
if (result.success)
|
|
776
|
+
return result.data.unstable_siteVersion;
|
|
777
|
+
return null;
|
|
778
|
+
}
|
|
779
|
+
function PreviewModeScript({
|
|
780
|
+
isPreview = false,
|
|
781
|
+
appOrigin = "https://app.makeswift.com"
|
|
782
|
+
}) {
|
|
783
|
+
const previewModeScript = `
|
|
784
|
+
const isPreview = ${isPreview}
|
|
785
|
+
const appOrigin = '${appOrigin.replace("'", "\\'")}'
|
|
786
|
+
const searchParamName = 'x-makeswift-preview-mode'
|
|
787
|
+
const headerName = 'X-Makeswift-Preview-Mode'
|
|
788
|
+
const originalUrl = new URL(window.location.href)
|
|
789
|
+
|
|
790
|
+
if (window.parent !== window) {
|
|
791
|
+
window.addEventListener('message', event => {
|
|
792
|
+
if (event.origin === appOrigin && event.data.type === 'makeswift_preview_mode') {
|
|
793
|
+
const { secret } = event.data
|
|
794
|
+
|
|
795
|
+
if (!isPreview && !originalUrl.searchParams.has(searchParamName)) {
|
|
796
|
+
const url = new URL(originalUrl)
|
|
797
|
+
|
|
798
|
+
url.searchParams.set(searchParamName, secret)
|
|
799
|
+
|
|
800
|
+
window.location.replace(url)
|
|
801
|
+
} else {
|
|
802
|
+
const originalFetch = window.fetch
|
|
803
|
+
|
|
804
|
+
window.fetch = function patchedFetch(resource, options) {
|
|
805
|
+
const request = new Request(resource, options)
|
|
806
|
+
|
|
807
|
+
if (new URL(request.url).origin !== window.location.origin) {
|
|
808
|
+
return originalFetch.call(this, resource, options)
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
return originalFetch.call(
|
|
812
|
+
this,
|
|
813
|
+
new Request(request, { headers: { [headerName]: secret } }),
|
|
814
|
+
)
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
})
|
|
819
|
+
|
|
820
|
+
window.parent.postMessage({ type: 'makeswift_preview_mode' }, appOrigin)
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
if (originalUrl.searchParams.has(searchParamName)) {
|
|
824
|
+
const url = new URL(originalUrl)
|
|
825
|
+
|
|
826
|
+
url.searchParams.delete(searchParamName)
|
|
827
|
+
|
|
828
|
+
window.history.replaceState(null, '', url)
|
|
829
|
+
}
|
|
830
|
+
`;
|
|
831
|
+
const makeswiftConnectionCheckScript = `
|
|
832
|
+
const appOrigin = '${appOrigin.replace("'", "\\'")}'
|
|
833
|
+
|
|
834
|
+
if (window.parent !== window) {
|
|
835
|
+
window.addEventListener('message', event => {
|
|
836
|
+
if (
|
|
837
|
+
event.origin === appOrigin &&
|
|
838
|
+
event.data.type === '${actions.ActionTypes.MAKESWIFT_CONNECTION_INIT}'
|
|
839
|
+
) {
|
|
840
|
+
setInterval(() => {
|
|
841
|
+
window.parent.postMessage({
|
|
842
|
+
type: '${actions.ActionTypes.MAKESWIFT_CONNECTION_CHECK}',
|
|
843
|
+
payload: {
|
|
844
|
+
currentUrl: window.location.href
|
|
845
|
+
}
|
|
846
|
+
}, appOrigin)
|
|
847
|
+
}, 20)
|
|
848
|
+
}
|
|
849
|
+
})
|
|
850
|
+
|
|
851
|
+
window.parent.postMessage({ type: '${actions.ActionTypes.MAKESWIFT_CONNECTION_INIT}' }, appOrigin)
|
|
852
|
+
}
|
|
853
|
+
`;
|
|
854
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
855
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx("script", {
|
|
856
|
+
id: "makeswift-preview-mode",
|
|
857
|
+
type: "module",
|
|
858
|
+
dangerouslySetInnerHTML: {
|
|
859
|
+
__html: previewModeScript
|
|
860
|
+
}
|
|
861
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("script", {
|
|
862
|
+
id: "makeswift-connection-check",
|
|
863
|
+
type: "module",
|
|
864
|
+
dangerouslySetInnerHTML: {
|
|
865
|
+
__html: makeswiftConnectionCheckScript
|
|
866
|
+
}
|
|
867
|
+
})]
|
|
868
|
+
});
|
|
869
|
+
}
|
|
792
870
|
class Makeswift {
|
|
793
|
-
constructor(apiKey, {
|
|
871
|
+
constructor(apiKey, {
|
|
872
|
+
apiOrigin = "https://api.makeswift.com",
|
|
873
|
+
runtime = ReactRuntime,
|
|
874
|
+
unstable_previewData
|
|
875
|
+
} = {}) {
|
|
794
876
|
__publicField(this, "apiKey");
|
|
795
877
|
__publicField(this, "apiOrigin");
|
|
796
878
|
__publicField(this, "graphqlClient");
|
|
797
879
|
__publicField(this, "runtime");
|
|
880
|
+
__publicField(this, "siteVersion");
|
|
798
881
|
if (typeof apiKey !== "string") {
|
|
799
882
|
throw new Error(`The Makeswift client must be passed a valid Makeswift site API key: \`new Makeswift('<makeswift_site_api_key>')\`
|
|
800
883
|
Received "${apiKey}" instead.`);
|
|
@@ -807,17 +890,27 @@ Received "${apiKey}" instead.`);
|
|
|
807
890
|
}
|
|
808
891
|
this.graphqlClient = new GraphQLClient(new URL("graphql", apiOrigin).href);
|
|
809
892
|
this.runtime = runtime;
|
|
893
|
+
this.siteVersion = getMakeswiftSiteVersion(unstable_previewData);
|
|
810
894
|
}
|
|
811
895
|
async fetch(path, init) {
|
|
896
|
+
var _a;
|
|
812
897
|
const response = await fetch(new URL(path, this.apiOrigin).toString(), __spreadProps(__spreadValues({}, init), {
|
|
813
|
-
headers:
|
|
898
|
+
headers: __spreadValues({
|
|
899
|
+
["X-API-Key"]: this.apiKey,
|
|
900
|
+
"Makeswift-Site-API-Key": this.apiKey,
|
|
901
|
+
"Makeswift-Site-Version": (_a = this.siteVersion) != null ? _a : MakeswiftSiteVersion.Live
|
|
902
|
+
}, init == null ? void 0 : init.headers)
|
|
814
903
|
}));
|
|
815
904
|
return response;
|
|
816
905
|
}
|
|
817
|
-
async getPages(
|
|
818
|
-
const
|
|
819
|
-
|
|
906
|
+
async getPages() {
|
|
907
|
+
const response = await this.fetch(`/v2/pages`, {
|
|
908
|
+
headers: {
|
|
909
|
+
"Makeswift-Site-Version": MakeswiftSiteVersion.Live
|
|
910
|
+
}
|
|
911
|
+
});
|
|
820
912
|
if (!response.ok) {
|
|
913
|
+
console.error("Failed to get pages", await response.json());
|
|
821
914
|
throw new Error(`Failed to get pages with error: "${response.statusText}"`);
|
|
822
915
|
}
|
|
823
916
|
const json = await response.json();
|
|
@@ -827,14 +920,36 @@ Received "${apiKey}" instead.`);
|
|
|
827
920
|
const result = await this.graphqlClient.request(TypographiesQuery, { typographyIds });
|
|
828
921
|
return result.typographies;
|
|
829
922
|
}
|
|
830
|
-
async
|
|
923
|
+
async getSwatches(ids, preview) {
|
|
924
|
+
var _a;
|
|
925
|
+
const url = new URL(`v1/swatches/bulk`, this.apiOrigin);
|
|
926
|
+
ids.forEach((id) => {
|
|
927
|
+
url.searchParams.append("ids", id);
|
|
928
|
+
});
|
|
929
|
+
const response = await this.fetch(url.pathname + url.search, {
|
|
930
|
+
headers: {
|
|
931
|
+
"Makeswift-Site-Version": (_a = this.siteVersion) != null ? _a : preview ? MakeswiftSiteVersion.Working : MakeswiftSiteVersion.Live
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
if (!response.ok) {
|
|
935
|
+
console.error("Failed to get swatches", await response.json());
|
|
936
|
+
return [];
|
|
937
|
+
}
|
|
938
|
+
return await response.json();
|
|
939
|
+
}
|
|
940
|
+
async getIntrospectedResources(_a, preview) {
|
|
941
|
+
var _b = _a, {
|
|
942
|
+
swatchIds
|
|
943
|
+
} = _b, introspectedResourceIds = __objRest(_b, [
|
|
944
|
+
"swatchIds"
|
|
945
|
+
]);
|
|
831
946
|
const result = await this.graphqlClient.request(IntrospectedResourcesQuery, introspectedResourceIds);
|
|
832
|
-
|
|
947
|
+
const swatches = await this.getSwatches(swatchIds, preview);
|
|
948
|
+
return __spreadProps(__spreadValues({}, result), { swatches });
|
|
833
949
|
}
|
|
834
|
-
async introspect(element) {
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
const descriptors$1 = constants.getPropControllerDescriptors(runtime.store.getState());
|
|
950
|
+
async introspect(element, preview) {
|
|
951
|
+
const runtime = this.runtime;
|
|
952
|
+
const descriptors = reactPage.getPropControllerDescriptors(runtime.store.getState());
|
|
838
953
|
const swatchIds = /* @__PURE__ */ new Set();
|
|
839
954
|
const fileIds = /* @__PURE__ */ new Set();
|
|
840
955
|
const typographyIds = /* @__PURE__ */ new Set();
|
|
@@ -847,26 +962,26 @@ Received "${apiKey}" instead.`);
|
|
|
847
962
|
while (current = remaining.pop()) {
|
|
848
963
|
let getResourcesFromElementDescriptors = function(elementDescriptors2, props) {
|
|
849
964
|
Object.entries(elementDescriptors2).forEach(([propName, descriptor]) => {
|
|
850
|
-
|
|
965
|
+
reactPage.getElementSwatchIds(descriptor, props[propName]).forEach((swatchId) => {
|
|
851
966
|
swatchIds.add(swatchId);
|
|
852
967
|
});
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
968
|
+
reactPage.getFileIds(descriptor, props[propName]).forEach((fileId) => fileIds.add(fileId));
|
|
969
|
+
reactPage.getTypographyIds(descriptor, props[propName]).forEach((typographyId) => typographyIds.add(typographyId));
|
|
970
|
+
reactPage.getTableIds(descriptor, props[propName]).forEach((tableId) => tableIds.add(tableId));
|
|
971
|
+
reactPage.getPageIds(descriptor, props[propName]).forEach((pageId) => pageIds.add(pageId));
|
|
972
|
+
reactPage.getElementChildren(descriptor, props[propName]).forEach((child) => {
|
|
858
973
|
if (!seen.has(child.key)) {
|
|
859
974
|
seen.add(child.key);
|
|
860
975
|
remaining.push(child);
|
|
861
976
|
}
|
|
862
977
|
});
|
|
863
|
-
if (descriptor.type ===
|
|
978
|
+
if (descriptor.type === reactPage.ShapeControlType) {
|
|
864
979
|
const prop = props[propName];
|
|
865
980
|
if (prop == null)
|
|
866
981
|
return;
|
|
867
982
|
getResourcesFromElementDescriptors(descriptor.config.type, prop);
|
|
868
983
|
}
|
|
869
|
-
if (descriptor.type ===
|
|
984
|
+
if (descriptor.type === reactPage.ListControlType) {
|
|
870
985
|
const prop = props[propName];
|
|
871
986
|
if (prop == null)
|
|
872
987
|
return;
|
|
@@ -874,13 +989,13 @@ Received "${apiKey}" instead.`);
|
|
|
874
989
|
getResourcesFromElementDescriptors({ propName: descriptor.config.type }, { propName: item.value });
|
|
875
990
|
});
|
|
876
991
|
}
|
|
877
|
-
if (descriptor.type ===
|
|
992
|
+
if (descriptor.type === reactPage.Types.Shape) {
|
|
878
993
|
const prop = props[propName];
|
|
879
994
|
if (prop == null)
|
|
880
995
|
return;
|
|
881
996
|
getResourcesFromElementDescriptors(descriptor.options.type, prop);
|
|
882
997
|
}
|
|
883
|
-
if (descriptor.type ===
|
|
998
|
+
if (descriptor.type === reactPage.Types.List) {
|
|
884
999
|
const prop = props[propName];
|
|
885
1000
|
if (prop == null)
|
|
886
1001
|
return;
|
|
@@ -891,7 +1006,7 @@ Received "${apiKey}" instead.`);
|
|
|
891
1006
|
});
|
|
892
1007
|
};
|
|
893
1008
|
let element2;
|
|
894
|
-
if (
|
|
1009
|
+
if (reactPage.isElementReference(current)) {
|
|
895
1010
|
const globalElement = await this.getGlobalElement(current.value);
|
|
896
1011
|
globalElements.set(current.value, globalElement);
|
|
897
1012
|
const elementData = globalElement == null ? void 0 : globalElement.data;
|
|
@@ -901,7 +1016,7 @@ Received "${apiKey}" instead.`);
|
|
|
901
1016
|
} else {
|
|
902
1017
|
element2 = current;
|
|
903
1018
|
}
|
|
904
|
-
const elementDescriptors = descriptors
|
|
1019
|
+
const elementDescriptors = descriptors.get(element2.type);
|
|
905
1020
|
if (elementDescriptors == null)
|
|
906
1021
|
continue;
|
|
907
1022
|
getResourcesFromElementDescriptors(elementDescriptors, element2.props);
|
|
@@ -909,8 +1024,8 @@ Received "${apiKey}" instead.`);
|
|
|
909
1024
|
const typographies = await this.getTypographies([...typographyIds]);
|
|
910
1025
|
typographies.forEach((typography) => {
|
|
911
1026
|
typography == null ? void 0 : typography.style.forEach((style) => {
|
|
912
|
-
var
|
|
913
|
-
const swatchId = (
|
|
1027
|
+
var _a;
|
|
1028
|
+
const swatchId = (_a = style.value.color) == null ? void 0 : _a.swatchId;
|
|
914
1029
|
if (swatchId != null)
|
|
915
1030
|
swatchIds.add(swatchId);
|
|
916
1031
|
});
|
|
@@ -920,44 +1035,44 @@ Received "${apiKey}" instead.`);
|
|
|
920
1035
|
fileIds: [...fileIds],
|
|
921
1036
|
tableIds: [...tableIds],
|
|
922
1037
|
pageIds: [...pageIds]
|
|
923
|
-
});
|
|
1038
|
+
}, preview);
|
|
924
1039
|
const pagePathnameSlices = pagePathnamesById.map((pagePathnameSlice) => pagePathnameSlice && __spreadProps(__spreadValues({}, pagePathnameSlice), {
|
|
925
1040
|
id: Buffer.from(`Page:${pagePathnameSlice.id}`).toString("base64")
|
|
926
1041
|
}));
|
|
927
1042
|
return {
|
|
928
1043
|
[types.APIResourceType.Swatch]: [...swatchIds].map((id) => {
|
|
929
|
-
var
|
|
1044
|
+
var _a;
|
|
930
1045
|
return {
|
|
931
1046
|
id,
|
|
932
|
-
value: (
|
|
1047
|
+
value: (_a = swatches.find((swatch) => (swatch == null ? void 0 : swatch.id) === id)) != null ? _a : null
|
|
933
1048
|
};
|
|
934
1049
|
}),
|
|
935
1050
|
[types.APIResourceType.File]: [...fileIds].map((id) => {
|
|
936
|
-
var
|
|
1051
|
+
var _a;
|
|
937
1052
|
return {
|
|
938
1053
|
id,
|
|
939
|
-
value: (
|
|
1054
|
+
value: (_a = files.find((file) => (file == null ? void 0 : file.id) === id)) != null ? _a : null
|
|
940
1055
|
};
|
|
941
1056
|
}),
|
|
942
1057
|
[types.APIResourceType.Typography]: [...typographyIds].map((id) => {
|
|
943
|
-
var
|
|
1058
|
+
var _a;
|
|
944
1059
|
return {
|
|
945
1060
|
id,
|
|
946
|
-
value: (
|
|
1061
|
+
value: (_a = typographies.find((typography) => (typography == null ? void 0 : typography.id) === id)) != null ? _a : null
|
|
947
1062
|
};
|
|
948
1063
|
}),
|
|
949
1064
|
[types.APIResourceType.Table]: [...tableIds].map((id) => {
|
|
950
|
-
var
|
|
1065
|
+
var _a;
|
|
951
1066
|
return {
|
|
952
1067
|
id,
|
|
953
|
-
value: (
|
|
1068
|
+
value: (_a = tables.find((table) => (table == null ? void 0 : table.id) === id)) != null ? _a : null
|
|
954
1069
|
};
|
|
955
1070
|
}),
|
|
956
1071
|
[types.APIResourceType.PagePathnameSlice]: [...pageIds].map((id) => {
|
|
957
|
-
var
|
|
1072
|
+
var _a;
|
|
958
1073
|
return {
|
|
959
1074
|
id,
|
|
960
|
-
value: (
|
|
1075
|
+
value: (_a = pagePathnameSlices.find((pagePathnameSlice) => (pagePathnameSlice == null ? void 0 : pagePathnameSlice.id) === id)) != null ? _a : null
|
|
961
1076
|
};
|
|
962
1077
|
}),
|
|
963
1078
|
[types.APIResourceType.GlobalElement]: [...globalElements.entries()].map(([id, value]) => ({
|
|
@@ -966,31 +1081,33 @@ Received "${apiKey}" instead.`);
|
|
|
966
1081
|
}))
|
|
967
1082
|
};
|
|
968
1083
|
}
|
|
969
|
-
async
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
const response = await this.fetch(`/v1/pages/${pageId}/document?${searchParams}`);
|
|
1084
|
+
async getPageSnapshot(pathname, { preview: previewOverride = false } = {}) {
|
|
1085
|
+
var _a;
|
|
1086
|
+
const siteVersion = (_a = this.siteVersion) != null ? _a : previewOverride ? MakeswiftSiteVersion.Working : MakeswiftSiteVersion.Live;
|
|
1087
|
+
const response = await this.fetch(`/v2/pages/${encodeURIComponent(pathname)}/document`, {
|
|
1088
|
+
headers: { "Makeswift-Site-Version": siteVersion }
|
|
1089
|
+
});
|
|
976
1090
|
if (!response.ok) {
|
|
977
1091
|
if (response.status === 404)
|
|
978
1092
|
return null;
|
|
979
|
-
|
|
1093
|
+
console.error("Failed to get page snapshot", await response.json());
|
|
1094
|
+
throw new Error(`Failed to get page snapshot with error: "${response.statusText}"`);
|
|
980
1095
|
}
|
|
981
1096
|
const document2 = await response.json();
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
if (page == null)
|
|
987
|
-
return null;
|
|
988
|
-
const snapshot = this.getPageSnapshotByPageId(page.id, { preview });
|
|
989
|
-
return snapshot;
|
|
1097
|
+
const cacheData = await this.introspect(document2.data, previewOverride);
|
|
1098
|
+
const apiOrigin = this.apiOrigin.href;
|
|
1099
|
+
const preview = siteVersion === MakeswiftSiteVersion.Working;
|
|
1100
|
+
return { document: document2, cacheData, apiOrigin, preview };
|
|
990
1101
|
}
|
|
991
1102
|
async getSwatch(swatchId) {
|
|
992
|
-
const
|
|
993
|
-
|
|
1103
|
+
const response = await this.fetch(`v1/swatches/${swatchId}`);
|
|
1104
|
+
if (!response.ok) {
|
|
1105
|
+
if (response.status !== 404)
|
|
1106
|
+
console.error("Failed to get swatch", await response.json());
|
|
1107
|
+
return null;
|
|
1108
|
+
}
|
|
1109
|
+
const swatch = await response.json();
|
|
1110
|
+
return swatch;
|
|
994
1111
|
}
|
|
995
1112
|
async getFile(fileId) {
|
|
996
1113
|
const result = await this.graphqlClient.request(FileQuery, { fileId });
|
|
@@ -1014,97 +1131,6 @@ Received "${apiKey}" instead.`);
|
|
|
1014
1131
|
return result.table;
|
|
1015
1132
|
}
|
|
1016
1133
|
}
|
|
1017
|
-
function PreviewModeScript({
|
|
1018
|
-
isPreview = false,
|
|
1019
|
-
appOrigin = "https://app.makeswift.com"
|
|
1020
|
-
}) {
|
|
1021
|
-
const previewModeScript = `
|
|
1022
|
-
const isPreview = ${isPreview}
|
|
1023
|
-
const appOrigin = '${appOrigin.replace("'", "\\'")}'
|
|
1024
|
-
const searchParamName = 'x-makeswift-preview-mode'
|
|
1025
|
-
const headerName = 'X-Makeswift-Preview-Mode'
|
|
1026
|
-
const originalUrl = new URL(window.location.href)
|
|
1027
|
-
|
|
1028
|
-
if (window.parent !== window) {
|
|
1029
|
-
window.addEventListener('message', event => {
|
|
1030
|
-
if (event.origin === appOrigin && event.data.type === 'makeswift_preview_mode') {
|
|
1031
|
-
const { secret } = event.data
|
|
1032
|
-
|
|
1033
|
-
if (!isPreview && !originalUrl.searchParams.has(searchParamName)) {
|
|
1034
|
-
const url = new URL(originalUrl)
|
|
1035
|
-
|
|
1036
|
-
url.searchParams.set(searchParamName, secret)
|
|
1037
|
-
|
|
1038
|
-
window.location.replace(url)
|
|
1039
|
-
} else {
|
|
1040
|
-
const originalFetch = window.fetch
|
|
1041
|
-
|
|
1042
|
-
window.fetch = function patchedFetch(resource, options) {
|
|
1043
|
-
const request = new Request(resource, options)
|
|
1044
|
-
|
|
1045
|
-
if (new URL(request.url).origin !== window.location.origin) {
|
|
1046
|
-
return originalFetch.call(this, resource, options)
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
return originalFetch.call(
|
|
1050
|
-
this,
|
|
1051
|
-
new Request(request, { headers: { [headerName]: secret } }),
|
|
1052
|
-
)
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
})
|
|
1057
|
-
|
|
1058
|
-
window.parent.postMessage({ type: 'makeswift_preview_mode' }, appOrigin)
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
if (originalUrl.searchParams.has(searchParamName)) {
|
|
1062
|
-
const url = new URL(originalUrl)
|
|
1063
|
-
|
|
1064
|
-
url.searchParams.delete(searchParamName)
|
|
1065
|
-
|
|
1066
|
-
window.history.replaceState(null, '', url)
|
|
1067
|
-
}
|
|
1068
|
-
`;
|
|
1069
|
-
const makeswiftConnectionCheckScript = `
|
|
1070
|
-
const appOrigin = '${appOrigin.replace("'", "\\'")}'
|
|
1071
|
-
|
|
1072
|
-
if (window.parent !== window) {
|
|
1073
|
-
window.addEventListener('message', event => {
|
|
1074
|
-
if (
|
|
1075
|
-
event.origin === appOrigin &&
|
|
1076
|
-
event.data.type === '${actions.ActionTypes.MAKESWIFT_CONNECTION_INIT}'
|
|
1077
|
-
) {
|
|
1078
|
-
setInterval(() => {
|
|
1079
|
-
window.parent.postMessage({
|
|
1080
|
-
type: '${actions.ActionTypes.MAKESWIFT_CONNECTION_CHECK}',
|
|
1081
|
-
payload: {
|
|
1082
|
-
currentUrl: window.location.href
|
|
1083
|
-
}
|
|
1084
|
-
}, appOrigin)
|
|
1085
|
-
}, 20)
|
|
1086
|
-
}
|
|
1087
|
-
})
|
|
1088
|
-
|
|
1089
|
-
window.parent.postMessage({ type: '${actions.ActionTypes.MAKESWIFT_CONNECTION_INIT}' }, appOrigin)
|
|
1090
|
-
}
|
|
1091
|
-
`;
|
|
1092
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1093
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx("script", {
|
|
1094
|
-
id: "makeswift-preview-mode",
|
|
1095
|
-
type: "module",
|
|
1096
|
-
dangerouslySetInnerHTML: {
|
|
1097
|
-
__html: previewModeScript
|
|
1098
|
-
}
|
|
1099
|
-
}), /* @__PURE__ */ jsxRuntime.jsx("script", {
|
|
1100
|
-
id: "makeswift-connection-check",
|
|
1101
|
-
type: "module",
|
|
1102
|
-
dangerouslySetInnerHTML: {
|
|
1103
|
-
__html: makeswiftConnectionCheckScript
|
|
1104
|
-
}
|
|
1105
|
-
})]
|
|
1106
|
-
});
|
|
1107
|
-
}
|
|
1108
1134
|
class Document$1 extends NextDocument__default["default"] {
|
|
1109
1135
|
static async getInitialProps(ctx) {
|
|
1110
1136
|
const initialProps = await NextDocument__default["default"].getInitialProps(ctx);
|
|
@@ -1159,8 +1185,8 @@ async function fonts(_req, res, { getFonts } = {}) {
|
|
|
1159
1185
|
const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
|
|
1160
1186
|
return res.json(fonts2);
|
|
1161
1187
|
}
|
|
1162
|
-
const version = "0.
|
|
1163
|
-
async function handler(req, res, { apiKey }) {
|
|
1188
|
+
const version = "0.9.0";
|
|
1189
|
+
async function handler(req, res, { apiKey, unstable_siteVersions }) {
|
|
1164
1190
|
if (req.query.secret !== apiKey) {
|
|
1165
1191
|
return res.status(401).json({ message: "Unauthorized" });
|
|
1166
1192
|
}
|
|
@@ -1170,7 +1196,8 @@ async function handler(req, res, { apiKey }) {
|
|
|
1170
1196
|
interactionMode: true,
|
|
1171
1197
|
clientSideNavigation: true,
|
|
1172
1198
|
elementFromPoint: false,
|
|
1173
|
-
customBreakpoints: true
|
|
1199
|
+
customBreakpoints: true,
|
|
1200
|
+
unstable_siteVersions
|
|
1174
1201
|
});
|
|
1175
1202
|
}
|
|
1176
1203
|
async function proxyPreviewMode(req, res, { apiKey }) {
|
|
@@ -1201,7 +1228,11 @@ async function proxyPreviewMode(req, res, { apiKey }) {
|
|
|
1201
1228
|
const proto = isForwardedProtoHttps || isForwardedSSL ? "https" : "http";
|
|
1202
1229
|
let target = `${proto}://${host}`;
|
|
1203
1230
|
const secure = process.env["NODE_ENV"] === "production";
|
|
1204
|
-
const
|
|
1231
|
+
const previewData = {
|
|
1232
|
+
makeswift: true,
|
|
1233
|
+
unstable_siteVersion: MakeswiftSiteVersion.Working
|
|
1234
|
+
};
|
|
1235
|
+
const setCookie = res.setPreviewData(previewData).getHeader("Set-Cookie");
|
|
1205
1236
|
res.removeHeader("Set-Cookie");
|
|
1206
1237
|
if (!Array.isArray(setCookie))
|
|
1207
1238
|
return res.status(500).send("Internal Server Error");
|
|
@@ -1243,7 +1274,8 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
|
|
|
1243
1274
|
function MakeswiftApiHandler(apiKey, {
|
|
1244
1275
|
appOrigin = "https://app.makeswift.com",
|
|
1245
1276
|
apiOrigin = "https://api.makeswift.com",
|
|
1246
|
-
getFonts
|
|
1277
|
+
getFonts,
|
|
1278
|
+
unstable_siteVersions = false
|
|
1247
1279
|
} = {}) {
|
|
1248
1280
|
const cors = Cors__default["default"]({ origin: appOrigin });
|
|
1249
1281
|
if (typeof apiKey !== "string") {
|
|
@@ -1265,12 +1297,12 @@ Received "${apiKey}" instead.`);
|
|
|
1265
1297
|
Received "${makeswift}" for the \`makeswift\` param instead.
|
|
1266
1298
|
Read more about dynamic catch-all routes here: https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes`);
|
|
1267
1299
|
}
|
|
1268
|
-
const client = new Makeswift(apiKey, { apiOrigin });
|
|
1300
|
+
const client = new Makeswift(apiKey, { apiOrigin, unstable_previewData: req.previewData });
|
|
1269
1301
|
const action = "/" + makeswift.join("/");
|
|
1270
1302
|
const matches = (pattern) => pathToRegexp.match(pattern, { decode: decodeURIComponent })(action);
|
|
1271
1303
|
let m;
|
|
1272
1304
|
if (matches("/manifest"))
|
|
1273
|
-
return handler(req, res, { apiKey });
|
|
1305
|
+
return handler(req, res, { apiKey, unstable_siteVersions });
|
|
1274
1306
|
if (matches("/revalidate"))
|
|
1275
1307
|
return revalidate(req, res, { apiKey });
|
|
1276
1308
|
if (matches("/proxy-preview-mode"))
|
|
@@ -1307,10 +1339,10 @@ function saveForwardedRef(props, ref) {
|
|
|
1307
1339
|
[FORWARDED_NEXT_DYNAMIC_REF_KEY]: ref
|
|
1308
1340
|
});
|
|
1309
1341
|
}
|
|
1310
|
-
function loadForwardedRef(
|
|
1311
|
-
var
|
|
1342
|
+
function loadForwardedRef(_c) {
|
|
1343
|
+
var _d = _c, {
|
|
1312
1344
|
[FORWARDED_NEXT_DYNAMIC_REF_KEY]: ref
|
|
1313
|
-
} =
|
|
1345
|
+
} = _d, props = __objRest(_d, [
|
|
1314
1346
|
__restKey(FORWARDED_NEXT_DYNAMIC_REF_KEY)
|
|
1315
1347
|
]);
|
|
1316
1348
|
return __spreadProps(__spreadValues({}, props), {
|
|
@@ -1373,14 +1405,15 @@ async function getStaticPaths() {
|
|
|
1373
1405
|
}
|
|
1374
1406
|
const REVALIDATE_SECONDS = 1;
|
|
1375
1407
|
async function getStaticProps(ctx) {
|
|
1376
|
-
var _a, _b,
|
|
1408
|
+
var _a, _b, _c;
|
|
1377
1409
|
deprecationWarning("getStaticProps");
|
|
1378
1410
|
const makeswift = new Makeswift(getApiKey(), {
|
|
1379
|
-
apiOrigin: getApiOrigin()
|
|
1411
|
+
apiOrigin: getApiOrigin(),
|
|
1412
|
+
unstable_previewData: ctx.previewData
|
|
1380
1413
|
});
|
|
1381
1414
|
const path = "/" + ((_b = (_a = ctx.params) == null ? void 0 : _a.path) != null ? _b : []).join("/");
|
|
1382
1415
|
const snapshot = await makeswift.getPageSnapshot(path, {
|
|
1383
|
-
preview: ((
|
|
1416
|
+
preview: ((_c = ctx.previewData) == null ? void 0 : _c.makeswift) === true
|
|
1384
1417
|
});
|
|
1385
1418
|
if (snapshot == null)
|
|
1386
1419
|
return {
|
|
@@ -1398,7 +1431,8 @@ async function getServerSideProps(ctx) {
|
|
|
1398
1431
|
var _a, _b;
|
|
1399
1432
|
deprecationWarning("getServerSideProps");
|
|
1400
1433
|
const makeswift = new Makeswift(getApiKey(), {
|
|
1401
|
-
apiOrigin: getApiOrigin()
|
|
1434
|
+
apiOrigin: getApiOrigin(),
|
|
1435
|
+
unstable_previewData: ctx.previewData
|
|
1402
1436
|
});
|
|
1403
1437
|
const path = "/" + ((_b = (_a = ctx.params) == null ? void 0 : _a.path) != null ? _b : []).join("/");
|
|
1404
1438
|
const snapshot = await makeswift.getPageSnapshot(path, {
|
|
@@ -1453,13 +1487,13 @@ function registerComponent$c(runtime) {
|
|
|
1453
1487
|
type: constants.MakeswiftComponentType.Box,
|
|
1454
1488
|
label: "Box",
|
|
1455
1489
|
props: {
|
|
1456
|
-
id:
|
|
1457
|
-
backgrounds:
|
|
1458
|
-
width:
|
|
1459
|
-
format:
|
|
1490
|
+
id: reactPage.ElementID(),
|
|
1491
|
+
backgrounds: reactPage.Backgrounds(),
|
|
1492
|
+
width: reactPage.Width({
|
|
1493
|
+
format: reactPage.Width.Format.ClassName,
|
|
1460
1494
|
defaultValue: { value: 100, unit: "%" }
|
|
1461
1495
|
}),
|
|
1462
|
-
height:
|
|
1496
|
+
height: reactPage.ResponsiveIconRadioGroup({
|
|
1463
1497
|
label: "Height",
|
|
1464
1498
|
options: [
|
|
1465
1499
|
{ value: "auto", label: "Auto", icon: "HeightAuto16" },
|
|
@@ -1467,7 +1501,7 @@ function registerComponent$c(runtime) {
|
|
|
1467
1501
|
],
|
|
1468
1502
|
defaultValue: "auto"
|
|
1469
1503
|
}),
|
|
1470
|
-
verticalAlign:
|
|
1504
|
+
verticalAlign: reactPage.ResponsiveIconRadioGroup({
|
|
1471
1505
|
label: "Align items",
|
|
1472
1506
|
options: [
|
|
1473
1507
|
{ value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
|
|
@@ -1481,9 +1515,9 @@ function registerComponent$c(runtime) {
|
|
|
1481
1515
|
],
|
|
1482
1516
|
defaultValue: "flex-start"
|
|
1483
1517
|
}),
|
|
1484
|
-
margin:
|
|
1485
|
-
padding:
|
|
1486
|
-
format:
|
|
1518
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName }),
|
|
1519
|
+
padding: reactPage.Padding({
|
|
1520
|
+
format: reactPage.Padding.Format.ClassName,
|
|
1487
1521
|
preset: [
|
|
1488
1522
|
{
|
|
1489
1523
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -1496,16 +1530,16 @@ function registerComponent$c(runtime) {
|
|
|
1496
1530
|
}
|
|
1497
1531
|
]
|
|
1498
1532
|
}),
|
|
1499
|
-
border:
|
|
1500
|
-
borderRadius:
|
|
1501
|
-
boxShadow:
|
|
1502
|
-
rowGap:
|
|
1533
|
+
border: reactPage.Border({ format: reactPage.Border.Format.ClassName }),
|
|
1534
|
+
borderRadius: reactPage.BorderRadius({ format: reactPage.BorderRadius.Format.ClassName }),
|
|
1535
|
+
boxShadow: reactPage.Shadows({ format: reactPage.Shadows.Format.ClassName }),
|
|
1536
|
+
rowGap: reactPage.GapY((props) => ({
|
|
1503
1537
|
hidden: props.children == null
|
|
1504
1538
|
})),
|
|
1505
|
-
columnGap:
|
|
1539
|
+
columnGap: reactPage.GapX((props) => ({
|
|
1506
1540
|
hidden: props.children == null
|
|
1507
1541
|
})),
|
|
1508
|
-
boxAnimateType:
|
|
1542
|
+
boxAnimateType: reactPage.ResponsiveSelect({
|
|
1509
1543
|
label: "Animate box in",
|
|
1510
1544
|
labelOrientation: "vertical",
|
|
1511
1545
|
options: [
|
|
@@ -1521,7 +1555,7 @@ function registerComponent$c(runtime) {
|
|
|
1521
1555
|
],
|
|
1522
1556
|
defaultValue: "none"
|
|
1523
1557
|
}),
|
|
1524
|
-
boxAnimateDuration:
|
|
1558
|
+
boxAnimateDuration: reactPage.ResponsiveNumber((props, device) => ({
|
|
1525
1559
|
label: "Box duration",
|
|
1526
1560
|
defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
|
|
1527
1561
|
min: 0.1,
|
|
@@ -1529,7 +1563,7 @@ function registerComponent$c(runtime) {
|
|
|
1529
1563
|
suffix: "s",
|
|
1530
1564
|
hidden: isHiddenBasedOnBoxAnimation(props, device)
|
|
1531
1565
|
})),
|
|
1532
|
-
boxAnimateDelay:
|
|
1566
|
+
boxAnimateDelay: reactPage.ResponsiveNumber((props, device) => ({
|
|
1533
1567
|
label: "Box delay",
|
|
1534
1568
|
defaultValue: DEFAULT_BOX_ANIMATE_DELAY,
|
|
1535
1569
|
min: 0,
|
|
@@ -1537,7 +1571,7 @@ function registerComponent$c(runtime) {
|
|
|
1537
1571
|
suffix: "s",
|
|
1538
1572
|
hidden: isHiddenBasedOnBoxAnimation(props, device)
|
|
1539
1573
|
})),
|
|
1540
|
-
itemAnimateType:
|
|
1574
|
+
itemAnimateType: reactPage.ResponsiveSelect({
|
|
1541
1575
|
label: "Animate items in",
|
|
1542
1576
|
labelOrientation: "vertical",
|
|
1543
1577
|
options: [
|
|
@@ -1553,7 +1587,7 @@ function registerComponent$c(runtime) {
|
|
|
1553
1587
|
],
|
|
1554
1588
|
defaultValue: "none"
|
|
1555
1589
|
}),
|
|
1556
|
-
itemAnimateDuration:
|
|
1590
|
+
itemAnimateDuration: reactPage.ResponsiveNumber((props, device) => ({
|
|
1557
1591
|
label: "Items duration",
|
|
1558
1592
|
defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
|
|
1559
1593
|
min: 0.1,
|
|
@@ -1561,7 +1595,7 @@ function registerComponent$c(runtime) {
|
|
|
1561
1595
|
suffix: "s",
|
|
1562
1596
|
hidden: isHiddenBasedOnItemAnimation(props, device)
|
|
1563
1597
|
})),
|
|
1564
|
-
itemAnimateDelay:
|
|
1598
|
+
itemAnimateDelay: reactPage.ResponsiveNumber((props, device) => ({
|
|
1565
1599
|
label: "Items delay",
|
|
1566
1600
|
defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,
|
|
1567
1601
|
min: 0,
|
|
@@ -1569,7 +1603,7 @@ function registerComponent$c(runtime) {
|
|
|
1569
1603
|
suffix: "s",
|
|
1570
1604
|
hidden: isHiddenBasedOnItemAnimation(props, device)
|
|
1571
1605
|
})),
|
|
1572
|
-
itemStaggerDuration:
|
|
1606
|
+
itemStaggerDuration: reactPage.ResponsiveNumber((props, device) => ({
|
|
1573
1607
|
label: "Stagger",
|
|
1574
1608
|
min: 0,
|
|
1575
1609
|
step: 0.05,
|
|
@@ -1577,11 +1611,11 @@ function registerComponent$c(runtime) {
|
|
|
1577
1611
|
defaultValue: DEFAULT_ITEM_STAGGER_DURATION,
|
|
1578
1612
|
hidden: isHiddenBasedOnItemAnimation(props, device)
|
|
1579
1613
|
})),
|
|
1580
|
-
hidePlaceholder:
|
|
1614
|
+
hidePlaceholder: reactPage.Checkbox((props) => ({
|
|
1581
1615
|
label: "Hide placeholder",
|
|
1582
1616
|
hidden: props.children != null
|
|
1583
1617
|
})),
|
|
1584
|
-
children:
|
|
1618
|
+
children: reactPage.Grid()
|
|
1585
1619
|
}
|
|
1586
1620
|
});
|
|
1587
1621
|
}
|
|
@@ -1592,9 +1626,9 @@ function registerComponent$b(runtime) {
|
|
|
1592
1626
|
type: constants.MakeswiftComponentType.Button,
|
|
1593
1627
|
label: "Button",
|
|
1594
1628
|
props: {
|
|
1595
|
-
id:
|
|
1596
|
-
children:
|
|
1597
|
-
link:
|
|
1629
|
+
id: reactPage.ElementID(),
|
|
1630
|
+
children: reactPage.TextInput({ placeholder: "Button text" }),
|
|
1631
|
+
link: reactPage.Link({
|
|
1598
1632
|
defaultValue: {
|
|
1599
1633
|
type: "OPEN_PAGE",
|
|
1600
1634
|
payload: {
|
|
@@ -1603,7 +1637,7 @@ function registerComponent$b(runtime) {
|
|
|
1603
1637
|
}
|
|
1604
1638
|
}
|
|
1605
1639
|
}),
|
|
1606
|
-
variant:
|
|
1640
|
+
variant: reactPage.ResponsiveSelect({
|
|
1607
1641
|
label: "Style",
|
|
1608
1642
|
labelOrientation: "horizontal",
|
|
1609
1643
|
options: [
|
|
@@ -1617,7 +1651,7 @@ function registerComponent$b(runtime) {
|
|
|
1617
1651
|
],
|
|
1618
1652
|
defaultValue: "flat"
|
|
1619
1653
|
}),
|
|
1620
|
-
shape:
|
|
1654
|
+
shape: reactPage.ResponsiveIconRadioGroup({
|
|
1621
1655
|
label: "Shape",
|
|
1622
1656
|
options: [
|
|
1623
1657
|
{ label: "Pill", value: "pill", icon: "ButtonPill16" },
|
|
@@ -1626,7 +1660,7 @@ function registerComponent$b(runtime) {
|
|
|
1626
1660
|
],
|
|
1627
1661
|
defaultValue: "rounded"
|
|
1628
1662
|
}),
|
|
1629
|
-
size:
|
|
1663
|
+
size: reactPage.ResponsiveIconRadioGroup({
|
|
1630
1664
|
label: "Size",
|
|
1631
1665
|
options: [
|
|
1632
1666
|
{ label: "Small", value: "small", icon: "SizeSmall16" },
|
|
@@ -1635,19 +1669,19 @@ function registerComponent$b(runtime) {
|
|
|
1635
1669
|
],
|
|
1636
1670
|
defaultValue: "medium"
|
|
1637
1671
|
}),
|
|
1638
|
-
color:
|
|
1672
|
+
color: reactPage.ResponsiveColor((props, device) => {
|
|
1639
1673
|
var _a;
|
|
1640
1674
|
const variant = props.variant;
|
|
1641
1675
|
const hidden = ((_a = state_breakpoints.findBreakpointOverride(runtime.getBreakpoints(), variant, device)) == null ? void 0 : _a.value) === "clear";
|
|
1642
1676
|
return { placeholder: "black", hidden };
|
|
1643
1677
|
}),
|
|
1644
|
-
textColor:
|
|
1678
|
+
textColor: reactPage.ResponsiveColor({
|
|
1645
1679
|
label: "Text color",
|
|
1646
1680
|
placeholder: "white"
|
|
1647
1681
|
}),
|
|
1648
|
-
textStyle:
|
|
1649
|
-
width:
|
|
1650
|
-
margin:
|
|
1682
|
+
textStyle: reactPage.TextStyle(),
|
|
1683
|
+
width: reactPage.Width(),
|
|
1684
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName })
|
|
1651
1685
|
}
|
|
1652
1686
|
});
|
|
1653
1687
|
}
|
|
@@ -1657,22 +1691,22 @@ function registerComponent$a(runtime) {
|
|
|
1657
1691
|
})))), {
|
|
1658
1692
|
type: constants.MakeswiftComponentType.Carousel,
|
|
1659
1693
|
label: "Carousel",
|
|
1660
|
-
icon:
|
|
1694
|
+
icon: reactPage.ComponentIcon.Carousel,
|
|
1661
1695
|
props: {
|
|
1662
|
-
id:
|
|
1663
|
-
images:
|
|
1696
|
+
id: reactPage.ElementID(),
|
|
1697
|
+
images: reactPage.Images({
|
|
1664
1698
|
preset: [
|
|
1665
1699
|
{ key: uuid.v4(), props: {} },
|
|
1666
1700
|
{ key: uuid.v4(), props: {} },
|
|
1667
1701
|
{ key: uuid.v4(), props: {} }
|
|
1668
1702
|
]
|
|
1669
1703
|
}),
|
|
1670
|
-
width:
|
|
1671
|
-
format:
|
|
1704
|
+
width: reactPage.Width({
|
|
1705
|
+
format: reactPage.Width.Format.ClassName,
|
|
1672
1706
|
defaultValue: { value: 400, unit: "px" }
|
|
1673
1707
|
}),
|
|
1674
|
-
margin:
|
|
1675
|
-
pageSize:
|
|
1708
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName }),
|
|
1709
|
+
pageSize: reactPage.ResponsiveNumber((props) => {
|
|
1676
1710
|
var _a;
|
|
1677
1711
|
const images = props.images;
|
|
1678
1712
|
const imagesLength = (_a = images == null ? void 0 : images.length) != null ? _a : 0;
|
|
@@ -1684,7 +1718,7 @@ function registerComponent$a(runtime) {
|
|
|
1684
1718
|
step: 1
|
|
1685
1719
|
};
|
|
1686
1720
|
}),
|
|
1687
|
-
step:
|
|
1721
|
+
step: reactPage.ResponsiveNumber((props, device) => {
|
|
1688
1722
|
var _a, _b;
|
|
1689
1723
|
const pageSize = props.pageSize;
|
|
1690
1724
|
const pageSizeValue = (_b = (_a = state_breakpoints.findBreakpointOverride(runtime.getBreakpoints(), pageSize, device)) == null ? void 0 : _a.value) != null ? _b : 1;
|
|
@@ -1696,7 +1730,7 @@ function registerComponent$a(runtime) {
|
|
|
1696
1730
|
step: 1
|
|
1697
1731
|
};
|
|
1698
1732
|
}),
|
|
1699
|
-
slideAlignment:
|
|
1733
|
+
slideAlignment: reactPage.ResponsiveIconRadioGroup({
|
|
1700
1734
|
label: "Alignment",
|
|
1701
1735
|
options: [
|
|
1702
1736
|
{ label: "Top", value: "flex-start", icon: "VerticalAlignStart16" },
|
|
@@ -1705,13 +1739,13 @@ function registerComponent$a(runtime) {
|
|
|
1705
1739
|
],
|
|
1706
1740
|
defaultValue: "center"
|
|
1707
1741
|
}),
|
|
1708
|
-
gap:
|
|
1742
|
+
gap: reactPage.GapX({
|
|
1709
1743
|
label: "Gap",
|
|
1710
1744
|
step: 5,
|
|
1711
1745
|
defaultValue: { value: 0, unit: "px" }
|
|
1712
1746
|
}),
|
|
1713
|
-
autoplay:
|
|
1714
|
-
delay:
|
|
1747
|
+
autoplay: reactPage.Checkbox({ label: "Autoplay" }),
|
|
1748
|
+
delay: reactPage.Number((props) => ({
|
|
1715
1749
|
label: "Delay",
|
|
1716
1750
|
preset: 5,
|
|
1717
1751
|
min: 1,
|
|
@@ -1719,8 +1753,8 @@ function registerComponent$a(runtime) {
|
|
|
1719
1753
|
suffix: "seconds",
|
|
1720
1754
|
hidden: !props.autoplay
|
|
1721
1755
|
})),
|
|
1722
|
-
showArrows:
|
|
1723
|
-
arrowPosition:
|
|
1756
|
+
showArrows: reactPage.Checkbox({ preset: true, label: "Show arrows" }),
|
|
1757
|
+
arrowPosition: reactPage.ResponsiveIconRadioGroup((props) => ({
|
|
1724
1758
|
label: "Arrow position",
|
|
1725
1759
|
options: [
|
|
1726
1760
|
{ label: "Inside", value: "inside", icon: "ArrowInside16" },
|
|
@@ -1730,24 +1764,24 @@ function registerComponent$a(runtime) {
|
|
|
1730
1764
|
defaultValue: "inside",
|
|
1731
1765
|
hidden: props.showArrows === false
|
|
1732
1766
|
})),
|
|
1733
|
-
arrowColor:
|
|
1767
|
+
arrowColor: reactPage.ResponsiveColor((props) => ({
|
|
1734
1768
|
label: "Arrow color",
|
|
1735
1769
|
placeholder: "black",
|
|
1736
1770
|
hidden: props.showArrows === false
|
|
1737
1771
|
})),
|
|
1738
|
-
arrowBackground:
|
|
1772
|
+
arrowBackground: reactPage.ResponsiveColor((props) => ({
|
|
1739
1773
|
label: "Arrow background",
|
|
1740
1774
|
placeholder: "white",
|
|
1741
1775
|
hidden: props.showArrows === false
|
|
1742
1776
|
})),
|
|
1743
|
-
showDots:
|
|
1744
|
-
dotColor:
|
|
1777
|
+
showDots: reactPage.Checkbox({ preset: true, label: "Show dots" }),
|
|
1778
|
+
dotColor: reactPage.ResponsiveColor((props) => ({
|
|
1745
1779
|
label: "Dot color",
|
|
1746
1780
|
placeholder: "black",
|
|
1747
1781
|
hidden: props.showDots === false
|
|
1748
1782
|
})),
|
|
1749
|
-
slideBorder:
|
|
1750
|
-
slideBorderRadius:
|
|
1783
|
+
slideBorder: reactPage.Border({ format: reactPage.Border.Format.ClassName }),
|
|
1784
|
+
slideBorderRadius: reactPage.BorderRadius({ format: reactPage.BorderRadius.Format.ClassName })
|
|
1751
1785
|
}
|
|
1752
1786
|
});
|
|
1753
1787
|
}
|
|
@@ -1757,13 +1791,13 @@ function registerComponent$9(runtime) {
|
|
|
1757
1791
|
})))), {
|
|
1758
1792
|
type: constants.MakeswiftComponentType.Countdown,
|
|
1759
1793
|
label: "Countdown",
|
|
1760
|
-
icon:
|
|
1794
|
+
icon: reactPage.ComponentIcon.Countdown,
|
|
1761
1795
|
props: {
|
|
1762
|
-
id:
|
|
1763
|
-
date:
|
|
1796
|
+
id: reactPage.ElementID(),
|
|
1797
|
+
date: reactPage.Date(() => ({
|
|
1764
1798
|
preset: new Date(Date.now() + 1e3 * 60 * 60 * 24 * 2).toISOString()
|
|
1765
1799
|
})),
|
|
1766
|
-
variant:
|
|
1800
|
+
variant: reactPage.ResponsiveIconRadioGroup({
|
|
1767
1801
|
label: "Style",
|
|
1768
1802
|
options: [
|
|
1769
1803
|
{ label: "Filled", value: "filled", icon: "CountdownSolid16" },
|
|
@@ -1782,7 +1816,7 @@ function registerComponent$9(runtime) {
|
|
|
1782
1816
|
],
|
|
1783
1817
|
defaultValue: "filled"
|
|
1784
1818
|
}),
|
|
1785
|
-
shape:
|
|
1819
|
+
shape: reactPage.ResponsiveIconRadioGroup({
|
|
1786
1820
|
label: "Shape",
|
|
1787
1821
|
options: [
|
|
1788
1822
|
{ label: "Pill", value: "pill", icon: "ButtonPill16" },
|
|
@@ -1791,7 +1825,7 @@ function registerComponent$9(runtime) {
|
|
|
1791
1825
|
],
|
|
1792
1826
|
defaultValue: "rounded"
|
|
1793
1827
|
}),
|
|
1794
|
-
size:
|
|
1828
|
+
size: reactPage.ResponsiveIconRadioGroup({
|
|
1795
1829
|
label: "Size",
|
|
1796
1830
|
options: [
|
|
1797
1831
|
{ label: "Small", value: "small", icon: "SizeSmall16" },
|
|
@@ -1800,7 +1834,7 @@ function registerComponent$9(runtime) {
|
|
|
1800
1834
|
],
|
|
1801
1835
|
defaultValue: "medium"
|
|
1802
1836
|
}),
|
|
1803
|
-
gap:
|
|
1837
|
+
gap: reactPage.GapX({
|
|
1804
1838
|
preset: [
|
|
1805
1839
|
{
|
|
1806
1840
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -1813,32 +1847,32 @@ function registerComponent$9(runtime) {
|
|
|
1813
1847
|
max: 100,
|
|
1814
1848
|
defaultValue: { value: 0, unit: "px" }
|
|
1815
1849
|
}),
|
|
1816
|
-
numberFont:
|
|
1817
|
-
numberColor:
|
|
1850
|
+
numberFont: reactPage.Font({ label: "Number font" }),
|
|
1851
|
+
numberColor: reactPage.ResponsiveColor({
|
|
1818
1852
|
label: "Number color",
|
|
1819
1853
|
placeholder: "white"
|
|
1820
1854
|
}),
|
|
1821
|
-
blockColor:
|
|
1855
|
+
blockColor: reactPage.ResponsiveColor({
|
|
1822
1856
|
label: "Block color",
|
|
1823
1857
|
placeholder: "black"
|
|
1824
1858
|
}),
|
|
1825
|
-
labelFont:
|
|
1826
|
-
labelColor:
|
|
1859
|
+
labelFont: reactPage.Font({ label: "Label font" }),
|
|
1860
|
+
labelColor: reactPage.ResponsiveColor({
|
|
1827
1861
|
label: "Label color",
|
|
1828
1862
|
placeholder: "black"
|
|
1829
1863
|
}),
|
|
1830
|
-
width:
|
|
1831
|
-
format:
|
|
1864
|
+
width: reactPage.Width({
|
|
1865
|
+
format: reactPage.Width.Format.ClassName,
|
|
1832
1866
|
defaultValue: { value: 560, unit: "px" }
|
|
1833
1867
|
}),
|
|
1834
|
-
margin:
|
|
1835
|
-
daysLabel:
|
|
1836
|
-
hoursLabel:
|
|
1837
|
-
minutesLabel:
|
|
1868
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName }),
|
|
1869
|
+
daysLabel: reactPage.TextInput({ label: "Days label", placeholder: "Days" }),
|
|
1870
|
+
hoursLabel: reactPage.TextInput({ label: "Hours label", placeholder: "Hours" }),
|
|
1871
|
+
minutesLabel: reactPage.TextInput({
|
|
1838
1872
|
label: "Minutes label",
|
|
1839
1873
|
placeholder: "Minutes"
|
|
1840
1874
|
}),
|
|
1841
|
-
secondsLabel:
|
|
1875
|
+
secondsLabel: reactPage.TextInput({
|
|
1842
1876
|
label: "Seconds label",
|
|
1843
1877
|
placeholder: "Seconds"
|
|
1844
1878
|
})
|
|
@@ -1851,10 +1885,10 @@ function registerComponent$8(runtime) {
|
|
|
1851
1885
|
})))), {
|
|
1852
1886
|
type: constants.MakeswiftComponentType.Divider,
|
|
1853
1887
|
label: "Divider",
|
|
1854
|
-
icon:
|
|
1888
|
+
icon: reactPage.ComponentIcon.Divider,
|
|
1855
1889
|
props: {
|
|
1856
|
-
id:
|
|
1857
|
-
variant:
|
|
1890
|
+
id: reactPage.ElementID(),
|
|
1891
|
+
variant: reactPage.ResponsiveSelect({
|
|
1858
1892
|
label: "Style",
|
|
1859
1893
|
labelOrientation: "horizontal",
|
|
1860
1894
|
options: [
|
|
@@ -1865,17 +1899,17 @@ function registerComponent$8(runtime) {
|
|
|
1865
1899
|
],
|
|
1866
1900
|
defaultValue: "solid"
|
|
1867
1901
|
}),
|
|
1868
|
-
thickness:
|
|
1902
|
+
thickness: reactPage.ResponsiveLength({
|
|
1869
1903
|
label: "Height",
|
|
1870
1904
|
defaultValue: { value: 1, unit: "px" },
|
|
1871
1905
|
options: [{ value: "px", label: "Pixels", icon: "Px16" }]
|
|
1872
1906
|
}),
|
|
1873
|
-
color:
|
|
1874
|
-
width:
|
|
1875
|
-
format:
|
|
1907
|
+
color: reactPage.ResponsiveColor({ placeholder: "black" }),
|
|
1908
|
+
width: reactPage.Width({
|
|
1909
|
+
format: reactPage.Width.Format.ClassName,
|
|
1876
1910
|
defaultValue: { value: 100, unit: "%" }
|
|
1877
1911
|
}),
|
|
1878
|
-
margin:
|
|
1912
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName })
|
|
1879
1913
|
}
|
|
1880
1914
|
});
|
|
1881
1915
|
}
|
|
@@ -1885,12 +1919,12 @@ function registerComponent$7(runtime) {
|
|
|
1885
1919
|
})))), {
|
|
1886
1920
|
type: constants.MakeswiftComponentType.Embed,
|
|
1887
1921
|
label: "Embed",
|
|
1888
|
-
icon:
|
|
1922
|
+
icon: reactPage.ComponentIcon.Code,
|
|
1889
1923
|
props: {
|
|
1890
|
-
id:
|
|
1891
|
-
html:
|
|
1892
|
-
width:
|
|
1893
|
-
margin:
|
|
1924
|
+
id: reactPage.ElementID(),
|
|
1925
|
+
html: reactPage.TextArea({ label: "Code", rows: 20 }),
|
|
1926
|
+
width: reactPage.Width({ format: reactPage.Width.Format.ClassName }),
|
|
1927
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName })
|
|
1894
1928
|
}
|
|
1895
1929
|
});
|
|
1896
1930
|
}
|
|
@@ -1924,12 +1958,12 @@ function registerComponent$6(runtime) {
|
|
|
1924
1958
|
})))), {
|
|
1925
1959
|
type: constants.MakeswiftComponentType.Form,
|
|
1926
1960
|
label: "Form",
|
|
1927
|
-
icon:
|
|
1961
|
+
icon: reactPage.ComponentIcon.Form,
|
|
1928
1962
|
props: {
|
|
1929
|
-
id:
|
|
1930
|
-
tableId:
|
|
1931
|
-
fields:
|
|
1932
|
-
submitLink:
|
|
1963
|
+
id: reactPage.ElementID(),
|
|
1964
|
+
tableId: reactPage.Table(),
|
|
1965
|
+
fields: reactPage.TableFormFields(),
|
|
1966
|
+
submitLink: reactPage.Link((props) => ({
|
|
1933
1967
|
label: "Redirect to",
|
|
1934
1968
|
options: [
|
|
1935
1969
|
{ value: "OPEN_PAGE", label: "Open page" },
|
|
@@ -1937,7 +1971,7 @@ function registerComponent$6(runtime) {
|
|
|
1937
1971
|
],
|
|
1938
1972
|
hidden: props.tableId == null
|
|
1939
1973
|
})),
|
|
1940
|
-
gap:
|
|
1974
|
+
gap: reactPage.GapY((props) => ({
|
|
1941
1975
|
preset: [
|
|
1942
1976
|
{
|
|
1943
1977
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -1948,7 +1982,7 @@ function registerComponent$6(runtime) {
|
|
|
1948
1982
|
defaultValue: { value: 0, unit: "px" },
|
|
1949
1983
|
hidden: props.tableId == null
|
|
1950
1984
|
})),
|
|
1951
|
-
shape:
|
|
1985
|
+
shape: reactPage.ResponsiveIconRadioGroup((props) => ({
|
|
1952
1986
|
label: "Shape",
|
|
1953
1987
|
options: [
|
|
1954
1988
|
{ label: "Pill", value: Shapes.PILL, icon: "ButtonPill16" },
|
|
@@ -1958,7 +1992,7 @@ function registerComponent$6(runtime) {
|
|
|
1958
1992
|
defaultValue: Shapes.ROUNDED,
|
|
1959
1993
|
hidden: props.tableId == null
|
|
1960
1994
|
})),
|
|
1961
|
-
size:
|
|
1995
|
+
size: reactPage.ResponsiveIconRadioGroup((props) => ({
|
|
1962
1996
|
label: "Size",
|
|
1963
1997
|
options: [
|
|
1964
1998
|
{ label: "Small", value: Sizes.SMALL, icon: "SizeSmall16" },
|
|
@@ -1968,7 +2002,7 @@ function registerComponent$6(runtime) {
|
|
|
1968
2002
|
defaultValue: Sizes.MEDIUM,
|
|
1969
2003
|
hidden: (props == null ? void 0 : props.tableId) == null
|
|
1970
2004
|
})),
|
|
1971
|
-
contrast:
|
|
2005
|
+
contrast: reactPage.ResponsiveIconRadioGroup((props) => ({
|
|
1972
2006
|
label: "Color",
|
|
1973
2007
|
options: [
|
|
1974
2008
|
{ label: "Light mode", value: Contrasts.LIGHT, icon: "Sun16" },
|
|
@@ -1977,8 +2011,8 @@ function registerComponent$6(runtime) {
|
|
|
1977
2011
|
defaultValue: Contrasts.LIGHT,
|
|
1978
2012
|
hidden: props.tableId == null
|
|
1979
2013
|
})),
|
|
1980
|
-
labelTextStyle:
|
|
1981
|
-
labelTextColor:
|
|
2014
|
+
labelTextStyle: reactPage.TextStyle({ label: "Label text style" }),
|
|
2015
|
+
labelTextColor: reactPage.ResponsiveColor((props, device) => {
|
|
1982
2016
|
const hidden = props.tableId == null;
|
|
1983
2017
|
const responsiveContrast = props.contrast;
|
|
1984
2018
|
const contrast = state_breakpoints.findBreakpointOverride(runtime.getBreakpoints(), responsiveContrast, device);
|
|
@@ -1988,23 +2022,23 @@ function registerComponent$6(runtime) {
|
|
|
1988
2022
|
placeholder: (contrast == null ? void 0 : contrast.value) === Contrasts.DARK ? "rgba(255,255,255,0.95)" : "rgba(0,0,0,0.8)"
|
|
1989
2023
|
};
|
|
1990
2024
|
}),
|
|
1991
|
-
submitTextStyle:
|
|
1992
|
-
brandColor:
|
|
2025
|
+
submitTextStyle: reactPage.TextStyle({ label: "Button text style" }),
|
|
2026
|
+
brandColor: reactPage.ResponsiveColor((props) => ({
|
|
1993
2027
|
label: "Button color",
|
|
1994
2028
|
placeholder: "black",
|
|
1995
2029
|
hidden: props.tableId == null
|
|
1996
2030
|
})),
|
|
1997
|
-
submitTextColor:
|
|
2031
|
+
submitTextColor: reactPage.ResponsiveColor((props) => ({
|
|
1998
2032
|
label: "Button text color",
|
|
1999
2033
|
placeholder: "white",
|
|
2000
2034
|
hidden: props.tableId == null
|
|
2001
2035
|
})),
|
|
2002
|
-
submitLabel:
|
|
2036
|
+
submitLabel: reactPage.TextInput((props) => ({
|
|
2003
2037
|
label: "Button label",
|
|
2004
2038
|
placeholder: "Submit",
|
|
2005
2039
|
hidden: props.tableId == null
|
|
2006
2040
|
})),
|
|
2007
|
-
submitVariant:
|
|
2041
|
+
submitVariant: reactPage.ResponsiveSelect((props) => ({
|
|
2008
2042
|
label: "Button style",
|
|
2009
2043
|
options: [
|
|
2010
2044
|
{ value: "flat", label: "Flat" },
|
|
@@ -2018,11 +2052,11 @@ function registerComponent$6(runtime) {
|
|
|
2018
2052
|
defaultValue: "flat",
|
|
2019
2053
|
hidden: props.tableId == null
|
|
2020
2054
|
})),
|
|
2021
|
-
submitWidth:
|
|
2055
|
+
submitWidth: reactPage.ResponsiveLength((props) => ({
|
|
2022
2056
|
label: "Button width",
|
|
2023
2057
|
hidden: props.tableId == null
|
|
2024
2058
|
})),
|
|
2025
|
-
submitAlignment:
|
|
2059
|
+
submitAlignment: reactPage.ResponsiveIconRadioGroup((props) => ({
|
|
2026
2060
|
label: "Button alignment",
|
|
2027
2061
|
options: [
|
|
2028
2062
|
{ label: "Left", value: Alignments.LEFT, icon: "AlignLeft16" },
|
|
@@ -2032,7 +2066,7 @@ function registerComponent$6(runtime) {
|
|
|
2032
2066
|
defaultValue: Alignments.CENTER,
|
|
2033
2067
|
hidden: props.tableId == null
|
|
2034
2068
|
})),
|
|
2035
|
-
width:
|
|
2069
|
+
width: reactPage.Width({
|
|
2036
2070
|
preset: [
|
|
2037
2071
|
{
|
|
2038
2072
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2040,9 +2074,9 @@ function registerComponent$6(runtime) {
|
|
|
2040
2074
|
}
|
|
2041
2075
|
],
|
|
2042
2076
|
defaultValue: { value: 100, unit: "%" },
|
|
2043
|
-
format:
|
|
2077
|
+
format: reactPage.Width.Format.ClassName
|
|
2044
2078
|
}),
|
|
2045
|
-
margin:
|
|
2079
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName })
|
|
2046
2080
|
}
|
|
2047
2081
|
});
|
|
2048
2082
|
}
|
|
@@ -2053,17 +2087,17 @@ function registerComponent$5(runtime) {
|
|
|
2053
2087
|
type: constants.MakeswiftComponentType.Image,
|
|
2054
2088
|
label: "Image",
|
|
2055
2089
|
props: {
|
|
2056
|
-
id:
|
|
2057
|
-
file:
|
|
2058
|
-
altText:
|
|
2059
|
-
link:
|
|
2060
|
-
width:
|
|
2061
|
-
margin:
|
|
2062
|
-
padding:
|
|
2063
|
-
border:
|
|
2064
|
-
borderRadius:
|
|
2065
|
-
boxShadow:
|
|
2066
|
-
opacity:
|
|
2090
|
+
id: reactPage.ElementID(),
|
|
2091
|
+
file: reactPage.Image(),
|
|
2092
|
+
altText: reactPage.TextInput({ label: "Alt text" }),
|
|
2093
|
+
link: reactPage.Link({ label: "On click" }),
|
|
2094
|
+
width: reactPage.Width(),
|
|
2095
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName }),
|
|
2096
|
+
padding: reactPage.Padding({ format: reactPage.Padding.Format.ClassName }),
|
|
2097
|
+
border: reactPage.Border({ format: reactPage.Border.Format.ClassName }),
|
|
2098
|
+
borderRadius: reactPage.BorderRadius({ format: reactPage.BorderRadius.Format.ClassName }),
|
|
2099
|
+
boxShadow: reactPage.Shadows({ format: reactPage.Shadows.Format.ClassName }),
|
|
2100
|
+
opacity: reactPage.ResponsiveOpacity()
|
|
2067
2101
|
}
|
|
2068
2102
|
});
|
|
2069
2103
|
}
|
|
@@ -2073,23 +2107,23 @@ function registerComponent$4(runtime) {
|
|
|
2073
2107
|
})))), {
|
|
2074
2108
|
type: constants.MakeswiftComponentType.Navigation,
|
|
2075
2109
|
label: "Navigation",
|
|
2076
|
-
icon:
|
|
2110
|
+
icon: reactPage.ComponentIcon.Navigation,
|
|
2077
2111
|
props: {
|
|
2078
|
-
id:
|
|
2079
|
-
links:
|
|
2080
|
-
linkTextStyle:
|
|
2112
|
+
id: reactPage.ElementID(),
|
|
2113
|
+
links: reactPage.NavigationLinks(),
|
|
2114
|
+
linkTextStyle: reactPage.TextStyle((props) => {
|
|
2081
2115
|
const links = props.links;
|
|
2082
2116
|
return {
|
|
2083
2117
|
label: "Link text style",
|
|
2084
2118
|
hidden: links == null || links.length === 0
|
|
2085
2119
|
};
|
|
2086
2120
|
}),
|
|
2087
|
-
showLogo:
|
|
2088
|
-
logoFile:
|
|
2121
|
+
showLogo: reactPage.Checkbox({ preset: true, label: "Show logo" }),
|
|
2122
|
+
logoFile: reactPage.Image((props) => ({
|
|
2089
2123
|
label: "Logo",
|
|
2090
2124
|
hidden: props.showLogo === false
|
|
2091
2125
|
})),
|
|
2092
|
-
logoWidth:
|
|
2126
|
+
logoWidth: reactPage.ResponsiveLength((props) => ({
|
|
2093
2127
|
preset: [
|
|
2094
2128
|
{
|
|
2095
2129
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2102,15 +2136,15 @@ function registerComponent$4(runtime) {
|
|
|
2102
2136
|
options: [{ value: "px", label: "Pixels", icon: "Px16" }],
|
|
2103
2137
|
hidden: props.showLogo === false
|
|
2104
2138
|
})),
|
|
2105
|
-
logoAltText:
|
|
2139
|
+
logoAltText: reactPage.TextInput((props) => ({
|
|
2106
2140
|
label: "Logo alt text",
|
|
2107
2141
|
hidden: props.showLogo === false
|
|
2108
2142
|
})),
|
|
2109
|
-
logoLink:
|
|
2143
|
+
logoLink: reactPage.Link((props) => ({
|
|
2110
2144
|
label: "Logo on click",
|
|
2111
2145
|
hidden: props.showLogo === false
|
|
2112
2146
|
})),
|
|
2113
|
-
alignment:
|
|
2147
|
+
alignment: reactPage.ResponsiveIconRadioGroup({
|
|
2114
2148
|
label: "Alignment",
|
|
2115
2149
|
options: [
|
|
2116
2150
|
{ label: "Left", value: "flex-start", icon: "AlignLeft16" },
|
|
@@ -2119,7 +2153,7 @@ function registerComponent$4(runtime) {
|
|
|
2119
2153
|
],
|
|
2120
2154
|
defaultValue: "flex-end"
|
|
2121
2155
|
}),
|
|
2122
|
-
gutter:
|
|
2156
|
+
gutter: reactPage.GapX({
|
|
2123
2157
|
preset: [
|
|
2124
2158
|
{
|
|
2125
2159
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2132,14 +2166,14 @@ function registerComponent$4(runtime) {
|
|
|
2132
2166
|
step: 1,
|
|
2133
2167
|
defaultValue: { value: 0, unit: "px" }
|
|
2134
2168
|
}),
|
|
2135
|
-
mobileMenuAnimation:
|
|
2169
|
+
mobileMenuAnimation: reactPage.ResponsiveSelect({
|
|
2136
2170
|
label: "Mobile menu",
|
|
2137
2171
|
options: [
|
|
2138
2172
|
{ value: "coverRight", label: "Cover from right" },
|
|
2139
2173
|
{ value: "coverLeft", label: "Cover from left" }
|
|
2140
2174
|
]
|
|
2141
2175
|
}),
|
|
2142
|
-
mobileMenuOpenIconColor:
|
|
2176
|
+
mobileMenuOpenIconColor: reactPage.ResponsiveColor((props, device) => {
|
|
2143
2177
|
const mobileMenuAnimation = props.mobileMenuAnimation;
|
|
2144
2178
|
const hidden = !state_breakpoints.findBreakpointOverride(runtime.getBreakpoints(), mobileMenuAnimation, device);
|
|
2145
2179
|
return {
|
|
@@ -2148,7 +2182,7 @@ function registerComponent$4(runtime) {
|
|
|
2148
2182
|
hidden
|
|
2149
2183
|
};
|
|
2150
2184
|
}),
|
|
2151
|
-
mobileMenuCloseIconColor:
|
|
2185
|
+
mobileMenuCloseIconColor: reactPage.ResponsiveColor((props, device) => {
|
|
2152
2186
|
const mobileMenuAnimation = props.mobileMenuAnimation;
|
|
2153
2187
|
const hidden = !state_breakpoints.findBreakpointOverride(runtime.getBreakpoints(), mobileMenuAnimation, device);
|
|
2154
2188
|
return {
|
|
@@ -2157,7 +2191,7 @@ function registerComponent$4(runtime) {
|
|
|
2157
2191
|
hidden
|
|
2158
2192
|
};
|
|
2159
2193
|
}),
|
|
2160
|
-
mobileMenuBackgroundColor:
|
|
2194
|
+
mobileMenuBackgroundColor: reactPage.ResponsiveColor((props, device) => {
|
|
2161
2195
|
const mobileMenuAnimation = props.mobileMenuAnimation;
|
|
2162
2196
|
const hidden = !state_breakpoints.findBreakpointOverride(runtime.getBreakpoints(), mobileMenuAnimation, device);
|
|
2163
2197
|
return {
|
|
@@ -2166,11 +2200,11 @@ function registerComponent$4(runtime) {
|
|
|
2166
2200
|
hidden
|
|
2167
2201
|
};
|
|
2168
2202
|
}),
|
|
2169
|
-
width:
|
|
2170
|
-
format:
|
|
2203
|
+
width: reactPage.Width({
|
|
2204
|
+
format: reactPage.Width.Format.ClassName,
|
|
2171
2205
|
defaultValue: { value: 100, unit: "%" }
|
|
2172
2206
|
}),
|
|
2173
|
-
margin:
|
|
2207
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName })
|
|
2174
2208
|
}
|
|
2175
2209
|
});
|
|
2176
2210
|
}
|
|
@@ -2182,10 +2216,10 @@ function registerComponent$3(runtime) {
|
|
|
2182
2216
|
label: "Page",
|
|
2183
2217
|
hidden: true,
|
|
2184
2218
|
props: {
|
|
2185
|
-
children:
|
|
2186
|
-
backgrounds:
|
|
2187
|
-
rowGap:
|
|
2188
|
-
columnGap:
|
|
2219
|
+
children: reactPage.Grid(),
|
|
2220
|
+
backgrounds: reactPage.Backgrounds(),
|
|
2221
|
+
rowGap: reactPage.GapY(),
|
|
2222
|
+
columnGap: reactPage.GapX()
|
|
2189
2223
|
}
|
|
2190
2224
|
});
|
|
2191
2225
|
}
|
|
@@ -2195,10 +2229,10 @@ function registerComponent$2(runtime) {
|
|
|
2195
2229
|
})))), {
|
|
2196
2230
|
type: constants.MakeswiftComponentType.SocialLinks,
|
|
2197
2231
|
label: "Social Links",
|
|
2198
|
-
icon:
|
|
2232
|
+
icon: reactPage.ComponentIcon.SocialLinks,
|
|
2199
2233
|
props: {
|
|
2200
|
-
id:
|
|
2201
|
-
links:
|
|
2234
|
+
id: reactPage.ElementID(),
|
|
2235
|
+
links: reactPage.SocialLinks({
|
|
2202
2236
|
preset: {
|
|
2203
2237
|
links: [
|
|
2204
2238
|
{
|
|
@@ -2217,7 +2251,7 @@ function registerComponent$2(runtime) {
|
|
|
2217
2251
|
openInNewTab: false
|
|
2218
2252
|
}
|
|
2219
2253
|
}),
|
|
2220
|
-
shape:
|
|
2254
|
+
shape: reactPage.ResponsiveIconRadioGroup((props) => {
|
|
2221
2255
|
const links = props.links;
|
|
2222
2256
|
return {
|
|
2223
2257
|
label: "Shape",
|
|
@@ -2231,7 +2265,7 @@ function registerComponent$2(runtime) {
|
|
|
2231
2265
|
hidden: links == null || links.links.length === 0
|
|
2232
2266
|
};
|
|
2233
2267
|
}),
|
|
2234
|
-
size:
|
|
2268
|
+
size: reactPage.ResponsiveIconRadioGroup((props) => {
|
|
2235
2269
|
const links = props.links;
|
|
2236
2270
|
return {
|
|
2237
2271
|
label: "Size",
|
|
@@ -2244,7 +2278,7 @@ function registerComponent$2(runtime) {
|
|
|
2244
2278
|
hidden: links == null || links.links.length === 0
|
|
2245
2279
|
};
|
|
2246
2280
|
}),
|
|
2247
|
-
hoverStyle:
|
|
2281
|
+
hoverStyle: reactPage.ResponsiveSelect((props) => {
|
|
2248
2282
|
const links = props.links;
|
|
2249
2283
|
const hidden = links == null || links.links.length === 0;
|
|
2250
2284
|
return {
|
|
@@ -2260,7 +2294,7 @@ function registerComponent$2(runtime) {
|
|
|
2260
2294
|
hidden
|
|
2261
2295
|
};
|
|
2262
2296
|
}),
|
|
2263
|
-
fill:
|
|
2297
|
+
fill: reactPage.ResponsiveColor((props) => {
|
|
2264
2298
|
const links = props.links;
|
|
2265
2299
|
const hidden = links == null || links.links.length === 0;
|
|
2266
2300
|
return {
|
|
@@ -2268,7 +2302,7 @@ function registerComponent$2(runtime) {
|
|
|
2268
2302
|
hidden
|
|
2269
2303
|
};
|
|
2270
2304
|
}),
|
|
2271
|
-
backgroundColor:
|
|
2305
|
+
backgroundColor: reactPage.ResponsiveColor((props) => {
|
|
2272
2306
|
const links = props.links;
|
|
2273
2307
|
const hidden = links == null || links.links.length === 0;
|
|
2274
2308
|
return {
|
|
@@ -2276,7 +2310,7 @@ function registerComponent$2(runtime) {
|
|
|
2276
2310
|
hidden
|
|
2277
2311
|
};
|
|
2278
2312
|
}),
|
|
2279
|
-
alignment:
|
|
2313
|
+
alignment: reactPage.ResponsiveIconRadioGroup({
|
|
2280
2314
|
label: "Alignment",
|
|
2281
2315
|
options: [
|
|
2282
2316
|
{ label: "flex-start", value: "flex-start", icon: "AlignLeft16" },
|
|
@@ -2285,7 +2319,7 @@ function registerComponent$2(runtime) {
|
|
|
2285
2319
|
],
|
|
2286
2320
|
defaultValue: "center"
|
|
2287
2321
|
}),
|
|
2288
|
-
gutter:
|
|
2322
|
+
gutter: reactPage.GapX({
|
|
2289
2323
|
preset: [
|
|
2290
2324
|
{
|
|
2291
2325
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2298,12 +2332,12 @@ function registerComponent$2(runtime) {
|
|
|
2298
2332
|
step: 1,
|
|
2299
2333
|
defaultValue: { value: 0, unit: "px" }
|
|
2300
2334
|
}),
|
|
2301
|
-
width:
|
|
2302
|
-
format:
|
|
2335
|
+
width: reactPage.Width({
|
|
2336
|
+
format: reactPage.Width.Format.ClassName,
|
|
2303
2337
|
defaultValue: { value: 100, unit: "%" }
|
|
2304
2338
|
}),
|
|
2305
|
-
margin:
|
|
2306
|
-
format:
|
|
2339
|
+
margin: reactPage.Margin({
|
|
2340
|
+
format: reactPage.Margin.Format.ClassName,
|
|
2307
2341
|
preset: [
|
|
2308
2342
|
{
|
|
2309
2343
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2326,8 +2360,8 @@ function registerComponent$1(runtime) {
|
|
|
2326
2360
|
type: constants.MakeswiftComponentType.Text,
|
|
2327
2361
|
label: "Text",
|
|
2328
2362
|
props: {
|
|
2329
|
-
id:
|
|
2330
|
-
text:
|
|
2363
|
+
id: reactPage.ElementID(),
|
|
2364
|
+
text: reactPage.RichText(() => ({
|
|
2331
2365
|
preset: {
|
|
2332
2366
|
document: {
|
|
2333
2367
|
object: "document",
|
|
@@ -2373,8 +2407,8 @@ function registerComponent$1(runtime) {
|
|
|
2373
2407
|
}
|
|
2374
2408
|
}
|
|
2375
2409
|
})),
|
|
2376
|
-
width:
|
|
2377
|
-
format:
|
|
2410
|
+
width: reactPage.Width({
|
|
2411
|
+
format: reactPage.Width.Format.ClassName,
|
|
2378
2412
|
preset: [
|
|
2379
2413
|
{
|
|
2380
2414
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2383,8 +2417,8 @@ function registerComponent$1(runtime) {
|
|
|
2383
2417
|
],
|
|
2384
2418
|
defaultValue: { value: 100, unit: "%" }
|
|
2385
2419
|
}),
|
|
2386
|
-
margin:
|
|
2387
|
-
format:
|
|
2420
|
+
margin: reactPage.Margin({
|
|
2421
|
+
format: reactPage.Margin.Format.ClassName,
|
|
2388
2422
|
preset: [
|
|
2389
2423
|
{
|
|
2390
2424
|
deviceId: state_breakpoints.getBaseBreakpoint(runtime.getBreakpoints()).id,
|
|
@@ -2406,16 +2440,16 @@ function registerComponent(runtime) {
|
|
|
2406
2440
|
})))), {
|
|
2407
2441
|
type: constants.MakeswiftComponentType.Video,
|
|
2408
2442
|
label: "Video",
|
|
2409
|
-
icon:
|
|
2443
|
+
icon: reactPage.ComponentIcon.Video,
|
|
2410
2444
|
props: {
|
|
2411
|
-
id:
|
|
2412
|
-
video:
|
|
2413
|
-
width:
|
|
2414
|
-
format:
|
|
2445
|
+
id: reactPage.ElementID(),
|
|
2446
|
+
video: reactPage.Video({ preset: { controls: true } }),
|
|
2447
|
+
width: reactPage.Width({
|
|
2448
|
+
format: reactPage.Width.Format.ClassName,
|
|
2415
2449
|
defaultValue: { value: 560, unit: "px" }
|
|
2416
2450
|
}),
|
|
2417
|
-
margin:
|
|
2418
|
-
borderRadius:
|
|
2451
|
+
margin: reactPage.Margin({ format: reactPage.Margin.Format.ClassName }),
|
|
2452
|
+
borderRadius: reactPage.BorderRadius({ format: reactPage.BorderRadius.Format.ClassName })
|
|
2419
2453
|
}
|
|
2420
2454
|
});
|
|
2421
2455
|
}
|
|
@@ -2451,7 +2485,7 @@ function registerBuiltinComponents(runtime) {
|
|
|
2451
2485
|
}
|
|
2452
2486
|
const isServer = typeof window === "undefined";
|
|
2453
2487
|
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2454
|
-
const useInsertionEffect = (
|
|
2488
|
+
const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
|
|
2455
2489
|
function useStyle(style) {
|
|
2456
2490
|
const serialized = serialize.serializeStyles([style], css.cache.registered);
|
|
2457
2491
|
utils.registerStyles(css.cache, serialized, false);
|
|
@@ -2605,17 +2639,17 @@ function useTable(tableId) {
|
|
|
2605
2639
|
}, [client, tableId]);
|
|
2606
2640
|
return table;
|
|
2607
2641
|
}
|
|
2608
|
-
function mapSideColor(swatches,
|
|
2609
|
-
var
|
|
2642
|
+
function mapSideColor(swatches, _f) {
|
|
2643
|
+
var _g = _f, { color } = _g, restOfSide = __objRest(_g, ["color"]);
|
|
2610
2644
|
return __spreadProps(__spreadValues({}, restOfSide), {
|
|
2611
2645
|
color: color && {
|
|
2612
2646
|
alpha: color.alpha,
|
|
2613
|
-
swatch: swatches.filter(
|
|
2647
|
+
swatch: swatches.filter(reactPage.isNonNullable).find((s) => s && s.id === color.swatchId)
|
|
2614
2648
|
}
|
|
2615
2649
|
});
|
|
2616
2650
|
}
|
|
2617
2651
|
function useBorder(value) {
|
|
2618
|
-
const swatchIds =
|
|
2652
|
+
const swatchIds = reactPage.getBorderSwatchIds(value);
|
|
2619
2653
|
const swatches = useSwatches(swatchIds);
|
|
2620
2654
|
if (value == null)
|
|
2621
2655
|
return null;
|
|
@@ -2640,7 +2674,7 @@ const ShadowDefaultValue = {
|
|
|
2640
2674
|
color: null
|
|
2641
2675
|
};
|
|
2642
2676
|
function useBoxShadow(value) {
|
|
2643
|
-
const swatchIds =
|
|
2677
|
+
const swatchIds = reactPage.getBoxShadowsSwatchIds(value);
|
|
2644
2678
|
const swatches = useSwatches(swatchIds);
|
|
2645
2679
|
if (value == null)
|
|
2646
2680
|
return null;
|
|
@@ -2656,7 +2690,7 @@ function useBoxShadow(value) {
|
|
|
2656
2690
|
return __spreadProps(__spreadValues({}, restOfShadow), {
|
|
2657
2691
|
payload: {
|
|
2658
2692
|
color: color != null ? {
|
|
2659
|
-
swatch: swatches.filter(
|
|
2693
|
+
swatch: swatches.filter(reactPage.isNonNullable).find((s) => s && s.id === color.swatchId),
|
|
2660
2694
|
alpha: color.alpha
|
|
2661
2695
|
} : null,
|
|
2662
2696
|
inset: inset != null ? inset : ShadowDefaultValue.inset,
|
|
@@ -2671,7 +2705,7 @@ function useBoxShadow(value) {
|
|
|
2671
2705
|
});
|
|
2672
2706
|
}
|
|
2673
2707
|
function useResponsiveColor(color) {
|
|
2674
|
-
const swatchIds =
|
|
2708
|
+
const swatchIds = reactPage.getResponsiveColorSwatchIds(color);
|
|
2675
2709
|
const swatches = useSwatches(swatchIds);
|
|
2676
2710
|
if (color == null)
|
|
2677
2711
|
return null;
|
|
@@ -2680,7 +2714,7 @@ function useResponsiveColor(color) {
|
|
|
2680
2714
|
const { swatchId, alpha } = v;
|
|
2681
2715
|
const swatch = swatches.find((s) => s && s.id === swatchId);
|
|
2682
2716
|
return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
|
|
2683
|
-
}).filter(
|
|
2717
|
+
}).filter(reactPage.isNonNullable);
|
|
2684
2718
|
}
|
|
2685
2719
|
const getIndexes = (spans, index) => {
|
|
2686
2720
|
const flattened = spans.reduce((a, s) => a.concat(s), []);
|
|
@@ -2702,10 +2736,10 @@ function lengthDataToString(data) {
|
|
|
2702
2736
|
return data;
|
|
2703
2737
|
}
|
|
2704
2738
|
function paddingPropertyDataToStyle(data, defaultValue = {}) {
|
|
2705
|
-
var _a, _b,
|
|
2739
|
+
var _a, _b, _c, _d;
|
|
2706
2740
|
const paddingTop = (_a = data.paddingTop) != null ? _a : defaultValue.paddingTop;
|
|
2707
2741
|
const paddingRight = (_b = data.paddingRight) != null ? _b : defaultValue.paddingRight;
|
|
2708
|
-
const paddingBottom = (
|
|
2742
|
+
const paddingBottom = (_c = data.paddingBottom) != null ? _c : defaultValue.paddingBottom;
|
|
2709
2743
|
const paddingLeft = (_d = data.paddingLeft) != null ? _d : defaultValue.paddingLeft;
|
|
2710
2744
|
const style = {};
|
|
2711
2745
|
if (paddingTop != null)
|
|
@@ -2719,10 +2753,10 @@ function paddingPropertyDataToStyle(data, defaultValue = {}) {
|
|
|
2719
2753
|
return style;
|
|
2720
2754
|
}
|
|
2721
2755
|
function marginPropertyDataToStyle(data, defaultValue = {}) {
|
|
2722
|
-
var _a, _b,
|
|
2756
|
+
var _a, _b, _c, _d;
|
|
2723
2757
|
const marginTop = (_a = data.marginTop) != null ? _a : defaultValue.marginTop;
|
|
2724
2758
|
const marginRight = (_b = data.marginRight) != null ? _b : defaultValue.marginRight;
|
|
2725
|
-
const marginBottom = (
|
|
2759
|
+
const marginBottom = (_c = data.marginBottom) != null ? _c : defaultValue.marginBottom;
|
|
2726
2760
|
const marginLeft = (_d = data.marginLeft) != null ? _d : defaultValue.marginLeft;
|
|
2727
2761
|
const style = {};
|
|
2728
2762
|
if (marginTop != null)
|
|
@@ -2743,10 +2777,10 @@ function lengthPercentageDataToString(data) {
|
|
|
2743
2777
|
return data;
|
|
2744
2778
|
}
|
|
2745
2779
|
function borderRadiusPropertyDataToStyle(data, defaultValue = {}) {
|
|
2746
|
-
var _a, _b,
|
|
2780
|
+
var _a, _b, _c, _d;
|
|
2747
2781
|
const borderTopLeftRadius = (_a = data.borderTopLeftRadius) != null ? _a : defaultValue.borderTopLeftRadius;
|
|
2748
2782
|
const borderTopRightRadius = (_b = data.borderTopRightRadius) != null ? _b : defaultValue.borderTopRightRadius;
|
|
2749
|
-
const borderBottomRightRadius = (
|
|
2783
|
+
const borderBottomRightRadius = (_c = data.borderBottomRightRadius) != null ? _c : defaultValue.borderBottomRightRadius;
|
|
2750
2784
|
const borderBottomLeftRadius = (_d = data.borderBottomLeftRadius) != null ? _d : defaultValue.borderBottomLeftRadius;
|
|
2751
2785
|
const style = {};
|
|
2752
2786
|
if (borderTopLeftRadius != null) {
|
|
@@ -2767,10 +2801,10 @@ function colorToString(color) {
|
|
|
2767
2801
|
return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
|
|
2768
2802
|
}
|
|
2769
2803
|
function borderPropertyDataToStyle(data, defaultValue = {}) {
|
|
2770
|
-
var _a, _b,
|
|
2804
|
+
var _a, _b, _c, _d;
|
|
2771
2805
|
const borderTop = (_a = data.borderTop) != null ? _a : defaultValue.borderTop;
|
|
2772
2806
|
const borderRight = (_b = data.borderRight) != null ? _b : defaultValue.borderRight;
|
|
2773
|
-
const borderBottom = (
|
|
2807
|
+
const borderBottom = (_c = data.borderBottom) != null ? _c : defaultValue.borderBottom;
|
|
2774
2808
|
const borderLeft = (_d = data.borderLeft) != null ? _d : defaultValue.borderLeft;
|
|
2775
2809
|
const style = {};
|
|
2776
2810
|
if (borderTop != null)
|
|
@@ -2926,7 +2960,7 @@ const defaultPadding = {
|
|
|
2926
2960
|
};
|
|
2927
2961
|
function useStyleControlCssObject(style, controlDefinition) {
|
|
2928
2962
|
const { properties } = controlDefinition.config;
|
|
2929
|
-
return __spreadValues(__spreadValues({}, properties.includes(
|
|
2963
|
+
return __spreadValues(__spreadValues({}, properties.includes(reactPage.StyleControlProperty.Width) && {
|
|
2930
2964
|
maxWidth: "100%"
|
|
2931
2965
|
}), useResponsiveStyle([
|
|
2932
2966
|
style == null ? void 0 : style.width,
|
|
@@ -2936,20 +2970,20 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2936
2970
|
style == null ? void 0 : style.borderRadius,
|
|
2937
2971
|
style == null ? void 0 : style.textStyle
|
|
2938
2972
|
], ([width, margin, padding, border, borderRadius, textStyle]) => {
|
|
2939
|
-
var _a, _b,
|
|
2940
|
-
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(
|
|
2973
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k;
|
|
2974
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(reactPage.StyleControlProperty.Width) && {
|
|
2941
2975
|
width: (_a = widthToString(width)) != null ? _a : "100%"
|
|
2942
|
-
}), properties.includes(
|
|
2976
|
+
}), properties.includes(reactPage.StyleControlProperty.Margin) && marginPropertyDataToStyle(margin != null ? margin : defaultMargin, defaultMargin)), properties.includes(reactPage.StyleControlProperty.Padding) && paddingPropertyDataToStyle(padding != null ? padding : defaultPadding, defaultPadding)), properties.includes(reactPage.StyleControlProperty.Border) && {
|
|
2943
2977
|
borderTop: (_b = borderSideToString2(border == null ? void 0 : border.borderTop)) != null ? _b : "0 solid black",
|
|
2944
|
-
borderRight: (
|
|
2978
|
+
borderRight: (_c = borderSideToString2(border == null ? void 0 : border.borderRight)) != null ? _c : "0 solid black",
|
|
2945
2979
|
borderBottom: (_d = borderSideToString2(border == null ? void 0 : border.borderBottom)) != null ? _d : "0 solid black",
|
|
2946
|
-
borderLeft: (
|
|
2947
|
-
}), properties.includes(
|
|
2980
|
+
borderLeft: (_e2 = borderSideToString2(border == null ? void 0 : border.borderLeft)) != null ? _e2 : "0 solid black"
|
|
2981
|
+
}), properties.includes(reactPage.StyleControlProperty.BorderRadius) && {
|
|
2948
2982
|
borderTopLeftRadius: (_f = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _f : 0,
|
|
2949
2983
|
borderTopRightRadius: (_g = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _g : 0,
|
|
2950
2984
|
borderBottomRightRadius: (_h = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _h : 0,
|
|
2951
2985
|
borderBottomLeftRadius: (_i = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _i : 0
|
|
2952
|
-
}), properties.includes(
|
|
2986
|
+
}), properties.includes(reactPage.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: `"${textStyle.fontFamily}"` }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
|
|
2953
2987
|
textTransform: (_j = textStyle == null ? void 0 : textStyle.textTransform) != null ? _j : [],
|
|
2954
2988
|
fontStyle: (_k = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _k : []
|
|
2955
2989
|
}));
|
|
@@ -3034,10 +3068,10 @@ function useComboboxControlValue(data) {
|
|
|
3034
3068
|
}
|
|
3035
3069
|
function useImageControlValue(data, definition) {
|
|
3036
3070
|
var _a;
|
|
3037
|
-
const format = (_a = definition.config.format) != null ? _a :
|
|
3071
|
+
const format = (_a = definition.config.format) != null ? _a : reactPage.ImageControlValueFormat.URL;
|
|
3038
3072
|
const fileId = data != null ? data : null;
|
|
3039
3073
|
const file = useFile(fileId);
|
|
3040
|
-
if (format ===
|
|
3074
|
+
if (format === reactPage.ImageControlValueFormat.URL) {
|
|
3041
3075
|
return file == null ? void 0 : file.publicUrl;
|
|
3042
3076
|
}
|
|
3043
3077
|
if (file == null || file.dimensions == null)
|
|
@@ -3136,12 +3170,12 @@ function useNumber(numberControlData, controlDefinition) {
|
|
|
3136
3170
|
return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
|
|
3137
3171
|
}
|
|
3138
3172
|
const Text = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
|
|
3139
|
-
return require("./index.
|
|
3173
|
+
return require("./index.cjs8.js");
|
|
3140
3174
|
}))));
|
|
3141
3175
|
function useRichText(data, control) {
|
|
3142
3176
|
const textCallbackRef = React.useCallback((handle) => {
|
|
3143
3177
|
var _a;
|
|
3144
|
-
if (
|
|
3178
|
+
if (reactPage.isPropControllersHandle(handle))
|
|
3145
3179
|
(_a = handle == null ? void 0 : handle.setPropControllers) == null ? void 0 : _a.call(handle, control == null ? null : {
|
|
3146
3180
|
text: control
|
|
3147
3181
|
});
|
|
@@ -3152,7 +3186,7 @@ function useRichText(data, control) {
|
|
|
3152
3186
|
});
|
|
3153
3187
|
}
|
|
3154
3188
|
const EditableText = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
|
|
3155
|
-
return require("./index.
|
|
3189
|
+
return require("./index.cjs9.js");
|
|
3156
3190
|
}))));
|
|
3157
3191
|
const ReadOnlyText = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
|
|
3158
3192
|
return require("./ReadOnlyTextV2.cjs.js");
|
|
@@ -3163,7 +3197,8 @@ function useRichTextV2(data, control) {
|
|
|
3163
3197
|
text: data,
|
|
3164
3198
|
control
|
|
3165
3199
|
}) : /* @__PURE__ */ jsxRuntime.jsx(ReadOnlyText, {
|
|
3166
|
-
text: data
|
|
3200
|
+
text: data,
|
|
3201
|
+
control
|
|
3167
3202
|
});
|
|
3168
3203
|
}
|
|
3169
3204
|
function useSelectControlValue(data, definition) {
|
|
@@ -3221,13 +3256,13 @@ function useSlot(data, control) {
|
|
|
3221
3256
|
}, element.key))
|
|
3222
3257
|
});
|
|
3223
3258
|
}
|
|
3224
|
-
function Slot(
|
|
3225
|
-
var
|
|
3259
|
+
function Slot(_h) {
|
|
3260
|
+
var _i = _h, {
|
|
3226
3261
|
as,
|
|
3227
3262
|
control,
|
|
3228
3263
|
children,
|
|
3229
3264
|
className
|
|
3230
|
-
} =
|
|
3265
|
+
} = _i, restOfProps = __objRest(_i, [
|
|
3231
3266
|
"as",
|
|
3232
3267
|
"control",
|
|
3233
3268
|
"children",
|
|
@@ -3256,15 +3291,15 @@ function Slot(_f) {
|
|
|
3256
3291
|
}
|
|
3257
3292
|
Slot.Placeholder = SlotPlaceholder;
|
|
3258
3293
|
Slot.Item = SlotItem;
|
|
3259
|
-
function SlotItem(
|
|
3260
|
-
var
|
|
3294
|
+
function SlotItem(_j) {
|
|
3295
|
+
var _k = _j, {
|
|
3261
3296
|
as,
|
|
3262
3297
|
control,
|
|
3263
3298
|
grid,
|
|
3264
3299
|
index,
|
|
3265
3300
|
children,
|
|
3266
3301
|
className
|
|
3267
|
-
} =
|
|
3302
|
+
} = _k, restOfProps = __objRest(_k, [
|
|
3268
3303
|
"as",
|
|
3269
3304
|
"control",
|
|
3270
3305
|
"grid",
|
|
@@ -3383,25 +3418,25 @@ function ControlValue({
|
|
|
3383
3418
|
parameters: [data, definition],
|
|
3384
3419
|
children: (value) => children(value)
|
|
3385
3420
|
}, definition.type);
|
|
3386
|
-
case
|
|
3421
|
+
case reactPage.SelectControlType:
|
|
3387
3422
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3388
3423
|
hook: useSelectControlValue,
|
|
3389
3424
|
parameters: [data, definition],
|
|
3390
3425
|
children: (value) => children(value)
|
|
3391
3426
|
}, definition.type);
|
|
3392
|
-
case
|
|
3427
|
+
case reactPage.ColorControlType:
|
|
3393
3428
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3394
3429
|
hook: useColorValue,
|
|
3395
3430
|
parameters: [data, definition],
|
|
3396
3431
|
children: (value) => children(value)
|
|
3397
3432
|
}, definition.type);
|
|
3398
|
-
case
|
|
3433
|
+
case reactPage.ImageControlType:
|
|
3399
3434
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3400
3435
|
hook: useImageControlValue,
|
|
3401
3436
|
parameters: [data, definition],
|
|
3402
3437
|
children: (value) => children(value)
|
|
3403
3438
|
}, definition.type);
|
|
3404
|
-
case
|
|
3439
|
+
case reactPage.LinkControlType:
|
|
3405
3440
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3406
3441
|
hook: useLinkControlValue,
|
|
3407
3442
|
parameters: [data, definition],
|
|
@@ -3413,39 +3448,39 @@ function ControlValue({
|
|
|
3413
3448
|
parameters: [data],
|
|
3414
3449
|
children: (value) => children(value)
|
|
3415
3450
|
}, definition.type);
|
|
3416
|
-
case
|
|
3451
|
+
case reactPage.ShapeControlType:
|
|
3417
3452
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeControlValue, {
|
|
3418
3453
|
definition,
|
|
3419
3454
|
data,
|
|
3420
3455
|
control,
|
|
3421
3456
|
children: (value) => children(value)
|
|
3422
3457
|
});
|
|
3423
|
-
case
|
|
3458
|
+
case reactPage.ListControlType:
|
|
3424
3459
|
return /* @__PURE__ */ jsxRuntime.jsx(ListControlValue, {
|
|
3425
3460
|
definition,
|
|
3426
3461
|
data,
|
|
3427
3462
|
control,
|
|
3428
3463
|
children: (value) => children(value)
|
|
3429
3464
|
});
|
|
3430
|
-
case
|
|
3465
|
+
case reactPage.SlotControlType:
|
|
3431
3466
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3432
3467
|
hook: useSlot,
|
|
3433
3468
|
parameters: [data, control],
|
|
3434
3469
|
children: (value) => children(value)
|
|
3435
3470
|
}, definition.type);
|
|
3436
|
-
case
|
|
3471
|
+
case reactPage.RichTextControlType:
|
|
3437
3472
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3438
3473
|
hook: useRichText,
|
|
3439
3474
|
parameters: [data, control],
|
|
3440
3475
|
children: (value) => children(value)
|
|
3441
3476
|
}, definition.type);
|
|
3442
|
-
case
|
|
3477
|
+
case reactPage.RichTextV2ControlType:
|
|
3443
3478
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3444
3479
|
hook: useRichTextV2,
|
|
3445
3480
|
parameters: [data, control],
|
|
3446
3481
|
children: (value) => children(value)
|
|
3447
3482
|
}, definition.type);
|
|
3448
|
-
case
|
|
3483
|
+
case reactPage.StyleControlType:
|
|
3449
3484
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3450
3485
|
hook: useFormattedStyle,
|
|
3451
3486
|
parameters: [data, definition, control],
|
|
@@ -3481,28 +3516,28 @@ function PropsValue({
|
|
|
3481
3516
|
}) {
|
|
3482
3517
|
var _a;
|
|
3483
3518
|
const store = useStore();
|
|
3484
|
-
const propControllerDescriptorsRef = React.useRef((_a =
|
|
3519
|
+
const propControllerDescriptorsRef = React.useRef((_a = reactPage.getComponentPropControllerDescriptors(store.getState(), element.type)) != null ? _a : {});
|
|
3485
3520
|
const props = element.props;
|
|
3486
3521
|
const documentKey = useDocumentKey();
|
|
3487
3522
|
const propControllers = useSelector((state) => {
|
|
3488
3523
|
if (documentKey == null)
|
|
3489
3524
|
return null;
|
|
3490
|
-
return
|
|
3525
|
+
return reactPage.getPropControllers(state, documentKey, element.key);
|
|
3491
3526
|
});
|
|
3492
3527
|
return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
|
|
3493
|
-
var _a2, _b,
|
|
3528
|
+
var _a2, _b, _c, _d;
|
|
3494
3529
|
switch (descriptor.type) {
|
|
3495
3530
|
case textInput.CheckboxControlType:
|
|
3496
3531
|
case textInput.NumberControlType:
|
|
3497
3532
|
case textInput.TextInputControlType:
|
|
3498
3533
|
case textInput.TextAreaControlType:
|
|
3499
|
-
case
|
|
3500
|
-
case
|
|
3501
|
-
case
|
|
3534
|
+
case reactPage.SelectControlType:
|
|
3535
|
+
case reactPage.ColorControlType:
|
|
3536
|
+
case reactPage.ImageControlType:
|
|
3502
3537
|
case combobox.ComboboxControlType:
|
|
3503
|
-
case
|
|
3504
|
-
case
|
|
3505
|
-
case
|
|
3538
|
+
case reactPage.ShapeControlType:
|
|
3539
|
+
case reactPage.ListControlType:
|
|
3540
|
+
case reactPage.LinkControlType:
|
|
3506
3541
|
return /* @__PURE__ */ jsxRuntime.jsx(ControlValue, {
|
|
3507
3542
|
definition: descriptor,
|
|
3508
3543
|
data: props[propName],
|
|
@@ -3511,7 +3546,7 @@ function PropsValue({
|
|
|
3511
3546
|
[propName]: value
|
|
3512
3547
|
}))
|
|
3513
3548
|
});
|
|
3514
|
-
case
|
|
3549
|
+
case reactPage.StyleControlType: {
|
|
3515
3550
|
const control = (_a2 = propControllers == null ? void 0 : propControllers[propName]) != null ? _a2 : null;
|
|
3516
3551
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3517
3552
|
hook: useFormattedStyle,
|
|
@@ -3521,7 +3556,7 @@ function PropsValue({
|
|
|
3521
3556
|
}))
|
|
3522
3557
|
}, descriptor.type);
|
|
3523
3558
|
}
|
|
3524
|
-
case
|
|
3559
|
+
case reactPage.RichTextControlType: {
|
|
3525
3560
|
const control = (_b = propControllers == null ? void 0 : propControllers[propName]) != null ? _b : null;
|
|
3526
3561
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3527
3562
|
hook: useRichText,
|
|
@@ -3531,8 +3566,8 @@ function PropsValue({
|
|
|
3531
3566
|
}))
|
|
3532
3567
|
}, descriptor.type);
|
|
3533
3568
|
}
|
|
3534
|
-
case
|
|
3535
|
-
const control = (
|
|
3569
|
+
case reactPage.RichTextV2ControlType: {
|
|
3570
|
+
const control = (_c = propControllers == null ? void 0 : propControllers[propName]) != null ? _c : null;
|
|
3536
3571
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3537
3572
|
hook: useRichTextV2,
|
|
3538
3573
|
parameters: [props[propName], control],
|
|
@@ -3541,7 +3576,7 @@ function PropsValue({
|
|
|
3541
3576
|
}))
|
|
3542
3577
|
}, descriptor.type);
|
|
3543
3578
|
}
|
|
3544
|
-
case
|
|
3579
|
+
case reactPage.SlotControlType: {
|
|
3545
3580
|
const control = (_d = propControllers == null ? void 0 : propControllers[propName]) != null ? _d : null;
|
|
3546
3581
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3547
3582
|
hook: useSlot,
|
|
@@ -3551,9 +3586,9 @@ function PropsValue({
|
|
|
3551
3586
|
}))
|
|
3552
3587
|
}, descriptor.type);
|
|
3553
3588
|
}
|
|
3554
|
-
case
|
|
3589
|
+
case reactPage.Types.Width:
|
|
3555
3590
|
switch (descriptor.options.format) {
|
|
3556
|
-
case
|
|
3591
|
+
case reactPage.WidthPropControllerFormat.ClassName:
|
|
3557
3592
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3558
3593
|
hook: useWidthStyle,
|
|
3559
3594
|
parameters: [props[propName], descriptor],
|
|
@@ -3566,9 +3601,9 @@ function PropsValue({
|
|
|
3566
3601
|
[propName]: props[propName]
|
|
3567
3602
|
}));
|
|
3568
3603
|
}
|
|
3569
|
-
case
|
|
3604
|
+
case reactPage.Types.Padding:
|
|
3570
3605
|
switch (descriptor.options.format) {
|
|
3571
|
-
case
|
|
3606
|
+
case reactPage.PaddingPropControllerFormat.ClassName:
|
|
3572
3607
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3573
3608
|
hook: usePaddingStyle,
|
|
3574
3609
|
parameters: [props[propName]],
|
|
@@ -3581,9 +3616,9 @@ function PropsValue({
|
|
|
3581
3616
|
[propName]: props[propName]
|
|
3582
3617
|
}));
|
|
3583
3618
|
}
|
|
3584
|
-
case
|
|
3619
|
+
case reactPage.Types.Margin:
|
|
3585
3620
|
switch (descriptor.options.format) {
|
|
3586
|
-
case
|
|
3621
|
+
case reactPage.MarginPropControllerFormat.ClassName:
|
|
3587
3622
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3588
3623
|
hook: useMarginStyle,
|
|
3589
3624
|
parameters: [props[propName]],
|
|
@@ -3596,9 +3631,9 @@ function PropsValue({
|
|
|
3596
3631
|
[propName]: props[propName]
|
|
3597
3632
|
}));
|
|
3598
3633
|
}
|
|
3599
|
-
case
|
|
3634
|
+
case reactPage.Types.BorderRadius:
|
|
3600
3635
|
switch (descriptor.options.format) {
|
|
3601
|
-
case
|
|
3636
|
+
case reactPage.BorderRadiusPropControllerFormat.ClassName:
|
|
3602
3637
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3603
3638
|
hook: useBorderRadiusStyle,
|
|
3604
3639
|
parameters: [props[propName]],
|
|
@@ -3611,9 +3646,9 @@ function PropsValue({
|
|
|
3611
3646
|
[propName]: props[propName]
|
|
3612
3647
|
}));
|
|
3613
3648
|
}
|
|
3614
|
-
case
|
|
3649
|
+
case reactPage.Types.Shadows:
|
|
3615
3650
|
switch (descriptor.options.format) {
|
|
3616
|
-
case
|
|
3651
|
+
case reactPage.ShadowsPropControllerFormat.ClassName:
|
|
3617
3652
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3618
3653
|
hook: useShadowsStyle,
|
|
3619
3654
|
parameters: [props[propName]],
|
|
@@ -3626,9 +3661,9 @@ function PropsValue({
|
|
|
3626
3661
|
[propName]: props[propName]
|
|
3627
3662
|
}));
|
|
3628
3663
|
}
|
|
3629
|
-
case
|
|
3664
|
+
case reactPage.Types.Border:
|
|
3630
3665
|
switch (descriptor.options.format) {
|
|
3631
|
-
case
|
|
3666
|
+
case reactPage.BorderPropControllerFormat.ClassName:
|
|
3632
3667
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3633
3668
|
hook: useBorderStyle,
|
|
3634
3669
|
parameters: [props[propName]],
|
|
@@ -3641,7 +3676,7 @@ function PropsValue({
|
|
|
3641
3676
|
[propName]: props[propName]
|
|
3642
3677
|
}));
|
|
3643
3678
|
}
|
|
3644
|
-
case
|
|
3679
|
+
case reactPage.Types.ResponsiveColor:
|
|
3645
3680
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3646
3681
|
hook: useResponsiveColor,
|
|
3647
3682
|
parameters: [props[propName]],
|
|
@@ -3707,7 +3742,7 @@ class ElementImperativeHandle {
|
|
|
3707
3742
|
}
|
|
3708
3743
|
setPropControllers(propControllers) {
|
|
3709
3744
|
const current = this.getCurrent();
|
|
3710
|
-
if (
|
|
3745
|
+
if (reactPage.isPropControllersHandle(current))
|
|
3711
3746
|
current.setPropControllers(propControllers);
|
|
3712
3747
|
this.lastPropControllers = propControllers;
|
|
3713
3748
|
}
|
|
@@ -3726,18 +3761,22 @@ function isDomNodeHandle(value) {
|
|
|
3726
3761
|
}
|
|
3727
3762
|
class ReactRuntime {
|
|
3728
3763
|
constructor({
|
|
3729
|
-
breakpoints
|
|
3730
|
-
|
|
3764
|
+
breakpoints,
|
|
3765
|
+
unstable_i18n
|
|
3766
|
+
} = {}) {
|
|
3731
3767
|
__publicField(this, "store");
|
|
3732
|
-
this.store =
|
|
3733
|
-
breakpoints: breakpoints ? state_breakpoints.parseBreakpointsInput(breakpoints) : void 0
|
|
3768
|
+
this.store = reactPage.configureStore({
|
|
3769
|
+
breakpoints: breakpoints ? state_breakpoints.parseBreakpointsInput(breakpoints) : void 0,
|
|
3770
|
+
locales: unstable_i18n ? __spreadProps(__spreadValues({}, unstable_i18n), {
|
|
3771
|
+
locale: null
|
|
3772
|
+
}) : void 0
|
|
3734
3773
|
});
|
|
3735
3774
|
registerBuiltinComponents(this);
|
|
3736
3775
|
}
|
|
3737
3776
|
static registerComponent(component, {
|
|
3738
3777
|
type,
|
|
3739
3778
|
label,
|
|
3740
|
-
icon =
|
|
3779
|
+
icon = reactPage.ComponentIcon.Code,
|
|
3741
3780
|
hidden = false,
|
|
3742
3781
|
props
|
|
3743
3782
|
}) {
|
|
@@ -3753,15 +3792,15 @@ class ReactRuntime {
|
|
|
3753
3792
|
};
|
|
3754
3793
|
}
|
|
3755
3794
|
static copyElementTree(elementTree2, replacementContext) {
|
|
3756
|
-
return
|
|
3795
|
+
return reactPage.copyElementTree(this.store.getState(), elementTree2, replacementContext);
|
|
3757
3796
|
}
|
|
3758
3797
|
static getBreakpoints() {
|
|
3759
|
-
return
|
|
3798
|
+
return reactPage.getBreakpoints(this.store.getState());
|
|
3760
3799
|
}
|
|
3761
3800
|
registerComponent(component, {
|
|
3762
3801
|
type,
|
|
3763
3802
|
label,
|
|
3764
|
-
icon =
|
|
3803
|
+
icon = reactPage.ComponentIcon.Cube,
|
|
3765
3804
|
hidden = false,
|
|
3766
3805
|
props
|
|
3767
3806
|
}) {
|
|
@@ -3777,13 +3816,13 @@ class ReactRuntime {
|
|
|
3777
3816
|
};
|
|
3778
3817
|
}
|
|
3779
3818
|
copyElementTree(elementTree2, replacementContext) {
|
|
3780
|
-
return
|
|
3819
|
+
return reactPage.copyElementTree(this.store.getState(), elementTree2, replacementContext);
|
|
3781
3820
|
}
|
|
3782
3821
|
getBreakpoints() {
|
|
3783
|
-
return
|
|
3822
|
+
return reactPage.getBreakpoints(this.store.getState());
|
|
3784
3823
|
}
|
|
3785
3824
|
}
|
|
3786
|
-
__publicField(ReactRuntime, "store",
|
|
3825
|
+
__publicField(ReactRuntime, "store", reactPage.configureStore());
|
|
3787
3826
|
registerBuiltinComponents(ReactRuntime);
|
|
3788
3827
|
const StoreContext = React.createContext(ReactRuntime.store);
|
|
3789
3828
|
const PreviewProvider = dynamic__default["default"](() => Promise.resolve().then(function() {
|
|
@@ -3792,10 +3831,10 @@ const PreviewProvider = dynamic__default["default"](() => Promise.resolve().then
|
|
|
3792
3831
|
const LiveProvider = dynamic__default["default"](() => Promise.resolve().then(function() {
|
|
3793
3832
|
return require("./LiveProvider.cjs.js");
|
|
3794
3833
|
}));
|
|
3795
|
-
function RuntimeProvider(
|
|
3796
|
-
var
|
|
3834
|
+
function RuntimeProvider(_l) {
|
|
3835
|
+
var _m = _l, {
|
|
3797
3836
|
preview
|
|
3798
|
-
} =
|
|
3837
|
+
} = _m, props = __objRest(_m, [
|
|
3799
3838
|
"preview"
|
|
3800
3839
|
]);
|
|
3801
3840
|
return preview ? /* @__PURE__ */ jsxRuntime.jsx(PreviewProvider, __spreadValues({}, props)) : /* @__PURE__ */ jsxRuntime.jsx(LiveProvider, __spreadValues({}, props));
|
|
@@ -3832,26 +3871,26 @@ function useSelector(selector) {
|
|
|
3832
3871
|
return withSelector.useSyncExternalStoreWithSelector(store.subscribe, store.getState, store.getState, selector);
|
|
3833
3872
|
}
|
|
3834
3873
|
function useComponent(type) {
|
|
3835
|
-
return useSelector((state) =>
|
|
3874
|
+
return useSelector((state) => reactPage.getReactComponent(state, type));
|
|
3836
3875
|
}
|
|
3837
3876
|
function useElementId(elementKey) {
|
|
3838
3877
|
const documentKey = useDocumentKey();
|
|
3839
|
-
return useSelector((state) => documentKey == null || elementKey == null ? null :
|
|
3878
|
+
return useSelector((state) => documentKey == null || elementKey == null ? null : reactPage.getElementId(state, documentKey, elementKey));
|
|
3840
3879
|
}
|
|
3841
3880
|
function useDocument(documentKey) {
|
|
3842
|
-
return useSelector((state) =>
|
|
3881
|
+
return useSelector((state) => reactPage.getDocument(state, documentKey));
|
|
3843
3882
|
}
|
|
3844
3883
|
function useIsInBuilder() {
|
|
3845
|
-
return useSelector((state) =>
|
|
3884
|
+
return useSelector((state) => reactPage.getIsInBuilder(state));
|
|
3846
3885
|
}
|
|
3847
3886
|
function useIsPreview() {
|
|
3848
|
-
return useSelector((state) =>
|
|
3887
|
+
return useSelector((state) => reactPage.getIsPreview(state));
|
|
3849
3888
|
}
|
|
3850
3889
|
function useBuilderEditMode() {
|
|
3851
|
-
return useSelector((state) =>
|
|
3890
|
+
return useSelector((state) => reactPage.getBuilderEditMode(state));
|
|
3852
3891
|
}
|
|
3853
3892
|
function useBreakpoints() {
|
|
3854
|
-
return useSelector((state) =>
|
|
3893
|
+
return useSelector((state) => reactPage.getBreakpoints(state));
|
|
3855
3894
|
}
|
|
3856
3895
|
function useDispatch() {
|
|
3857
3896
|
const store = React.useContext(StoreContext);
|
|
@@ -3961,7 +4000,7 @@ const Element$1 = React.memo(React.forwardRef(function Element2({
|
|
|
3961
4000
|
}, [dispatch, documentKey, elementKey, isRegisterElementDisabled]);
|
|
3962
4001
|
return /* @__PURE__ */ jsxRuntime.jsx(FindDomNode, {
|
|
3963
4002
|
ref: findDomNodeCallbackRef,
|
|
3964
|
-
children:
|
|
4003
|
+
children: reactPage.isElementReference(element) ? /* @__PURE__ */ jsxRuntime.jsx(ElementReference, {
|
|
3965
4004
|
ref: elementCallbackRef,
|
|
3966
4005
|
elementReference: element
|
|
3967
4006
|
}, elementKey) : /* @__PURE__ */ jsxRuntime.jsx(ElementData, {
|