@makeswift/runtime 0.2.18 → 0.3.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 +35 -70
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +34 -65
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +176 -208
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +177 -208
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +227 -249
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +229 -247
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +270 -203
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +273 -202
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +50 -71
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +51 -68
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +6 -17
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +7 -14
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +723 -553
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +723 -552
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +16 -38
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +17 -38
- package/dist/Image.es.js.map +1 -1
- package/dist/Navigation.cjs.js +318 -224
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +318 -220
- package/dist/Navigation.es.js.map +1 -1
- package/dist/Root.cjs.js +116 -78
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +99 -77
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +119 -86
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +120 -83
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +83 -99
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +84 -99
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +8 -19
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +8 -18
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js +6 -1
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +6 -2
- package/dist/actions.es.js.map +1 -1
- package/dist/components.cjs.js +6 -18
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +5 -8
- package/dist/components.es.js.map +1 -1
- package/dist/controls.es.js +1 -1
- package/dist/grid-item.cjs.js +612 -0
- package/dist/grid-item.cjs.js.map +1 -0
- package/dist/grid-item.es.js +604 -0
- package/dist/grid-item.es.js.map +1 -0
- package/dist/index.cjs.js +592 -275
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +98 -474
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs3.js +20 -107
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.es.js +587 -274
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +99 -473
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +21 -103
- package/dist/index.es3.js.map +1 -1
- package/dist/next.cjs.js +1 -2
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +2 -3
- package/dist/next.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +16 -3
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +19 -6
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react.cjs.js +1 -2
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +1 -2
- package/dist/react.es.js.map +1 -1
- package/dist/slot.cjs.js +41 -6
- package/dist/slot.cjs.js.map +1 -1
- package/dist/slot.es.js +36 -6
- package/dist/slot.es.js.map +1 -1
- package/dist/types/src/components/builtin/Box/Box.d.ts +7 -7
- package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/Button.d.ts +46 -34
- package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +5 -5
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/Form.d.ts +3 -3
- 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 +4 -6
- 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 +3 -0
- 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 +2 -0
- 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 +3 -7
- 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 +7 -13
- 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 +2 -0
- 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.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +2 -0
- 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 +2 -0
- 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/PlaceholderTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +4 -8
- 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 +2 -0
- 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.map +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/TextArea/index.d.ts +2 -7
- 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 +2 -0
- 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/services/{cssField.d.ts → responsiveField.d.ts} +5 -4
- package/dist/types/src/components/builtin/Form/components/Field/services/responsiveField.d.ts.map +1 -0
- package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +2 -3
- package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Image/Image.d.ts +7 -7
- package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +3 -3
- 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 +8 -81
- 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.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +8 -81
- 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.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 -2
- package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Root/components/Placeholder/index.d.ts +1 -2
- package/dist/types/src/components/builtin/Root/components/Placeholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +3 -3
- 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.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/Text.d.ts +3 -3
- package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +8 -11
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +3 -6
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Video/Video.d.ts +4 -4
- 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 +1 -1
- package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +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.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +255 -4
- package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +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 +8 -4
- package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/grid-item.d.ts +17 -0
- package/dist/types/src/components/shared/grid-item.d.ts.map +1 -0
- package/dist/types/src/components/utils/responsive-style.d.ts +22 -1
- package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -1
- package/dist/types/src/controls/style.d.ts +5 -65
- package/dist/types/src/controls/style.d.ts.map +1 -1
- package/dist/types/src/css/border-radius.d.ts +20 -0
- package/dist/types/src/css/border-radius.d.ts.map +1 -0
- package/dist/types/src/css/border.d.ts +31 -0
- package/dist/types/src/css/border.d.ts.map +1 -0
- package/dist/types/src/css/length-percentage.d.ts +10 -0
- package/dist/types/src/css/length-percentage.d.ts.map +1 -0
- package/dist/types/src/css/length.d.ts +14 -0
- package/dist/types/src/css/length.d.ts.map +1 -0
- package/dist/types/src/css/margin.d.ts +20 -0
- package/dist/types/src/css/margin.d.ts.map +1 -0
- package/dist/types/src/css/padding.d.ts +20 -0
- package/dist/types/src/css/padding.d.ts.map +1 -0
- package/dist/types/src/next/document.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +96 -33
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls.d.ts +10 -2
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/use-global-style.d.ts +3 -0
- package/dist/types/src/runtimes/react/use-global-style.d.ts.map +1 -0
- package/dist/types/src/state/actions.d.ts +13 -1
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/useMediaQuery.es.js +1 -1
- package/package.json +1 -3
- package/dist/cssMediaRules.cjs.js +0 -210
- package/dist/cssMediaRules.cjs.js.map +0 -1
- package/dist/cssMediaRules.es.js +0 -201
- package/dist/cssMediaRules.es.js.map +0 -1
- package/dist/index.cjs4.js +0 -18
- package/dist/index.cjs4.js.map +0 -1
- package/dist/index.es4.js +0 -13
- package/dist/index.es4.js.map +0 -1
- package/dist/types/src/components/builtin/Form/components/Field/services/cssField.d.ts.map +0 -1
- package/dist/types/src/components/utils/cssMediaRules.d.ts +0 -69
- package/dist/types/src/components/utils/cssMediaRules.d.ts.map +0 -1
- package/dist/useBoxShadow.cjs.js +0 -78
- package/dist/useBoxShadow.cjs.js.map +0 -1
- package/dist/useBoxShadow.es.js +0 -77
- package/dist/useBoxShadow.es.js.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -34,7 +34,7 @@ var __publicField = (obj, key, value) => {
|
|
|
34
34
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
35
35
|
return value;
|
|
36
36
|
};
|
|
37
|
-
var
|
|
37
|
+
var _c;
|
|
38
38
|
import * as React from "react";
|
|
39
39
|
import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useLayoutEffect, useCallback, Component, useImperativeHandle } from "react";
|
|
40
40
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
@@ -45,13 +45,12 @@ import { gql, useQuery as useQuery$1, useMutation as useMutation$1, ApolloClient
|
|
|
45
45
|
import { BatchHttpLink } from "@apollo/client/link/batch-http";
|
|
46
46
|
import { KeyUtils } from "slate";
|
|
47
47
|
import { P as PagePathnameSliceFragmentDoc } from "./graphql.es.js";
|
|
48
|
-
import { T as Types, E as ElementID, B as Backgrounds, W as Width, h as ResponsiveIconRadioGroup, M as Margin, P as Padding, i as Border, j as BorderRadius, k as Shadows, G as GapY, l as GapX, m as ResponsiveSelect, n as ResponsiveNumber, o as Checkbox, p as Grid, q as TextInput, L as Link, r as ResponsiveColor, s as TextStyle, t as Images, N as Number, D as Date$1, F as Font, u as ResponsiveLength, v as TextArea, w as Table, x as TableFormFields, y as Image, z as ResponsiveOpacity, A as NavigationLinks, H as SocialLinks, J as RichText, V as Video, K as StyleControlProperty, O as ImageControlValueFormat, I as ImageControlType, C as ColorControlType,
|
|
48
|
+
import { T as Types, E as ElementID, B as Backgrounds, W as Width, h as ResponsiveIconRadioGroup, M as Margin, P as Padding, i as Border, j as BorderRadius, k as Shadows, G as GapY, l as GapX, m as ResponsiveSelect, n as ResponsiveNumber, o as Checkbox, p as Grid, q as TextInput, L as Link, r as ResponsiveColor, s as TextStyle, t as Images, N as Number$1, D as Date$1, F as Font, u as ResponsiveLength, v as TextArea, w as Table, x as TableFormFields, y as Image, z as ResponsiveOpacity, A as NavigationLinks, H as SocialLinks, J as RichText, V as Video, K as StyleControlProperty, O as ImageControlValueFormat, I as ImageControlType, C as ColorControlType, Q as BorderPropControllerFormat, U as ShadowsPropControllerFormat, X as BorderRadiusPropControllerFormat, Y as MarginPropControllerFormat, Z as PaddingPropControllerFormat, _ as WidthPropControllerFormat, S as SlotControlType, a as StyleControlType } from "./slot.es.js";
|
|
49
49
|
import { S as ShapeControlType, L as ListControlType, b as LinkControlType } from "./control.es.js";
|
|
50
50
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
51
|
-
import
|
|
51
|
+
import { cache, cx } from "@emotion/css";
|
|
52
52
|
import { S as SelectControlType, T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
|
|
53
53
|
import { C as ComboboxControlType } from "./combobox.es.js";
|
|
54
|
-
import { cache, cx, css } from "@emotion/css";
|
|
55
54
|
import ColorHelper from "color";
|
|
56
55
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
57
56
|
import { g as getBox } from "./box-models.es.js";
|
|
@@ -285,7 +284,7 @@ const INTROSPECTION_QUERY = gql`
|
|
|
285
284
|
${TYPOGRAPHY_FRAGMENT}
|
|
286
285
|
`;
|
|
287
286
|
async function introspect(element, client, store) {
|
|
288
|
-
var _a, _b,
|
|
287
|
+
var _a, _b, _c2;
|
|
289
288
|
const descriptors = getPropControllerDescriptors(store.getState());
|
|
290
289
|
const swatchIds = /* @__PURE__ */ new Set();
|
|
291
290
|
const fileIds = /* @__PURE__ */ new Set();
|
|
@@ -357,7 +356,7 @@ async function introspect(element, client, store) {
|
|
|
357
356
|
query: TYPOGRAPHIES_BY_ID,
|
|
358
357
|
variables: { ids: [...typographyIds] }
|
|
359
358
|
});
|
|
360
|
-
(
|
|
359
|
+
(_c2 = typographiesResult == null ? void 0 : typographiesResult.data) == null ? void 0 : _c2.typographies.forEach((typography) => {
|
|
361
360
|
typography == null ? void 0 : typography.style.forEach((style) => {
|
|
362
361
|
var _a2;
|
|
363
362
|
const swatchId = (_a2 = style.value.color) == null ? void 0 : _a2.swatchId;
|
|
@@ -928,34 +927,25 @@ if (originalUrl.searchParams.has(searchParamName)) {
|
|
|
928
927
|
}
|
|
929
928
|
class Document$1 extends NextDocument {
|
|
930
929
|
static async getInitialProps(ctx) {
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
dangerouslySetInnerHTML: {
|
|
951
|
-
__html: css2
|
|
952
|
-
}
|
|
953
|
-
})]
|
|
954
|
-
})
|
|
955
|
-
});
|
|
956
|
-
} finally {
|
|
957
|
-
sheet.seal();
|
|
958
|
-
}
|
|
930
|
+
const initialProps = await NextDocument.getInitialProps(ctx);
|
|
931
|
+
KeyUtils.resetGenerator();
|
|
932
|
+
const {
|
|
933
|
+
extractCritical
|
|
934
|
+
} = createEmotionServer(cache);
|
|
935
|
+
const {
|
|
936
|
+
ids,
|
|
937
|
+
css
|
|
938
|
+
} = extractCritical(initialProps.html);
|
|
939
|
+
return __spreadProps(__spreadValues({}, initialProps), {
|
|
940
|
+
styles: /* @__PURE__ */ jsxs(Fragment, {
|
|
941
|
+
children: [initialProps.styles, /* @__PURE__ */ jsx("style", {
|
|
942
|
+
"data-emotion": `css ${ids.join(" ")}`,
|
|
943
|
+
dangerouslySetInnerHTML: {
|
|
944
|
+
__html: css
|
|
945
|
+
}
|
|
946
|
+
})]
|
|
947
|
+
})
|
|
948
|
+
});
|
|
959
949
|
}
|
|
960
950
|
render() {
|
|
961
951
|
const {
|
|
@@ -972,7 +962,7 @@ class Document$1 extends NextDocument {
|
|
|
972
962
|
});
|
|
973
963
|
}
|
|
974
964
|
}
|
|
975
|
-
const version = "0.
|
|
965
|
+
const version = "0.3.0";
|
|
976
966
|
function isErrorWithMessage(error) {
|
|
977
967
|
return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
|
|
978
968
|
}
|
|
@@ -1162,14 +1152,14 @@ async function getStaticPaths() {
|
|
|
1162
1152
|
}
|
|
1163
1153
|
const REVALIDATE_SECONDS = 1;
|
|
1164
1154
|
async function getStaticProps(ctx) {
|
|
1165
|
-
var _a, _b,
|
|
1155
|
+
var _a, _b, _c2;
|
|
1166
1156
|
deprecationWarning("getStaticProps");
|
|
1167
1157
|
const makeswift = new Makeswift(getApiKey(), {
|
|
1168
1158
|
apiOrigin: getApiOrigin()
|
|
1169
1159
|
});
|
|
1170
1160
|
const path = "/" + ((_b = (_a = ctx.params) == null ? void 0 : _a.path) != null ? _b : []).join("/");
|
|
1171
1161
|
const snapshot = await makeswift.getPageSnapshot(path, {
|
|
1172
|
-
preview: ((
|
|
1162
|
+
preview: ((_c2 = ctx.previewData) == null ? void 0 : _c2.makeswift) === true
|
|
1173
1163
|
});
|
|
1174
1164
|
if (snapshot == null)
|
|
1175
1165
|
return {
|
|
@@ -1320,7 +1310,7 @@ function registerComponent$c(runtime) {
|
|
|
1320
1310
|
props: {
|
|
1321
1311
|
id: ElementID(),
|
|
1322
1312
|
backgrounds: Backgrounds(),
|
|
1323
|
-
width: Width(),
|
|
1313
|
+
width: Width({ format: Width.Format.ClassName }),
|
|
1324
1314
|
height: ResponsiveIconRadioGroup({
|
|
1325
1315
|
label: "Height",
|
|
1326
1316
|
options: [
|
|
@@ -1343,8 +1333,9 @@ function registerComponent$c(runtime) {
|
|
|
1343
1333
|
],
|
|
1344
1334
|
defaultValue: "flex-start"
|
|
1345
1335
|
}),
|
|
1346
|
-
margin: Margin(),
|
|
1336
|
+
margin: Margin({ format: Margin.Format.ClassName }),
|
|
1347
1337
|
padding: Padding({
|
|
1338
|
+
format: Padding.Format.ClassName,
|
|
1348
1339
|
preset: [
|
|
1349
1340
|
{
|
|
1350
1341
|
deviceId: "desktop",
|
|
@@ -1357,9 +1348,9 @@ function registerComponent$c(runtime) {
|
|
|
1357
1348
|
}
|
|
1358
1349
|
]
|
|
1359
1350
|
}),
|
|
1360
|
-
border: Border(),
|
|
1361
|
-
borderRadius: BorderRadius(),
|
|
1362
|
-
boxShadow: Shadows(),
|
|
1351
|
+
border: Border({ format: Border.Format.ClassName }),
|
|
1352
|
+
borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),
|
|
1353
|
+
boxShadow: Shadows({ format: Shadows.Format.ClassName }),
|
|
1363
1354
|
rowGap: GapY((props) => ({
|
|
1364
1355
|
hidden: props.children == null
|
|
1365
1356
|
})),
|
|
@@ -1506,7 +1497,7 @@ function registerComponent$b(runtime) {
|
|
|
1506
1497
|
}),
|
|
1507
1498
|
textStyle: TextStyle(),
|
|
1508
1499
|
width: Width(),
|
|
1509
|
-
margin: Margin()
|
|
1500
|
+
margin: Margin({ format: Margin.Format.ClassName })
|
|
1510
1501
|
}
|
|
1511
1502
|
});
|
|
1512
1503
|
}
|
|
@@ -1524,8 +1515,11 @@ function registerComponent$a(runtime) {
|
|
|
1524
1515
|
{ key: uuid(), props: {} }
|
|
1525
1516
|
]
|
|
1526
1517
|
}),
|
|
1527
|
-
width: Width({
|
|
1528
|
-
|
|
1518
|
+
width: Width({
|
|
1519
|
+
format: Width.Format.ClassName,
|
|
1520
|
+
defaultValue: { value: 400, unit: "px" }
|
|
1521
|
+
}),
|
|
1522
|
+
margin: Margin({ format: Margin.Format.ClassName }),
|
|
1529
1523
|
pageSize: ResponsiveNumber((props) => {
|
|
1530
1524
|
var _a;
|
|
1531
1525
|
const images = props.images;
|
|
@@ -1565,7 +1559,7 @@ function registerComponent$a(runtime) {
|
|
|
1565
1559
|
defaultValue: { value: 0, unit: "px" }
|
|
1566
1560
|
}),
|
|
1567
1561
|
autoplay: Checkbox({ label: "Autoplay" }),
|
|
1568
|
-
delay: Number((props) => ({
|
|
1562
|
+
delay: Number$1((props) => ({
|
|
1569
1563
|
label: "Delay",
|
|
1570
1564
|
preset: 5,
|
|
1571
1565
|
min: 1,
|
|
@@ -1600,8 +1594,8 @@ function registerComponent$a(runtime) {
|
|
|
1600
1594
|
placeholder: "black",
|
|
1601
1595
|
hidden: props.showDots === false
|
|
1602
1596
|
})),
|
|
1603
|
-
slideBorder: Border(),
|
|
1604
|
-
slideBorderRadius: BorderRadius()
|
|
1597
|
+
slideBorder: Border({ format: Border.Format.ClassName }),
|
|
1598
|
+
slideBorderRadius: BorderRadius({ format: BorderRadius.Format.ClassName })
|
|
1605
1599
|
}
|
|
1606
1600
|
});
|
|
1607
1601
|
}
|
|
@@ -1674,8 +1668,11 @@ function registerComponent$9(runtime) {
|
|
|
1674
1668
|
label: "Label color",
|
|
1675
1669
|
placeholder: "black"
|
|
1676
1670
|
}),
|
|
1677
|
-
width: Width({
|
|
1678
|
-
|
|
1671
|
+
width: Width({
|
|
1672
|
+
format: Width.Format.ClassName,
|
|
1673
|
+
defaultValue: { value: 560, unit: "px" }
|
|
1674
|
+
}),
|
|
1675
|
+
margin: Margin({ format: Margin.Format.ClassName }),
|
|
1679
1676
|
daysLabel: TextInput({ label: "Days label", placeholder: "Days" }),
|
|
1680
1677
|
hoursLabel: TextInput({ label: "Hours label", placeholder: "Hours" }),
|
|
1681
1678
|
minutesLabel: TextInput({
|
|
@@ -1713,8 +1710,11 @@ function registerComponent$8(runtime) {
|
|
|
1713
1710
|
options: [{ value: "px", label: "Pixels", icon: "Px16" }]
|
|
1714
1711
|
}),
|
|
1715
1712
|
color: ResponsiveColor({ placeholder: "black" }),
|
|
1716
|
-
width: Width({
|
|
1717
|
-
|
|
1713
|
+
width: Width({
|
|
1714
|
+
format: Width.Format.ClassName,
|
|
1715
|
+
defaultValue: { value: 100, unit: "%" }
|
|
1716
|
+
}),
|
|
1717
|
+
margin: Margin({ format: Margin.Format.ClassName })
|
|
1718
1718
|
}
|
|
1719
1719
|
});
|
|
1720
1720
|
}
|
|
@@ -1726,8 +1726,8 @@ function registerComponent$7(runtime) {
|
|
|
1726
1726
|
props: {
|
|
1727
1727
|
id: ElementID(),
|
|
1728
1728
|
html: TextArea({ label: "Code", rows: 20 }),
|
|
1729
|
-
width: Width({}),
|
|
1730
|
-
margin: Margin()
|
|
1729
|
+
width: Width({ format: Width.Format.ClassName }),
|
|
1730
|
+
margin: Margin({ format: Margin.Format.ClassName })
|
|
1731
1731
|
}
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
@@ -1864,9 +1864,10 @@ function registerComponent$6(runtime) {
|
|
|
1864
1864
|
})),
|
|
1865
1865
|
width: Width({
|
|
1866
1866
|
preset: [{ deviceId: "desktop", value: { value: 550, unit: "px" } }],
|
|
1867
|
-
defaultValue: { value: 100, unit: "%" }
|
|
1867
|
+
defaultValue: { value: 100, unit: "%" },
|
|
1868
|
+
format: Width.Format.ClassName
|
|
1868
1869
|
}),
|
|
1869
|
-
margin: Margin()
|
|
1870
|
+
margin: Margin({ format: Margin.Format.ClassName })
|
|
1870
1871
|
}
|
|
1871
1872
|
});
|
|
1872
1873
|
}
|
|
@@ -1880,11 +1881,11 @@ function registerComponent$5(runtime) {
|
|
|
1880
1881
|
altText: TextInput({ label: "Alt text" }),
|
|
1881
1882
|
link: Link({ label: "On click" }),
|
|
1882
1883
|
width: Width(),
|
|
1883
|
-
margin: Margin(),
|
|
1884
|
-
padding: Padding(),
|
|
1885
|
-
border: Border(),
|
|
1886
|
-
borderRadius: BorderRadius(),
|
|
1887
|
-
boxShadow: Shadows(),
|
|
1884
|
+
margin: Margin({ format: Margin.Format.ClassName }),
|
|
1885
|
+
padding: Padding({ format: Padding.Format.ClassName }),
|
|
1886
|
+
border: Border({ format: Border.Format.ClassName }),
|
|
1887
|
+
borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),
|
|
1888
|
+
boxShadow: Shadows({ format: Shadows.Format.ClassName }),
|
|
1888
1889
|
opacity: ResponsiveOpacity()
|
|
1889
1890
|
}
|
|
1890
1891
|
});
|
|
@@ -1976,8 +1977,11 @@ function registerComponent$4(runtime) {
|
|
|
1976
1977
|
hidden
|
|
1977
1978
|
};
|
|
1978
1979
|
}),
|
|
1979
|
-
width: Width({
|
|
1980
|
-
|
|
1980
|
+
width: Width({
|
|
1981
|
+
format: Width.Format.ClassName,
|
|
1982
|
+
defaultValue: { value: 100, unit: "%" }
|
|
1983
|
+
}),
|
|
1984
|
+
margin: Margin({ format: Margin.Format.ClassName })
|
|
1981
1985
|
}
|
|
1982
1986
|
});
|
|
1983
1987
|
}
|
|
@@ -2096,8 +2100,12 @@ function registerComponent$2(runtime) {
|
|
|
2096
2100
|
step: 1,
|
|
2097
2101
|
defaultValue: { value: 0, unit: "px" }
|
|
2098
2102
|
}),
|
|
2099
|
-
width: Width({
|
|
2103
|
+
width: Width({
|
|
2104
|
+
format: Width.Format.ClassName,
|
|
2105
|
+
defaultValue: { value: 100, unit: "%" }
|
|
2106
|
+
}),
|
|
2100
2107
|
margin: Margin({
|
|
2108
|
+
format: Margin.Format.ClassName,
|
|
2101
2109
|
preset: [
|
|
2102
2110
|
{
|
|
2103
2111
|
deviceId: "desktop",
|
|
@@ -2163,10 +2171,12 @@ function registerComponent$1(runtime) {
|
|
|
2163
2171
|
}
|
|
2164
2172
|
})),
|
|
2165
2173
|
width: Width({
|
|
2174
|
+
format: Width.Format.ClassName,
|
|
2166
2175
|
preset: [{ deviceId: "desktop", value: { value: 700, unit: "px" } }],
|
|
2167
2176
|
defaultValue: { value: 100, unit: "%" }
|
|
2168
2177
|
}),
|
|
2169
2178
|
margin: Margin({
|
|
2179
|
+
format: Margin.Format.ClassName,
|
|
2170
2180
|
preset: [
|
|
2171
2181
|
{
|
|
2172
2182
|
deviceId: "desktop",
|
|
@@ -2190,9 +2200,12 @@ function registerComponent(runtime) {
|
|
|
2190
2200
|
props: {
|
|
2191
2201
|
id: ElementID(),
|
|
2192
2202
|
video: Video({ preset: { controls: true } }),
|
|
2193
|
-
width: Width({
|
|
2194
|
-
|
|
2195
|
-
|
|
2203
|
+
width: Width({
|
|
2204
|
+
format: Width.Format.ClassName,
|
|
2205
|
+
defaultValue: { value: 560, unit: "px" }
|
|
2206
|
+
}),
|
|
2207
|
+
margin: Margin({ format: Margin.Format.ClassName }),
|
|
2208
|
+
borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName })
|
|
2196
2209
|
}
|
|
2197
2210
|
});
|
|
2198
2211
|
}
|
|
@@ -2227,149 +2240,6 @@ function registerBuiltinComponents(runtime) {
|
|
|
2227
2240
|
unregisterVideoComponent();
|
|
2228
2241
|
};
|
|
2229
2242
|
}
|
|
2230
|
-
var _path;
|
|
2231
|
-
function _extends() {
|
|
2232
|
-
_extends = Object.assign || function(target) {
|
|
2233
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2234
|
-
var source = arguments[i];
|
|
2235
|
-
for (var key in source) {
|
|
2236
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2237
|
-
target[key] = source[key];
|
|
2238
|
-
}
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
return target;
|
|
2242
|
-
};
|
|
2243
|
-
return _extends.apply(this, arguments);
|
|
2244
|
-
}
|
|
2245
|
-
var SvgWarning20 = function SvgWarning202(props) {
|
|
2246
|
-
return /* @__PURE__ */ React.createElement("svg", _extends({
|
|
2247
|
-
width: 20,
|
|
2248
|
-
height: 20,
|
|
2249
|
-
viewBox: "0 0 20 20",
|
|
2250
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2251
|
-
}, props), _path || (_path = /* @__PURE__ */ React.createElement("path", {
|
|
2252
|
-
fillRule: "evenodd",
|
|
2253
|
-
clipRule: "evenodd",
|
|
2254
|
-
d: "M2.89864 18H17.1014C18.4183 18 19.2633 16.6003 18.65 15.4349L11.5486 1.94236C10.8925 0.69577 9.10749 0.695766 8.45139 1.94236L1.35003 15.4349C0.736692 16.6003 1.58174 18 2.89864 18ZM9 6C9 5.44772 9.44771 5 10 5C10.5523 5 11 5.44772 11 6V11C11 11.5523 10.5523 12 10 12C9.44771 12 9 11.5523 9 11V6ZM11.25 14.75C11.25 15.4404 10.6904 16 10 16C9.30964 16 8.75 15.4404 8.75 14.75C8.75 14.0596 9.30964 13.5 10 13.5C10.6904 13.5 11.25 14.0596 11.25 14.75Z"
|
|
2255
|
-
})));
|
|
2256
|
-
};
|
|
2257
|
-
const ErrorDiv = styled("div")`
|
|
2258
|
-
width: 100%;
|
|
2259
|
-
height: 54px;
|
|
2260
|
-
background-color: #fcedf2;
|
|
2261
|
-
border-radius: 6px;
|
|
2262
|
-
padding: 16px;
|
|
2263
|
-
display: flex;
|
|
2264
|
-
align-items: center;
|
|
2265
|
-
gap: 8px;
|
|
2266
|
-
color: #c73e6d;
|
|
2267
|
-
fill: currentColor;
|
|
2268
|
-
font-family: Heebo, sans-serif;
|
|
2269
|
-
font-size: 16px;
|
|
2270
|
-
`;
|
|
2271
|
-
const FallbackComponent = forwardRef(function FallbackComponent2({
|
|
2272
|
-
text
|
|
2273
|
-
}, ref) {
|
|
2274
|
-
return /* @__PURE__ */ jsxs(ErrorDiv, {
|
|
2275
|
-
ref,
|
|
2276
|
-
children: [/* @__PURE__ */ jsx(SvgWarning20, {}), /* @__PURE__ */ jsx("span", {
|
|
2277
|
-
children: text
|
|
2278
|
-
})]
|
|
2279
|
-
});
|
|
2280
|
-
});
|
|
2281
|
-
function isNonNullable(value) {
|
|
2282
|
-
return value != null;
|
|
2283
|
-
}
|
|
2284
|
-
function mapSideColor(swatches, _c) {
|
|
2285
|
-
var _d = _c, { color } = _d, restOfSide = __objRest(_d, ["color"]);
|
|
2286
|
-
return __spreadProps(__spreadValues({}, restOfSide), {
|
|
2287
|
-
color: color && {
|
|
2288
|
-
alpha: color.alpha,
|
|
2289
|
-
swatch: swatches.find((s) => s && s.id === color.swatchId)
|
|
2290
|
-
}
|
|
2291
|
-
});
|
|
2292
|
-
}
|
|
2293
|
-
function useBorder(value) {
|
|
2294
|
-
const swatchIds = value == null ? [] : [
|
|
2295
|
-
...Array.from(new Set(value.map(({ value: { borderTop, borderLeft, borderBottom, borderRight } }) => [
|
|
2296
|
-
borderTop && borderTop.color && borderTop.color.swatchId,
|
|
2297
|
-
borderBottom && borderBottom.color && borderBottom.color.swatchId,
|
|
2298
|
-
borderLeft && borderLeft.color && borderLeft.color.swatchId,
|
|
2299
|
-
borderRight && borderRight.color && borderRight.color.swatchId
|
|
2300
|
-
]).reduce((a, b) => a.concat(b)).filter(isNonNullable)))
|
|
2301
|
-
];
|
|
2302
|
-
const skip = value == null || swatchIds.length === 0;
|
|
2303
|
-
const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
|
|
2304
|
-
if (value == null || error != null)
|
|
2305
|
-
return null;
|
|
2306
|
-
const { swatches = [] } = data;
|
|
2307
|
-
return value.map((_a) => {
|
|
2308
|
-
var _b = _a, { value: { borderTop, borderBottom, borderLeft, borderRight } } = _b, rest = __objRest(_b, ["value"]);
|
|
2309
|
-
return __spreadProps(__spreadValues({}, rest), {
|
|
2310
|
-
value: {
|
|
2311
|
-
borderTop: borderTop && mapSideColor(swatches, borderTop),
|
|
2312
|
-
borderBottom: borderBottom && mapSideColor(swatches, borderBottom),
|
|
2313
|
-
borderLeft: borderLeft && mapSideColor(swatches, borderLeft),
|
|
2314
|
-
borderRight: borderRight && mapSideColor(swatches, borderRight)
|
|
2315
|
-
}
|
|
2316
|
-
});
|
|
2317
|
-
});
|
|
2318
|
-
}
|
|
2319
|
-
function useResponsiveColor(color) {
|
|
2320
|
-
const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
|
|
2321
|
-
const skip = swatchIds.length === 0;
|
|
2322
|
-
const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
|
|
2323
|
-
if (color == null || error != null)
|
|
2324
|
-
return null;
|
|
2325
|
-
const { swatches = [] } = data;
|
|
2326
|
-
return color.map((_a) => {
|
|
2327
|
-
var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
|
|
2328
|
-
const { swatchId, alpha } = v;
|
|
2329
|
-
const swatch = swatches.find((s) => s && s.id === swatchId);
|
|
2330
|
-
return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
|
|
2331
|
-
}).filter(isNonNullable);
|
|
2332
|
-
}
|
|
2333
|
-
function useFile(fileId) {
|
|
2334
|
-
const { error, data = {} } = useQuery(FILE_BY_ID, {
|
|
2335
|
-
skip: fileId == null,
|
|
2336
|
-
variables: { id: fileId }
|
|
2337
|
-
});
|
|
2338
|
-
if (fileId == null || error != null)
|
|
2339
|
-
return null;
|
|
2340
|
-
return data.file;
|
|
2341
|
-
}
|
|
2342
|
-
const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
|
|
2343
|
-
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
2344
|
-
function usePage(pageId) {
|
|
2345
|
-
const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
|
|
2346
|
-
skip: pageId == null,
|
|
2347
|
-
variables: { ids: [pageId] }
|
|
2348
|
-
});
|
|
2349
|
-
if (pageId == null || error != null)
|
|
2350
|
-
return null;
|
|
2351
|
-
const { pagePathnamesById: [page] = [] } = data;
|
|
2352
|
-
return page;
|
|
2353
|
-
}
|
|
2354
|
-
function responsiveStyle(responsiveValues, join$1, strategy) {
|
|
2355
|
-
return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
|
|
2356
|
-
const device = getDevice(deviceId);
|
|
2357
|
-
const mediaQuery = getDeviceMediaQuery(device);
|
|
2358
|
-
return __spreadProps(__spreadValues({}, acc), {
|
|
2359
|
-
[mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
|
|
2360
|
-
});
|
|
2361
|
-
}, {});
|
|
2362
|
-
}
|
|
2363
|
-
function responsiveWidth(widthData, defaultValue = "100%") {
|
|
2364
|
-
return __spreadValues({
|
|
2365
|
-
maxWidth: "100%"
|
|
2366
|
-
}, responsiveStyle([widthData], ([width = defaultValue]) => ({
|
|
2367
|
-
width: typeof width === "object" ? `${width.value}${width.unit}` : width
|
|
2368
|
-
})));
|
|
2369
|
-
}
|
|
2370
|
-
function colorToString(color) {
|
|
2371
|
-
return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
|
|
2372
|
-
}
|
|
2373
2243
|
function murmur2(str) {
|
|
2374
2244
|
var h = 0;
|
|
2375
2245
|
var k, i = 0, len = str.length;
|
|
@@ -2630,7 +2500,7 @@ var insertStyles = function insertStyles2(cache2, serialized, isStringTag) {
|
|
|
2630
2500
|
};
|
|
2631
2501
|
const isServer = typeof window === "undefined";
|
|
2632
2502
|
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2633
|
-
const useInsertionEffect = (
|
|
2503
|
+
const useInsertionEffect = (_c = React[useInsertionEffectSpecifier]) != null ? _c : React.useLayoutEffect;
|
|
2634
2504
|
function useStyle(style) {
|
|
2635
2505
|
const serialized = serializeStyles([style], cache.registered);
|
|
2636
2506
|
registerStyles(cache, serialized, false);
|
|
@@ -2641,6 +2511,379 @@ function useStyle(style) {
|
|
|
2641
2511
|
insertStyles(cache, serialized, false);
|
|
2642
2512
|
return `${cache.key}-${serialized.name}`;
|
|
2643
2513
|
}
|
|
2514
|
+
var _path;
|
|
2515
|
+
function _extends() {
|
|
2516
|
+
_extends = Object.assign || function(target) {
|
|
2517
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2518
|
+
var source = arguments[i];
|
|
2519
|
+
for (var key in source) {
|
|
2520
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2521
|
+
target[key] = source[key];
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
return target;
|
|
2526
|
+
};
|
|
2527
|
+
return _extends.apply(this, arguments);
|
|
2528
|
+
}
|
|
2529
|
+
var SvgWarning20 = function SvgWarning202(props) {
|
|
2530
|
+
return /* @__PURE__ */ React.createElement("svg", _extends({
|
|
2531
|
+
width: 20,
|
|
2532
|
+
height: 20,
|
|
2533
|
+
viewBox: "0 0 20 20",
|
|
2534
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2535
|
+
}, props), _path || (_path = /* @__PURE__ */ React.createElement("path", {
|
|
2536
|
+
fillRule: "evenodd",
|
|
2537
|
+
clipRule: "evenodd",
|
|
2538
|
+
d: "M2.89864 18H17.1014C18.4183 18 19.2633 16.6003 18.65 15.4349L11.5486 1.94236C10.8925 0.69577 9.10749 0.695766 8.45139 1.94236L1.35003 15.4349C0.736692 16.6003 1.58174 18 2.89864 18ZM9 6C9 5.44772 9.44771 5 10 5C10.5523 5 11 5.44772 11 6V11C11 11.5523 10.5523 12 10 12C9.44771 12 9 11.5523 9 11V6ZM11.25 14.75C11.25 15.4404 10.6904 16 10 16C9.30964 16 8.75 15.4404 8.75 14.75C8.75 14.0596 9.30964 13.5 10 13.5C10.6904 13.5 11.25 14.0596 11.25 14.75Z"
|
|
2539
|
+
})));
|
|
2540
|
+
};
|
|
2541
|
+
const FallbackComponent = forwardRef(function FallbackComponent2({
|
|
2542
|
+
text
|
|
2543
|
+
}, ref) {
|
|
2544
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2545
|
+
ref,
|
|
2546
|
+
className: useStyle({
|
|
2547
|
+
width: "100%",
|
|
2548
|
+
height: 54,
|
|
2549
|
+
backgroundColor: "#fcedf2",
|
|
2550
|
+
borderRadius: 6,
|
|
2551
|
+
padding: 16,
|
|
2552
|
+
display: "flex",
|
|
2553
|
+
alignItems: "center",
|
|
2554
|
+
gap: 8,
|
|
2555
|
+
color: "#c73e6d",
|
|
2556
|
+
fill: "currentColor",
|
|
2557
|
+
fontFamily: "Heebo, sans-serif",
|
|
2558
|
+
fontSize: 16
|
|
2559
|
+
}),
|
|
2560
|
+
children: [/* @__PURE__ */ jsx(SvgWarning20, {}), /* @__PURE__ */ jsx("span", {
|
|
2561
|
+
children: text
|
|
2562
|
+
})]
|
|
2563
|
+
});
|
|
2564
|
+
});
|
|
2565
|
+
function isNonNullable(value) {
|
|
2566
|
+
return value != null;
|
|
2567
|
+
}
|
|
2568
|
+
function mapSideColor(swatches, _d) {
|
|
2569
|
+
var _e = _d, { color } = _e, restOfSide = __objRest(_e, ["color"]);
|
|
2570
|
+
return __spreadProps(__spreadValues({}, restOfSide), {
|
|
2571
|
+
color: color && {
|
|
2572
|
+
alpha: color.alpha,
|
|
2573
|
+
swatch: swatches.find((s) => s && s.id === color.swatchId)
|
|
2574
|
+
}
|
|
2575
|
+
});
|
|
2576
|
+
}
|
|
2577
|
+
function useBorder(value) {
|
|
2578
|
+
const swatchIds = value == null ? [] : [
|
|
2579
|
+
...Array.from(new Set(value.map(({ value: { borderTop, borderLeft, borderBottom, borderRight } }) => [
|
|
2580
|
+
borderTop && borderTop.color && borderTop.color.swatchId,
|
|
2581
|
+
borderBottom && borderBottom.color && borderBottom.color.swatchId,
|
|
2582
|
+
borderLeft && borderLeft.color && borderLeft.color.swatchId,
|
|
2583
|
+
borderRight && borderRight.color && borderRight.color.swatchId
|
|
2584
|
+
]).reduce((a, b) => a.concat(b)).filter(isNonNullable)))
|
|
2585
|
+
];
|
|
2586
|
+
const skip = value == null || swatchIds.length === 0;
|
|
2587
|
+
const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
|
|
2588
|
+
if (value == null || error != null)
|
|
2589
|
+
return null;
|
|
2590
|
+
const { swatches = [] } = data;
|
|
2591
|
+
return value.map((_a) => {
|
|
2592
|
+
var _b = _a, { value: { borderTop, borderBottom, borderLeft, borderRight } } = _b, rest = __objRest(_b, ["value"]);
|
|
2593
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
2594
|
+
value: {
|
|
2595
|
+
borderTop: borderTop && mapSideColor(swatches, borderTop),
|
|
2596
|
+
borderBottom: borderBottom && mapSideColor(swatches, borderBottom),
|
|
2597
|
+
borderLeft: borderLeft && mapSideColor(swatches, borderLeft),
|
|
2598
|
+
borderRight: borderRight && mapSideColor(swatches, borderRight)
|
|
2599
|
+
}
|
|
2600
|
+
});
|
|
2601
|
+
});
|
|
2602
|
+
}
|
|
2603
|
+
const ShadowDefaultValue = {
|
|
2604
|
+
inset: false,
|
|
2605
|
+
offsetX: 0,
|
|
2606
|
+
offsetY: 2,
|
|
2607
|
+
blurRadius: 4,
|
|
2608
|
+
spreadRadius: 0,
|
|
2609
|
+
color: null
|
|
2610
|
+
};
|
|
2611
|
+
function useBoxShadow(value) {
|
|
2612
|
+
const swatchIds = value == null ? [] : [
|
|
2613
|
+
...Array.from(new Set(value.map(({ value: shadows }) => shadows.map(({ payload: { color } }) => color && color.swatchId)).reduce((a, b) => a.concat(b), []).filter(isNonNullable)))
|
|
2614
|
+
];
|
|
2615
|
+
const skip = value == null || swatchIds.length === 0;
|
|
2616
|
+
const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
|
|
2617
|
+
if (value == null || error != null)
|
|
2618
|
+
return null;
|
|
2619
|
+
const { swatches = [] } = data;
|
|
2620
|
+
return value.map((_a) => {
|
|
2621
|
+
var _b = _a, { value: shadows } = _b, restOfValue = __objRest(_b, ["value"]);
|
|
2622
|
+
return __spreadProps(__spreadValues({}, restOfValue), {
|
|
2623
|
+
value: shadows.map((_a2) => {
|
|
2624
|
+
var _b2 = _a2, {
|
|
2625
|
+
payload: { color, inset, offsetX, offsetY, blurRadius, spreadRadius }
|
|
2626
|
+
} = _b2, restOfShadow = __objRest(_b2, [
|
|
2627
|
+
"payload"
|
|
2628
|
+
]);
|
|
2629
|
+
return __spreadProps(__spreadValues({}, restOfShadow), {
|
|
2630
|
+
payload: {
|
|
2631
|
+
color: color != null ? {
|
|
2632
|
+
swatch: swatches.find((s) => s && s.id === color.swatchId),
|
|
2633
|
+
alpha: color.alpha
|
|
2634
|
+
} : null,
|
|
2635
|
+
inset: inset != null ? inset : ShadowDefaultValue.inset,
|
|
2636
|
+
offsetX: offsetX != null ? offsetX : ShadowDefaultValue.offsetX,
|
|
2637
|
+
offsetY: offsetY != null ? offsetY : ShadowDefaultValue.offsetY,
|
|
2638
|
+
blurRadius: blurRadius != null ? blurRadius : ShadowDefaultValue.blurRadius,
|
|
2639
|
+
spreadRadius: spreadRadius != null ? spreadRadius : ShadowDefaultValue.spreadRadius
|
|
2640
|
+
}
|
|
2641
|
+
});
|
|
2642
|
+
})
|
|
2643
|
+
});
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2646
|
+
function useResponsiveColor(color) {
|
|
2647
|
+
const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
|
|
2648
|
+
const skip = swatchIds.length === 0;
|
|
2649
|
+
const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
|
|
2650
|
+
if (color == null || error != null)
|
|
2651
|
+
return null;
|
|
2652
|
+
const { swatches = [] } = data;
|
|
2653
|
+
return color.map((_a) => {
|
|
2654
|
+
var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
|
|
2655
|
+
const { swatchId, alpha } = v;
|
|
2656
|
+
const swatch = swatches.find((s) => s && s.id === swatchId);
|
|
2657
|
+
return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
|
|
2658
|
+
}).filter(isNonNullable);
|
|
2659
|
+
}
|
|
2660
|
+
function useFile(fileId) {
|
|
2661
|
+
const { error, data = {} } = useQuery(FILE_BY_ID, {
|
|
2662
|
+
skip: fileId == null,
|
|
2663
|
+
variables: { id: fileId }
|
|
2664
|
+
});
|
|
2665
|
+
if (fileId == null || error != null)
|
|
2666
|
+
return null;
|
|
2667
|
+
return data.file;
|
|
2668
|
+
}
|
|
2669
|
+
const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
|
|
2670
|
+
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
2671
|
+
function usePage(pageId) {
|
|
2672
|
+
const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
|
|
2673
|
+
skip: pageId == null,
|
|
2674
|
+
variables: { ids: [pageId] }
|
|
2675
|
+
});
|
|
2676
|
+
if (pageId == null || error != null)
|
|
2677
|
+
return null;
|
|
2678
|
+
const { pagePathnamesById: [page] = [] } = data;
|
|
2679
|
+
return page;
|
|
2680
|
+
}
|
|
2681
|
+
const getIndexes = (spans, index) => {
|
|
2682
|
+
const flattened = spans.reduce((a, s) => a.concat(s), []);
|
|
2683
|
+
if (index < 0 || index > flattened.length)
|
|
2684
|
+
throw new RangeError();
|
|
2685
|
+
let remainder = index;
|
|
2686
|
+
let rowIndex = 0;
|
|
2687
|
+
while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
|
|
2688
|
+
remainder -= spans[rowIndex].length;
|
|
2689
|
+
rowIndex += 1;
|
|
2690
|
+
}
|
|
2691
|
+
return [rowIndex, remainder];
|
|
2692
|
+
};
|
|
2693
|
+
function lengthDataToString(data) {
|
|
2694
|
+
if (typeof data === "object")
|
|
2695
|
+
return `${data.value}${data.unit}`;
|
|
2696
|
+
if (typeof data === "number")
|
|
2697
|
+
return `${data}px`;
|
|
2698
|
+
return data;
|
|
2699
|
+
}
|
|
2700
|
+
function paddingPropertyDataToStyle(data, defaultValue = {}) {
|
|
2701
|
+
var _a, _b, _c2, _d;
|
|
2702
|
+
const paddingTop = (_a = data.paddingTop) != null ? _a : defaultValue.paddingTop;
|
|
2703
|
+
const paddingRight = (_b = data.paddingRight) != null ? _b : defaultValue.paddingRight;
|
|
2704
|
+
const paddingBottom = (_c2 = data.paddingBottom) != null ? _c2 : defaultValue.paddingBottom;
|
|
2705
|
+
const paddingLeft = (_d = data.paddingLeft) != null ? _d : defaultValue.paddingLeft;
|
|
2706
|
+
const style = {};
|
|
2707
|
+
if (paddingTop)
|
|
2708
|
+
style.paddingTop = lengthDataToString(paddingTop);
|
|
2709
|
+
if (paddingRight)
|
|
2710
|
+
style.paddingRight = lengthDataToString(paddingRight);
|
|
2711
|
+
if (paddingBottom)
|
|
2712
|
+
style.paddingBottom = lengthDataToString(paddingBottom);
|
|
2713
|
+
if (paddingLeft)
|
|
2714
|
+
style.paddingLeft = lengthDataToString(paddingLeft);
|
|
2715
|
+
return style;
|
|
2716
|
+
}
|
|
2717
|
+
function marginPropertyDataToStyle(data, defaultValue = {}) {
|
|
2718
|
+
var _a, _b, _c2, _d;
|
|
2719
|
+
const marginTop = (_a = data.marginTop) != null ? _a : defaultValue.marginTop;
|
|
2720
|
+
const marginRight = (_b = data.marginRight) != null ? _b : defaultValue.marginRight;
|
|
2721
|
+
const marginBottom = (_c2 = data.marginBottom) != null ? _c2 : defaultValue.marginBottom;
|
|
2722
|
+
const marginLeft = (_d = data.marginLeft) != null ? _d : defaultValue.marginLeft;
|
|
2723
|
+
const style = {};
|
|
2724
|
+
if (marginTop)
|
|
2725
|
+
style.marginTop = lengthDataToString(marginTop);
|
|
2726
|
+
if (marginRight)
|
|
2727
|
+
style.marginRight = lengthDataToString(marginRight);
|
|
2728
|
+
if (marginBottom)
|
|
2729
|
+
style.marginBottom = lengthDataToString(marginBottom);
|
|
2730
|
+
if (marginLeft)
|
|
2731
|
+
style.marginLeft = lengthDataToString(marginLeft);
|
|
2732
|
+
return style;
|
|
2733
|
+
}
|
|
2734
|
+
function lengthPercentageDataToString(data) {
|
|
2735
|
+
if (typeof data === "object")
|
|
2736
|
+
return `${data.value}${data.unit}`;
|
|
2737
|
+
if (typeof data === "number")
|
|
2738
|
+
return `${data}px`;
|
|
2739
|
+
return data;
|
|
2740
|
+
}
|
|
2741
|
+
function borderRadiusPropertyDataToStyle(data, defaultValue = {}) {
|
|
2742
|
+
var _a, _b, _c2, _d;
|
|
2743
|
+
const borderTopLeftRadius = (_a = data.borderTopLeftRadius) != null ? _a : defaultValue.borderTopLeftRadius;
|
|
2744
|
+
const borderTopRightRadius = (_b = data.borderTopRightRadius) != null ? _b : defaultValue.borderTopRightRadius;
|
|
2745
|
+
const borderBottomRightRadius = (_c2 = data.borderBottomRightRadius) != null ? _c2 : defaultValue.borderBottomRightRadius;
|
|
2746
|
+
const borderBottomLeftRadius = (_d = data.borderBottomLeftRadius) != null ? _d : defaultValue.borderBottomLeftRadius;
|
|
2747
|
+
const style = {};
|
|
2748
|
+
if (borderTopLeftRadius) {
|
|
2749
|
+
style.borderTopLeftRadius = lengthPercentageDataToString(borderTopLeftRadius);
|
|
2750
|
+
}
|
|
2751
|
+
if (borderTopRightRadius) {
|
|
2752
|
+
style.borderTopRightRadius = lengthPercentageDataToString(borderTopRightRadius);
|
|
2753
|
+
}
|
|
2754
|
+
if (borderBottomRightRadius) {
|
|
2755
|
+
style.borderBottomRightRadius = lengthPercentageDataToString(borderBottomRightRadius);
|
|
2756
|
+
}
|
|
2757
|
+
if (borderBottomLeftRadius) {
|
|
2758
|
+
style.borderBottomLeftRadius = lengthPercentageDataToString(borderBottomLeftRadius);
|
|
2759
|
+
}
|
|
2760
|
+
return style;
|
|
2761
|
+
}
|
|
2762
|
+
function colorToString(color) {
|
|
2763
|
+
return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
|
|
2764
|
+
}
|
|
2765
|
+
function borderPropertyDataToStyle(data, defaultValue = {}) {
|
|
2766
|
+
var _a, _b, _c2, _d;
|
|
2767
|
+
const borderTop = (_a = data.borderTop) != null ? _a : defaultValue.borderTop;
|
|
2768
|
+
const borderRight = (_b = data.borderRight) != null ? _b : defaultValue.borderRight;
|
|
2769
|
+
const borderBottom = (_c2 = data.borderBottom) != null ? _c2 : defaultValue.borderBottom;
|
|
2770
|
+
const borderLeft = (_d = data.borderLeft) != null ? _d : defaultValue.borderLeft;
|
|
2771
|
+
const style = {};
|
|
2772
|
+
if (borderTop)
|
|
2773
|
+
style.borderTop = borderSideToString(borderTop);
|
|
2774
|
+
if (borderRight)
|
|
2775
|
+
style.borderRight = borderSideToString(borderRight);
|
|
2776
|
+
if (borderBottom)
|
|
2777
|
+
style.borderBottom = borderSideToString(borderBottom);
|
|
2778
|
+
if (borderLeft)
|
|
2779
|
+
style.borderLeft = borderSideToString(borderLeft);
|
|
2780
|
+
return style;
|
|
2781
|
+
}
|
|
2782
|
+
function borderSideToString(borderSide) {
|
|
2783
|
+
if (typeof borderSide === "string")
|
|
2784
|
+
return borderSide;
|
|
2785
|
+
if (typeof borderSide === "number")
|
|
2786
|
+
return `${borderSide}px`;
|
|
2787
|
+
const { width, color, style } = borderSide;
|
|
2788
|
+
return `${width != null ? width : 0}px ${style} ${color != null ? colorToString(color) : "black"}`;
|
|
2789
|
+
}
|
|
2790
|
+
function responsiveStyle(responsiveValues, join$1, strategy) {
|
|
2791
|
+
return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
|
|
2792
|
+
const device = getDevice(deviceId);
|
|
2793
|
+
const mediaQuery = getDeviceMediaQuery(device);
|
|
2794
|
+
return __spreadProps(__spreadValues({}, acc), {
|
|
2795
|
+
[mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
|
|
2796
|
+
});
|
|
2797
|
+
}, {});
|
|
2798
|
+
}
|
|
2799
|
+
function responsiveWidth(widthData, defaultValue = "100%") {
|
|
2800
|
+
return __spreadValues({
|
|
2801
|
+
maxWidth: "100%"
|
|
2802
|
+
}, responsiveStyle([widthData], ([width = defaultValue]) => ({
|
|
2803
|
+
width: typeof width === "object" ? `${width.value}${width.unit}` : width
|
|
2804
|
+
})));
|
|
2805
|
+
}
|
|
2806
|
+
function responsivePadding(paddingData, defaultValue = {}) {
|
|
2807
|
+
return responsiveStyle([paddingData], ([padding = {}]) => paddingPropertyDataToStyle(padding, Object.assign({ paddingTop: 0, paddingRight: 0, paddingBottom: 0, paddingLeft: 0 }, defaultValue)));
|
|
2808
|
+
}
|
|
2809
|
+
function responsiveMargin(marginData, defaultValue = {}) {
|
|
2810
|
+
return responsiveStyle([marginData], ([margin = {}]) => marginPropertyDataToStyle(margin, Object.assign({ marginTop: 0, marginRight: "auto", marginBottom: 0, marginLeft: "auto" }, defaultValue)));
|
|
2811
|
+
}
|
|
2812
|
+
function responsiveBorderRadius(borderRadiusData, defaultValue = {}) {
|
|
2813
|
+
return responsiveStyle([borderRadiusData], ([borderRadius = {}]) => borderRadiusPropertyDataToStyle(borderRadius, Object.assign({
|
|
2814
|
+
borderTopLeftRadius: 0,
|
|
2815
|
+
borderTopRightRadius: 0,
|
|
2816
|
+
borderBottomRightRadius: 0,
|
|
2817
|
+
borderBottomLeftRadius: 0
|
|
2818
|
+
}, defaultValue)));
|
|
2819
|
+
}
|
|
2820
|
+
function responsiveBorder(borderData, defaultValue = {}) {
|
|
2821
|
+
return responsiveStyle([borderData], ([border = {}]) => borderPropertyDataToStyle(border, Object.assign({
|
|
2822
|
+
borderTop: "0px solid black",
|
|
2823
|
+
borderRight: "0px solid black",
|
|
2824
|
+
borderBottom: "0px solid black",
|
|
2825
|
+
borderLeft: "0px solid black"
|
|
2826
|
+
}, defaultValue)));
|
|
2827
|
+
}
|
|
2828
|
+
const floor = (d) => (v) => Math.floor(10 ** d * v) / 10 ** d;
|
|
2829
|
+
function responsiveGridItem(props) {
|
|
2830
|
+
return __spreadValues({
|
|
2831
|
+
display: "flex"
|
|
2832
|
+
}, responsiveStyle([props.grid, props.columnGap, props.rowGap], ([
|
|
2833
|
+
{ spans, count } = { spans: [[12]], count: 12 },
|
|
2834
|
+
columnGap = { value: 0, unit: "px" },
|
|
2835
|
+
rowGap = { value: 0, unit: "px" }
|
|
2836
|
+
]) => {
|
|
2837
|
+
const [rowIndex, columnIndex] = getIndexes(spans, props.index);
|
|
2838
|
+
const firstCol = columnIndex === 0;
|
|
2839
|
+
const lastCol = columnIndex === spans[rowIndex].length - 1;
|
|
2840
|
+
const span = spans[rowIndex][columnIndex];
|
|
2841
|
+
const fraction = floor(5)(span / count);
|
|
2842
|
+
const width = `${fraction} * (100% + ${columnGap.value}${columnGap.unit})`;
|
|
2843
|
+
const excessWidth = `${Number(firstCol) + Number(lastCol)} * ${columnGap.value}${columnGap.unit} / 2`;
|
|
2844
|
+
const iePrecisionError = "0.01px";
|
|
2845
|
+
const flexBasis = `calc(${width} - ${excessWidth} - ${iePrecisionError})`;
|
|
2846
|
+
const firstRow = rowIndex === 0;
|
|
2847
|
+
const lastRow = rowIndex === spans.length - 1;
|
|
2848
|
+
return span === 0 ? { display: "none" } : {
|
|
2849
|
+
flexBasis,
|
|
2850
|
+
minWidth: flexBasis,
|
|
2851
|
+
maxWidth: flexBasis,
|
|
2852
|
+
paddingLeft: firstCol ? 0 : `${columnGap.value / 2}${columnGap.unit}`,
|
|
2853
|
+
paddingRight: lastCol ? 0 : `${columnGap.value / 2}${columnGap.unit}`,
|
|
2854
|
+
paddingTop: firstRow ? 0 : `${rowGap.value / 2}${rowGap.unit}`,
|
|
2855
|
+
paddingBottom: lastRow ? 0 : `${rowGap.value / 2}${rowGap.unit}`
|
|
2856
|
+
};
|
|
2857
|
+
}));
|
|
2858
|
+
}
|
|
2859
|
+
const getBoxShadow = (shadows) => shadows.map(({ payload: { inset, offsetX, offsetY, blurRadius, spreadRadius, color } }) => `${inset ? "inset " : ""}${offsetX.toFixed(1)}px ${offsetY.toFixed(1)}px ${blurRadius}px ${spreadRadius}px ${color != null ? colorToString(color) : "rgba(0,0,0,0.2)"}`).filter(Boolean).join();
|
|
2860
|
+
function responsiveShadow(value) {
|
|
2861
|
+
return responsiveStyle([value], ([shadow = []]) => ({
|
|
2862
|
+
boxShadow: getBoxShadow(shadow)
|
|
2863
|
+
}));
|
|
2864
|
+
}
|
|
2865
|
+
function responsiveTextStyle(value) {
|
|
2866
|
+
return responsiveStyle([value], ([
|
|
2867
|
+
textStyle = {
|
|
2868
|
+
fontFamily: null,
|
|
2869
|
+
letterSpacing: null,
|
|
2870
|
+
fontSize: null,
|
|
2871
|
+
fontWeight: null,
|
|
2872
|
+
textTransform: [],
|
|
2873
|
+
fontStyle: []
|
|
2874
|
+
}
|
|
2875
|
+
]) => {
|
|
2876
|
+
const {
|
|
2877
|
+
fontSize,
|
|
2878
|
+
fontWeight,
|
|
2879
|
+
fontStyle = [],
|
|
2880
|
+
textTransform = [],
|
|
2881
|
+
letterSpacing,
|
|
2882
|
+
fontFamily
|
|
2883
|
+
} = textStyle;
|
|
2884
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, fontFamily == null ? {} : { fontFamily }), fontWeight == null ? {} : { fontWeight }), letterSpacing == null ? {} : { letterSpacing }), fontSize == null ? {} : { fontSize: `${fontSize.value}${fontSize.unit}` }), textTransform.includes("uppercase") ? { textTransform: "uppercase" } : {}), fontStyle.includes("italic") ? { fontStyle: "italic" } : {});
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2644
2887
|
function useStyleControlCssObject(style, controlDefinition) {
|
|
2645
2888
|
const { properties } = controlDefinition.config;
|
|
2646
2889
|
return __spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
|
|
@@ -2653,52 +2896,40 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2653
2896
|
style == null ? void 0 : style.borderRadius,
|
|
2654
2897
|
style == null ? void 0 : style.textStyle
|
|
2655
2898
|
], ([width, margin, padding, border, borderRadius, textStyle]) => {
|
|
2656
|
-
var _a, _b,
|
|
2899
|
+
var _a, _b, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2657
2900
|
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
|
|
2658
2901
|
width: (_a = widthToString(width)) != null ? _a : "100%"
|
|
2659
|
-
}), properties.includes(StyleControlProperty.Margin) && {
|
|
2660
|
-
marginTop:
|
|
2661
|
-
marginRight:
|
|
2662
|
-
marginBottom:
|
|
2663
|
-
marginLeft:
|
|
2664
|
-
}), properties.includes(StyleControlProperty.Padding) && {
|
|
2665
|
-
paddingTop:
|
|
2666
|
-
paddingRight:
|
|
2667
|
-
paddingBottom:
|
|
2668
|
-
paddingLeft:
|
|
2669
|
-
}), properties.includes(StyleControlProperty.Border) && {
|
|
2670
|
-
borderTop: (
|
|
2671
|
-
borderRight: (
|
|
2672
|
-
borderBottom: (
|
|
2673
|
-
borderLeft: (
|
|
2902
|
+
}), properties.includes(StyleControlProperty.Margin) && margin != null && marginPropertyDataToStyle(margin, {
|
|
2903
|
+
marginTop: 0,
|
|
2904
|
+
marginRight: "auto",
|
|
2905
|
+
marginBottom: 0,
|
|
2906
|
+
marginLeft: "auto"
|
|
2907
|
+
})), properties.includes(StyleControlProperty.Padding) && padding != null && paddingPropertyDataToStyle(padding, {
|
|
2908
|
+
paddingTop: 0,
|
|
2909
|
+
paddingRight: 0,
|
|
2910
|
+
paddingBottom: 0,
|
|
2911
|
+
paddingLeft: 0
|
|
2912
|
+
})), properties.includes(StyleControlProperty.Border) && {
|
|
2913
|
+
borderTop: (_b = borderSideToString2(border == null ? void 0 : border.borderTop)) != null ? _b : "0 solid black",
|
|
2914
|
+
borderRight: (_c2 = borderSideToString2(border == null ? void 0 : border.borderRight)) != null ? _c2 : "0 solid black",
|
|
2915
|
+
borderBottom: (_d = borderSideToString2(border == null ? void 0 : border.borderBottom)) != null ? _d : "0 solid black",
|
|
2916
|
+
borderLeft: (_e = borderSideToString2(border == null ? void 0 : border.borderLeft)) != null ? _e : "0 solid black"
|
|
2674
2917
|
}), properties.includes(StyleControlProperty.BorderRadius) && {
|
|
2675
|
-
borderTopLeftRadius: (
|
|
2676
|
-
borderTopRightRadius: (
|
|
2677
|
-
borderBottomRightRadius: (
|
|
2678
|
-
borderBottomLeftRadius: (
|
|
2918
|
+
borderTopLeftRadius: (_f = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _f : 0,
|
|
2919
|
+
borderTopRightRadius: (_g = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _g : 0,
|
|
2920
|
+
borderBottomRightRadius: (_h = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _h : 0,
|
|
2921
|
+
borderBottomLeftRadius: (_i = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _i : 0
|
|
2679
2922
|
}), properties.includes(StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
|
|
2680
|
-
textTransform: (
|
|
2681
|
-
fontStyle: (
|
|
2923
|
+
textTransform: (_j = textStyle == null ? void 0 : textStyle.textTransform) != null ? _j : [],
|
|
2924
|
+
fontStyle: (_k = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _k : []
|
|
2682
2925
|
}));
|
|
2683
2926
|
}));
|
|
2684
2927
|
function widthToString(widthProperty) {
|
|
2685
2928
|
if (widthProperty == null)
|
|
2686
2929
|
return null;
|
|
2687
|
-
return
|
|
2688
|
-
}
|
|
2689
|
-
function marginToString(marginProperty) {
|
|
2690
|
-
if (marginProperty == null)
|
|
2691
|
-
return null;
|
|
2692
|
-
if (marginProperty === "auto")
|
|
2693
|
-
return marginProperty;
|
|
2694
|
-
return `${marginProperty.value}${marginProperty.unit}`;
|
|
2695
|
-
}
|
|
2696
|
-
function paddingToString(paddingProperty) {
|
|
2697
|
-
if (paddingProperty == null)
|
|
2698
|
-
return null;
|
|
2699
|
-
return `${paddingProperty.value}${paddingProperty.unit}`;
|
|
2930
|
+
return lengthPercentageDataToString(widthProperty);
|
|
2700
2931
|
}
|
|
2701
|
-
function
|
|
2932
|
+
function borderSideToString2(borderSide) {
|
|
2702
2933
|
if (borderSide == null)
|
|
2703
2934
|
return null;
|
|
2704
2935
|
const { width, color, style: style2 } = borderSide;
|
|
@@ -2707,7 +2938,7 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2707
2938
|
function borderRadiusToString(borderRadius) {
|
|
2708
2939
|
if (borderRadius == null)
|
|
2709
2940
|
return null;
|
|
2710
|
-
return
|
|
2941
|
+
return lengthPercentageDataToString(borderRadius);
|
|
2711
2942
|
}
|
|
2712
2943
|
function fontSizeToString(fontSize) {
|
|
2713
2944
|
return `${fontSize.value}${fontSize.unit}`;
|
|
@@ -2942,18 +3173,6 @@ function ControlValue({
|
|
|
2942
3173
|
return children(data);
|
|
2943
3174
|
}
|
|
2944
3175
|
}
|
|
2945
|
-
const getIndexes = (spans, index) => {
|
|
2946
|
-
const flattened = spans.reduce((a, s) => a.concat(s), []);
|
|
2947
|
-
if (index < 0 || index > flattened.length)
|
|
2948
|
-
throw new RangeError();
|
|
2949
|
-
let remainder = index;
|
|
2950
|
-
let rowIndex = 0;
|
|
2951
|
-
while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
|
|
2952
|
-
remainder -= spans[rowIndex].length;
|
|
2953
|
-
rowIndex += 1;
|
|
2954
|
-
}
|
|
2955
|
-
return [rowIndex, remainder];
|
|
2956
|
-
};
|
|
2957
3176
|
function useSlot(data, control) {
|
|
2958
3177
|
if (data == null || data.elements.length === 0) {
|
|
2959
3178
|
return /* @__PURE__ */ jsx(Slot.Placeholder, {
|
|
@@ -3116,13 +3335,25 @@ function pollBoxModel({
|
|
|
3116
3335
|
onBoxModelChange(null);
|
|
3117
3336
|
};
|
|
3118
3337
|
}
|
|
3119
|
-
function
|
|
3120
|
-
return
|
|
3338
|
+
function useWidthStyle(value, descriptor) {
|
|
3339
|
+
return useStyle(responsiveWidth(value, descriptor.options.defaultValue));
|
|
3340
|
+
}
|
|
3341
|
+
function usePaddingStyle(value) {
|
|
3342
|
+
return useStyle(responsivePadding(value));
|
|
3343
|
+
}
|
|
3344
|
+
function useMarginStyle(value) {
|
|
3345
|
+
return useStyle(responsiveMargin(value));
|
|
3346
|
+
}
|
|
3347
|
+
function useBorderRadiusStyle(value) {
|
|
3348
|
+
return useStyle(responsiveBorderRadius(value));
|
|
3349
|
+
}
|
|
3350
|
+
function useShadowsStyle(value) {
|
|
3351
|
+
const shadowValue = useBoxShadow(value);
|
|
3352
|
+
return useStyle(responsiveShadow(shadowValue != null ? shadowValue : void 0));
|
|
3121
3353
|
}
|
|
3122
|
-
function
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3125
|
-
return useMemo(() => options.format === WidthControlValueFormats.ClassName ? css(responsiveWidth(value, options.defaultValue)) : value, [value, options.defaultValue, options.format]);
|
|
3354
|
+
function useBorderStyle(value) {
|
|
3355
|
+
const borderData = useBorder(value);
|
|
3356
|
+
return useStyle(responsiveBorder(borderData != null ? borderData : void 0));
|
|
3126
3357
|
}
|
|
3127
3358
|
function PropsValue({
|
|
3128
3359
|
element,
|
|
@@ -3178,13 +3409,95 @@ function PropsValue({
|
|
|
3178
3409
|
}, descriptor.type);
|
|
3179
3410
|
}
|
|
3180
3411
|
case Types.Width:
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3412
|
+
switch (descriptor.options.format) {
|
|
3413
|
+
case WidthPropControllerFormat.ClassName:
|
|
3414
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3415
|
+
hook: useWidthStyle,
|
|
3416
|
+
parameters: [props[propName], descriptor],
|
|
3417
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3418
|
+
[propName]: value
|
|
3419
|
+
}))
|
|
3420
|
+
}, descriptor.type);
|
|
3421
|
+
default:
|
|
3422
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3423
|
+
[propName]: props[propName]
|
|
3424
|
+
}));
|
|
3425
|
+
}
|
|
3426
|
+
case Types.Padding:
|
|
3427
|
+
switch (descriptor.options.format) {
|
|
3428
|
+
case PaddingPropControllerFormat.ClassName:
|
|
3429
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3430
|
+
hook: usePaddingStyle,
|
|
3431
|
+
parameters: [props[propName]],
|
|
3432
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3433
|
+
[propName]: value
|
|
3434
|
+
}))
|
|
3435
|
+
}, descriptor.type);
|
|
3436
|
+
default:
|
|
3437
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3438
|
+
[propName]: props[propName]
|
|
3439
|
+
}));
|
|
3440
|
+
}
|
|
3441
|
+
case Types.Margin:
|
|
3442
|
+
switch (descriptor.options.format) {
|
|
3443
|
+
case MarginPropControllerFormat.ClassName:
|
|
3444
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3445
|
+
hook: useMarginStyle,
|
|
3446
|
+
parameters: [props[propName]],
|
|
3447
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3448
|
+
[propName]: value
|
|
3449
|
+
}))
|
|
3450
|
+
}, descriptor.type);
|
|
3451
|
+
default:
|
|
3452
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3453
|
+
[propName]: props[propName]
|
|
3454
|
+
}));
|
|
3455
|
+
}
|
|
3456
|
+
case Types.BorderRadius:
|
|
3457
|
+
switch (descriptor.options.format) {
|
|
3458
|
+
case BorderRadiusPropControllerFormat.ClassName:
|
|
3459
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3460
|
+
hook: useBorderRadiusStyle,
|
|
3461
|
+
parameters: [props[propName]],
|
|
3462
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3463
|
+
[propName]: value
|
|
3464
|
+
}))
|
|
3465
|
+
}, descriptor.type);
|
|
3466
|
+
default:
|
|
3467
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3468
|
+
[propName]: props[propName]
|
|
3469
|
+
}));
|
|
3470
|
+
}
|
|
3471
|
+
case Types.Shadows:
|
|
3472
|
+
switch (descriptor.options.format) {
|
|
3473
|
+
case ShadowsPropControllerFormat.ClassName:
|
|
3474
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3475
|
+
hook: useShadowsStyle,
|
|
3476
|
+
parameters: [props[propName]],
|
|
3477
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3478
|
+
[propName]: value
|
|
3479
|
+
}))
|
|
3480
|
+
}, descriptor.type);
|
|
3481
|
+
default:
|
|
3482
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3483
|
+
[propName]: props[propName]
|
|
3484
|
+
}));
|
|
3485
|
+
}
|
|
3486
|
+
case Types.Border:
|
|
3487
|
+
switch (descriptor.options.format) {
|
|
3488
|
+
case BorderPropControllerFormat.ClassName:
|
|
3489
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3490
|
+
hook: useBorderStyle,
|
|
3491
|
+
parameters: [props[propName]],
|
|
3492
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3493
|
+
[propName]: value
|
|
3494
|
+
}))
|
|
3495
|
+
}, descriptor.type);
|
|
3496
|
+
default:
|
|
3497
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3498
|
+
[propName]: props[propName]
|
|
3499
|
+
}));
|
|
3500
|
+
}
|
|
3188
3501
|
case Types.ResponsiveColor:
|
|
3189
3502
|
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3190
3503
|
hook: useResponsiveColor,
|
|
@@ -3486,5 +3799,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
3486
3799
|
document: document2
|
|
3487
3800
|
});
|
|
3488
3801
|
}));
|
|
3489
|
-
export {
|
|
3802
|
+
export { getStaticProps as $, responsiveGridItem as A, useQuery as B, Contrasts as C, DocumentReference as D, Element as E, useMutation as F, Provider as G, Alignments as H, DEVICES as I, findDeviceOverride as J, serializeStyles as K, insertStyles as L, MakeswiftComponentType as M, TYPOGRAPHIES_BY_ID as N, SWATCHES_BY_ID as O, PageProvider as P, shallowMergeFallbacks as Q, RuntimeProvider as R, SITE_FONTS_QUERY as S, TABLE_BY_ID as T, isNonNullable as U, FILES_BY_ID as V, getDeviceMediaQuery as W, useElementId as X, deepEqual as Y, MakeswiftClient as Z, getStaticPaths as _, ReactRuntime as a, getServerSideProps as a0, Page as a1, Makeswift as a2, PreviewModeScript as a3, Document$1 as a4, MakeswiftApiHandler as a5, forwardNextDynamicRef as a6, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useBoxShadow as k, useResponsiveColor as l, useFile as m, usePage as n, PAGE_SNIPPETS_QUERY as o, Page$1 as p, useStyle as q, responsiveStyle as r, responsiveWidth as s, responsiveTextStyle as t, useIsInBuilder as u, colorToString as v, useIsomorphicLayoutEffect as w, Shapes as x, Sizes as y, useFormContext as z };
|
|
3490
3803
|
//# sourceMappingURL=index.es.js.map
|