@makeswift/runtime 0.20.5 → 0.20.6-canary.1
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/cjs/components/shared/Link/index.js +1 -4
- package/dist/cjs/components/shared/Link/index.js.map +1 -1
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/runtimes/react/react-runtime.js +10 -0
- package/dist/cjs/runtimes/react/react-runtime.js.map +1 -1
- package/dist/esm/components/shared/Link/index.js +1 -4
- package/dist/esm/components/shared/Link/index.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/runtimes/react/react-runtime.js +10 -0
- package/dist/esm/runtimes/react/react-runtime.js.map +1 -1
- package/dist/types/components/shared/Link/index.d.ts.map +1 -1
- package/dist/types/runtimes/react/react-runtime.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -50,7 +50,6 @@ const Link = (0, import_react.forwardRef)(function Link2({ link, onClick = () =>
|
|
|
50
50
|
}, ...restOfProps }, ref) {
|
|
51
51
|
const pageId = link && link.type === "OPEN_PAGE" ? link.payload.pageId : null;
|
|
52
52
|
const page = (0, import_makeswift_api.usePagePathnameSlice)(pageId ?? null);
|
|
53
|
-
const hasLocalizedPathname = page?.localizedPathname != null;
|
|
54
53
|
const elementKey = link?.type === "SCROLL_TO_ELEMENT" ? link.payload.elementIdConfig?.elementKey : null;
|
|
55
54
|
const elementId = (0, import_use_element_id.useElementId)(elementKey);
|
|
56
55
|
let useNextLink;
|
|
@@ -130,9 +129,7 @@ const Link = (0, import_react.forwardRef)(function Link2({ link, onClick = () =>
|
|
|
130
129
|
target,
|
|
131
130
|
onClick: handleClick,
|
|
132
131
|
href,
|
|
133
|
-
|
|
134
|
-
locale: false
|
|
135
|
-
},
|
|
132
|
+
locale: false,
|
|
136
133
|
legacyBehavior: false
|
|
137
134
|
}
|
|
138
135
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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 { LinkData } from '@makeswift/prop-controllers'\nimport { useElementId } from '../../../runtimes/react/hooks/use-element-id'\nimport { usePagePathnameSlice } from '../../../runtimes/react/hooks/makeswift-api'\n\ntype BaseProps = {\n link?: LinkData\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseProps>\n\n// workaround for https://github.com/vercel/next.js/issues/66650\nconst isValidHref = (href: string) => {\n try {\n const bases = ['http://n', 'https://n']\n // - if `href` is a relative path, it will be resolved relative to the base URL\n // - if `href` is a full URL, the base URL will be ignored, even if there is a mismatch of protocols\n // - if `href` is an incomplete, protocol-only URL with a protocol that\n // conflicts with one of the base URL, this will throw\n bases.forEach(base => new URL(href, base))\n } catch (_) {\n return false\n }\n return true\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, Props>(function Link(\n { link, onClick = () => {}, ...restOfProps }: Props,\n ref,\n) {\n const pageId = link && link.type === 'OPEN_PAGE' ? link.payload.pageId : null\n const page = usePagePathnameSlice(pageId ?? null)\n
|
|
1
|
+
{"version":3,"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 { LinkData } from '@makeswift/prop-controllers'\nimport { useElementId } from '../../../runtimes/react/hooks/use-element-id'\nimport { usePagePathnameSlice } from '../../../runtimes/react/hooks/makeswift-api'\n\ntype BaseProps = {\n link?: LinkData\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseProps>\n\n// workaround for https://github.com/vercel/next.js/issues/66650\nconst isValidHref = (href: string) => {\n try {\n const bases = ['http://n', 'https://n']\n // - if `href` is a relative path, it will be resolved relative to the base URL\n // - if `href` is a full URL, the base URL will be ignored, even if there is a mismatch of protocols\n // - if `href` is an incomplete, protocol-only URL with a protocol that\n // conflicts with one of the base URL, this will throw\n bases.forEach(base => new URL(href, base))\n } catch (_) {\n return false\n }\n return true\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, Props>(function Link(\n { link, onClick = () => {}, ...restOfProps }: Props,\n ref,\n) {\n const pageId = link && link.type === 'OPEN_PAGE' ? link.payload.pageId : null\n const page = usePagePathnameSlice(pageId ?? null)\n\n const elementKey =\n link?.type === 'SCROLL_TO_ELEMENT' ? link.payload.elementIdConfig?.elementKey : null\n const elementId = useElementId(elementKey)\n\n // We don't want to use `next/link` with relative paths because Next.js will attempt to normalize\n // it and mess up the path.\n let useNextLink: boolean | undefined\n let href: string | undefined\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) {\n useNextLink = true\n\n href = `/${page.localizedPathname ?? page.pathname}`\n }\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'OPEN_URL': {\n useNextLink = isValidHref(link.payload.url)\n\n href = link.payload.url\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'SEND_EMAIL': {\n useNextLink = false\n\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 useNextLink = false\n\n href = `tel:${link.payload.phoneNumber}`\n\n break\n }\n\n case 'SCROLL_TO_ELEMENT': {\n useNextLink = false\n\n href = `#${elementId ?? ''}`\n\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 if (href != null) 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 && hash != 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 if (useNextLink && href != null) {\n return (\n <NextLink\n {...restOfProps}\n ref={ref}\n target={target}\n onClick={handleClick}\n href={href}\n locale={false}\n // Next.js v12 has legacyBehavior set to true by default\n legacyBehavior={false}\n />\n )\n }\n\n // eslint-disable-next-line\n return <a {...restOfProps} ref={ref} href={href} target={target} onClick={handleClick} />\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8IM;AA9IN,mBAAiE;AACjE,wCAA2B;AAC3B,kBAAqB;AAGrB,4BAA6B;AAC7B,2BAAqC;AAUrC,MAAM,cAAc,CAAC,SAAiB;AACpC,MAAI;AACF,UAAM,QAAQ,CAAC,YAAY,WAAW;AAKtC,UAAM,QAAQ,UAAQ,IAAI,IAAI,MAAM,IAAI,CAAC;AAAA,EAC3C,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,MAAM,WAAO,yBAAqC,SAASA,MAChE,EAAE,MAAM,UAAU,MAAM;AAAC,GAAG,GAAG,YAAY,GAC3C,KACA;AACA,QAAM,SAAS,QAAQ,KAAK,SAAS,cAAc,KAAK,QAAQ,SAAS;AACzE,QAAM,WAAO,2CAAqB,UAAU,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AI,EAAE,EAAE;AAAA,MACrE,SAAS,OAAO;AACd,gBAAQ,MAAM,+BAA+B,IAAI,IAAI,KAAK;AAAA,MAC5D;AAEA,UAAI,QAAQ,QAAQ,QAAQ,QAAQ,SAAS,MAAM;AACjD,cAAM,eAAe;AACrB,cAAM,OAAO,MAAM;AAEnB,8CAAAC,SAAe,KAAK,SAAS,cAAc,IAAI,GAAI;AAAA,UACjD,UAAU;AAAA,UACV;AAAA,QACF,CAAC;AAED,YAAI,KAAK,SAAS,SAAS;AAAM,eAAK,QAAQ,UAAU,CAAC,GAAG,IAAI,IAAI;AAAA,MACtE;AAAA,IACF;AAAA,EACF;AAEA,MAAI,eAAe,QAAQ,MAAM;AAC/B,WACE;AAAA,MAAC,YAAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA,QAAQ;AAAA,QAER,gBAAgB;AAAA;AAAA,IAClB;AAAA,EAEJ;AAGA,SAAO,4CAAC,OAAG,GAAG,aAAa,KAAU,MAAY,QAAgB,SAAS,aAAa;AACzF,CAAC;","names":["Link","scrollIntoView","NextLink"]}
|
|
@@ -36,7 +36,7 @@ async function handler(...args) {
|
|
|
36
36
|
const supportsPreviewMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
|
|
37
37
|
const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
38
38
|
const body = {
|
|
39
|
-
version: "0.20.
|
|
39
|
+
version: "0.20.6-canary.1",
|
|
40
40
|
previewMode: supportsPreviewMode,
|
|
41
41
|
draftMode: supportsDraftMode,
|
|
42
42
|
interactionMode: true,
|
|
@@ -25,6 +25,14 @@ var import_register = require("../../components/builtin/register");
|
|
|
25
25
|
var import_actions = require("../../state/actions");
|
|
26
26
|
var import_components_meta = require("../../state/modules/components-meta");
|
|
27
27
|
var import_runtime_core = require("./runtime-core");
|
|
28
|
+
function validateComponentType(type, component) {
|
|
29
|
+
const componentName = component?.name ?? "Component";
|
|
30
|
+
if (typeof type !== "string" || type === "") {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`${componentName}: A non-empty string \`type\` is required for component registration, got ${type}`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
28
36
|
class ReactRuntime extends import_runtime_core.RuntimeCore {
|
|
29
37
|
// TODO: the static methods here are deprecated and only keep here for backward-compatibility purpose.
|
|
30
38
|
// We will remove them when we release a new breaking change.
|
|
@@ -36,6 +44,7 @@ class ReactRuntime extends import_runtime_core.RuntimeCore {
|
|
|
36
44
|
hidden = false,
|
|
37
45
|
props
|
|
38
46
|
}) {
|
|
47
|
+
validateComponentType(type, component);
|
|
39
48
|
const unregisterComponent = this.store.dispatch(
|
|
40
49
|
(0, import_actions.registerComponentEffect)(type, { label, icon, hidden }, props ?? {})
|
|
41
50
|
);
|
|
@@ -55,6 +64,7 @@ class ReactRuntime extends import_runtime_core.RuntimeCore {
|
|
|
55
64
|
hidden = false,
|
|
56
65
|
props
|
|
57
66
|
}) {
|
|
67
|
+
validateComponentType(type, component);
|
|
58
68
|
const unregisterComponent = this.store.dispatch(
|
|
59
69
|
(0, import_actions.registerComponentEffect)(type, { label, icon, hidden }, props ?? {})
|
|
60
70
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/react-runtime.ts"],"sourcesContent":["import { registerBuiltinComponents } from '../../components/builtin/register'\n\nimport { type Descriptor, type DescriptorValueType } from '../../prop-controllers/descriptors'\n\nimport { registerComponentEffect, registerReactComponentEffect } from '../../state/actions'\nimport { BreakpointsInput } from '../../state/modules/breakpoints'\nimport { ComponentIcon } from '../../state/modules/components-meta'\nimport type { ComponentType } from '../../state/react-page'\n\nimport { RuntimeCore } from './runtime-core'\n\nexport class ReactRuntime extends RuntimeCore {\n // TODO: the static methods here are deprecated and only keep here for backward-compatibility purpose.\n // We will remove them when we release a new breaking change.\n // ------------------ Deprecated API ------------------ //\n static registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Code,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n // ------------------ Deprecated API ends here ------------------ //\n\n registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Cube,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n constructor({ breakpoints }: { breakpoints?: BreakpointsInput } = {}) {\n super({ breakpoints })\n\n registerBuiltinComponents(this)\n }\n}\n\n// TODO: We should delete this once we remove the static methods in ReactRuntime.\nregisterBuiltinComponents(ReactRuntime)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA0C;AAI1C,qBAAsE;AAEtE,6BAA8B;AAG9B,0BAA4B;
|
|
1
|
+
{"version":3,"sources":["../../../../src/runtimes/react/react-runtime.ts"],"sourcesContent":["import { registerBuiltinComponents } from '../../components/builtin/register'\n\nimport { type Descriptor, type DescriptorValueType } from '../../prop-controllers/descriptors'\n\nimport { registerComponentEffect, registerReactComponentEffect } from '../../state/actions'\nimport { BreakpointsInput } from '../../state/modules/breakpoints'\nimport { ComponentIcon } from '../../state/modules/components-meta'\nimport type { ComponentType } from '../../state/react-page'\n\nimport { RuntimeCore } from './runtime-core'\n\nfunction validateComponentType(type: string, component?: ComponentType): void {\n const componentName = component?.name ?? 'Component'\n if (typeof type !== 'string' || type === '') {\n throw new Error(\n `${componentName}: A non-empty string \\`type\\` is required for component registration, got ${type}`,\n )\n }\n}\n\nexport class ReactRuntime extends RuntimeCore {\n // TODO: the static methods here are deprecated and only keep here for backward-compatibility purpose.\n // We will remove them when we release a new breaking change.\n // ------------------ Deprecated API ------------------ //\n static registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Code,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n validateComponentType(type, component as unknown as ComponentType)\n\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n // ------------------ Deprecated API ends here ------------------ //\n\n registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Cube,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n validateComponentType(type, component as unknown as ComponentType)\n\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n constructor({ breakpoints }: { breakpoints?: BreakpointsInput } = {}) {\n super({ breakpoints })\n\n registerBuiltinComponents(this)\n }\n}\n\n// TODO: We should delete this once we remove the static methods in ReactRuntime.\nregisterBuiltinComponents(ReactRuntime)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA0C;AAI1C,qBAAsE;AAEtE,6BAA8B;AAG9B,0BAA4B;AAE5B,SAAS,sBAAsB,MAAc,WAAiC;AAC5E,QAAM,gBAAgB,WAAW,QAAQ;AACzC,MAAI,OAAO,SAAS,YAAY,SAAS,IAAI;AAC3C,UAAM,IAAI;AAAA,MACR,GAAG,aAAa,6EAA6E,IAAI;AAAA,IACnG;AAAA,EACF;AACF;AAEO,MAAM,qBAAqB,gCAAY;AAAA;AAAA;AAAA;AAAA,EAI5C,OAAO,kBAIL,WACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO,qCAAc;AAAA,IACrB,SAAS;AAAA,IACT;AAAA,EACF,GACY;AACZ,0BAAsB,MAAM,SAAqC;AAEjE,UAAM,sBAAsB,KAAK,MAAM;AAAA,UACrC,wCAAwB,MAAM,EAAE,OAAO,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC;AAAA,IACpE;AAEA,UAAM,2BAA2B,KAAK,MAAM;AAAA,UAC1C,6CAA6B,MAAM,SAAqC;AAAA,IAC1E;AAEA,WAAO,MAAM;AACX,0BAAoB;AACpB,+BAAyB;AAAA,IAC3B;AAAA,EACF;AAAA;AAAA,EAIA,kBAIE,WACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO,qCAAc;AAAA,IACrB,SAAS;AAAA,IACT;AAAA,EACF,GACY;AACZ,0BAAsB,MAAM,SAAqC;AAEjE,UAAM,sBAAsB,KAAK,MAAM;AAAA,UACrC,wCAAwB,MAAM,EAAE,OAAO,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC;AAAA,IACpE;AAEA,UAAM,2BAA2B,KAAK,MAAM;AAAA,UAC1C,6CAA6B,MAAM,SAAqC;AAAA,IAC1E;AAEA,WAAO,MAAM;AACX,0BAAoB;AACpB,+BAAyB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEA,YAAY,EAAE,YAAY,IAAwC,CAAC,GAAG;AACpE,UAAM,EAAE,YAAY,CAAC;AAErB,mDAA0B,IAAI;AAAA,EAChC;AACF;AAAA,IAGA,2CAA0B,YAAY;","names":[]}
|
|
@@ -17,7 +17,6 @@ const Link = forwardRef(function Link2({ link, onClick = () => {
|
|
|
17
17
|
}, ...restOfProps }, ref) {
|
|
18
18
|
const pageId = link && link.type === "OPEN_PAGE" ? link.payload.pageId : null;
|
|
19
19
|
const page = usePagePathnameSlice(pageId ?? null);
|
|
20
|
-
const hasLocalizedPathname = page?.localizedPathname != null;
|
|
21
20
|
const elementKey = link?.type === "SCROLL_TO_ELEMENT" ? link.payload.elementIdConfig?.elementKey : null;
|
|
22
21
|
const elementId = useElementId(elementKey);
|
|
23
22
|
let useNextLink;
|
|
@@ -97,9 +96,7 @@ const Link = forwardRef(function Link2({ link, onClick = () => {
|
|
|
97
96
|
target,
|
|
98
97
|
onClick: handleClick,
|
|
99
98
|
href,
|
|
100
|
-
|
|
101
|
-
locale: false
|
|
102
|
-
},
|
|
99
|
+
locale: false,
|
|
103
100
|
legacyBehavior: false
|
|
104
101
|
}
|
|
105
102
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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 { LinkData } from '@makeswift/prop-controllers'\nimport { useElementId } from '../../../runtimes/react/hooks/use-element-id'\nimport { usePagePathnameSlice } from '../../../runtimes/react/hooks/makeswift-api'\n\ntype BaseProps = {\n link?: LinkData\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseProps>\n\n// workaround for https://github.com/vercel/next.js/issues/66650\nconst isValidHref = (href: string) => {\n try {\n const bases = ['http://n', 'https://n']\n // - if `href` is a relative path, it will be resolved relative to the base URL\n // - if `href` is a full URL, the base URL will be ignored, even if there is a mismatch of protocols\n // - if `href` is an incomplete, protocol-only URL with a protocol that\n // conflicts with one of the base URL, this will throw\n bases.forEach(base => new URL(href, base))\n } catch (_) {\n return false\n }\n return true\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, Props>(function Link(\n { link, onClick = () => {}, ...restOfProps }: Props,\n ref,\n) {\n const pageId = link && link.type === 'OPEN_PAGE' ? link.payload.pageId : null\n const page = usePagePathnameSlice(pageId ?? null)\n
|
|
1
|
+
{"version":3,"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 { LinkData } from '@makeswift/prop-controllers'\nimport { useElementId } from '../../../runtimes/react/hooks/use-element-id'\nimport { usePagePathnameSlice } from '../../../runtimes/react/hooks/makeswift-api'\n\ntype BaseProps = {\n link?: LinkData\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseProps>\n\n// workaround for https://github.com/vercel/next.js/issues/66650\nconst isValidHref = (href: string) => {\n try {\n const bases = ['http://n', 'https://n']\n // - if `href` is a relative path, it will be resolved relative to the base URL\n // - if `href` is a full URL, the base URL will be ignored, even if there is a mismatch of protocols\n // - if `href` is an incomplete, protocol-only URL with a protocol that\n // conflicts with one of the base URL, this will throw\n bases.forEach(base => new URL(href, base))\n } catch (_) {\n return false\n }\n return true\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, Props>(function Link(\n { link, onClick = () => {}, ...restOfProps }: Props,\n ref,\n) {\n const pageId = link && link.type === 'OPEN_PAGE' ? link.payload.pageId : null\n const page = usePagePathnameSlice(pageId ?? null)\n\n const elementKey =\n link?.type === 'SCROLL_TO_ELEMENT' ? link.payload.elementIdConfig?.elementKey : null\n const elementId = useElementId(elementKey)\n\n // We don't want to use `next/link` with relative paths because Next.js will attempt to normalize\n // it and mess up the path.\n let useNextLink: boolean | undefined\n let href: string | undefined\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) {\n useNextLink = true\n\n href = `/${page.localizedPathname ?? page.pathname}`\n }\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'OPEN_URL': {\n useNextLink = isValidHref(link.payload.url)\n\n href = link.payload.url\n\n target = link.payload.openInNewTab ? '_blank' : '_self'\n\n break\n }\n\n case 'SEND_EMAIL': {\n useNextLink = false\n\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 useNextLink = false\n\n href = `tel:${link.payload.phoneNumber}`\n\n break\n }\n\n case 'SCROLL_TO_ELEMENT': {\n useNextLink = false\n\n href = `#${elementId ?? ''}`\n\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 if (href != null) 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 && hash != 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 if (useNextLink && href != null) {\n return (\n <NextLink\n {...restOfProps}\n ref={ref}\n target={target}\n onClick={handleClick}\n href={href}\n locale={false}\n // Next.js v12 has legacyBehavior set to true by default\n legacyBehavior={false}\n />\n )\n }\n\n // eslint-disable-next-line\n return <a {...restOfProps} ref={ref} href={href} target={target} onClick={handleClick} />\n})\n"],"mappings":"AA8IM;AA9IN,SAAmC,kBAA8B;AACjE,OAAO,oBAAoB;AAC3B,OAAO,cAAc;AAGrB,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AAUrC,MAAM,cAAc,CAAC,SAAiB;AACpC,MAAI;AACF,UAAM,QAAQ,CAAC,YAAY,WAAW;AAKtC,UAAM,QAAQ,UAAQ,IAAI,IAAI,MAAM,IAAI,CAAC;AAAA,EAC3C,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,MAAM,OAAO,WAAqC,SAASA,MAChE,EAAE,MAAM,UAAU,MAAM;AAAC,GAAG,GAAG,YAAY,GAC3C,KACA;AACA,QAAM,SAAS,QAAQ,KAAK,SAAS,cAAc,KAAK,QAAQ,SAAS;AACzE,QAAM,OAAO,qBAAqB,UAAU,IAAI;AAEhD,QAAM,aACJ,MAAM,SAAS,sBAAsB,KAAK,QAAQ,iBAAiB,aAAa;AAClF,QAAM,YAAY,aAAa,UAAU;AAIzC,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,MAAI,MAAM;AACR,YAAQ,KAAK,MAAM;AAAA,MACjB,KAAK,aAAa;AAChB,YAAI,MAAM;AACR,wBAAc;AAEd,iBAAO,IAAI,KAAK,qBAAqB,KAAK,QAAQ;AAAA,QACpD;AAEA,iBAAS,KAAK,QAAQ,eAAe,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GAAG,IAAI,IAAI;AAAA,MACtE;AAAA,IACF;AAAA,EACF;AAEA,MAAI,eAAe,QAAQ,MAAM;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA,QAAQ;AAAA,QAER,gBAAgB;AAAA;AAAA,IAClB;AAAA,EAEJ;AAGA,SAAO,oBAAC,OAAG,GAAG,aAAa,KAAU,MAAY,QAAgB,SAAS,aAAa;AACzF,CAAC;","names":["Link"]}
|
|
@@ -13,7 +13,7 @@ async function handler(...args) {
|
|
|
13
13
|
const supportsPreviewMode = match(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
|
|
14
14
|
const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
15
15
|
const body = {
|
|
16
|
-
version: "0.20.
|
|
16
|
+
version: "0.20.6-canary.1",
|
|
17
17
|
previewMode: supportsPreviewMode,
|
|
18
18
|
draftMode: supportsDraftMode,
|
|
19
19
|
interactionMode: true,
|
|
@@ -2,6 +2,14 @@ import { registerBuiltinComponents } from "../../components/builtin/register";
|
|
|
2
2
|
import { registerComponentEffect, registerReactComponentEffect } from "../../state/actions";
|
|
3
3
|
import { ComponentIcon } from "../../state/modules/components-meta";
|
|
4
4
|
import { RuntimeCore } from "./runtime-core";
|
|
5
|
+
function validateComponentType(type, component) {
|
|
6
|
+
const componentName = component?.name ?? "Component";
|
|
7
|
+
if (typeof type !== "string" || type === "") {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`${componentName}: A non-empty string \`type\` is required for component registration, got ${type}`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
class ReactRuntime extends RuntimeCore {
|
|
6
14
|
// TODO: the static methods here are deprecated and only keep here for backward-compatibility purpose.
|
|
7
15
|
// We will remove them when we release a new breaking change.
|
|
@@ -13,6 +21,7 @@ class ReactRuntime extends RuntimeCore {
|
|
|
13
21
|
hidden = false,
|
|
14
22
|
props
|
|
15
23
|
}) {
|
|
24
|
+
validateComponentType(type, component);
|
|
16
25
|
const unregisterComponent = this.store.dispatch(
|
|
17
26
|
registerComponentEffect(type, { label, icon, hidden }, props ?? {})
|
|
18
27
|
);
|
|
@@ -32,6 +41,7 @@ class ReactRuntime extends RuntimeCore {
|
|
|
32
41
|
hidden = false,
|
|
33
42
|
props
|
|
34
43
|
}) {
|
|
44
|
+
validateComponentType(type, component);
|
|
35
45
|
const unregisterComponent = this.store.dispatch(
|
|
36
46
|
registerComponentEffect(type, { label, icon, hidden }, props ?? {})
|
|
37
47
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/react-runtime.ts"],"sourcesContent":["import { registerBuiltinComponents } from '../../components/builtin/register'\n\nimport { type Descriptor, type DescriptorValueType } from '../../prop-controllers/descriptors'\n\nimport { registerComponentEffect, registerReactComponentEffect } from '../../state/actions'\nimport { BreakpointsInput } from '../../state/modules/breakpoints'\nimport { ComponentIcon } from '../../state/modules/components-meta'\nimport type { ComponentType } from '../../state/react-page'\n\nimport { RuntimeCore } from './runtime-core'\n\nexport class ReactRuntime extends RuntimeCore {\n // TODO: the static methods here are deprecated and only keep here for backward-compatibility purpose.\n // We will remove them when we release a new breaking change.\n // ------------------ Deprecated API ------------------ //\n static registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Code,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n // ------------------ Deprecated API ends here ------------------ //\n\n registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Cube,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n constructor({ breakpoints }: { breakpoints?: BreakpointsInput } = {}) {\n super({ breakpoints })\n\n registerBuiltinComponents(this)\n }\n}\n\n// TODO: We should delete this once we remove the static methods in ReactRuntime.\nregisterBuiltinComponents(ReactRuntime)\n"],"mappings":"AAAA,SAAS,iCAAiC;AAI1C,SAAS,yBAAyB,oCAAoC;AAEtE,SAAS,qBAAqB;AAG9B,SAAS,mBAAmB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/runtimes/react/react-runtime.ts"],"sourcesContent":["import { registerBuiltinComponents } from '../../components/builtin/register'\n\nimport { type Descriptor, type DescriptorValueType } from '../../prop-controllers/descriptors'\n\nimport { registerComponentEffect, registerReactComponentEffect } from '../../state/actions'\nimport { BreakpointsInput } from '../../state/modules/breakpoints'\nimport { ComponentIcon } from '../../state/modules/components-meta'\nimport type { ComponentType } from '../../state/react-page'\n\nimport { RuntimeCore } from './runtime-core'\n\nfunction validateComponentType(type: string, component?: ComponentType): void {\n const componentName = component?.name ?? 'Component'\n if (typeof type !== 'string' || type === '') {\n throw new Error(\n `${componentName}: A non-empty string \\`type\\` is required for component registration, got ${type}`,\n )\n }\n}\n\nexport class ReactRuntime extends RuntimeCore {\n // TODO: the static methods here are deprecated and only keep here for backward-compatibility purpose.\n // We will remove them when we release a new breaking change.\n // ------------------ Deprecated API ------------------ //\n static registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Code,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n validateComponentType(type, component as unknown as ComponentType)\n\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n // ------------------ Deprecated API ends here ------------------ //\n\n registerComponent<\n P extends Record<string, Descriptor>,\n C extends ComponentType<{ [K in keyof P]: DescriptorValueType<P[K]> }>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Cube,\n hidden = false,\n props,\n }: { type: string; label: string; icon?: ComponentIcon; hidden?: boolean; props?: P },\n ): () => void {\n validateComponentType(type, component as unknown as ComponentType)\n\n const unregisterComponent = this.store.dispatch(\n registerComponentEffect(type, { label, icon, hidden }, props ?? {}),\n )\n\n const unregisterReactComponent = this.store.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n constructor({ breakpoints }: { breakpoints?: BreakpointsInput } = {}) {\n super({ breakpoints })\n\n registerBuiltinComponents(this)\n }\n}\n\n// TODO: We should delete this once we remove the static methods in ReactRuntime.\nregisterBuiltinComponents(ReactRuntime)\n"],"mappings":"AAAA,SAAS,iCAAiC;AAI1C,SAAS,yBAAyB,oCAAoC;AAEtE,SAAS,qBAAqB;AAG9B,SAAS,mBAAmB;AAE5B,SAAS,sBAAsB,MAAc,WAAiC;AAC5E,QAAM,gBAAgB,WAAW,QAAQ;AACzC,MAAI,OAAO,SAAS,YAAY,SAAS,IAAI;AAC3C,UAAM,IAAI;AAAA,MACR,GAAG,aAAa,6EAA6E,IAAI;AAAA,IACnG;AAAA,EACF;AACF;AAEO,MAAM,qBAAqB,YAAY;AAAA;AAAA;AAAA;AAAA,EAI5C,OAAO,kBAIL,WACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO,cAAc;AAAA,IACrB,SAAS;AAAA,IACT;AAAA,EACF,GACY;AACZ,0BAAsB,MAAM,SAAqC;AAEjE,UAAM,sBAAsB,KAAK,MAAM;AAAA,MACrC,wBAAwB,MAAM,EAAE,OAAO,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC;AAAA,IACpE;AAEA,UAAM,2BAA2B,KAAK,MAAM;AAAA,MAC1C,6BAA6B,MAAM,SAAqC;AAAA,IAC1E;AAEA,WAAO,MAAM;AACX,0BAAoB;AACpB,+BAAyB;AAAA,IAC3B;AAAA,EACF;AAAA;AAAA,EAIA,kBAIE,WACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO,cAAc;AAAA,IACrB,SAAS;AAAA,IACT;AAAA,EACF,GACY;AACZ,0BAAsB,MAAM,SAAqC;AAEjE,UAAM,sBAAsB,KAAK,MAAM;AAAA,MACrC,wBAAwB,MAAM,EAAE,OAAO,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC;AAAA,IACpE;AAEA,UAAM,2BAA2B,KAAK,MAAM;AAAA,MAC1C,6BAA6B,MAAM,SAAqC;AAAA,IAC1E;AAEA,WAAO,MAAM;AACX,0BAAoB;AACpB,+BAAyB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEA,YAAY,EAAE,YAAY,IAAwC,CAAC,GAAG;AACpE,UAAM,EAAE,YAAY,CAAC;AAErB,8BAA0B,IAAI;AAAA,EAChC;AACF;AAGA,0BAA0B,YAAY;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,UAAU,EAAE,MAAM,OAAO,CAAA;AAIxE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAItD,KAAK,SAAS,GAAG;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAA;CAC5D,CAAA;AAmBD,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,UAAU,EAAE,MAAM,OAAO,CAAA;AAIxE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAItD,KAAK,SAAS,GAAG;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAA;CAC5D,CAAA;AAmBD,eAAO,MAAM,IAAI,6PA+Hf,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-runtime.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/react/react-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAG9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"react-runtime.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/react/react-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAG9F,OAAO,EAAE,gBAAgB,EAAE,MAA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W,CAAC,EAAE,gBAAgB,CAAA;KAAO;CAKrE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.6-canary.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
"uuid": "^9.0.0",
|
|
151
151
|
"zod": "^3.21.4",
|
|
152
152
|
"@makeswift/controls": "0.1.4",
|
|
153
|
-
"@makeswift/
|
|
154
|
-
"@makeswift/
|
|
153
|
+
"@makeswift/next-plugin": "0.3.0",
|
|
154
|
+
"@makeswift/prop-controllers": "0.3.5"
|
|
155
155
|
},
|
|
156
156
|
"devDependencies": {
|
|
157
157
|
"@emotion/jest": "^11.11.0",
|