@makeswift/runtime 0.1.0-next.0 → 0.1.2
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/Form.cjs.js +33 -14
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +33 -13
- package/dist/Form.es.js.map +1 -1
- package/dist/Text.es.js +1 -1
- package/dist/components.cjs.js +1 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +1 -1
- package/dist/index.cjs.js +19 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.es.js +21 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es3.js +2 -2
- package/dist/index.es3.js.map +1 -1
- package/dist/style.cjs.js +5 -2
- package/dist/style.cjs.js.map +1 -1
- package/dist/style.es.js +5 -2
- package/dist/style.es.js.map +1 -1
- package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/components/Field/index.d.ts +1 -1
- package/dist/types/components/builtin/Form/components/Field/index.d.ts.map +1 -1
- package/dist/types/components/{hooks/useTable.d.ts → builtin/Form/types.d.ts} +2 -6
- package/dist/types/components/builtin/Form/types.d.ts.map +1 -0
- package/dist/types/components/hooks/index.d.ts +0 -1
- package/dist/types/components/hooks/index.d.ts.map +1 -1
- package/dist/types/controls/style.d.ts +65 -0
- package/dist/types/controls/style.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/runtimes/react/index.d.ts.map +1 -1
- package/dist/useBoxShadow.es.js +1 -1
- package/package.json +2 -2
- package/dist/types/components/builtin/Box/contants.d.ts +0 -9
- package/dist/types/components/builtin/Box/contants.d.ts.map +0 -1
- package/dist/types/components/builtin/Button/constants.d.ts +0 -2
- package/dist/types/components/builtin/Button/constants.d.ts.map +0 -1
- package/dist/types/components/builtin/Form/constants.d.ts +0 -1
- package/dist/types/components/builtin/Form/constants.d.ts.map +0 -1
- package/dist/types/components/hooks/useTable.d.ts.map +0 -1
- package/dist/types/dynamic.d.ts +0 -2
- package/dist/types/dynamic.d.ts.map +0 -1
- package/dist/types/next/plugin.d.ts +0 -3
- package/dist/types/next/plugin.d.ts.map +0 -1
- package/dist/useBackgrounds.cjs.js +0 -124
- package/dist/useBackgrounds.cjs.js.map +0 -1
- package/dist/useBackgrounds.es.js +0 -123
- package/dist/useBackgrounds.es.js.map +0 -1
- package/dist/usePage.cjs.js +0 -14
- package/dist/usePage.cjs.js.map +0 -1
- package/dist/usePage.es.js +0 -13
- package/dist/usePage.es.js.map +0 -1
- package/dist/useTable.cjs.js +0 -10
- package/dist/useTable.cjs.js.map +0 -1
- package/dist/useTable.es.js +0 -9
- package/dist/useTable.es.js.map +0 -1
package/dist/index.cjs3.js
CHANGED
|
@@ -63,7 +63,7 @@ const Link = React.forwardRef(function Link2(_a, ref) {
|
|
|
63
63
|
const page = usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
|
|
64
64
|
const elementKey = (link == null ? void 0 : link.type) === "SCROLL_TO_ELEMENT" ? (_a2 = link.payload.elementIdConfig) == null ? void 0 : _a2.elementKey : null;
|
|
65
65
|
const elementId = next.useElementId(elementKey);
|
|
66
|
-
let href = "";
|
|
66
|
+
let href = "#";
|
|
67
67
|
let target;
|
|
68
68
|
let block;
|
|
69
69
|
if (link) {
|
package/dist/index.cjs3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs3.js","sources":["../src/components/hooks/usePage.ts","../src/components/shared/Link/index.tsx"],"sourcesContent":["import { useQuery } from '../../api/react'\nimport { PAGE_PATHNAMES_BY_ID } from '../utils/queries'\n\ntype Page = {\n id: string\n pathname: string\n}\n\nexport function usePage(pageId: string | null | undefined): Page | null | undefined {\n const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {\n skip: pageId == null,\n variables: { ids: [pageId] },\n })\n\n if (pageId == null || error != null) return null\n\n const { pagePathnamesById: [page] = [] } = data\n\n return page\n}\n","import { ComponentPropsWithoutRef, forwardRef, MouseEvent } from 'react'\nimport scrollIntoView from 'scroll-into-view-if-needed'\nimport NextLink from 'next/link'\n\nimport { LinkValue as LinkPropControllerValue } from '../../../prop-controllers/descriptors'\nimport { usePage } from '../../hooks'\nimport { useElementId } from '../../../runtimes/react'\n\ntype BaseProps = {\n link?: LinkPropControllerValue\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseProps>\n\nexport const Link = forwardRef<HTMLAnchorElement, Props>(function Link(\n { link, onClick = () => {}, ...restOfProps }: Props,\n ref,\n) {\n const page = usePage(link && link.type === 'OPEN_PAGE' ? link.payload.pageId : null)\n const elementKey =\n link?.type === 'SCROLL_TO_ELEMENT' ? link.payload.elementIdConfig?.elementKey : null\n const elementId = useElementId(elementKey)\n\n let href = ''\n let target: '_blank' | '_self' | undefined\n let block: 'start' | 'center' | 'end' | undefined\n\n if (link) {\n switch (link.type) {\n case 'OPEN_PAGE': {\n if (page) href = `/${page.pathname}`\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'OPEN_URL': {\n href = link.payload.url\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'SEND_EMAIL': {\n const { to, subject = '', body = '' } = link.payload\n\n if (to != null) href = `mailto:${to}?subject=${subject}&body=${body}`\n\n break\n }\n\n case 'CALL_PHONE': {\n href = `tel:${link.payload.phoneNumber}`\n\n break\n }\n\n case 'SCROLL_TO_ELEMENT': {\n href = `#${elementId ?? ''}`\n block = link.payload.block\n\n break\n }\n\n default:\n throw new RangeError(`Invalid link type \"${(link as any).type}.\"`)\n }\n }\n\n function handleClick(event: MouseEvent<HTMLAnchorElement>) {\n onClick(event)\n\n if (event.defaultPrevented) return\n\n /**\n * When we introduced `next/link` instead of just `a` element slate no longer prevented link from navigating within\n * content mode. This is a hack to compensate for what would be expected as slate's default behavior.\n * On upgrade of slate this can be reevaluated.\n */\n if (event.currentTarget.isContentEditable) return event.preventDefault()\n\n if (link && link.type === 'SCROLL_TO_ELEMENT') {\n let hash: string | undefined\n\n try {\n hash = new URL(`http://www.example.com/${href}`).hash\n } catch (error) {\n console.error(`Link received invalid href: ${href}`, error)\n }\n\n if (href != null && href === hash) {\n event.preventDefault()\n const view = event.view as unknown as Window\n\n scrollIntoView(view.document.querySelector(hash)!, {\n behavior: 'smooth',\n block,\n })\n\n if (view.location.hash !== hash) view.history.pushState({}, '', hash)\n }\n }\n }\n\n return (\n <NextLink href={href}>\n {/* eslint-disable-next-line */}\n <a {...restOfProps} ref={ref} target={target} onClick={handleClick} />\n </NextLink>\n )\n})\n"],"names":["useQuery","PAGE_PATHNAMES_BY_ID","Link","forwardRef","ref","link","onClick","restOfProps","page","usePage","type","payload","pageId","elementKey","elementIdConfig","elementId","useElementId","href","target","block","pathname","openInNewTab","url","to","subject","body","phoneNumber","RangeError","handleClick","event","defaultPrevented","currentTarget","isContentEditable","preventDefault","hash","URL","error","view","scrollIntoView","document","querySelector","behavior","location","history","pushState","NextLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,iBAAiB,QAA4D;AAClF,QAAM,EAAE,OAAO,OAAO,CAAC,MAAMA,KAAAA,SAASC,KAAAA,sBAAsB;AAAA,IAC1D,MAAM,UAAU;AAAA,IAChB,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE;AAAA,EAAA,CAC5B;AAEG,MAAA,UAAU,QAAQ,SAAS;AAAa,WAAA;AAE5C,QAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAO,MAAA;AAEpC,SAAA;AACT;ACJaC,MAAAA,OAAOC,MAAAA,WAAqC,eACvD,IACAC,KACA;AAFA,eAAEC;AAAAA;AAAAA,IAAMC,UAAU,MAAM;AAAA,IAAE;AAAA,MA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C,IAAK,0BAAyBlB,MAAlC,EAA0CiB;AAAAA,eAC1CE;AACCA,gBAAAA,MAAO,+BAA8BnB,QAAQmB,KAArD;AAAA,MACD;AAEGnB,UAAAA,QAAQ,QAAQA,SAASiB,MAAM;AACjCL,cAAMI,eAAN;AACMI,cAAAA,OAAOR,MAAMQ;AAEnBC,gCAAAA,WAAeD,KAAKE,SAASC,cAAcN,IAA5B,GAAoC;AAAA,UACjDO,UAAU;AAAA,UACVtB;AAAAA,QAAAA,CAFY;AAKVkB,YAAAA,KAAKK,SAASR,SAASA;AAAMG,eAAKM,QAAQC,UAAU,IAAI,IAAIV,IAA/B;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAED,wCACGW,kBAAAA,YAAD;AAAA,IAAU;AAAA,IAAV,+EAEStC;MAAa;AAAA,MAAU;AAAA,MAAgB,SAASqB;AAAAA,IAAAA,EAAvD;AAAA,EAAA,CAHJ;AAMD,CAlG6B;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs3.js","sources":["../src/components/hooks/usePage.ts","../src/components/shared/Link/index.tsx"],"sourcesContent":["import { useQuery } from '../../api/react'\nimport { PAGE_PATHNAMES_BY_ID } from '../utils/queries'\n\ntype Page = {\n id: string\n pathname: string\n}\n\nexport function usePage(pageId: string | null | undefined): Page | null | undefined {\n const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {\n skip: pageId == null,\n variables: { ids: [pageId] },\n })\n\n if (pageId == null || error != null) return null\n\n const { pagePathnamesById: [page] = [] } = data\n\n return page\n}\n","import { ComponentPropsWithoutRef, forwardRef, MouseEvent } from 'react'\nimport scrollIntoView from 'scroll-into-view-if-needed'\nimport NextLink from 'next/link'\n\nimport { LinkValue as LinkPropControllerValue } from '../../../prop-controllers/descriptors'\nimport { usePage } from '../../hooks'\nimport { useElementId } from '../../../runtimes/react'\n\ntype BaseProps = {\n link?: LinkPropControllerValue\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseProps>\n\nexport const Link = forwardRef<HTMLAnchorElement, Props>(function Link(\n { link, onClick = () => {}, ...restOfProps }: Props,\n ref,\n) {\n const page = usePage(link && link.type === 'OPEN_PAGE' ? link.payload.pageId : null)\n const elementKey =\n link?.type === 'SCROLL_TO_ELEMENT' ? link.payload.elementIdConfig?.elementKey : null\n const elementId = useElementId(elementKey)\n\n let href = '#'\n let target: '_blank' | '_self' | undefined\n let block: 'start' | 'center' | 'end' | undefined\n\n if (link) {\n switch (link.type) {\n case 'OPEN_PAGE': {\n if (page) href = `/${page.pathname}`\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'OPEN_URL': {\n href = link.payload.url\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'SEND_EMAIL': {\n const { to, subject = '', body = '' } = link.payload\n\n if (to != null) href = `mailto:${to}?subject=${subject}&body=${body}`\n\n break\n }\n\n case 'CALL_PHONE': {\n href = `tel:${link.payload.phoneNumber}`\n\n break\n }\n\n case 'SCROLL_TO_ELEMENT': {\n href = `#${elementId ?? ''}`\n block = link.payload.block\n\n break\n }\n\n default:\n throw new RangeError(`Invalid link type \"${(link as any).type}.\"`)\n }\n }\n\n function handleClick(event: MouseEvent<HTMLAnchorElement>) {\n onClick(event)\n\n if (event.defaultPrevented) return\n\n /**\n * When we introduced `next/link` instead of just `a` element slate no longer prevented link from navigating within\n * content mode. This is a hack to compensate for what would be expected as slate's default behavior.\n * On upgrade of slate this can be reevaluated.\n */\n if (event.currentTarget.isContentEditable) return event.preventDefault()\n\n if (link && link.type === 'SCROLL_TO_ELEMENT') {\n let hash: string | undefined\n\n try {\n hash = new URL(`http://www.example.com/${href}`).hash\n } catch (error) {\n console.error(`Link received invalid href: ${href}`, error)\n }\n\n if (href != null && href === hash) {\n event.preventDefault()\n const view = event.view as unknown as Window\n\n scrollIntoView(view.document.querySelector(hash)!, {\n behavior: 'smooth',\n block,\n })\n\n if (view.location.hash !== hash) view.history.pushState({}, '', hash)\n }\n }\n }\n\n return (\n <NextLink href={href}>\n {/* eslint-disable-next-line */}\n <a {...restOfProps} ref={ref} target={target} onClick={handleClick} />\n </NextLink>\n )\n})\n"],"names":["useQuery","PAGE_PATHNAMES_BY_ID","Link","forwardRef","ref","link","onClick","restOfProps","page","usePage","type","payload","pageId","elementKey","elementIdConfig","elementId","useElementId","href","target","block","pathname","openInNewTab","url","to","subject","body","phoneNumber","RangeError","handleClick","event","defaultPrevented","currentTarget","isContentEditable","preventDefault","hash","URL","error","view","scrollIntoView","document","querySelector","behavior","location","history","pushState","NextLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,iBAAiB,QAA4D;AAClF,QAAM,EAAE,OAAO,OAAO,CAAC,MAAMA,KAAAA,SAASC,KAAAA,sBAAsB;AAAA,IAC1D,MAAM,UAAU;AAAA,IAChB,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE;AAAA,EAAA,CAC5B;AAEG,MAAA,UAAU,QAAQ,SAAS;AAAa,WAAA;AAE5C,QAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAO,MAAA;AAEpC,SAAA;AACT;ACJaC,MAAAA,OAAOC,MAAAA,WAAqC,eACvD,IACAC,KACA;AAFA,eAAEC;AAAAA;AAAAA,IAAMC,UAAU,MAAM;AAAA,IAAE;AAAA,MAA1B,IAA+BC,wBAA/B,IAA+BA;AAAAA,IAA7BF;AAAAA,IAAMC;AAAAA;;AAGFE,QAAAA,OAAOC,QAAQJ,QAAQA,KAAKK,SAAS,cAAcL,KAAKM,QAAQC,SAAS,IAA3D;AACpB,QAAMC,aACJR,8BAAMK,UAAS,sBAAsBL,YAAKM,QAAQG,oBAAbT,oBAA8BQ,aAAa;AAC5EE,QAAAA,YAAYC,kBAAaH,UAAD;AAE1BI,MAAAA,OAAO;AACPC,MAAAA;AACAC,MAAAA;AAEJ,MAAId,MAAM;AACAA,YAAAA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,eAAKM,QAAQC,UAAU,IAAI,IAAIV,IAA/B;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAED,wCACGW,kBAAAA,YAAD;AAAA,IAAU;AAAA,IAAV,+EAEStC;MAAa;AAAA,MAAU;AAAA,MAAgB,SAASqB;AAAAA,IAAAA,EAAvD;AAAA,EAAA,CAHJ;AAMD,CAlG6B;;;"}
|
package/dist/index.es.js
CHANGED
|
@@ -1503,9 +1503,7 @@ function useFormContext() {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
const { Provider } = Context$1;
|
|
1505
1505
|
function registerComponent$6(runtime) {
|
|
1506
|
-
return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Form.es.js")
|
|
1507
|
-
return n.a;
|
|
1508
|
-
})))), {
|
|
1506
|
+
return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Form.es.js")))), {
|
|
1509
1507
|
type: "./components/Form/index.js",
|
|
1510
1508
|
label: "Form",
|
|
1511
1509
|
icon: "Form40",
|
|
@@ -2387,10 +2385,11 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2387
2385
|
style == null ? void 0 : style.margin,
|
|
2388
2386
|
style == null ? void 0 : style.padding,
|
|
2389
2387
|
useBorder(style == null ? void 0 : style.border),
|
|
2390
|
-
style == null ? void 0 : style.borderRadius
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2388
|
+
style == null ? void 0 : style.borderRadius,
|
|
2389
|
+
style == null ? void 0 : style.textStyle
|
|
2390
|
+
], ([width, margin, padding, border, borderRadius, textStyle]) => {
|
|
2391
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
2392
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
|
|
2394
2393
|
width: (_a = widthToString(width)) != null ? _a : "100%"
|
|
2395
2394
|
}), properties.includes(StyleControlProperty.Margin) && {
|
|
2396
2395
|
marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
|
|
@@ -2412,7 +2411,10 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2412
2411
|
borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
|
|
2413
2412
|
borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
|
|
2414
2413
|
borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
|
|
2415
|
-
})
|
|
2414
|
+
}), 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 }), {
|
|
2415
|
+
textTransform: (_r = textStyle == null ? void 0 : textStyle.textTransform) != null ? _r : [],
|
|
2416
|
+
fontStyle: (_s = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _s : []
|
|
2417
|
+
}));
|
|
2416
2418
|
}));
|
|
2417
2419
|
function widthToString(widthProperty) {
|
|
2418
2420
|
if (widthProperty == null)
|
|
@@ -2442,6 +2444,9 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2442
2444
|
return null;
|
|
2443
2445
|
return `${borderRadius.value}${borderRadius.unit}`;
|
|
2444
2446
|
}
|
|
2447
|
+
function fontSizeToString(fontSize) {
|
|
2448
|
+
return `${fontSize.value}${fontSize.unit}`;
|
|
2449
|
+
}
|
|
2445
2450
|
}
|
|
2446
2451
|
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2447
2452
|
const useInsertionEffect = (_e = React[useInsertionEffectSpecifier]) != null ? _e : React.useLayoutEffect;
|
|
@@ -2830,17 +2835,17 @@ function useDispatch() {
|
|
|
2830
2835
|
const store = useContext(Context);
|
|
2831
2836
|
return store.dispatch;
|
|
2832
2837
|
}
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
if (
|
|
2838
|
+
const originalError = console.error;
|
|
2839
|
+
let patched = false;
|
|
2840
|
+
function suppressRefWarning(ownerName) {
|
|
2841
|
+
if (patched === false) {
|
|
2837
2842
|
console.error = (...args) => {
|
|
2838
2843
|
if (typeof args[0] === "string" && args[0].includes("Function components cannot be given refs.") && args[0].includes(`Check the render method of \`${ownerName}\`.`)) {
|
|
2839
2844
|
return;
|
|
2840
2845
|
}
|
|
2841
|
-
return
|
|
2846
|
+
return originalError(...args);
|
|
2842
2847
|
};
|
|
2843
|
-
|
|
2848
|
+
patched = true;
|
|
2844
2849
|
}
|
|
2845
2850
|
}
|
|
2846
2851
|
const ElementData = memo(forwardRef(function ElementData2({
|
|
@@ -2850,7 +2855,7 @@ const ElementData = memo(forwardRef(function ElementData2({
|
|
|
2850
2855
|
const [handle, setHandle] = useState(null);
|
|
2851
2856
|
const [foundDomNode, setFoundDomNode] = useState(null);
|
|
2852
2857
|
useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
|
|
2853
|
-
|
|
2858
|
+
suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
|
|
2854
2859
|
if (Component2 == null) {
|
|
2855
2860
|
return /* @__PURE__ */ jsx(FallbackComponent, {
|
|
2856
2861
|
ref,
|
|
@@ -2959,5 +2964,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
2959
2964
|
document: document2
|
|
2960
2965
|
});
|
|
2961
2966
|
}));
|
|
2962
|
-
export { Alignments as A, TYPOGRAPHIES_BY_ID as B, Contrasts as C, DocumentReference as D, Element as E, SWATCHES_BY_ID as F, shallowMergeFallbacks as G, join as H, getDevice as I, getDeviceMediaQuery as J, isNonNullable as K, FILES_BY_ID as L, PAGE_PATHNAMES_BY_ID as M, useElementId as N, deepEqual as O, PageProvider as P, MakeswiftClient as Q, RuntimeProvider as R, SITE_FONTS_QUERY as S, TABLE_BY_ID as T, Document$1 as U, getServerSideProps as V, getStaticProps as W, getStaticPaths as X, Page as Y, forwardNextDynamicRef as Z, ReactRuntime as a, 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, useResponsiveColor as k, useFile as l, PAGE_SNIPPETS_QUERY as m, Page$1 as n, colorToString as o, useIsomorphicLayoutEffect as p,
|
|
2967
|
+
export { Alignments as A, TYPOGRAPHIES_BY_ID as B, Contrasts as C, DocumentReference as D, Element as E, SWATCHES_BY_ID as F, shallowMergeFallbacks as G, join as H, getDevice as I, getDeviceMediaQuery as J, isNonNullable as K, FILES_BY_ID as L, PAGE_PATHNAMES_BY_ID as M, useElementId as N, deepEqual as O, PageProvider as P, MakeswiftClient as Q, RuntimeProvider as R, SITE_FONTS_QUERY as S, TABLE_BY_ID as T, Document$1 as U, getServerSideProps as V, getStaticProps as W, getStaticPaths as X, Page as Y, forwardNextDynamicRef as Z, ReactRuntime as a, 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, useResponsiveColor as k, useFile as l, PAGE_SNIPPETS_QUERY as m, Page$1 as n, colorToString as o, useIsomorphicLayoutEffect as p, Shapes as q, responsiveWidth as r, Sizes as s, useFormContext as t, useIsInBuilder as u, useQuery as v, useMutation as w, Provider as x, DEVICES as y, findDeviceOverride as z };
|
|
2963
2968
|
//# sourceMappingURL=index.es.js.map
|