@makeswift/runtime 0.18.0 → 0.18.1-canary.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/cjs/components/shared/Link/index.js +10 -1
- package/dist/cjs/components/shared/Link/index.js.map +1 -1
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/components/shared/Link/index.js +10 -1
- package/dist/esm/components/shared/Link/index.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/types/components/shared/Link/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -37,6 +37,15 @@ var import_scroll_into_view_if_needed = __toESM(require("scroll-into-view-if-nee
|
|
|
37
37
|
var import_link = __toESM(require("next/link"));
|
|
38
38
|
var import_react2 = require("../../../runtimes/react");
|
|
39
39
|
var import_makeswift_api = require("../../../runtimes/react/hooks/makeswift-api");
|
|
40
|
+
const isValidHref = (href) => {
|
|
41
|
+
try {
|
|
42
|
+
const bases = ["http://n", "https://n"];
|
|
43
|
+
bases.forEach((base) => new URL(href, base));
|
|
44
|
+
} catch (_) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
40
49
|
const Link = (0, import_react.forwardRef)(function Link2({ link, onClick = () => {
|
|
41
50
|
}, ...restOfProps }, ref) {
|
|
42
51
|
const pageId = link && link.type === "OPEN_PAGE" ? link.payload.pageId : null;
|
|
@@ -59,7 +68,7 @@ const Link = (0, import_react.forwardRef)(function Link2({ link, onClick = () =>
|
|
|
59
68
|
break;
|
|
60
69
|
}
|
|
61
70
|
case "OPEN_URL": {
|
|
62
|
-
useNextLink =
|
|
71
|
+
useNextLink = isValidHref(link.payload.url);
|
|
63
72
|
href = link.payload.url;
|
|
64
73
|
target = link.payload.openInNewTab ? "_blank" : "_self";
|
|
65
74
|
break;
|
|
@@ -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'\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\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 const hasLocalizedPathname = page?.localizedPathname != 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 =
|
|
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'\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 const hasLocalizedPathname = page?.localizedPathname != 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 {...(hasLocalizedPathname && {\n locale: false,\n })}\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;AA+IM;AA/IN,mBAAiE;AACjE,wCAA2B;AAC3B,kBAAqB;AAGrB,IAAAA,gBAA6B;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,yBAAq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AAK;AAEb,QAAI,MAAM;AAAkB;AAO5B,QAAI,MAAM,cAAc;AAAmB,aAAO,MAAM,eAAe;AAEvE,QAAI,QAAQ,KAAK,SAAS,qBAAqB;AAC7C,UAAI;AAEJ,UAAI;AACF,YAAI,QAAQ;AAAM,iBAAO,IAAI,IAAI,0BAA0B,IAAI,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,QACC,GAAI,wBAAwB;AAAA,UAC3B,QAAQ;AAAA,QACV;AAAA,QAEA,gBAAgB;AAAA;AAAA,IAClB;AAAA,EAEJ;AAGA,SAAO,4CAAC,OAAG,GAAG,aAAa,KAAU,MAAY,QAAgB,SAAS,aAAa;AACzF,CAAC;","names":["import_react","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.18.0",
|
|
39
|
+
version: "0.18.1-canary.0",
|
|
40
40
|
previewMode: supportsPreviewMode,
|
|
41
41
|
draftMode: supportsDraftMode,
|
|
42
42
|
interactionMode: true,
|
|
@@ -4,6 +4,15 @@ import scrollIntoView from "scroll-into-view-if-needed";
|
|
|
4
4
|
import NextLink from "next/link";
|
|
5
5
|
import { useElementId } from "../../../runtimes/react";
|
|
6
6
|
import { usePagePathnameSlice } from "../../../runtimes/react/hooks/makeswift-api";
|
|
7
|
+
const isValidHref = (href) => {
|
|
8
|
+
try {
|
|
9
|
+
const bases = ["http://n", "https://n"];
|
|
10
|
+
bases.forEach((base) => new URL(href, base));
|
|
11
|
+
} catch (_) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
7
16
|
const Link = forwardRef(function Link2({ link, onClick = () => {
|
|
8
17
|
}, ...restOfProps }, ref) {
|
|
9
18
|
const pageId = link && link.type === "OPEN_PAGE" ? link.payload.pageId : null;
|
|
@@ -26,7 +35,7 @@ const Link = forwardRef(function Link2({ link, onClick = () => {
|
|
|
26
35
|
break;
|
|
27
36
|
}
|
|
28
37
|
case "OPEN_URL": {
|
|
29
|
-
useNextLink =
|
|
38
|
+
useNextLink = isValidHref(link.payload.url);
|
|
30
39
|
href = link.payload.url;
|
|
31
40
|
target = link.payload.openInNewTab ? "_blank" : "_self";
|
|
32
41
|
break;
|
|
@@ -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'\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\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 const hasLocalizedPathname = page?.localizedPathname != 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 =
|
|
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'\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 const hasLocalizedPathname = page?.localizedPathname != 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 {...(hasLocalizedPathname && {\n locale: false,\n })}\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":"AA+IM;AA/IN,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;AAChD,QAAM,uBAAuB,MAAM,qBAAqB;AAExD,QAAM,aACJ,MAAM,SAAS,sBAAsB,KAAK,QAAQ,iBAAiB,aAAa;AAClF,QAAM,YAAY,aAAa,UAAU;AAIzC,MAAI;AACJ,MAAI;AACJ,MAA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AAS,MAAM;AACjD,cAAM,eAAe;AACrB,cAAM,OAAO,MAAM;AAEnB,uBAAe,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;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACC,GAAI,wBAAwB;AAAA,UAC3B,QAAQ;AAAA,QACV;AAAA,QAEA,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.18.0",
|
|
16
|
+
version: "0.18.1-canary.0",
|
|
17
17
|
previewMode: supportsPreviewMode,
|
|
18
18
|
draftMode: supportsDraftMode,
|
|
19
19
|
interactionMode: true,
|
|
@@ -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;
|
|
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,6PAkIf,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.18.0",
|
|
3
|
+
"version": "0.18.1-canary.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
"use-sync-external-store": "^1.0.0-rc.0",
|
|
139
139
|
"uuid": "^9.0.0",
|
|
140
140
|
"zod": "^3.21.4",
|
|
141
|
-
"@makeswift/next-plugin": "0.3.0",
|
|
142
141
|
"@makeswift/controls": "0.0.1",
|
|
142
|
+
"@makeswift/next-plugin": "0.3.0",
|
|
143
143
|
"@makeswift/prop-controllers": "0.3.0"
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|