@makeswift/runtime 0.0.11 → 0.0.12
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/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 +3 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +1 -2
- package/dist/components.es.js.map +1 -1
- package/dist/constants.cjs.js +128 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +128 -1
- package/dist/constants.es.js.map +1 -1
- package/dist/index.cjs.js +357 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +353 -16
- package/dist/index.es.js.map +1 -1
- package/dist/next.cjs.js +9 -6
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +10 -7
- package/dist/next.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +45 -45
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +44 -44
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/types/api/constants.d.ts.map +1 -1
- package/dist/types/api/generated/graphql.d.ts +55 -0
- package/dist/types/api/generated/graphql.d.ts.map +1 -1
- package/dist/types/api/react.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +2 -2
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/components/page/Page.d.ts +23 -0
- package/dist/types/components/page/Page.d.ts.map +1 -1
- package/dist/types/next.d.ts +2 -1
- package/dist/types/next.d.ts.map +1 -1
- package/dist/types/state/actions.d.ts +13 -1
- package/dist/types/state/actions.d.ts.map +1 -1
- package/dist/types/state/react-builder-preview.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/Page.cjs.js +0 -222
- package/dist/Page.cjs.js.map +0 -1
- package/dist/Page.es.js +0 -216
- package/dist/Page.es.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -47,8 +47,8 @@ var ssr = require("@apollo/client/react/ssr");
|
|
|
47
47
|
var slate = require("slate");
|
|
48
48
|
var uuid = require("uuid/v4");
|
|
49
49
|
var jsxRuntime = require("react/jsx-runtime");
|
|
50
|
-
require("html-react-parser");
|
|
51
|
-
require("next/head");
|
|
50
|
+
var parse = require("html-react-parser");
|
|
51
|
+
var Head = require("next/head");
|
|
52
52
|
var descriptors = require("./descriptors.cjs.js");
|
|
53
53
|
var ColorHelper = require("color");
|
|
54
54
|
var scrollIntoView = require("scroll-into-view-if-needed");
|
|
@@ -95,6 +95,8 @@ function _interopNamespace(e) {
|
|
|
95
95
|
var React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
96
96
|
var styled__default = /* @__PURE__ */ _interopDefaultLegacy(styled);
|
|
97
97
|
var uuid__default = /* @__PURE__ */ _interopDefaultLegacy(uuid);
|
|
98
|
+
var parse__default = /* @__PURE__ */ _interopDefaultLegacy(parse);
|
|
99
|
+
var Head__default = /* @__PURE__ */ _interopDefaultLegacy(Head);
|
|
98
100
|
var ColorHelper__default = /* @__PURE__ */ _interopDefaultLegacy(ColorHelper);
|
|
99
101
|
var scrollIntoView__default = /* @__PURE__ */ _interopDefaultLegacy(scrollIntoView);
|
|
100
102
|
var NextLink__default = /* @__PURE__ */ _interopDefaultLegacy(NextLink);
|
|
@@ -318,6 +320,24 @@ const typePolicies = {
|
|
|
318
320
|
__typename: "Table",
|
|
319
321
|
id: args == null ? void 0 : args.id
|
|
320
322
|
}, true);
|
|
323
|
+
},
|
|
324
|
+
page(existingData, {
|
|
325
|
+
args,
|
|
326
|
+
toReference
|
|
327
|
+
}) {
|
|
328
|
+
return existingData != null ? existingData : toReference({
|
|
329
|
+
__typename: "Page",
|
|
330
|
+
id: args == null ? void 0 : args.id
|
|
331
|
+
}, true);
|
|
332
|
+
},
|
|
333
|
+
site(existingData, {
|
|
334
|
+
args,
|
|
335
|
+
toReference
|
|
336
|
+
}) {
|
|
337
|
+
return existingData != null ? existingData : toReference({
|
|
338
|
+
__typename: "Site",
|
|
339
|
+
id: args == null ? void 0 : args.id
|
|
340
|
+
}, true);
|
|
321
341
|
}
|
|
322
342
|
}
|
|
323
343
|
}
|
|
@@ -2550,7 +2570,7 @@ const Reel = styled__default["default"](framerMotion.motion.div)`
|
|
|
2550
2570
|
}
|
|
2551
2571
|
`)}
|
|
2552
2572
|
`;
|
|
2553
|
-
const Page = styled__default["default"](framerMotion.motion.div)`
|
|
2573
|
+
const Page$1 = styled__default["default"](framerMotion.motion.div)`
|
|
2554
2574
|
position: relative;
|
|
2555
2575
|
width: 100%;
|
|
2556
2576
|
`;
|
|
@@ -2763,7 +2783,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
2763
2783
|
},
|
|
2764
2784
|
children: [/* @__PURE__ */ jsxRuntime.jsxs(Container$b, {
|
|
2765
2785
|
children: [/* @__PURE__ */ jsxRuntime.jsx(ClipMask, {
|
|
2766
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Page, __spreadProps(__spreadValues({}, bindPage()), {
|
|
2786
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Page$1, __spreadProps(__spreadValues({}, bindPage()), {
|
|
2767
2787
|
animate: animation,
|
|
2768
2788
|
children: /* @__PURE__ */ jsxRuntime.jsx(Reel, {
|
|
2769
2789
|
gap,
|
|
@@ -3552,7 +3572,7 @@ const defaultHtml = `<div style="padding: 24px; background-color: rgba(161, 168,
|
|
|
3552
3572
|
<rect y="160" width="40" height="8" rx="2" fill="#A1A8C2" fill-opacity="0.5"/>
|
|
3553
3573
|
</svg>
|
|
3554
3574
|
</div>`;
|
|
3555
|
-
const SCRIPT_TAG = "script";
|
|
3575
|
+
const SCRIPT_TAG$1 = "script";
|
|
3556
3576
|
const Embed = React.forwardRef(function Embed2({
|
|
3557
3577
|
id,
|
|
3558
3578
|
width,
|
|
@@ -3570,7 +3590,7 @@ const Embed = React.forwardRef(function Embed2({
|
|
|
3570
3590
|
return;
|
|
3571
3591
|
const walker = container.ownerDocument.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
3572
3592
|
acceptNode(node) {
|
|
3573
|
-
return node.tagName.toLowerCase() === SCRIPT_TAG ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
|
3593
|
+
return node.tagName.toLowerCase() === SCRIPT_TAG$1 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
|
3574
3594
|
}
|
|
3575
3595
|
});
|
|
3576
3596
|
const nodes = [];
|
|
@@ -3581,7 +3601,7 @@ const Embed = React.forwardRef(function Embed2({
|
|
|
3581
3601
|
await new Promise((resolve) => {
|
|
3582
3602
|
var _a, _b;
|
|
3583
3603
|
const node = nodes[i];
|
|
3584
|
-
const script = node.ownerDocument.createElement(SCRIPT_TAG);
|
|
3604
|
+
const script = node.ownerDocument.createElement(SCRIPT_TAG$1);
|
|
3585
3605
|
script.textContent = node.textContent;
|
|
3586
3606
|
Array.from(node.attributes).forEach(({
|
|
3587
3607
|
name,
|
|
@@ -4910,7 +4930,7 @@ function useTableFormFieldRefs(propController, { fieldsCount }) {
|
|
|
4910
4930
|
}
|
|
4911
4931
|
}, [propController, container, items, isInBuilder]);
|
|
4912
4932
|
const itemRefs = React.useMemo(() => Array.from({ length: fieldsCount + 1 }).map((_, index) => (item) => {
|
|
4913
|
-
setItems((
|
|
4933
|
+
setItems((is2) => [...is2.slice(0, index), item, ...is2.slice(index + 1)]);
|
|
4914
4934
|
}), [fieldsCount, setItems]);
|
|
4915
4935
|
return { container: setContainer, items: itemRefs };
|
|
4916
4936
|
}
|
|
@@ -7837,6 +7857,325 @@ function registerBuiltinComponents(runtime) {
|
|
|
7837
7857
|
unregisterVideoComponent();
|
|
7838
7858
|
};
|
|
7839
7859
|
}
|
|
7860
|
+
const SCRIPT_TAG = "script";
|
|
7861
|
+
function BodySnippet({
|
|
7862
|
+
code,
|
|
7863
|
+
cleanup
|
|
7864
|
+
}) {
|
|
7865
|
+
React.useEffect(() => {
|
|
7866
|
+
const container = document.createElement("div");
|
|
7867
|
+
container.innerHTML = code;
|
|
7868
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
|
|
7869
|
+
const scripts = [];
|
|
7870
|
+
while (walker.nextNode()) {
|
|
7871
|
+
if (walker.currentNode instanceof HTMLScriptElement)
|
|
7872
|
+
scripts.push(walker.currentNode);
|
|
7873
|
+
}
|
|
7874
|
+
scripts.forEach((inlineScript) => {
|
|
7875
|
+
var _a;
|
|
7876
|
+
const executableScript = document.createElement(SCRIPT_TAG);
|
|
7877
|
+
executableScript.textContent = inlineScript.textContent;
|
|
7878
|
+
Array.from(inlineScript.attributes).forEach(({
|
|
7879
|
+
name,
|
|
7880
|
+
value
|
|
7881
|
+
}) => {
|
|
7882
|
+
executableScript.setAttribute(name, value);
|
|
7883
|
+
});
|
|
7884
|
+
(_a = inlineScript.parentNode) == null ? void 0 : _a.replaceChild(executableScript, inlineScript);
|
|
7885
|
+
});
|
|
7886
|
+
const nodes = Array.from(container.childNodes);
|
|
7887
|
+
document.body.append(...nodes);
|
|
7888
|
+
return () => {
|
|
7889
|
+
nodes.forEach((node) => {
|
|
7890
|
+
var _a;
|
|
7891
|
+
(_a = node.parentNode) == null ? void 0 : _a.removeChild(node);
|
|
7892
|
+
});
|
|
7893
|
+
if (cleanup == null)
|
|
7894
|
+
return;
|
|
7895
|
+
const cleanUp = new Function(cleanup);
|
|
7896
|
+
try {
|
|
7897
|
+
cleanUp();
|
|
7898
|
+
} catch {
|
|
7899
|
+
}
|
|
7900
|
+
};
|
|
7901
|
+
}, [code, cleanup]);
|
|
7902
|
+
return null;
|
|
7903
|
+
}
|
|
7904
|
+
function is(x, y) {
|
|
7905
|
+
if (x === y)
|
|
7906
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
7907
|
+
return x !== x && y !== y;
|
|
7908
|
+
}
|
|
7909
|
+
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
7910
|
+
const shallowEqual = (a, b) => {
|
|
7911
|
+
if (is(a, b))
|
|
7912
|
+
return true;
|
|
7913
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
7914
|
+
return false;
|
|
7915
|
+
const keysA = Object.keys(a);
|
|
7916
|
+
const keysB = Object.keys(b);
|
|
7917
|
+
if (keysA.length !== keysB.length)
|
|
7918
|
+
return false;
|
|
7919
|
+
for (let i = 0; i < keysA.length; i += 1) {
|
|
7920
|
+
if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
|
|
7921
|
+
return false;
|
|
7922
|
+
}
|
|
7923
|
+
return true;
|
|
7924
|
+
};
|
|
7925
|
+
const { hasOwnProperty } = Object.prototype;
|
|
7926
|
+
const deepEqual = (a, b) => {
|
|
7927
|
+
if (shallowEqual(a, b))
|
|
7928
|
+
return true;
|
|
7929
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
7930
|
+
return false;
|
|
7931
|
+
const keysA = Object.keys(a);
|
|
7932
|
+
const keysB = Object.keys(b);
|
|
7933
|
+
if (keysA.length !== keysB.length)
|
|
7934
|
+
return false;
|
|
7935
|
+
for (let i = 0; i < keysA.length; i += 1) {
|
|
7936
|
+
if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
|
|
7937
|
+
return false;
|
|
7938
|
+
}
|
|
7939
|
+
return true;
|
|
7940
|
+
};
|
|
7941
|
+
const defaultFavicon = {
|
|
7942
|
+
mimetype: "image/png",
|
|
7943
|
+
publicUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAACXBIWXMAABcRAAAXEQHKJvM/AAABjElEQVRYhc2XzU3EMBCFB8TddAAXn6EE6GCpgNABZ1/IXnymBOgAOmA7YM8+ABVsXEHQQFaKQryeN3Yk3ilKJtEnv/nLUd/3pFG0riGi88yrnQn+UfJ5FUi0riWiB2H4nQn+KRd0DFP8agXEfkqCYJBoHdtxIQxfm+DfFgEhoith3NYE30o/qgGR2BJB+xY7kdYEL8oNFUi0jiFMJuxVWrJqEMFxsyUNCsE6AeNztvBp7aJ143vXksoRnwhYtmNdSoIQa6RlO9YXEWW7KgoCleOgxgTf1QZBT+RZ2lXFING6UxCCq+ceeUE8fYdknY599v9sJvzGBP+yCEgC7GPmETc0OJ+0awAlkhe2pAbIXAeFZ8xe2g2Nk3c3ub0xwWt6zY9qbmiqGVMbZK21ZC/YmhlbeBMTzZNDQqcvDb1kM1x32iqZSt1HaqukfKvq34BAOTLsrH+ETNmUkKHHA+428RgeclPVWozeSyAI2EdWB34jtqXNTAySOY3i/KgFIlqOa4GkFmBegorzg4joG07he/M7zl6jAAAAAElFTkSuQmCC"
|
|
7944
|
+
};
|
|
7945
|
+
const VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_.\-\d]*$/;
|
|
7946
|
+
const VALID_HEAD_ELEMENT_TYPES = ["title", "base", "link", "style", "meta", "script", "noscript", "template"];
|
|
7947
|
+
function snippetToElement(snippet) {
|
|
7948
|
+
return React.Children.map(parse__default["default"](snippet.code), (element) => {
|
|
7949
|
+
if (typeof element === "string")
|
|
7950
|
+
return element;
|
|
7951
|
+
if (!VALID_TAG_REGEX.test(element.type))
|
|
7952
|
+
return null;
|
|
7953
|
+
const key = element.key ? `${snippet.id}:${element.key}` : snippet.id;
|
|
7954
|
+
return React.createElement(element.type, __spreadProps(__spreadValues({}, element.props), {
|
|
7955
|
+
key
|
|
7956
|
+
}));
|
|
7957
|
+
});
|
|
7958
|
+
}
|
|
7959
|
+
const filterUsedSnippetProperties = ({
|
|
7960
|
+
code,
|
|
7961
|
+
builderEnabled,
|
|
7962
|
+
liveEnabled,
|
|
7963
|
+
location,
|
|
7964
|
+
cleanup
|
|
7965
|
+
}) => ({
|
|
7966
|
+
code,
|
|
7967
|
+
builderEnabled,
|
|
7968
|
+
liveEnabled,
|
|
7969
|
+
location,
|
|
7970
|
+
cleanup
|
|
7971
|
+
});
|
|
7972
|
+
const PAGE_SNIPPETS_QUERY = client.gql`
|
|
7973
|
+
query PageById($id: ID!) {
|
|
7974
|
+
page(id: $id) {
|
|
7975
|
+
__typename
|
|
7976
|
+
id
|
|
7977
|
+
snippets {
|
|
7978
|
+
__typename
|
|
7979
|
+
id
|
|
7980
|
+
name
|
|
7981
|
+
code
|
|
7982
|
+
cleanup
|
|
7983
|
+
location
|
|
7984
|
+
shouldAddToNewPages
|
|
7985
|
+
liveEnabled
|
|
7986
|
+
builderEnabled
|
|
7987
|
+
}
|
|
7988
|
+
}
|
|
7989
|
+
}
|
|
7990
|
+
`;
|
|
7991
|
+
const SITE_FONTS_QUERY = client.gql`
|
|
7992
|
+
query SiteById($id: ID!) {
|
|
7993
|
+
site(id: $id) {
|
|
7994
|
+
id
|
|
7995
|
+
googleFonts {
|
|
7996
|
+
edges {
|
|
7997
|
+
activeVariants {
|
|
7998
|
+
specifier
|
|
7999
|
+
}
|
|
8000
|
+
node {
|
|
8001
|
+
family
|
|
8002
|
+
variants {
|
|
8003
|
+
specifier
|
|
8004
|
+
}
|
|
8005
|
+
}
|
|
8006
|
+
}
|
|
8007
|
+
}
|
|
8008
|
+
}
|
|
8009
|
+
}
|
|
8010
|
+
`;
|
|
8011
|
+
function Page({
|
|
8012
|
+
page,
|
|
8013
|
+
preview = false
|
|
8014
|
+
}) {
|
|
8015
|
+
var _a;
|
|
8016
|
+
const isInBuilder = useIsInBuilder();
|
|
8017
|
+
const [snippets, setSnippets] = React.useState(page.snippets);
|
|
8018
|
+
useQuery(PAGE_SNIPPETS_QUERY, {
|
|
8019
|
+
variables: {
|
|
8020
|
+
id: page.id
|
|
8021
|
+
},
|
|
8022
|
+
skip: isInBuilder === false,
|
|
8023
|
+
fetchPolicy: "cache-only",
|
|
8024
|
+
onCompleted(data) {
|
|
8025
|
+
if (data == null)
|
|
8026
|
+
return;
|
|
8027
|
+
const oldSnippets = snippets.map(filterUsedSnippetProperties);
|
|
8028
|
+
const newSnippets = data.page.snippets.map(filterUsedSnippetProperties);
|
|
8029
|
+
if (deepEqual(newSnippets, oldSnippets))
|
|
8030
|
+
return;
|
|
8031
|
+
setSnippets(data.page.snippets);
|
|
8032
|
+
}
|
|
8033
|
+
});
|
|
8034
|
+
const {
|
|
8035
|
+
data: siteData
|
|
8036
|
+
} = useQuery(SITE_FONTS_QUERY, {
|
|
8037
|
+
variables: {
|
|
8038
|
+
id: page.site.id
|
|
8039
|
+
},
|
|
8040
|
+
skip: isInBuilder === false,
|
|
8041
|
+
fetchPolicy: "cache-only"
|
|
8042
|
+
});
|
|
8043
|
+
const favicon = (_a = page.meta.favicon) != null ? _a : defaultFavicon;
|
|
8044
|
+
const {
|
|
8045
|
+
title,
|
|
8046
|
+
description,
|
|
8047
|
+
keywords,
|
|
8048
|
+
socialImage
|
|
8049
|
+
} = page.meta;
|
|
8050
|
+
const {
|
|
8051
|
+
canonicalUrl,
|
|
8052
|
+
isIndexingBlocked
|
|
8053
|
+
} = page.seo;
|
|
8054
|
+
const fontFamilyParamValue = React.useMemo(() => {
|
|
8055
|
+
if ((siteData == null ? void 0 : siteData.site) == null) {
|
|
8056
|
+
return page.fonts.map(({
|
|
8057
|
+
family,
|
|
8058
|
+
variants
|
|
8059
|
+
}) => {
|
|
8060
|
+
return `${family.replace(/ /g, "+")}:${variants.join()}`;
|
|
8061
|
+
}).join("|");
|
|
8062
|
+
}
|
|
8063
|
+
return siteData.site.googleFonts.edges.filter((edge) => edge != null).map(({
|
|
8064
|
+
activeVariants,
|
|
8065
|
+
node: {
|
|
8066
|
+
family,
|
|
8067
|
+
variants
|
|
8068
|
+
}
|
|
8069
|
+
}) => {
|
|
8070
|
+
const activeVariantSpecifiers = variants.filter((variant) => activeVariants.some((activeVariant) => activeVariant.specifier === variant.specifier)).map((variant) => variant.specifier).join();
|
|
8071
|
+
return `${family.replace(/ /g, "+")}:${activeVariantSpecifiers}`;
|
|
8072
|
+
}).join("|");
|
|
8073
|
+
}, [siteData, page]);
|
|
8074
|
+
const filteredSnippets = React.useMemo(() => snippets.filter((snippet) => preview ? snippet.builderEnabled : snippet.liveEnabled), [snippets]);
|
|
8075
|
+
const headSnippets = React.useMemo(() => filteredSnippets.filter((snippet) => snippet.location === "HEAD"), [filteredSnippets]);
|
|
8076
|
+
const previousHeadSnippets = React.useRef(null);
|
|
8077
|
+
React.useEffect(() => {
|
|
8078
|
+
var _a2;
|
|
8079
|
+
const headSnippetsToCleanUp = ((_a2 = previousHeadSnippets.current) != null ? _a2 : []).filter((previousSnippet) => previousSnippet.cleanup != null).filter((previousSnippet) => !headSnippets.some((snippet) => previousSnippet.id === snippet.id));
|
|
8080
|
+
headSnippetsToCleanUp.forEach((snippetToCleanUp) => {
|
|
8081
|
+
if (snippetToCleanUp.cleanup == null)
|
|
8082
|
+
return;
|
|
8083
|
+
const cleanUp = new Function(snippetToCleanUp.cleanup);
|
|
8084
|
+
try {
|
|
8085
|
+
cleanUp();
|
|
8086
|
+
} catch {
|
|
8087
|
+
}
|
|
8088
|
+
});
|
|
8089
|
+
previousHeadSnippets.current = headSnippets;
|
|
8090
|
+
}, [headSnippets]);
|
|
8091
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8092
|
+
children: [/* @__PURE__ */ jsxRuntime.jsxs(Head__default["default"], {
|
|
8093
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx("style", {
|
|
8094
|
+
children: `
|
|
8095
|
+
html {
|
|
8096
|
+
font-family: sans-serif;
|
|
8097
|
+
}
|
|
8098
|
+
div#__next {
|
|
8099
|
+
overflow: hidden;
|
|
8100
|
+
}
|
|
8101
|
+
`
|
|
8102
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("link", {
|
|
8103
|
+
rel: "icon",
|
|
8104
|
+
type: favicon.mimetype,
|
|
8105
|
+
href: favicon.publicUrl
|
|
8106
|
+
}), canonicalUrl && /* @__PURE__ */ jsxRuntime.jsx("link", {
|
|
8107
|
+
rel: "canonical",
|
|
8108
|
+
href: canonicalUrl
|
|
8109
|
+
}), isIndexingBlocked && /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8110
|
+
name: "robots",
|
|
8111
|
+
content: "noindex"
|
|
8112
|
+
}), title && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8113
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx("title", {
|
|
8114
|
+
children: title
|
|
8115
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8116
|
+
property: "og:title",
|
|
8117
|
+
content: title
|
|
8118
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8119
|
+
name: "twitter:title",
|
|
8120
|
+
content: title
|
|
8121
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8122
|
+
itemProp: "name",
|
|
8123
|
+
content: title
|
|
8124
|
+
})]
|
|
8125
|
+
}), description && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8126
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8127
|
+
name: "description",
|
|
8128
|
+
content: description
|
|
8129
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8130
|
+
property: "og:description",
|
|
8131
|
+
content: description
|
|
8132
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8133
|
+
name: "twitter:description",
|
|
8134
|
+
content: description
|
|
8135
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8136
|
+
itemProp: "description",
|
|
8137
|
+
content: description
|
|
8138
|
+
})]
|
|
8139
|
+
}), keywords && /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8140
|
+
name: "keywords",
|
|
8141
|
+
content: keywords
|
|
8142
|
+
}), socialImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8143
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8144
|
+
property: "og:image",
|
|
8145
|
+
content: socialImage.publicUrl
|
|
8146
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8147
|
+
property: "og:image:type",
|
|
8148
|
+
content: socialImage.publicUrl
|
|
8149
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8150
|
+
name: "twitter:image",
|
|
8151
|
+
content: socialImage.publicUrl
|
|
8152
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8153
|
+
name: "twitter:card",
|
|
8154
|
+
content: socialImage.publicUrl
|
|
8155
|
+
}), /* @__PURE__ */ jsxRuntime.jsx("meta", {
|
|
8156
|
+
itemProp: "image",
|
|
8157
|
+
content: socialImage.publicUrl
|
|
8158
|
+
})]
|
|
8159
|
+
}), fontFamilyParamValue !== "" && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
8160
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("link", {
|
|
8161
|
+
rel: "stylesheet",
|
|
8162
|
+
href: `https://fonts.googleapis.com/css?family=${fontFamilyParamValue}&display=swap`
|
|
8163
|
+
})
|
|
8164
|
+
}), headSnippets.map(snippetToElement).map((children) => React.Children.map(children, (child) => {
|
|
8165
|
+
if (typeof child === "string")
|
|
8166
|
+
return child;
|
|
8167
|
+
if (VALID_HEAD_ELEMENT_TYPES.includes(child.type))
|
|
8168
|
+
return child;
|
|
8169
|
+
return null;
|
|
8170
|
+
}))]
|
|
8171
|
+
}), /* @__PURE__ */ jsxRuntime.jsx(DocumentReference, {
|
|
8172
|
+
documentReference: reactPage.createDocumentReference(page.id)
|
|
8173
|
+
}), filteredSnippets.filter((snippet) => snippet.location === "BODY").map((snippet) => /* @__PURE__ */ jsxRuntime.jsx(BodySnippet, {
|
|
8174
|
+
code: snippet.code,
|
|
8175
|
+
cleanup: snippet.cleanup
|
|
8176
|
+
}, snippet.id))]
|
|
8177
|
+
});
|
|
8178
|
+
}
|
|
7840
8179
|
var _path;
|
|
7841
8180
|
function _extends() {
|
|
7842
8181
|
_extends = Object.assign || function(target) {
|
|
@@ -8692,21 +9031,21 @@ const Element$1 = React.memo(React.forwardRef(function Element2({
|
|
|
8692
9031
|
}, elementKey);
|
|
8693
9032
|
}));
|
|
8694
9033
|
const Document = React.memo(React.forwardRef(function Document2({
|
|
8695
|
-
document
|
|
9034
|
+
document: document2
|
|
8696
9035
|
}, ref) {
|
|
8697
9036
|
return /* @__PURE__ */ jsxRuntime.jsx(DocumentContext.Provider, {
|
|
8698
|
-
value:
|
|
9037
|
+
value: document2.key,
|
|
8699
9038
|
children: /* @__PURE__ */ jsxRuntime.jsx(Element$1, {
|
|
8700
9039
|
ref,
|
|
8701
|
-
element:
|
|
9040
|
+
element: document2.rootElement
|
|
8702
9041
|
})
|
|
8703
9042
|
});
|
|
8704
9043
|
}));
|
|
8705
9044
|
const DocumentReference = React.memo(React.forwardRef(function DocumentReference2({
|
|
8706
9045
|
documentReference
|
|
8707
9046
|
}, ref) {
|
|
8708
|
-
const
|
|
8709
|
-
if (
|
|
9047
|
+
const document2 = useDocument(documentReference.key);
|
|
9048
|
+
if (document2 == null) {
|
|
8710
9049
|
return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
|
|
8711
9050
|
ref,
|
|
8712
9051
|
text: "Document not found"
|
|
@@ -8714,7 +9053,7 @@ const DocumentReference = React.memo(React.forwardRef(function DocumentReference
|
|
|
8714
9053
|
}
|
|
8715
9054
|
return /* @__PURE__ */ jsxRuntime.jsx(Document, {
|
|
8716
9055
|
ref,
|
|
8717
|
-
document
|
|
9056
|
+
document: document2
|
|
8718
9057
|
});
|
|
8719
9058
|
}));
|
|
8720
9059
|
exports.Box = Box;
|
|
@@ -8736,10 +9075,13 @@ exports.Form = Form;
|
|
|
8736
9075
|
exports.ImageComponent = ImageComponent;
|
|
8737
9076
|
exports.MakeswiftClient = MakeswiftClient;
|
|
8738
9077
|
exports.Navigation = Navigation;
|
|
9078
|
+
exports.PAGE_SNIPPETS_QUERY = PAGE_SNIPPETS_QUERY;
|
|
9079
|
+
exports.Page = Page;
|
|
8739
9080
|
exports.PageProvider = PageProvider;
|
|
8740
9081
|
exports.ReactRuntime = ReactRuntime;
|
|
8741
9082
|
exports.Root = Root;
|
|
8742
9083
|
exports.RuntimeProvider = RuntimeProvider;
|
|
9084
|
+
exports.SITE_FONTS_QUERY = SITE_FONTS_QUERY;
|
|
8743
9085
|
exports.SocialLinks = SocialLinks;
|
|
8744
9086
|
exports.Text = Text;
|
|
8745
9087
|
exports.cssBorder = cssBorder;
|
|
@@ -8751,6 +9093,7 @@ exports.cssMediaRules = cssMediaRules;
|
|
|
8751
9093
|
exports.cssPadding = cssPadding;
|
|
8752
9094
|
exports.cssTextStyle = cssTextStyle;
|
|
8753
9095
|
exports.cssWidth = cssWidth;
|
|
9096
|
+
exports.deepEqual = deepEqual;
|
|
8754
9097
|
exports.registerBuiltinComponents = registerBuiltinComponents;
|
|
8755
9098
|
exports.registerComponent = registerComponent$c;
|
|
8756
9099
|
exports.useBackgrounds = useBackgrounds;
|