@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/react.cjs.js
CHANGED
|
@@ -5,13 +5,13 @@ var next = require("./index.cjs.js");
|
|
|
5
5
|
require("react");
|
|
6
6
|
require("use-sync-external-store/shim/with-selector");
|
|
7
7
|
require("next/dynamic");
|
|
8
|
-
require("./
|
|
8
|
+
require("./react-page.cjs.js");
|
|
9
9
|
require("redux");
|
|
10
10
|
require("redux-thunk");
|
|
11
|
-
require("./descriptors.cjs.js");
|
|
12
|
-
require("./slate.cjs2.js");
|
|
13
11
|
require("./state/breakpoints.cjs.js");
|
|
14
|
-
require("
|
|
12
|
+
require("slate");
|
|
13
|
+
require("is-hotkey");
|
|
14
|
+
require("slate-react");
|
|
15
15
|
require("@emotion/css");
|
|
16
16
|
require("@emotion/serialize");
|
|
17
17
|
require("@emotion/utils");
|
|
@@ -27,6 +27,7 @@ require("scroll-into-view-if-needed");
|
|
|
27
27
|
require("react-dom");
|
|
28
28
|
require("html-react-parser");
|
|
29
29
|
require("next/head");
|
|
30
|
+
require("zod");
|
|
30
31
|
require("@emotion/server/create-instance");
|
|
31
32
|
require("next/document");
|
|
32
33
|
require("cors");
|
|
@@ -34,6 +35,7 @@ require("path-to-regexp");
|
|
|
34
35
|
require("cookie");
|
|
35
36
|
require("http-proxy");
|
|
36
37
|
require("set-cookie-parser");
|
|
38
|
+
require("./constants.cjs.js");
|
|
37
39
|
require("uuid");
|
|
38
40
|
require("corporate-ipsum");
|
|
39
41
|
exports.ActionTypes = actions.ActionTypes;
|
package/dist/react.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/react.es.js
CHANGED
|
@@ -3,13 +3,13 @@ export { D as DocumentReference, E as Element, P as PageProvider, a as ReactRunt
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "use-sync-external-store/shim/with-selector";
|
|
5
5
|
import "next/dynamic";
|
|
6
|
-
import "./
|
|
6
|
+
import "./react-page.es.js";
|
|
7
7
|
import "redux";
|
|
8
8
|
import "redux-thunk";
|
|
9
|
-
import "./descriptors.es.js";
|
|
10
|
-
import "./slate.es2.js";
|
|
11
9
|
import "./state/breakpoints.es.js";
|
|
12
|
-
import "
|
|
10
|
+
import "slate";
|
|
11
|
+
import "is-hotkey";
|
|
12
|
+
import "slate-react";
|
|
13
13
|
import "@emotion/css";
|
|
14
14
|
import "@emotion/serialize";
|
|
15
15
|
import "@emotion/utils";
|
|
@@ -25,6 +25,7 @@ import "scroll-into-view-if-needed";
|
|
|
25
25
|
import "react-dom";
|
|
26
26
|
import "html-react-parser";
|
|
27
27
|
import "next/head";
|
|
28
|
+
import "zod";
|
|
28
29
|
import "@emotion/server/create-instance";
|
|
29
30
|
import "next/document";
|
|
30
31
|
import "cors";
|
|
@@ -32,6 +33,7 @@ import "path-to-regexp";
|
|
|
32
33
|
import "cookie";
|
|
33
34
|
import "http-proxy";
|
|
34
35
|
import "set-cookie-parser";
|
|
36
|
+
import "./constants.es.js";
|
|
35
37
|
import "uuid";
|
|
36
38
|
import "corporate-ipsum";
|
|
37
39
|
//# sourceMappingURL=react.es.js.map
|
package/dist/react.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/slate.cjs.js
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
var index = require("./index.cjs5.js");
|
|
4
|
+
var reactPage = require("./react-page.cjs.js");
|
|
4
5
|
var index$1 = require("./index.cjs6.js");
|
|
6
|
+
var index$2 = require("./index.cjs7.js");
|
|
5
7
|
require("slate");
|
|
6
|
-
require("is-hotkey");
|
|
7
|
-
require("./element.cjs.js");
|
|
8
|
-
require("./slate.cjs2.js");
|
|
9
8
|
require("./state/breakpoints.cjs.js");
|
|
10
9
|
require("./actions.cjs.js");
|
|
10
|
+
require("redux");
|
|
11
|
+
require("redux-thunk");
|
|
12
|
+
require("is-hotkey");
|
|
11
13
|
require("slate-react");
|
|
12
|
-
exports.
|
|
13
|
-
exports.List = index.List;
|
|
14
|
-
exports.Typography = index.Typography;
|
|
15
|
-
exports.onKeyDown = index.onKeyDown;
|
|
16
|
-
exports.withBlock = index.withBlock;
|
|
17
|
-
exports.withBuilder = index.withBuilder;
|
|
18
|
-
exports.withList = index.withList;
|
|
14
|
+
exports.TypographyActions = index.TypographyActions;
|
|
19
15
|
exports.withTypography = index.withTypography;
|
|
20
|
-
exports.
|
|
16
|
+
exports.BlockActions = reactPage.BlockActions;
|
|
17
|
+
exports.BlockPlugin = reactPage.BlockPlugin;
|
|
18
|
+
exports.BlockTextAlignment = reactPage.BlockTextAlignment;
|
|
19
|
+
exports.BlockType = reactPage.BlockType;
|
|
20
|
+
exports.InlineType = reactPage.InlineType;
|
|
21
|
+
exports.ListActions = reactPage.ListActions;
|
|
22
|
+
exports.RootBlockType = reactPage.RootBlockType;
|
|
23
|
+
exports.onKeyDown = reactPage.onKeyDown;
|
|
24
|
+
exports.withBlock = reactPage.withBlock;
|
|
25
|
+
exports.InlineModePlugin = index$1.InlineModePlugin;
|
|
21
26
|
exports.withInlineMode = index$1.withInlineMode;
|
|
27
|
+
exports.withBuilder = index$2.withBuilder;
|
|
22
28
|
//# sourceMappingURL=slate.cjs.js.map
|
package/dist/slate.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slate.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/slate.es.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { T as TypographyActions, w as withTypography } from "./index.es5.js";
|
|
2
|
+
export { b6 as BlockActions, ba as BlockPlugin, be as BlockTextAlignment, bc as BlockType, bd as InlineType, b7 as ListActions, bb as RootBlockType, b8 as onKeyDown, b9 as withBlock } from "./react-page.es.js";
|
|
3
|
+
export { I as InlineModePlugin, w as withInlineMode } from "./index.es6.js";
|
|
4
|
+
export { w as withBuilder } from "./index.es7.js";
|
|
3
5
|
import "slate";
|
|
4
|
-
import "is-hotkey";
|
|
5
|
-
import "./element.es.js";
|
|
6
|
-
import "./slate.es2.js";
|
|
7
6
|
import "./state/breakpoints.es.js";
|
|
8
7
|
import "./actions.es.js";
|
|
8
|
+
import "redux";
|
|
9
|
+
import "redux-thunk";
|
|
10
|
+
import "is-hotkey";
|
|
9
11
|
import "slate-react";
|
|
10
12
|
//# sourceMappingURL=slate.es.js.map
|
package/dist/slate.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slate.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoints.cjs.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label?: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<string, { width: number; label?: string; viewport?: number }>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n validateBreakpointsInput(input)\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n const transformed = sorted.reduce(\n (prev, curr, index, array) => {\n const { width, viewport, id, label } = curr\n const next = array[index + 1]\n\n const breakpoint: Breakpoint = {\n id,\n ...(label && { label }),\n ...(next && { minWidth: next.width + 1 }),\n maxWidth: width,\n viewportWidth: viewport ?? width,\n }\n\n return [...prev, breakpoint]\n },\n [\n { id: DefaultBreakpointID.Desktop, label: 'Desktop', minWidth: sorted[0].width + 1 },\n ] as Breakpoints,\n )\n\n return transformed\n}\n\nfunction validateBreakpointsInput(input: BreakpointsInput) {\n if (DefaultBreakpointID.Desktop in input) {\n throw new Error(\n `Cannot change the base breakpoint. \"${DefaultBreakpointID.Desktop}\" is reserved as the base breakpoint.`,\n )\n }\n\n if (Object.keys(input).length === 0) {\n throw new Error(`Breakpoints cannot be empty. You must provide at least one breakpoint.`)\n }\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n sorted.forEach(({ id, width, viewport }, index, array) => {\n // This is only valid for desktop-first. We need to check the inverse for mobile-first.\n if (viewport && viewport > width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be greater than its width.\n \"${id}\" has a viewport of ${viewport}px and a width of ${width}px.`,\n )\n }\n\n const next = array[index + 1]\n\n if (viewport && next && viewport < next.width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be smaller than the next breakpoint's width. \n \"${id}\" has a viewport of ${viewport}px and the next breakpoint \"${next.id}\" has a width of ${next.width}px.`,\n )\n }\n\n if (next && width === next.width) {\n throw new Error(\n `Breakpoints cannot have the same width. \"${id}\" and \"${next.id}\" have the same width`,\n )\n }\n })\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is DeviceOverride<R> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":["ActionTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG;AACvC,QAAI,KAAK,MAAM;AAAM,aAAO,KAAK;AAAA,EACnC;AAEA,SAAO,KAAK;AACd;ACLA,sBAGE,GAAM,GAAa;AACb,QAAA,QAAQ,KAAK,CAAC;AACd,QAAA,SAAS,mBAAK;AAEpB,QAAM,QAAQ,CAAO,QAAA;AAEnB,WAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI;AAAA,EAAA,CAC3C;AAEM,SAAA;AACT;ACUO,MAAM,sBAAsB;AAAA,EACjC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AACV;AAIO,MAAM,sBAAmC;AAAA,EAC9C;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AAAA,EACA;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AACF;AAEO,yBAAyB,cAAc,qBAA4B;AACjE,SAAA;AACT;AAEwB,iBAAA,QAAe,gBAAgB,GAAG,QAAuB;AAC/E,UAAQ,OAAO;AAAA,SACRA,QAAAA,YAAY,iBAAiB;AAC1B,YAAA,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,kBACmB;;AACb,QAAA,iBAAiB,uBACrB,aACA,MAAM,OAAO,CAAK,MAAA,EAAE,aAAa,cAAc,GAC/C,UACA,gBACF;AAEA,SAA0B,wBAAA,cAAc,aAAa,eAAe,QAAQ,MAAlD,YAAwD;AACpF;AAEO,MAAM,wBAAwB,CACnC,aACA,QACA,aACwB;AACxB,QAAM,UAAU;AAAA,IACd,GAAG,IAAI,IACL,OAAO,IAAI,CAAC,EAAE,eAAe,QAAQ,EAAE,OAAO,SAAS,IAAI,CAAC,EAAE,eAAe,QAAQ,CAAC,CACxF;AAAA,EAAA;AAGK,SAAA,QAAQ,IAAI,CAAa,aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,wBAAuB,aAAa,QAAQ,QAAQ,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK,QACxE,wBAAuB,aAAa,UAAU,UAAU,CAAA,MAAK,CAAC,KAAK,EAAE,OAAO,CAAA,EAAM,GAAA;AAAA,EAExF,EAAA;AACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"breakpoints.cjs.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label?: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<string, { width: number; label?: string; viewport?: number }>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n validateBreakpointsInput(input)\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n const transformed = sorted.reduce(\n (prev, curr, index, array) => {\n const { width, viewport, id, label } = curr\n const next = array[index + 1]\n\n const breakpoint: Breakpoint = {\n id,\n ...(label && { label }),\n ...(next && { minWidth: next.width + 1 }),\n maxWidth: width,\n viewportWidth: viewport ?? width,\n }\n\n return [...prev, breakpoint]\n },\n [\n { id: DefaultBreakpointID.Desktop, label: 'Desktop', minWidth: sorted[0].width + 1 },\n ] as Breakpoints,\n )\n\n return transformed\n}\n\nfunction validateBreakpointsInput(input: BreakpointsInput) {\n if (DefaultBreakpointID.Desktop in input) {\n throw new Error(\n `Cannot change the base breakpoint. \"${DefaultBreakpointID.Desktop}\" is reserved as the base breakpoint.`,\n )\n }\n\n if (Object.keys(input).length === 0) {\n throw new Error(`Breakpoints cannot be empty. You must provide at least one breakpoint.`)\n }\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n sorted.forEach(({ id, width, viewport }, index, array) => {\n // This is only valid for desktop-first. We need to check the inverse for mobile-first.\n if (viewport && viewport > width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be greater than its width.\n \"${id}\" has a viewport of ${viewport}px and a width of ${width}px.`,\n )\n }\n\n const next = array[index + 1]\n\n if (viewport && next && viewport < next.width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be smaller than the next breakpoint's width. \n \"${id}\" has a viewport of ${viewport}px and the next breakpoint \"${next.id}\" has a width of ${next.width}px.`,\n )\n }\n\n if (next && width === next.width) {\n throw new Error(\n `Breakpoints cannot have the same width. \"${id}\" and \"${next.id}\" have the same width`,\n )\n }\n })\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is NonNullable<typeof override> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":["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QACA,aACwB;AACxB,QAAM,UAAU;AAAA,IACd,GAAG,IAAI,IACL,OAAO,IAAI,CAAC,EAAE,eAAe,QAAQ,EAAE,OAAO,SAAS,IAAI,CAAC,EAAE,eAAe,QAAQ,CAAC,CACxF;AAAA,EAAA;AAGK,SAAA,QAAQ,IAAI,CAAa,aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,wBAAuB,aAAa,QAAQ,QAAQ,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK,QACxE,wBAAuB,aAAa,UAAU,UAAU,CAAA,MAAK,CAAC,KAAK,EAAE,OAAO,CAAA,EAAM,GAAA;AAAA,EAExF,EAAA;AACJ;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoints.es.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label?: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<string, { width: number; label?: string; viewport?: number }>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n validateBreakpointsInput(input)\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n const transformed = sorted.reduce(\n (prev, curr, index, array) => {\n const { width, viewport, id, label } = curr\n const next = array[index + 1]\n\n const breakpoint: Breakpoint = {\n id,\n ...(label && { label }),\n ...(next && { minWidth: next.width + 1 }),\n maxWidth: width,\n viewportWidth: viewport ?? width,\n }\n\n return [...prev, breakpoint]\n },\n [\n { id: DefaultBreakpointID.Desktop, label: 'Desktop', minWidth: sorted[0].width + 1 },\n ] as Breakpoints,\n )\n\n return transformed\n}\n\nfunction validateBreakpointsInput(input: BreakpointsInput) {\n if (DefaultBreakpointID.Desktop in input) {\n throw new Error(\n `Cannot change the base breakpoint. \"${DefaultBreakpointID.Desktop}\" is reserved as the base breakpoint.`,\n )\n }\n\n if (Object.keys(input).length === 0) {\n throw new Error(`Breakpoints cannot be empty. You must provide at least one breakpoint.`)\n }\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n sorted.forEach(({ id, width, viewport }, index, array) => {\n // This is only valid for desktop-first. We need to check the inverse for mobile-first.\n if (viewport && viewport > width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be greater than its width.\n \"${id}\" has a viewport of ${viewport}px and a width of ${width}px.`,\n )\n }\n\n const next = array[index + 1]\n\n if (viewport && next && viewport < next.width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be smaller than the next breakpoint's width. \n \"${id}\" has a viewport of ${viewport}px and the next breakpoint \"${next.id}\" has a width of ${next.width}px.`,\n )\n }\n\n if (next && width === next.width) {\n throw new Error(\n `Breakpoints cannot have the same width. \"${id}\" and \"${next.id}\" have the same width`,\n )\n }\n })\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is DeviceOverride<R> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK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aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,wBAAuB,aAAa,QAAQ,QAAQ,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK,QACxE,wBAAuB,aAAa,UAAU,UAAU,CAAA,MAAK,CAAC,KAAK,EAAE,OAAO,CAAA,EAAM,GAAA;AAAA,EAExF,EAAA;AACJ;;"}
|
|
1
|
+
{"version":3,"file":"breakpoints.es.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label?: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<string, { width: number; label?: string; viewport?: number }>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n validateBreakpointsInput(input)\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n const transformed = sorted.reduce(\n (prev, curr, index, array) => {\n const { width, viewport, id, label } = curr\n const next = array[index + 1]\n\n const breakpoint: Breakpoint = {\n id,\n ...(label && { label }),\n ...(next && { minWidth: next.width + 1 }),\n maxWidth: width,\n viewportWidth: viewport ?? width,\n }\n\n return [...prev, breakpoint]\n },\n [\n { id: DefaultBreakpointID.Desktop, label: 'Desktop', minWidth: sorted[0].width + 1 },\n ] as Breakpoints,\n )\n\n return transformed\n}\n\nfunction validateBreakpointsInput(input: BreakpointsInput) {\n if (DefaultBreakpointID.Desktop in input) {\n throw new Error(\n `Cannot change the base breakpoint. \"${DefaultBreakpointID.Desktop}\" is reserved as the base breakpoint.`,\n )\n }\n\n if (Object.keys(input).length === 0) {\n throw new Error(`Breakpoints cannot be empty. You must provide at least one breakpoint.`)\n }\n\n const sorted = Object.entries(input)\n .map(([id, value]) => ({ ...value, id }))\n .sort((a, b) => b.width - a.width) // Sort by width in descending order\n\n sorted.forEach(({ id, width, viewport }, index, array) => {\n // This is only valid for desktop-first. We need to check the inverse for mobile-first.\n if (viewport && viewport > width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be greater than its width.\n \"${id}\" has a viewport of ${viewport}px and a width of ${width}px.`,\n )\n }\n\n const next = array[index + 1]\n\n if (viewport && next && viewport < next.width) {\n throw new Error(\n `Error on breakpoint \"${id}\". Viewport cannot be smaller than the next breakpoint's width. \n \"${id}\" has a viewport of ${viewport}px and the next breakpoint \"${next.id}\" has a width of ${next.width}px.`,\n )\n }\n\n if (next && width === next.width) {\n throw new Error(\n `Breakpoints cannot have the same width. \"${id}\" and \"${next.id}\" have the same width`,\n )\n }\n })\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is NonNullable<typeof override> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG;AACvC,QAAI,KAAK,MAAM;AAAM,aAAO,KAAK;AAAA,EACnC;AAEA,SAAO,KAAK;AACd;ACLA,sBAGE,GAAM,GAAa;AACb,QAAA,QAAQ,KAAK,CAAC;AACd,QAAA,SAAS,mBAAK;AAEpB,QAAM,QAAQ,CAAO,QAAA;AAEnB,WAAO,OAAO,SAAS,OAAO,MAAM,E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cjs.js
CHANGED
|
@@ -7,10 +7,6 @@ const NumberControlType = "makeswift::controls::number";
|
|
|
7
7
|
function Number(config = {}) {
|
|
8
8
|
return { type: NumberControlType, config };
|
|
9
9
|
}
|
|
10
|
-
const SelectControlType = "makeswift::controls::select";
|
|
11
|
-
function Select(config) {
|
|
12
|
-
return { type: SelectControlType, config };
|
|
13
|
-
}
|
|
14
10
|
const TextAreaControlType = "makeswift::controls::text-area";
|
|
15
11
|
function TextArea(config = {}) {
|
|
16
12
|
return { type: TextAreaControlType, config };
|
|
@@ -23,8 +19,6 @@ exports.Checkbox = Checkbox;
|
|
|
23
19
|
exports.CheckboxControlType = CheckboxControlType;
|
|
24
20
|
exports.Number = Number;
|
|
25
21
|
exports.NumberControlType = NumberControlType;
|
|
26
|
-
exports.Select = Select;
|
|
27
|
-
exports.SelectControlType = SelectControlType;
|
|
28
22
|
exports.TextArea = TextArea;
|
|
29
23
|
exports.TextAreaControlType = TextAreaControlType;
|
|
30
24
|
exports.TextInput = TextInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.cjs.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts","../src/controls/
|
|
1
|
+
{"version":3,"file":"text-input.cjs.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts","../src/controls/text-area.ts","../src/controls/text-input.ts"],"sourcesContent":["export type CheckboxControlData = boolean\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config }\n}\n","export type NumberControlData = number\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config }\n}\n","export type TextAreaControlData = string\n\nexport const TextAreaControlType = 'makeswift::controls::text-area'\n\ntype TextAreaControlConfig = {\n label?: string\n defaultValue?: string\n rows?: number\n}\n\nexport type TextAreaControlDefinition<C extends TextAreaControlConfig = TextAreaControlConfig> = {\n type: typeof TextAreaControlType\n config: C\n}\n\nexport function TextArea<C extends TextAreaControlConfig>(\n config: C = {} as C,\n): TextAreaControlDefinition<C> {\n return { type: TextAreaControlType, config }\n}\n","export type TextInputControlData = string\n\nexport const TextInputControlType = 'makeswift::controls::text-input'\n\ntype TextInputControlConfig = {\n label?: string\n defaultValue?: string\n}\n\nexport type TextInputControlDefinition<C extends TextInputControlConfig = TextInputControlConfig> =\n {\n type: typeof TextInputControlType\n config: C\n }\n\nexport function TextInput<C extends TextInputControlConfig>(\n config: C = {} as C,\n): TextInputControlDefinition<C> {\n return { type: TextInputControlType, config }\n}\n"],"names":[],"mappings":";AAEO,MAAM,sBAAsB;AAajC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;AChBO,MAAM,oBAAoB;AAkB/B,gBAAA,SAAY,IACgB;AACrB,SAAA,EAAE,MAAM,mBAAmB;AACpC;ACrBO,MAAM,sBAAsB;AAcjC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;ACjBO,MAAM,uBAAuB;AAclC,mBAAA,SAAY,IACmB;AACxB,SAAA,EAAE,MAAM,sBAAsB;AACvC;;;;;;;;;"}
|
package/dist/text-input.es.js
CHANGED
|
@@ -6,10 +6,6 @@ const NumberControlType = "makeswift::controls::number";
|
|
|
6
6
|
function Number(config = {}) {
|
|
7
7
|
return { type: NumberControlType, config };
|
|
8
8
|
}
|
|
9
|
-
const SelectControlType = "makeswift::controls::select";
|
|
10
|
-
function Select(config) {
|
|
11
|
-
return { type: SelectControlType, config };
|
|
12
|
-
}
|
|
13
9
|
const TextAreaControlType = "makeswift::controls::text-area";
|
|
14
10
|
function TextArea(config = {}) {
|
|
15
11
|
return { type: TextAreaControlType, config };
|
|
@@ -18,5 +14,5 @@ const TextInputControlType = "makeswift::controls::text-input";
|
|
|
18
14
|
function TextInput(config = {}) {
|
|
19
15
|
return { type: TextInputControlType, config };
|
|
20
16
|
}
|
|
21
|
-
export { CheckboxControlType as C, NumberControlType as N,
|
|
17
|
+
export { CheckboxControlType as C, NumberControlType as N, TextAreaControlType as T, TextInputControlType as a, Checkbox as b, Number as c, TextArea as d, TextInput as e };
|
|
22
18
|
//# sourceMappingURL=text-input.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.es.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts","../src/controls/
|
|
1
|
+
{"version":3,"file":"text-input.es.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts","../src/controls/text-area.ts","../src/controls/text-input.ts"],"sourcesContent":["export type CheckboxControlData = boolean\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config }\n}\n","export type NumberControlData = number\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config }\n}\n","export type TextAreaControlData = string\n\nexport const TextAreaControlType = 'makeswift::controls::text-area'\n\ntype TextAreaControlConfig = {\n label?: string\n defaultValue?: string\n rows?: number\n}\n\nexport type TextAreaControlDefinition<C extends TextAreaControlConfig = TextAreaControlConfig> = {\n type: typeof TextAreaControlType\n config: C\n}\n\nexport function TextArea<C extends TextAreaControlConfig>(\n config: C = {} as C,\n): TextAreaControlDefinition<C> {\n return { type: TextAreaControlType, config }\n}\n","export type TextInputControlData = string\n\nexport const TextInputControlType = 'makeswift::controls::text-input'\n\ntype TextInputControlConfig = {\n label?: string\n defaultValue?: string\n}\n\nexport type TextInputControlDefinition<C extends TextInputControlConfig = TextInputControlConfig> =\n {\n type: typeof TextInputControlType\n config: C\n }\n\nexport function TextInput<C extends TextInputControlConfig>(\n config: C = {} as C,\n): TextInputControlDefinition<C> {\n return { type: TextInputControlType, config }\n}\n"],"names":[],"mappings":"AAEO,MAAM,sBAAsB;AAajC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;AChBO,MAAM,oBAAoB;AAkB/B,gBAAA,SAAY,IACgB;AACrB,SAAA,EAAE,MAAM,mBAAmB;AACpC;ACrBO,MAAM,sBAAsB;AAcjC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;ACjBO,MAAM,uBAAuB;AAclC,mBAAA,SAAY,IACmB;AACxB,SAAA,EAAE,MAAM,sBAAsB;AACvC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../../../src/api/graphql/documents/queries.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../../../src/api/graphql/documents/queries.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,0BAA0B,QAkBtC,CAAA;AAED,eAAO,MAAM,WAAW,QAQvB,CAAA;AAED,eAAO,MAAM,SAAS,QAQrB,CAAA;AAED,eAAO,MAAM,eAAe,QAQ3B,CAAA;AAED,eAAO,MAAM,sBAAsB,QAQlC,CAAA;AAED,eAAO,MAAM,UAAU,QAQtB,CAAA;AAED,eAAO,MAAM,iBAAiB,QAQ7B,CAAA;AAED,eAAO,MAAM,kBAAkB,QAQ9B,CAAA;AAED,eAAO,MAAM,yBAAyB,sKAQrC,CAAA"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type Maybe<T> = T | null;
|
|
2
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
+
export type Exact<T extends {
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
}> = {
|
|
6
6
|
[K in keyof T]: T[K];
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type Json = null | boolean | number | string | Json[] | {
|
|
9
9
|
[key: string]: Json;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type Scalars = {
|
|
12
12
|
ID: string;
|
|
13
13
|
JSON: Json;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type CreateTableRecordInput = {
|
|
16
16
|
data: CreateTableRecordInputData;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type CreateTableRecordInputData = {
|
|
19
19
|
columns: Array<CreateTableRecordInputDataColumn>;
|
|
20
20
|
tableId?: InputMaybe<Scalars['ID']>;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type CreateTableRecordInputDataColumn = {
|
|
23
23
|
columnId: Scalars['ID'];
|
|
24
24
|
data: Scalars['JSON'];
|
|
25
25
|
};
|
|
@@ -27,15 +27,15 @@ export declare const SnippetLocation: {
|
|
|
27
27
|
readonly Body: "BODY";
|
|
28
28
|
readonly Head: "HEAD";
|
|
29
29
|
};
|
|
30
|
-
export
|
|
31
|
-
export
|
|
30
|
+
export type SnippetLocation = typeof SnippetLocation[keyof typeof SnippetLocation];
|
|
31
|
+
export type SwatchFragment = {
|
|
32
32
|
__typename: 'Swatch';
|
|
33
33
|
id: string;
|
|
34
34
|
hue: number;
|
|
35
35
|
saturation: number;
|
|
36
36
|
lightness: number;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type FileFragment = {
|
|
39
39
|
__typename: 'File';
|
|
40
40
|
id: string;
|
|
41
41
|
name: string;
|
|
@@ -46,7 +46,7 @@ export declare type FileFragment = {
|
|
|
46
46
|
height: number;
|
|
47
47
|
} | null;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type TypographyFragment = {
|
|
50
50
|
__typename: 'Typography';
|
|
51
51
|
id: string;
|
|
52
52
|
name: string;
|
|
@@ -73,17 +73,17 @@ export declare type TypographyFragment = {
|
|
|
73
73
|
};
|
|
74
74
|
}>;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
76
|
+
export type PagePathnameSliceFragment = {
|
|
77
77
|
__typename: 'PagePathnameSlice';
|
|
78
78
|
id: string;
|
|
79
79
|
pathname: string;
|
|
80
80
|
};
|
|
81
|
-
export
|
|
81
|
+
export type GlobalElementFragment = {
|
|
82
82
|
__typename: 'GlobalElement';
|
|
83
83
|
id: string;
|
|
84
84
|
data: Json;
|
|
85
85
|
};
|
|
86
|
-
export
|
|
86
|
+
export type TableFragment = {
|
|
87
87
|
__typename: 'Table';
|
|
88
88
|
id: string;
|
|
89
89
|
name: string;
|
|
@@ -133,7 +133,7 @@ export declare type TableFragment = {
|
|
|
133
133
|
name: string;
|
|
134
134
|
}>;
|
|
135
135
|
};
|
|
136
|
-
export
|
|
136
|
+
export type SnippetFragment = {
|
|
137
137
|
__typename: 'Snippet';
|
|
138
138
|
id: string;
|
|
139
139
|
name: string;
|
|
@@ -144,7 +144,7 @@ export declare type SnippetFragment = {
|
|
|
144
144
|
liveEnabled: boolean;
|
|
145
145
|
builderEnabled: boolean;
|
|
146
146
|
};
|
|
147
|
-
export
|
|
147
|
+
export type PageFragment = {
|
|
148
148
|
__typename: 'Page';
|
|
149
149
|
id: string;
|
|
150
150
|
snippets: Array<{
|
|
@@ -159,7 +159,7 @@ export declare type PageFragment = {
|
|
|
159
159
|
builderEnabled: boolean;
|
|
160
160
|
}>;
|
|
161
161
|
};
|
|
162
|
-
export
|
|
162
|
+
export type SiteFragment = {
|
|
163
163
|
__typename: 'Site';
|
|
164
164
|
id: string;
|
|
165
165
|
googleFonts: {
|
|
@@ -176,20 +176,12 @@ export declare type SiteFragment = {
|
|
|
176
176
|
} | null>;
|
|
177
177
|
};
|
|
178
178
|
};
|
|
179
|
-
export
|
|
180
|
-
swatchIds: Array<Scalars['ID']> | Scalars['ID'];
|
|
179
|
+
export type IntrospectedResourcesQueryVariables = Exact<{
|
|
181
180
|
fileIds: Array<Scalars['ID']> | Scalars['ID'];
|
|
182
181
|
pageIds: Array<Scalars['ID']> | Scalars['ID'];
|
|
183
182
|
tableIds: Array<Scalars['ID']> | Scalars['ID'];
|
|
184
183
|
}>;
|
|
185
|
-
export
|
|
186
|
-
swatches: Array<{
|
|
187
|
-
__typename: 'Swatch';
|
|
188
|
-
id: string;
|
|
189
|
-
hue: number;
|
|
190
|
-
saturation: number;
|
|
191
|
-
lightness: number;
|
|
192
|
-
} | null>;
|
|
184
|
+
export type IntrospectedResourcesQueryResult = {
|
|
193
185
|
files: Array<{
|
|
194
186
|
__typename: 'File';
|
|
195
187
|
id: string;
|
|
@@ -257,10 +249,10 @@ export declare type IntrospectedResourcesQueryResult = {
|
|
|
257
249
|
}>;
|
|
258
250
|
} | null>;
|
|
259
251
|
};
|
|
260
|
-
export
|
|
252
|
+
export type SwatchQueryVariables = Exact<{
|
|
261
253
|
swatchId: Scalars['ID'];
|
|
262
254
|
}>;
|
|
263
|
-
export
|
|
255
|
+
export type SwatchQueryResult = {
|
|
264
256
|
swatch: {
|
|
265
257
|
__typename: 'Swatch';
|
|
266
258
|
id: string;
|
|
@@ -269,10 +261,10 @@ export declare type SwatchQueryResult = {
|
|
|
269
261
|
lightness: number;
|
|
270
262
|
} | null;
|
|
271
263
|
};
|
|
272
|
-
export
|
|
264
|
+
export type FileQueryVariables = Exact<{
|
|
273
265
|
fileId: Scalars['ID'];
|
|
274
266
|
}>;
|
|
275
|
-
export
|
|
267
|
+
export type FileQueryResult = {
|
|
276
268
|
file: {
|
|
277
269
|
__typename: 'File';
|
|
278
270
|
id: string;
|
|
@@ -285,10 +277,10 @@ export declare type FileQueryResult = {
|
|
|
285
277
|
} | null;
|
|
286
278
|
} | null;
|
|
287
279
|
};
|
|
288
|
-
export
|
|
280
|
+
export type TypographyQueryVariables = Exact<{
|
|
289
281
|
typographyId: Scalars['ID'];
|
|
290
282
|
}>;
|
|
291
|
-
export
|
|
283
|
+
export type TypographyQueryResult = {
|
|
292
284
|
typography: {
|
|
293
285
|
__typename: 'Typography';
|
|
294
286
|
id: string;
|
|
@@ -317,20 +309,20 @@ export declare type TypographyQueryResult = {
|
|
|
317
309
|
}>;
|
|
318
310
|
} | null;
|
|
319
311
|
};
|
|
320
|
-
export
|
|
312
|
+
export type PagePathnamesByIdQueryVariables = Exact<{
|
|
321
313
|
pageIds: Array<Scalars['ID']> | Scalars['ID'];
|
|
322
314
|
}>;
|
|
323
|
-
export
|
|
315
|
+
export type PagePathnamesByIdQueryResult = {
|
|
324
316
|
pagePathnamesById: Array<{
|
|
325
317
|
__typename: 'PagePathnameSlice';
|
|
326
318
|
id: string;
|
|
327
319
|
pathname: string;
|
|
328
320
|
} | null>;
|
|
329
321
|
};
|
|
330
|
-
export
|
|
322
|
+
export type TableQueryVariables = Exact<{
|
|
331
323
|
tableId: Scalars['ID'];
|
|
332
324
|
}>;
|
|
333
|
-
export
|
|
325
|
+
export type TableQueryResult = {
|
|
334
326
|
table: {
|
|
335
327
|
__typename: 'Table';
|
|
336
328
|
id: string;
|
|
@@ -382,10 +374,10 @@ export declare type TableQueryResult = {
|
|
|
382
374
|
}>;
|
|
383
375
|
} | null;
|
|
384
376
|
};
|
|
385
|
-
export
|
|
377
|
+
export type TypographiesQueryVariables = Exact<{
|
|
386
378
|
typographyIds: Array<Scalars['ID']> | Scalars['ID'];
|
|
387
379
|
}>;
|
|
388
|
-
export
|
|
380
|
+
export type TypographiesQueryResult = {
|
|
389
381
|
typographies: Array<{
|
|
390
382
|
__typename: 'Typography';
|
|
391
383
|
id: string;
|
|
@@ -414,20 +406,20 @@ export declare type TypographiesQueryResult = {
|
|
|
414
406
|
}>;
|
|
415
407
|
} | null>;
|
|
416
408
|
};
|
|
417
|
-
export
|
|
409
|
+
export type GlobalElementQueryVariables = Exact<{
|
|
418
410
|
globalElementId: Scalars['ID'];
|
|
419
411
|
}>;
|
|
420
|
-
export
|
|
412
|
+
export type GlobalElementQueryResult = {
|
|
421
413
|
globalElement: {
|
|
422
414
|
__typename: 'GlobalElement';
|
|
423
415
|
id: string;
|
|
424
416
|
data: Json;
|
|
425
417
|
} | null;
|
|
426
418
|
};
|
|
427
|
-
export
|
|
419
|
+
export type CreateTableRecordMutationVariables = Exact<{
|
|
428
420
|
input: CreateTableRecordInput;
|
|
429
421
|
}>;
|
|
430
|
-
export
|
|
422
|
+
export type CreateTableRecordMutationResult = {
|
|
431
423
|
createTableRecord: {
|
|
432
424
|
tableRecord: {
|
|
433
425
|
id: string;
|