@makeswift/runtime 0.1.3 → 0.1.6
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 +1 -0
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +1 -0
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.es.js +2 -2
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +2 -2
- package/dist/Countdown.cjs.js +1 -0
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +2 -1
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +1 -0
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +2 -1
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +1 -0
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +2 -2
- package/dist/Image.cjs2.js +1 -1
- package/dist/Image.es2.js +2 -2
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +2 -2
- package/dist/Root.cjs.js +1 -0
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +1 -0
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.es.js +1 -1
- package/dist/Text.cjs.js +1 -1
- package/dist/Text.es.js +2 -2
- package/dist/Video.cjs.js +1 -0
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +1 -0
- package/dist/Video.es.js.map +1 -1
- package/dist/components.cjs.js +4 -4
- package/dist/components.es.js +4 -4
- package/dist/controls.cjs.js +2 -0
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +1 -1
- package/dist/cssMediaRules.es.js +1 -1
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js.map +1 -1
- package/dist/index.cjs.js +90 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs3.js +1 -12
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.es.js +91 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es3.js +2 -12
- package/dist/index.es3.js.map +1 -1
- package/dist/next.cjs.js +1 -0
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +1 -0
- package/dist/next.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +1 -0
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +1 -0
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react.cjs.js +1 -0
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +1 -0
- package/dist/react.es.js.map +1 -1
- package/dist/text-input.cjs.js +6 -0
- package/dist/text-input.cjs.js.map +1 -1
- package/dist/text-input.es.js +5 -1
- package/dist/text-input.es.js.map +1 -1
- package/dist/types/api/react.d.ts.map +1 -1
- package/dist/types/controls/control.d.ts +3 -2
- package/dist/types/controls/control.d.ts.map +1 -1
- package/dist/types/controls/index.d.ts +1 -0
- package/dist/types/controls/index.d.ts.map +1 -1
- package/dist/types/controls/link.d.ts +50 -0
- package/dist/types/controls/link.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +4 -3
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/control.d.ts +3 -2
- package/dist/types/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/link.d.ts +11 -0
- package/dist/types/runtimes/react/controls/link.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/dist/useBoxShadow.es.js +1 -1
- package/dist/useMediaQuery.es.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs3.js
CHANGED
|
@@ -40,16 +40,6 @@ function _interopDefaultLegacy(e) {
|
|
|
40
40
|
}
|
|
41
41
|
var scrollIntoView__default = /* @__PURE__ */ _interopDefaultLegacy(scrollIntoView);
|
|
42
42
|
var NextLink__default = /* @__PURE__ */ _interopDefaultLegacy(NextLink);
|
|
43
|
-
function usePage(pageId) {
|
|
44
|
-
const { error, data = {} } = next.useQuery(next.PAGE_PATHNAMES_BY_ID, {
|
|
45
|
-
skip: pageId == null,
|
|
46
|
-
variables: { ids: [pageId] }
|
|
47
|
-
});
|
|
48
|
-
if (pageId == null || error != null)
|
|
49
|
-
return null;
|
|
50
|
-
const { pagePathnamesById: [page] = [] } = data;
|
|
51
|
-
return page;
|
|
52
|
-
}
|
|
53
43
|
const Link = React.forwardRef(function Link2(_a, ref) {
|
|
54
44
|
var _b = _a, {
|
|
55
45
|
link,
|
|
@@ -60,7 +50,7 @@ const Link = React.forwardRef(function Link2(_a, ref) {
|
|
|
60
50
|
"onClick"
|
|
61
51
|
]);
|
|
62
52
|
var _a2;
|
|
63
|
-
const page = usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
|
|
53
|
+
const page = next.usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
|
|
64
54
|
const elementKey = (link == null ? void 0 : link.type) === "SCROLL_TO_ELEMENT" ? (_a2 = link.payload.elementIdConfig) == null ? void 0 : _a2.elementKey : null;
|
|
65
55
|
const elementId = next.useElementId(elementKey);
|
|
66
56
|
let href = "#";
|
|
@@ -137,5 +127,4 @@ const Link = React.forwardRef(function Link2(_a, ref) {
|
|
|
137
127
|
});
|
|
138
128
|
});
|
|
139
129
|
exports.Link = Link;
|
|
140
|
-
exports.usePage = usePage;
|
|
141
130
|
//# sourceMappingURL=index.cjs3.js.map
|
package/dist/index.cjs3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs3.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index.cjs3.js","sources":["../src/components/shared/Link/index.tsx"],"sourcesContent":["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":["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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeaA,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,KAAAA,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,KAAKK;AAAAA,WACN,aAAa;AACZF,YAAAA;AAAMS,iBAAQ,IAAGT,KAAKY;AAEjBf,iBAAAA,KAAKM,QAAQU,eAAe,WAAW;AAEhD;AAAA,MACD;AAAA,WAEI,YAAY;AACfJ,eAAOZ,KAAKM,QAAQW;AAEXjB,iBAAAA,KAAKM,QAAQU,eAAe,WAAW;AAEhD;AAAA,MACD;AAAA,WAEI,cAAc;AACX,cAAA;AAAA,UAAEE;AAAAA,UAAIC,UAAU;AAAA,UAAIC,OAAO;AAAA,YAAOpB,KAAKM;AAE7C,YAAIY,MAAM;AAAc,iBAAA,UAASA,cAAcC,gBAAgBC;AAE/D;AAAA,MACD;AAAA,WAEI,cAAc;AACT,eAAA,OAAMpB,KAAKM,QAAQe;AAE3B;AAAA,MACD;AAAA,WAEI,qBAAqB;AACxBT,eAAQ,IAAGF,gCAAa;AACxBI,gBAAQd,KAAKM,QAAQQ;AAErB;AAAA,MACD;AAAA;AAGO,cAAA,IAAIQ,WAAY,sBAAsBtB,KAAaK,QAAnD;AAAA;AAAA,EAEX;AAEQkB,uBAAYC,OAAsC;AACzDvB,YAAQuB,KAAD;AAEHA,QAAAA,MAAMC;AAAkB;AAOxBD,QAAAA,MAAME,cAAcC;AAAmB,aAAOH,MAAMI;AAEpD5B,QAAAA,QAAQA,KAAKK,SAAS,qBAAqB;AACzCwB,UAAAA;AAEA,UAAA;AACFA,eAAO,IAAIC,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;;"}
|
package/dist/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ var __publicField = (obj, key, value) => {
|
|
|
36
36
|
};
|
|
37
37
|
var _e;
|
|
38
38
|
import * as React from "react";
|
|
39
|
-
import { createContext, useContext, useEffect, useState, useMemo, useRef, Children, createElement, forwardRef, useLayoutEffect, Component, memo, useImperativeHandle } from "react";
|
|
39
|
+
import { createContext, useContext, useEffect, useState, useMemo, useRef, Children, createElement, forwardRef, useLayoutEffect, useCallback, Component, memo, useImperativeHandle } from "react";
|
|
40
40
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
41
41
|
import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, k as getComponentPropControllerDescriptors, l as configureStore, m as getDocument, n as getElementId, o as getIsInBuilder, p as getReactComponent, c as createDocument } from "./react-page.es.js";
|
|
42
42
|
import { f as registerComponentHandleEffect, g as mountComponentEffect, h as registerComponentEffect, j as registerReactComponentEffect, k as registerDocumentEffect } from "./actions.es.js";
|
|
@@ -51,12 +51,13 @@ import { BatchHttpLink } from "@apollo/client/link/batch-http";
|
|
|
51
51
|
import { P as PagePathnameSliceFragmentDoc } from "./graphql.es.js";
|
|
52
52
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
53
53
|
import { T as Types, E as ElementID, B as Backgrounds, W as Width, R as ResponsiveIconRadioGroup, M as Margin, P as Padding, a as Border, b as BorderRadius, S as Shadows, G as GapY, c as GapX, e as ResponsiveSelect, f as ResponsiveNumber, C as Checkbox, g as Grid, h as TextInput, L as Link, i as ResponsiveColor, j as TextStyle, I as Images, N as Number, D as Date$1, F as Font, k as ResponsiveLength, l as TextArea, m as Table, n as TableFormFields, o as Image, p as ResponsiveOpacity, q as NavigationLinks, r as SocialLinks, s as RichText, V as Video, t as WidthControlValueFormats } from "./descriptors.es.js";
|
|
54
|
-
import { S as SelectControlType, T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
|
|
54
|
+
import { L as LinkControlType, S as SelectControlType, T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
|
|
55
55
|
import { C as ColorControlType } from "./color.es.js";
|
|
56
56
|
import { S as ShapeControlType, L as ListControlType, C as ComboboxControlType } from "./shape.es.js";
|
|
57
57
|
import { a as ImageControlValueFormat, I as ImageControlType } from "./image.es.js";
|
|
58
58
|
import { a as StyleControlProperty, S as StyleControlType } from "./style.es.js";
|
|
59
59
|
import ColorHelper from "color";
|
|
60
|
+
import scrollIntoView from "scroll-into-view-if-needed";
|
|
60
61
|
import { findDOMNode } from "react-dom";
|
|
61
62
|
import parse from "html-react-parser";
|
|
62
63
|
import Head from "next/head";
|
|
@@ -447,6 +448,8 @@ class MakeswiftClient {
|
|
|
447
448
|
variables: introspectionData
|
|
448
449
|
});
|
|
449
450
|
res.data.pagePathnamesById.forEach((pagePathnameSlice) => {
|
|
451
|
+
if (pagePathnameSlice == null)
|
|
452
|
+
return;
|
|
450
453
|
const id = Buffer.from(`Page:${pagePathnameSlice.id}`).toString("base64");
|
|
451
454
|
this.apolloClient.cache.writeFragment({
|
|
452
455
|
fragment: PagePathnameSliceFragmentDoc,
|
|
@@ -772,13 +775,13 @@ function Page$1({
|
|
|
772
775
|
content: socialImage.publicUrl
|
|
773
776
|
}), /* @__PURE__ */ jsx("meta", {
|
|
774
777
|
property: "og:image:type",
|
|
775
|
-
content: socialImage.
|
|
778
|
+
content: socialImage.mimetype
|
|
776
779
|
}), /* @__PURE__ */ jsx("meta", {
|
|
777
780
|
name: "twitter:image",
|
|
778
781
|
content: socialImage.publicUrl
|
|
779
782
|
}), /* @__PURE__ */ jsx("meta", {
|
|
780
783
|
name: "twitter:card",
|
|
781
|
-
content:
|
|
784
|
+
content: "summary_large_image"
|
|
782
785
|
}), /* @__PURE__ */ jsx("meta", {
|
|
783
786
|
itemProp: "image",
|
|
784
787
|
content: socialImage.publicUrl
|
|
@@ -2131,6 +2134,16 @@ function useFile(fileId) {
|
|
|
2131
2134
|
}
|
|
2132
2135
|
const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
|
|
2133
2136
|
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
2137
|
+
function usePage(pageId) {
|
|
2138
|
+
const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
|
|
2139
|
+
skip: pageId == null,
|
|
2140
|
+
variables: { ids: [pageId] }
|
|
2141
|
+
});
|
|
2142
|
+
if (pageId == null || error != null)
|
|
2143
|
+
return null;
|
|
2144
|
+
const { pagePathnamesById: [page] = [] } = data;
|
|
2145
|
+
return page;
|
|
2146
|
+
}
|
|
2134
2147
|
function responsiveStyle(responsiveValues, join$1, strategy) {
|
|
2135
2148
|
return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
|
|
2136
2149
|
const device = getDevice(deviceId);
|
|
@@ -2541,6 +2554,71 @@ function useImageControlValue(data, definition) {
|
|
|
2541
2554
|
dimensions: { width: file.dimensions.width, height: file.dimensions.height }
|
|
2542
2555
|
};
|
|
2543
2556
|
}
|
|
2557
|
+
function useLinkControlValue(link, _definition) {
|
|
2558
|
+
var _a;
|
|
2559
|
+
const page = usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
|
|
2560
|
+
const elementKey = (link == null ? void 0 : link.type) === "SCROLL_TO_ELEMENT" ? (_a = link.payload.elementIdConfig) == null ? void 0 : _a.elementKey : null;
|
|
2561
|
+
const elementId = useElementId(elementKey);
|
|
2562
|
+
let href = "#";
|
|
2563
|
+
let target;
|
|
2564
|
+
let block;
|
|
2565
|
+
if (link) {
|
|
2566
|
+
switch (link.type) {
|
|
2567
|
+
case "OPEN_PAGE": {
|
|
2568
|
+
if (page)
|
|
2569
|
+
href = `/${page.pathname}`;
|
|
2570
|
+
target = link.payload.openInNewTab ? "_blank" : "_self";
|
|
2571
|
+
break;
|
|
2572
|
+
}
|
|
2573
|
+
case "OPEN_URL": {
|
|
2574
|
+
href = link.payload.url;
|
|
2575
|
+
target = link.payload.openInNewTab ? "_blank" : "_self";
|
|
2576
|
+
break;
|
|
2577
|
+
}
|
|
2578
|
+
case "SEND_EMAIL": {
|
|
2579
|
+
const { to, subject = "", body = "" } = link.payload;
|
|
2580
|
+
if (to != null)
|
|
2581
|
+
href = `mailto:${to}?subject=${subject}&body=${body}`;
|
|
2582
|
+
break;
|
|
2583
|
+
}
|
|
2584
|
+
case "CALL_PHONE": {
|
|
2585
|
+
href = `tel:${link.payload.phoneNumber}`;
|
|
2586
|
+
break;
|
|
2587
|
+
}
|
|
2588
|
+
case "SCROLL_TO_ELEMENT": {
|
|
2589
|
+
href = `#${elementId != null ? elementId : ""}`;
|
|
2590
|
+
block = link.payload.block;
|
|
2591
|
+
break;
|
|
2592
|
+
}
|
|
2593
|
+
default:
|
|
2594
|
+
throw new RangeError(`Invalid link type "${link.type}."`);
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
const handleClick = useCallback((event) => {
|
|
2598
|
+
if (event.defaultPrevented)
|
|
2599
|
+
return;
|
|
2600
|
+
if (link && link.type === "SCROLL_TO_ELEMENT") {
|
|
2601
|
+
let hash;
|
|
2602
|
+
try {
|
|
2603
|
+
hash = new URL(`http://www.example.com/${href}`).hash;
|
|
2604
|
+
} catch (error) {
|
|
2605
|
+
console.error(`Link received invalid href: ${href}`, error);
|
|
2606
|
+
}
|
|
2607
|
+
if (href != null && href === hash) {
|
|
2608
|
+
event.preventDefault();
|
|
2609
|
+
const view = event.view;
|
|
2610
|
+
scrollIntoView(view.document.querySelector(hash), {
|
|
2611
|
+
behavior: "smooth",
|
|
2612
|
+
block
|
|
2613
|
+
});
|
|
2614
|
+
if (view.location.hash !== hash)
|
|
2615
|
+
view.history.pushState({}, "", hash);
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
}, [link, href, block]);
|
|
2619
|
+
const res = useMemo(() => ({ href, target, onClick: handleClick }), [href, target, handleClick]);
|
|
2620
|
+
return res;
|
|
2621
|
+
}
|
|
2544
2622
|
function ListControlValue({
|
|
2545
2623
|
definition,
|
|
2546
2624
|
data,
|
|
@@ -2625,6 +2703,12 @@ function ControlValue({
|
|
|
2625
2703
|
parameters: [data, definition],
|
|
2626
2704
|
children: (value) => children(value)
|
|
2627
2705
|
}, definition.type);
|
|
2706
|
+
case LinkControlType:
|
|
2707
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
2708
|
+
hook: useLinkControlValue,
|
|
2709
|
+
parameters: [data, definition],
|
|
2710
|
+
children: (value) => children(value)
|
|
2711
|
+
}, definition.type);
|
|
2628
2712
|
case ComboboxControlType:
|
|
2629
2713
|
return /* @__PURE__ */ jsx(RenderHook, {
|
|
2630
2714
|
hook: useComboboxControlValue,
|
|
@@ -2675,6 +2759,7 @@ function PropsValue({
|
|
|
2675
2759
|
case ComboboxControlType:
|
|
2676
2760
|
case ShapeControlType:
|
|
2677
2761
|
case ListControlType:
|
|
2762
|
+
case LinkControlType:
|
|
2678
2763
|
return /* @__PURE__ */ jsx(ControlValue, {
|
|
2679
2764
|
definition: descriptor,
|
|
2680
2765
|
data: props[propName],
|
|
@@ -2890,7 +2975,7 @@ const ElementData = memo(forwardRef(function ElementData2({
|
|
|
2890
2975
|
suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
|
|
2891
2976
|
if (Component2 == null) {
|
|
2892
2977
|
return /* @__PURE__ */ jsx(FallbackComponent, {
|
|
2893
|
-
ref,
|
|
2978
|
+
ref: setHandle,
|
|
2894
2979
|
text: "Component not found"
|
|
2895
2980
|
});
|
|
2896
2981
|
}
|
|
@@ -2996,5 +3081,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
2996
3081
|
document: document2
|
|
2997
3082
|
});
|
|
2998
3083
|
}));
|
|
2999
|
-
export { Alignments as A,
|
|
3084
|
+
export { Alignments as A, findDeviceOverride as B, Contrasts as C, DocumentReference as D, Element as E, TYPOGRAPHIES_BY_ID as F, SWATCHES_BY_ID as G, shallowMergeFallbacks as H, join as I, getDevice as J, getDeviceMediaQuery as K, isNonNullable as L, FILES_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, usePage as m, PAGE_SNIPPETS_QUERY as n, Page$1 as o, colorToString as p, useIsomorphicLayoutEffect as q, responsiveWidth as r, Shapes as s, Sizes as t, useIsInBuilder as u, useFormContext as v, useQuery as w, useMutation as x, Provider as y, DEVICES as z };
|
|
3000
3085
|
//# sourceMappingURL=index.es.js.map
|