@makeswift/runtime 0.0.22 → 0.1.0-next.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 +502 -0
- package/dist/Box.cjs.js.map +1 -0
- package/dist/Box.es.js +496 -0
- package/dist/Box.es.js.map +1 -0
- package/dist/Button.cjs.js +308 -0
- package/dist/Button.cjs.js.map +1 -0
- package/dist/Button.es.js +301 -0
- package/dist/Button.es.js.map +1 -0
- package/dist/Carousel.cjs.js +487 -0
- package/dist/Carousel.cjs.js.map +1 -0
- package/dist/Carousel.es.js +481 -0
- package/dist/Carousel.es.js.map +1 -0
- package/dist/Countdown.cjs.js +340 -0
- package/dist/Countdown.cjs.js.map +1 -0
- package/dist/Countdown.es.js +334 -0
- package/dist/Countdown.es.js.map +1 -0
- package/dist/Divider.cjs.js +115 -0
- package/dist/Divider.cjs.js.map +1 -0
- package/dist/Divider.es.js +109 -0
- package/dist/Divider.es.js.map +1 -0
- package/dist/Embed.cjs.js +129 -0
- package/dist/Embed.cjs.js.map +1 -0
- package/dist/Embed.es.js +123 -0
- package/dist/Embed.es.js.map +1 -0
- package/dist/Form.cjs.js +1705 -0
- package/dist/Form.cjs.js.map +1 -0
- package/dist/Form.es.js +1677 -0
- package/dist/Form.es.js.map +1 -0
- package/dist/Image.cjs2.js +148 -0
- package/dist/Image.cjs2.js.map +1 -0
- package/dist/Image.es2.js +141 -0
- package/dist/Image.es2.js.map +1 -0
- package/dist/Navigation.cjs.js +736 -0
- package/dist/Navigation.cjs.js.map +1 -0
- package/dist/Navigation.es.js +710 -0
- package/dist/Navigation.es.js.map +1 -0
- package/dist/Root.cjs.js +143 -0
- package/dist/Root.cjs.js.map +1 -0
- package/dist/Root.es.js +137 -0
- package/dist/Root.es.js.map +1 -0
- package/dist/SocialLinks.cjs.js +900 -0
- package/dist/SocialLinks.cjs.js.map +1 -0
- package/dist/SocialLinks.es.js +874 -0
- package/dist/SocialLinks.es.js.map +1 -0
- package/dist/Text.cjs.js +475 -0
- package/dist/Text.cjs.js.map +1 -0
- package/dist/Text.es.js +467 -0
- package/dist/Text.es.js.map +1 -0
- package/dist/Video.cjs.js +121 -0
- package/dist/Video.cjs.js.map +1 -0
- package/dist/Video.es.js +114 -0
- package/dist/Video.es.js.map +1 -0
- package/dist/components.cjs.js +80 -58
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +41 -18
- package/dist/components.es.js.map +1 -1
- package/dist/cssMediaRules.cjs.js +222 -0
- package/dist/cssMediaRules.cjs.js.map +1 -0
- package/dist/cssMediaRules.es.js +213 -0
- package/dist/cssMediaRules.es.js.map +1 -0
- package/dist/descriptors.es.js +1 -1
- package/dist/index.cjs.js +1410 -7741
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +522 -0
- package/dist/index.cjs2.js.map +1 -0
- package/dist/index.cjs3.js +141 -0
- package/dist/index.cjs3.js.map +1 -0
- package/dist/index.cjs4.js +18 -0
- package/dist/index.cjs4.js.map +1 -0
- package/dist/index.es.js +1341 -7697
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +514 -0
- package/dist/index.es2.js.map +1 -0
- package/dist/index.es3.js +134 -0
- package/dist/index.es3.js.map +1 -0
- package/dist/index.es4.js +13 -0
- package/dist/index.es4.js.map +1 -0
- package/dist/next.cjs.js +19 -201
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +12 -192
- package/dist/next.es.js.map +1 -1
- package/dist/placeholders.cjs.js +13 -0
- package/dist/placeholders.cjs.js.map +1 -0
- package/dist/placeholders.es.js +12 -0
- package/dist/placeholders.es.js.map +1 -0
- package/dist/react-builder-preview.cjs.js +23 -33
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +13 -23
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react-page.es.js +1 -1
- package/dist/react.cjs.js +16 -28
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +8 -20
- package/dist/react.es.js.map +1 -1
- package/dist/types/components/builtin/Box/Box.d.ts +1 -4
- package/dist/types/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/animations.d.ts +1 -8
- package/dist/types/components/builtin/Box/animations.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/constants.d.ts +9 -0
- package/dist/types/components/builtin/Box/constants.d.ts.map +1 -0
- package/dist/types/components/builtin/Box/contants.d.ts +9 -0
- package/dist/types/components/builtin/Box/contants.d.ts.map +1 -0
- package/dist/types/components/builtin/Box/index.d.ts +2 -2
- package/dist/types/components/builtin/Box/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/register.d.ts +3 -0
- package/dist/types/components/builtin/Box/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Button/Button.d.ts +1 -4
- package/dist/types/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/components/builtin/Button/constants.d.ts +2 -0
- package/dist/types/components/builtin/Button/constants.d.ts.map +1 -0
- package/dist/types/components/builtin/Button/contants.d.ts +2 -0
- package/dist/types/components/builtin/Button/contants.d.ts.map +1 -0
- package/dist/types/components/builtin/Button/index.d.ts +1 -1
- package/dist/types/components/builtin/Button/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Button/register.d.ts +3 -0
- package/dist/types/components/builtin/Button/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Carousel/Carousel.d.ts +0 -3
- package/dist/types/components/builtin/Carousel/Carousel.d.ts.map +1 -1
- package/dist/types/components/builtin/Carousel/index.d.ts +1 -1
- package/dist/types/components/builtin/Carousel/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Carousel/register.d.ts +3 -0
- package/dist/types/components/builtin/Carousel/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Countdown/Countdown.d.ts +0 -3
- package/dist/types/components/builtin/Countdown/Countdown.d.ts.map +1 -1
- package/dist/types/components/builtin/Countdown/index.d.ts +1 -1
- package/dist/types/components/builtin/Countdown/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Countdown/register.d.ts +3 -0
- package/dist/types/components/builtin/Countdown/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Divider/Divider.d.ts +0 -3
- package/dist/types/components/builtin/Divider/Divider.d.ts.map +1 -1
- package/dist/types/components/builtin/Divider/index.d.ts +1 -1
- package/dist/types/components/builtin/Divider/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Divider/register.d.ts +3 -0
- package/dist/types/components/builtin/Divider/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Embed/Embed.d.ts +0 -3
- package/dist/types/components/builtin/Embed/Embed.d.ts.map +1 -1
- package/dist/types/components/builtin/Embed/index.d.ts +1 -1
- package/dist/types/components/builtin/Embed/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Embed/register.d.ts +3 -0
- package/dist/types/components/builtin/Embed/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/Form.d.ts +1 -10
- package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/constants.d.ts +1 -0
- package/dist/types/components/builtin/Form/constants.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/context/FormContext.d.ts +6 -0
- package/dist/types/components/builtin/Form/context/FormContext.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/index.d.ts +1 -1
- package/dist/types/components/builtin/Form/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/register.d.ts +3 -0
- package/dist/types/components/builtin/Form/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Image/Image.d.ts +0 -3
- package/dist/types/components/builtin/Image/Image.d.ts.map +1 -1
- package/dist/types/components/builtin/Image/index.d.ts +1 -1
- package/dist/types/components/builtin/Image/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Image/register.d.ts +3 -0
- package/dist/types/components/builtin/Image/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Navigation/Navigation.d.ts +0 -3
- package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/index.d.ts +1 -1
- package/dist/types/components/builtin/Navigation/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/register.d.ts +3 -0
- package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Root/Root.d.ts +0 -2
- package/dist/types/components/builtin/Root/Root.d.ts.map +1 -1
- package/dist/types/components/builtin/Root/index.d.ts +1 -1
- package/dist/types/components/builtin/Root/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Root/register.d.ts +3 -0
- package/dist/types/components/builtin/Root/register.d.ts.map +1 -0
- package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts +0 -3
- package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/index.d.ts +1 -1
- package/dist/types/components/builtin/SocialLinks/index.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/register.d.ts +3 -0
- package/dist/types/components/builtin/SocialLinks/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/Text.d.ts +0 -3
- package/dist/types/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/components/builtin/Text/index.d.ts +1 -1
- package/dist/types/components/builtin/Text/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Text/register.d.ts +3 -0
- package/dist/types/components/builtin/Text/register.d.ts.map +1 -0
- package/dist/types/components/builtin/Video/Video.d.ts +0 -3
- package/dist/types/components/builtin/Video/Video.d.ts.map +1 -1
- package/dist/types/components/builtin/Video/index.d.ts +1 -1
- package/dist/types/components/builtin/Video/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Video/register.d.ts +3 -0
- package/dist/types/components/builtin/Video/register.d.ts.map +1 -0
- package/dist/types/components/builtin/index.d.ts +1 -2
- package/dist/types/components/builtin/index.d.ts.map +1 -1
- package/dist/types/components/builtin/register.d.ts +3 -0
- package/dist/types/components/builtin/register.d.ts.map +1 -0
- package/dist/types/dynamic.d.ts +2 -0
- package/dist/types/dynamic.d.ts.map +1 -0
- package/dist/types/next/plugin.d.ts +3 -0
- package/dist/types/next/plugin.d.ts.map +1 -0
- package/dist/types/next.d.ts +12 -2
- package/dist/types/next.d.ts.map +1 -1
- package/dist/useBackgrounds.cjs.js +124 -0
- package/dist/useBackgrounds.cjs.js.map +1 -0
- package/dist/useBackgrounds.es.js +123 -0
- package/dist/useBackgrounds.es.js.map +1 -0
- package/dist/useBoxShadow.cjs.js +78 -0
- package/dist/useBoxShadow.cjs.js.map +1 -0
- package/dist/useBoxShadow.es.js +77 -0
- package/dist/useBoxShadow.es.js.map +1 -0
- package/dist/useMediaQuery.cjs.js +26 -0
- package/dist/useMediaQuery.cjs.js.map +1 -0
- package/dist/useMediaQuery.es.js +25 -0
- package/dist/useMediaQuery.es.js.map +1 -0
- package/dist/usePage.cjs.js +14 -0
- package/dist/usePage.cjs.js.map +1 -0
- package/dist/usePage.es.js +13 -0
- package/dist/usePage.es.js.map +1 -0
- package/dist/useTable.cjs.js +10 -0
- package/dist/useTable.cjs.js.map +1 -0
- package/dist/useTable.es.js +9 -0
- package/dist/useTable.es.js.map +1 -0
- package/next/plugin.js +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { forwardRef } from "react";
|
|
33
|
+
import scrollIntoView from "scroll-into-view-if-needed";
|
|
34
|
+
import NextLink from "next/link";
|
|
35
|
+
import { q as useQuery, M as PAGE_PATHNAMES_BY_ID, N as useElementId } from "./index.es.js";
|
|
36
|
+
import { jsx } from "react/jsx-runtime";
|
|
37
|
+
function usePage(pageId) {
|
|
38
|
+
const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
|
|
39
|
+
skip: pageId == null,
|
|
40
|
+
variables: { ids: [pageId] }
|
|
41
|
+
});
|
|
42
|
+
if (pageId == null || error != null)
|
|
43
|
+
return null;
|
|
44
|
+
const { pagePathnamesById: [page] = [] } = data;
|
|
45
|
+
return page;
|
|
46
|
+
}
|
|
47
|
+
const Link = forwardRef(function Link2(_a, ref) {
|
|
48
|
+
var _b = _a, {
|
|
49
|
+
link,
|
|
50
|
+
onClick = () => {
|
|
51
|
+
}
|
|
52
|
+
} = _b, restOfProps = __objRest(_b, [
|
|
53
|
+
"link",
|
|
54
|
+
"onClick"
|
|
55
|
+
]);
|
|
56
|
+
var _a2;
|
|
57
|
+
const page = usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
|
|
58
|
+
const elementKey = (link == null ? void 0 : link.type) === "SCROLL_TO_ELEMENT" ? (_a2 = link.payload.elementIdConfig) == null ? void 0 : _a2.elementKey : null;
|
|
59
|
+
const elementId = useElementId(elementKey);
|
|
60
|
+
let href = "";
|
|
61
|
+
let target;
|
|
62
|
+
let block;
|
|
63
|
+
if (link) {
|
|
64
|
+
switch (link.type) {
|
|
65
|
+
case "OPEN_PAGE": {
|
|
66
|
+
if (page)
|
|
67
|
+
href = `/${page.pathname}`;
|
|
68
|
+
target = link.payload.openInNewTab ? "_blank" : "_self";
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "OPEN_URL": {
|
|
72
|
+
href = link.payload.url;
|
|
73
|
+
target = link.payload.openInNewTab ? "_blank" : "_self";
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case "SEND_EMAIL": {
|
|
77
|
+
const {
|
|
78
|
+
to,
|
|
79
|
+
subject = "",
|
|
80
|
+
body = ""
|
|
81
|
+
} = link.payload;
|
|
82
|
+
if (to != null)
|
|
83
|
+
href = `mailto:${to}?subject=${subject}&body=${body}`;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case "CALL_PHONE": {
|
|
87
|
+
href = `tel:${link.payload.phoneNumber}`;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "SCROLL_TO_ELEMENT": {
|
|
91
|
+
href = `#${elementId != null ? elementId : ""}`;
|
|
92
|
+
block = link.payload.block;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
throw new RangeError(`Invalid link type "${link.type}."`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function handleClick(event) {
|
|
100
|
+
onClick(event);
|
|
101
|
+
if (event.defaultPrevented)
|
|
102
|
+
return;
|
|
103
|
+
if (event.currentTarget.isContentEditable)
|
|
104
|
+
return event.preventDefault();
|
|
105
|
+
if (link && link.type === "SCROLL_TO_ELEMENT") {
|
|
106
|
+
let hash;
|
|
107
|
+
try {
|
|
108
|
+
hash = new URL(`http://www.example.com/${href}`).hash;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(`Link received invalid href: ${href}`, error);
|
|
111
|
+
}
|
|
112
|
+
if (href != null && href === hash) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
const view = event.view;
|
|
115
|
+
scrollIntoView(view.document.querySelector(hash), {
|
|
116
|
+
behavior: "smooth",
|
|
117
|
+
block
|
|
118
|
+
});
|
|
119
|
+
if (view.location.hash !== hash)
|
|
120
|
+
view.history.pushState({}, "", hash);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return /* @__PURE__ */ jsx(NextLink, {
|
|
125
|
+
href,
|
|
126
|
+
children: /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({}, restOfProps), {
|
|
127
|
+
ref,
|
|
128
|
+
target,
|
|
129
|
+
onClick: handleClick
|
|
130
|
+
}))
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
export { Link as L, usePage as u };
|
|
134
|
+
//# sourceMappingURL=index.es3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es3.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":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,iBAAiB,QAA4D;AAClF,QAAM,EAAE,OAAO,OAAO,CAAC,MAAM,SAAS,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;ACJaA,MAAAA,OAAOC,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,aAAaH,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,uBAAeD,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,6BACG,UAAD;AAAA,IAAU;AAAA,IAAV,oEAES3B;MAAa;AAAA,MAAU;AAAA,MAAgB,SAASqB;AAAAA,IAAAA,EAAvD;AAAA,EAAA,CAHJ;AAMD,CAlG6B;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { c as cssMediaRules } from "./cssMediaRules.es.js";
|
|
3
|
+
const GutterContainer = styled.div`
|
|
4
|
+
${(p) => cssMediaRules([p.gutter], ([gutter = {
|
|
5
|
+
value: 0,
|
|
6
|
+
unit: "px"
|
|
7
|
+
}]) => css`
|
|
8
|
+
padding-left: ${p.first ? "0px" : `${gutter.value / 2}${gutter.unit}`};
|
|
9
|
+
padding-right: ${p.last ? "0px" : `${gutter.value / 2}${gutter.unit}`};
|
|
10
|
+
`)}
|
|
11
|
+
`;
|
|
12
|
+
export { GutterContainer as G };
|
|
13
|
+
//# sourceMappingURL=index.es4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es4.js","sources":["../src/components/shared/GutterContainer/index.tsx"],"sourcesContent":["import styled, { css } from 'styled-components'\n\nimport { ResponsiveValue, Length } from '../../../prop-controllers/descriptors'\nimport { cssMediaRules } from '../../utils/cssMediaRules'\n\nconst GutterContainer = styled.div<{\n gutter?: ResponsiveValue<Length>\n first: boolean\n last: boolean\n}>`\n ${p =>\n cssMediaRules(\n [p.gutter],\n ([gutter = { value: 0, unit: 'px' }]) => css`\n padding-left: ${p.first ? '0px' : `${gutter.value / 2}${gutter.unit}`};\n padding-right: ${p.last ? '0px' : `${gutter.value / 2}${gutter.unit}`};\n `,\n )}\n`\n\nexport default GutterContainer\n"],"names":["GutterContainer","styled","div","p","cssMediaRules","gutter","value","unit","css","first","last"],"mappings":";;AAKA,MAAMA,kBAAkBC,OAAOC;AAAAA,IAK3BC,CAAAA,MACAC,cACE,CAACD,EAAEE,MAAH,GACA,CAAC,CAACA,SAAS;AAAA,EAAEC,OAAO;AAAA,EAAGC,MAAM;AAAlB,OAA8BC;AAAAA,wBACvBL,EAAEM,QAAQ,QAAS,GAAEJ,OAAOC,QAAQ,IAAID,OAAOE;AAAAA,yBAC9CJ,EAAEO,OAAO,QAAS,GAAEL,OAAOC,QAAQ,IAAID,OAAOE;AAAAA,OAJtD;AAAA;;"}
|
package/dist/next.cjs.js
CHANGED
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
3
|
+
require("next/document");
|
|
4
|
+
require("react");
|
|
5
|
+
require("styled-components");
|
|
6
|
+
require("slate");
|
|
7
|
+
require("@emotion/server/create-instance");
|
|
8
|
+
require("@emotion/css");
|
|
9
|
+
var next = require("./index.cjs.js");
|
|
10
|
+
require("react/jsx-runtime");
|
|
30
11
|
require("use-sync-external-store/shim/with-selector");
|
|
31
12
|
require("./react-page.cjs.js");
|
|
32
13
|
require("redux");
|
|
@@ -36,186 +17,23 @@ require("./descriptors.cjs.js");
|
|
|
36
17
|
require("./style.cjs.js");
|
|
37
18
|
require("./color.cjs.js");
|
|
38
19
|
require("./image.cjs.js");
|
|
39
|
-
require("
|
|
20
|
+
require("next/dynamic");
|
|
40
21
|
require("@apollo/client");
|
|
41
22
|
require("@apollo/client/link/batch-http");
|
|
42
23
|
require("./graphql.cjs.js");
|
|
24
|
+
require("./text-input.cjs.js");
|
|
43
25
|
require("./shape.cjs.js");
|
|
26
|
+
require("color");
|
|
27
|
+
require("react-dom");
|
|
44
28
|
require("html-react-parser");
|
|
45
29
|
require("next/head");
|
|
46
|
-
require("color");
|
|
47
|
-
require("scroll-into-view-if-needed");
|
|
48
|
-
require("next/link");
|
|
49
|
-
require("react-use-gesture");
|
|
50
|
-
require("@popmotion/popcorn");
|
|
51
30
|
require("uuid/v4");
|
|
52
|
-
require("next/image");
|
|
53
|
-
require("formik");
|
|
54
|
-
require("./box-models.cjs.js");
|
|
55
|
-
require("css-box-model");
|
|
56
|
-
require("polished");
|
|
57
|
-
require("react-player");
|
|
58
|
-
require("slate-hotkeys");
|
|
59
31
|
require("corporate-ipsum");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
var NextDocument__default = /* @__PURE__ */ _interopDefaultLegacy(NextDocument);
|
|
69
|
-
var createEmotionServer__default = /* @__PURE__ */ _interopDefaultLegacy(createEmotionServer);
|
|
70
|
-
class Document extends NextDocument__default["default"] {
|
|
71
|
-
static async getInitialProps(ctx) {
|
|
72
|
-
const sheet = new styled.ServerStyleSheet();
|
|
73
|
-
const originalRenderPage = ctx.renderPage;
|
|
74
|
-
try {
|
|
75
|
-
ctx.renderPage = () => originalRenderPage({
|
|
76
|
-
enhanceApp: (App) => (props) => sheet.collectStyles(/* @__PURE__ */ jsxRuntime.jsx(App, __spreadValues({}, props)))
|
|
77
|
-
});
|
|
78
|
-
const initialProps = await NextDocument__default["default"].getInitialProps(ctx);
|
|
79
|
-
slate.KeyUtils.resetGenerator();
|
|
80
|
-
const {
|
|
81
|
-
extractCritical
|
|
82
|
-
} = createEmotionServer__default["default"](css.cache);
|
|
83
|
-
const {
|
|
84
|
-
ids,
|
|
85
|
-
css: css$1
|
|
86
|
-
} = extractCritical(initialProps.html);
|
|
87
|
-
return __spreadProps(__spreadValues({}, initialProps), {
|
|
88
|
-
styles: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
89
|
-
children: [initialProps.styles, sheet.getStyleElement(), /* @__PURE__ */ jsxRuntime.jsx("style", {
|
|
90
|
-
"data-emotion": `css ${ids.join(" ")}`,
|
|
91
|
-
dangerouslySetInnerHTML: {
|
|
92
|
-
__html: css$1
|
|
93
|
-
}
|
|
94
|
-
})]
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
} finally {
|
|
98
|
-
sheet.seal();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const REVALIDATE_SECONDS = 1;
|
|
103
|
-
async function getServerSideProps({
|
|
104
|
-
query: {
|
|
105
|
-
pageId
|
|
106
|
-
}
|
|
107
|
-
}) {
|
|
108
|
-
const url = `${process["env"].MAKESWIFT_API_HOST}/v0/preview-page-data?id=${pageId}`;
|
|
109
|
-
const res = await fetch(url, {
|
|
110
|
-
headers: {
|
|
111
|
-
"x-api-key": process["env"].MAKESWIFT_SITE_API_KEY
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
if (res.status !== 200) {
|
|
115
|
-
console.error(await res.json());
|
|
116
|
-
return {
|
|
117
|
-
notFound: true
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
const page = await res.json();
|
|
121
|
-
if (page == null)
|
|
122
|
-
return {
|
|
123
|
-
notFound: true
|
|
124
|
-
};
|
|
125
|
-
const makeswiftApiEndpoint = `${process["env"].MAKESWIFT_API_HOST}/graphql`;
|
|
126
|
-
const client = new index.MakeswiftClient({
|
|
127
|
-
uri: makeswiftApiEndpoint
|
|
128
|
-
});
|
|
129
|
-
const cacheData = await client.prefetch(page.data);
|
|
130
|
-
return {
|
|
131
|
-
props: {
|
|
132
|
-
page,
|
|
133
|
-
rootElement: page.data,
|
|
134
|
-
makeswiftApiEndpoint,
|
|
135
|
-
cacheData,
|
|
136
|
-
preview: true
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
async function getStaticProps({
|
|
141
|
-
params
|
|
142
|
-
}) {
|
|
143
|
-
if (params == null)
|
|
144
|
-
return {
|
|
145
|
-
notFound: true,
|
|
146
|
-
revalidate: REVALIDATE_SECONDS
|
|
147
|
-
};
|
|
148
|
-
const {
|
|
149
|
-
path = []
|
|
150
|
-
} = params;
|
|
151
|
-
const url = `${process["env"].MAKESWIFT_API_HOST}/v0/live-page-data?path=${path.join("/")}`;
|
|
152
|
-
const res = await fetch(url, {
|
|
153
|
-
headers: {
|
|
154
|
-
"x-api-key": process["env"].MAKESWIFT_SITE_API_KEY
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
if (res.status !== 200) {
|
|
158
|
-
console.error(await res.json());
|
|
159
|
-
return {
|
|
160
|
-
notFound: true,
|
|
161
|
-
revalidate: REVALIDATE_SECONDS
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
const page = await res.json();
|
|
165
|
-
if (page == null)
|
|
166
|
-
return {
|
|
167
|
-
notFound: true,
|
|
168
|
-
revalidate: REVALIDATE_SECONDS
|
|
169
|
-
};
|
|
170
|
-
const makeswiftApiEndpoint = `${process["env"].MAKESWIFT_API_HOST}/graphql`;
|
|
171
|
-
const client = new index.MakeswiftClient({
|
|
172
|
-
uri: makeswiftApiEndpoint
|
|
173
|
-
});
|
|
174
|
-
const cacheData = await client.prefetch(page.data);
|
|
175
|
-
return {
|
|
176
|
-
props: {
|
|
177
|
-
page,
|
|
178
|
-
rootElement: page.data,
|
|
179
|
-
makeswiftApiEndpoint,
|
|
180
|
-
cacheData,
|
|
181
|
-
preview: false
|
|
182
|
-
},
|
|
183
|
-
revalidate: REVALIDATE_SECONDS
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
async function getStaticPaths() {
|
|
187
|
-
return {
|
|
188
|
-
paths: [],
|
|
189
|
-
fallback: "blocking"
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
function Page({
|
|
193
|
-
page,
|
|
194
|
-
rootElement,
|
|
195
|
-
makeswiftApiEndpoint,
|
|
196
|
-
cacheData,
|
|
197
|
-
preview
|
|
198
|
-
}) {
|
|
199
|
-
const [client] = React.useState(() => new index.MakeswiftClient({
|
|
200
|
-
uri: makeswiftApiEndpoint,
|
|
201
|
-
cacheData
|
|
202
|
-
}));
|
|
203
|
-
React.useEffect(() => {
|
|
204
|
-
client.updateCacheData(cacheData);
|
|
205
|
-
}, [client, cacheData]);
|
|
206
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.RuntimeProvider, {
|
|
207
|
-
client,
|
|
208
|
-
rootElements: /* @__PURE__ */ new Map([[page.id, rootElement]]),
|
|
209
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(index.Page, {
|
|
210
|
-
page,
|
|
211
|
-
preview
|
|
212
|
-
})
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
exports.MakeswiftClient = index.MakeswiftClient;
|
|
216
|
-
exports.Document = Document;
|
|
217
|
-
exports.Page = Page;
|
|
218
|
-
exports.getServerSideProps = getServerSideProps;
|
|
219
|
-
exports.getStaticPaths = getStaticPaths;
|
|
220
|
-
exports.getStaticProps = getStaticProps;
|
|
32
|
+
exports.Document = next.Document;
|
|
33
|
+
exports.MakeswiftClient = next.MakeswiftClient;
|
|
34
|
+
exports.Page = next.Page$1;
|
|
35
|
+
exports.forwardNextDynamicRef = next.forwardNextDynamicRef;
|
|
36
|
+
exports.getServerSideProps = next.getServerSideProps;
|
|
37
|
+
exports.getStaticPaths = next.getStaticPaths;
|
|
38
|
+
exports.getStaticProps = next.getStaticProps;
|
|
221
39
|
//# sourceMappingURL=next.cjs.js.map
|
package/dist/next.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.cjs.js","sources":[
|
|
1
|
+
{"version":3,"file":"next.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/next.es.js
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import NextDocument from "next/document";
|
|
21
|
-
import { useState, useEffect } from "react";
|
|
22
|
-
import { ServerStyleSheet } from "styled-components";
|
|
23
|
-
import { KeyUtils } from "slate";
|
|
24
|
-
import createEmotionServer from "@emotion/server/create-instance";
|
|
25
|
-
import { cache } from "@emotion/css";
|
|
26
|
-
import { W as MakeswiftClient, R as RuntimeProvider, V as Page$1 } from "./index.es.js";
|
|
27
|
-
export { W as MakeswiftClient } from "./index.es.js";
|
|
28
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
1
|
+
import "next/document";
|
|
2
|
+
import "react";
|
|
3
|
+
import "styled-components";
|
|
4
|
+
import "slate";
|
|
5
|
+
import "@emotion/server/create-instance";
|
|
6
|
+
import "@emotion/css";
|
|
7
|
+
export { U as Document, Q as MakeswiftClient, Y as Page, Z as forwardNextDynamicRef, V as getServerSideProps, X as getStaticPaths, W as getStaticProps } from "./index.es.js";
|
|
8
|
+
import "react/jsx-runtime";
|
|
29
9
|
import "use-sync-external-store/shim/with-selector";
|
|
30
10
|
import "./react-page.es.js";
|
|
31
11
|
import "redux";
|
|
@@ -35,176 +15,16 @@ import "./descriptors.es.js";
|
|
|
35
15
|
import "./style.es.js";
|
|
36
16
|
import "./color.es.js";
|
|
37
17
|
import "./image.es.js";
|
|
38
|
-
import "
|
|
18
|
+
import "next/dynamic";
|
|
39
19
|
import "@apollo/client";
|
|
40
20
|
import "@apollo/client/link/batch-http";
|
|
41
21
|
import "./graphql.es.js";
|
|
22
|
+
import "./text-input.es.js";
|
|
42
23
|
import "./shape.es.js";
|
|
24
|
+
import "color";
|
|
25
|
+
import "react-dom";
|
|
43
26
|
import "html-react-parser";
|
|
44
27
|
import "next/head";
|
|
45
|
-
import "color";
|
|
46
|
-
import "scroll-into-view-if-needed";
|
|
47
|
-
import "next/link";
|
|
48
|
-
import "react-use-gesture";
|
|
49
|
-
import "@popmotion/popcorn";
|
|
50
28
|
import "uuid/v4";
|
|
51
|
-
import "next/image";
|
|
52
|
-
import "formik";
|
|
53
|
-
import "./box-models.es.js";
|
|
54
|
-
import "css-box-model";
|
|
55
|
-
import "polished";
|
|
56
|
-
import "react-player";
|
|
57
|
-
import "slate-hotkeys";
|
|
58
29
|
import "corporate-ipsum";
|
|
59
|
-
import "is-hotkey";
|
|
60
|
-
import "slate-react";
|
|
61
|
-
import "@convertkit/slate-lists";
|
|
62
|
-
import "./text-input.es.js";
|
|
63
|
-
import "react-dom";
|
|
64
|
-
class Document extends NextDocument {
|
|
65
|
-
static async getInitialProps(ctx) {
|
|
66
|
-
const sheet = new ServerStyleSheet();
|
|
67
|
-
const originalRenderPage = ctx.renderPage;
|
|
68
|
-
try {
|
|
69
|
-
ctx.renderPage = () => originalRenderPage({
|
|
70
|
-
enhanceApp: (App) => (props) => sheet.collectStyles(/* @__PURE__ */ jsx(App, __spreadValues({}, props)))
|
|
71
|
-
});
|
|
72
|
-
const initialProps = await NextDocument.getInitialProps(ctx);
|
|
73
|
-
KeyUtils.resetGenerator();
|
|
74
|
-
const {
|
|
75
|
-
extractCritical
|
|
76
|
-
} = createEmotionServer(cache);
|
|
77
|
-
const {
|
|
78
|
-
ids,
|
|
79
|
-
css
|
|
80
|
-
} = extractCritical(initialProps.html);
|
|
81
|
-
return __spreadProps(__spreadValues({}, initialProps), {
|
|
82
|
-
styles: /* @__PURE__ */ jsxs(Fragment, {
|
|
83
|
-
children: [initialProps.styles, sheet.getStyleElement(), /* @__PURE__ */ jsx("style", {
|
|
84
|
-
"data-emotion": `css ${ids.join(" ")}`,
|
|
85
|
-
dangerouslySetInnerHTML: {
|
|
86
|
-
__html: css
|
|
87
|
-
}
|
|
88
|
-
})]
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
} finally {
|
|
92
|
-
sheet.seal();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const REVALIDATE_SECONDS = 1;
|
|
97
|
-
async function getServerSideProps({
|
|
98
|
-
query: {
|
|
99
|
-
pageId
|
|
100
|
-
}
|
|
101
|
-
}) {
|
|
102
|
-
const url = `${process["env"].MAKESWIFT_API_HOST}/v0/preview-page-data?id=${pageId}`;
|
|
103
|
-
const res = await fetch(url, {
|
|
104
|
-
headers: {
|
|
105
|
-
"x-api-key": process["env"].MAKESWIFT_SITE_API_KEY
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
if (res.status !== 200) {
|
|
109
|
-
console.error(await res.json());
|
|
110
|
-
return {
|
|
111
|
-
notFound: true
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
const page = await res.json();
|
|
115
|
-
if (page == null)
|
|
116
|
-
return {
|
|
117
|
-
notFound: true
|
|
118
|
-
};
|
|
119
|
-
const makeswiftApiEndpoint = `${process["env"].MAKESWIFT_API_HOST}/graphql`;
|
|
120
|
-
const client = new MakeswiftClient({
|
|
121
|
-
uri: makeswiftApiEndpoint
|
|
122
|
-
});
|
|
123
|
-
const cacheData = await client.prefetch(page.data);
|
|
124
|
-
return {
|
|
125
|
-
props: {
|
|
126
|
-
page,
|
|
127
|
-
rootElement: page.data,
|
|
128
|
-
makeswiftApiEndpoint,
|
|
129
|
-
cacheData,
|
|
130
|
-
preview: true
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
async function getStaticProps({
|
|
135
|
-
params
|
|
136
|
-
}) {
|
|
137
|
-
if (params == null)
|
|
138
|
-
return {
|
|
139
|
-
notFound: true,
|
|
140
|
-
revalidate: REVALIDATE_SECONDS
|
|
141
|
-
};
|
|
142
|
-
const {
|
|
143
|
-
path = []
|
|
144
|
-
} = params;
|
|
145
|
-
const url = `${process["env"].MAKESWIFT_API_HOST}/v0/live-page-data?path=${path.join("/")}`;
|
|
146
|
-
const res = await fetch(url, {
|
|
147
|
-
headers: {
|
|
148
|
-
"x-api-key": process["env"].MAKESWIFT_SITE_API_KEY
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
if (res.status !== 200) {
|
|
152
|
-
console.error(await res.json());
|
|
153
|
-
return {
|
|
154
|
-
notFound: true,
|
|
155
|
-
revalidate: REVALIDATE_SECONDS
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
const page = await res.json();
|
|
159
|
-
if (page == null)
|
|
160
|
-
return {
|
|
161
|
-
notFound: true,
|
|
162
|
-
revalidate: REVALIDATE_SECONDS
|
|
163
|
-
};
|
|
164
|
-
const makeswiftApiEndpoint = `${process["env"].MAKESWIFT_API_HOST}/graphql`;
|
|
165
|
-
const client = new MakeswiftClient({
|
|
166
|
-
uri: makeswiftApiEndpoint
|
|
167
|
-
});
|
|
168
|
-
const cacheData = await client.prefetch(page.data);
|
|
169
|
-
return {
|
|
170
|
-
props: {
|
|
171
|
-
page,
|
|
172
|
-
rootElement: page.data,
|
|
173
|
-
makeswiftApiEndpoint,
|
|
174
|
-
cacheData,
|
|
175
|
-
preview: false
|
|
176
|
-
},
|
|
177
|
-
revalidate: REVALIDATE_SECONDS
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
async function getStaticPaths() {
|
|
181
|
-
return {
|
|
182
|
-
paths: [],
|
|
183
|
-
fallback: "blocking"
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function Page({
|
|
187
|
-
page,
|
|
188
|
-
rootElement,
|
|
189
|
-
makeswiftApiEndpoint,
|
|
190
|
-
cacheData,
|
|
191
|
-
preview
|
|
192
|
-
}) {
|
|
193
|
-
const [client] = useState(() => new MakeswiftClient({
|
|
194
|
-
uri: makeswiftApiEndpoint,
|
|
195
|
-
cacheData
|
|
196
|
-
}));
|
|
197
|
-
useEffect(() => {
|
|
198
|
-
client.updateCacheData(cacheData);
|
|
199
|
-
}, [client, cacheData]);
|
|
200
|
-
return /* @__PURE__ */ jsx(RuntimeProvider, {
|
|
201
|
-
client,
|
|
202
|
-
rootElements: /* @__PURE__ */ new Map([[page.id, rootElement]]),
|
|
203
|
-
children: /* @__PURE__ */ jsx(Page$1, {
|
|
204
|
-
page,
|
|
205
|
-
preview
|
|
206
|
-
})
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
export { Document, Page, getServerSideProps, getStaticPaths, getStaticProps };
|
|
210
30
|
//# sourceMappingURL=next.es.js.map
|
package/dist/next.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.es.js","sources":[
|
|
1
|
+
{"version":3,"file":"next.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|