@immediately-run/sdk 0.22.0 → 0.24.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.
Files changed (39) hide show
  1. package/dist/boot.cjs +8 -4
  2. package/dist/boot.cjs.map +1 -1
  3. package/dist/boot.d.cts +22 -2
  4. package/dist/boot.d.ts +22 -2
  5. package/dist/boot.js +6 -3
  6. package/dist/boot.js.map +1 -1
  7. package/dist/components/Admonition.cjs +58 -0
  8. package/dist/components/Admonition.cjs.map +1 -0
  9. package/dist/components/Admonition.d.cts +24 -0
  10. package/dist/components/Admonition.d.ts +24 -0
  11. package/dist/components/Admonition.js +34 -0
  12. package/dist/components/Admonition.js.map +1 -0
  13. package/dist/components/Link.cjs +64 -0
  14. package/dist/components/Link.cjs.map +1 -0
  15. package/dist/components/Link.d.cts +10 -0
  16. package/dist/components/Link.d.ts +10 -0
  17. package/dist/components/Link.js +39 -0
  18. package/dist/components/Link.js.map +1 -0
  19. package/dist/components/MDXComponents.cjs +17 -38
  20. package/dist/components/MDXComponents.cjs.map +1 -1
  21. package/dist/components/MDXComponents.d.cts +13 -13
  22. package/dist/components/MDXComponents.d.ts +13 -13
  23. package/dist/components/MDXComponents.js +12 -35
  24. package/dist/components/MDXComponents.js.map +1 -1
  25. package/dist/components/WikiLink.cjs +89 -0
  26. package/dist/components/WikiLink.cjs.map +1 -0
  27. package/dist/components/WikiLink.d.cts +42 -0
  28. package/dist/components/WikiLink.d.ts +42 -0
  29. package/dist/components/WikiLink.js +65 -0
  30. package/dist/components/WikiLink.js.map +1 -0
  31. package/dist/index.d.cts +5 -2
  32. package/dist/index.d.ts +5 -2
  33. package/dist/version.cjs +1 -1
  34. package/dist/version.cjs.map +1 -1
  35. package/dist/version.d.cts +1 -1
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/dist/version.js.map +1 -1
  39. package/package.json +1 -1
@@ -18,58 +18,37 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var MDXComponents_exports = {};
20
20
  __export(MDXComponents_exports, {
21
+ Admonition: () => import_Admonition2.Admonition,
21
22
  DEFAULT_MDX_COMPONENTS: () => DEFAULT_MDX_COMPONENTS,
22
- InternalLink: () => InternalLink,
23
- Link: () => Link
23
+ InternalLink: () => import_Link2.InternalLink,
24
+ Link: () => import_Link2.Link,
25
+ WikiLink: () => import_WikiLink2.WikiLink
24
26
  });
25
27
  module.exports = __toCommonJS(MDXComponents_exports);
26
28
  var import_jsx_runtime = require("react/jsx-runtime");
27
- var import_react = require("react");
28
- var import_routing = require("../routing");
29
- var import_TinkerableContext = require("../TinkerableContext");
30
- var import_urlUtils = require("../urlUtils");
31
- const InternalLink = ({
32
- href,
33
- children,
34
- ...props
35
- }) => {
36
- const clickHandler = (0, import_react.useCallback)(
37
- (e) => {
38
- if (href) {
39
- e.preventDefault();
40
- (0, import_routing.navigate)(href);
41
- }
42
- },
43
- [href]
44
- );
45
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href, onClick: clickHandler, ...props, children });
46
- };
47
- const Link = ({
48
- href,
49
- children,
50
- ...properties
51
- }) => {
52
- const { outerHref, navigationState } = (0, import_react.use)(import_TinkerableContext.TinkerableContext);
53
- if (href && (0, import_urlUtils.isInternalHref)(outerHref, href, navigationState)) {
54
- const targetHref = (0, import_urlUtils.constructOuterUrl)(outerHref, href, navigationState);
55
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalLink, { href: targetHref, ...properties, children });
56
- } else {
57
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { ...{ href, ...properties }, children });
58
- }
59
- };
29
+ var import_Admonition = require("./Admonition");
30
+ var import_Link = require("./Link");
31
+ var import_WikiLink = require("./WikiLink");
32
+ var import_Link2 = require("./Link");
33
+ var import_Admonition2 = require("./Admonition");
34
+ var import_WikiLink2 = require("./WikiLink");
60
35
  const DEFAULT_MDX_COMPONENTS = {
61
36
  a({
62
37
  href,
63
38
  children,
64
39
  ...properties
65
40
  }) {
66
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { href, ...properties, children });
67
- }
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Link.Link, { href, ...properties, children });
42
+ },
43
+ Admonition: import_Admonition.Admonition,
44
+ WikiLink: import_WikiLink.WikiLink
68
45
  };
69
46
  // Annotate the CommonJS export names for ESM import in node:
70
47
  0 && (module.exports = {
48
+ Admonition,
71
49
  DEFAULT_MDX_COMPONENTS,
72
50
  InternalLink,
73
- Link
51
+ Link,
52
+ WikiLink
74
53
  });
75
54
  //# sourceMappingURL=MDXComponents.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode, use, useCallback } from 'react';\nimport { navigate } from '../routing';\nimport { TinkerableContext } from '../TinkerableContext';\nimport { constructOuterUrl, constructUrl, isInternalHref, repositoryPrefixURL } from '../urlUtils';\n\n/** An `<a>` that performs in-sandbox navigation on click (prevents the default\n * full-page load and routes via {@link navigate}). */\nexport const InternalLink = ({\n href,\n children,\n ...props\n}: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>): ReactNode => {\n const clickHandler = useCallback(\n (e: any) => {\n if (href) {\n e.preventDefault();\n navigate(href);\n }\n },\n [href]\n );\n return (\n <a href={href} onClick={clickHandler} {...props}>\n {children}\n </a>\n );\n};\n\n/** A link that routes same-app hrefs through the sandbox router (as an\n * {@link InternalLink}) and renders external hrefs as a plain `<a>`. */\nexport const Link = ({\n href,\n children,\n ...properties\n}: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>): ReactNode => {\n const { outerHref, navigationState } = use(TinkerableContext);\n if (href && isInternalHref(outerHref, href, navigationState)) {\n const targetHref = constructOuterUrl(outerHref, href, navigationState);\n return (\n <InternalLink href={targetHref} {...properties}>\n {children}\n </InternalLink>\n );\n } else {\n // create a regular link to external resource\n return <a {...{ href, ...properties }}>{children}</a>;\n }\n};\n\n/** Default MDX component overrides: routes `<a>` through {@link Link} so links in\n * MDX prose navigate within the app. Passed to {@link MDXProvider} by `boot`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n return (\n <Link href={href} {...properties}>\n {children}\n </Link>\n );\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBI;AAtBJ,mBAA4C;AAC5C,qBAAyB;AACzB,+BAAkC;AAClC,sBAAqF;AAI9E,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4G;AAC1G,QAAM,mBAAe;AAAA,IACnB,CAAC,MAAW;AACV,UAAI,MAAM;AACR,UAAE,eAAe;AACjB,qCAAS,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AACA,SACE,4CAAC,OAAE,MAAY,SAAS,cAAe,GAAG,OACvC,UACH;AAEJ;AAIO,MAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4G;AAC1G,QAAM,EAAE,WAAW,gBAAgB,QAAI,kBAAI,0CAAiB;AAC5D,MAAI,YAAQ,gCAAe,WAAW,MAAM,eAAe,GAAG;AAC5D,UAAM,iBAAa,mCAAkB,WAAW,MAAM,eAAe;AACrE,WACE,4CAAC,gBAAa,MAAM,YAAa,GAAG,YACjC,UACH;AAAA,EAEJ,OAAO;AAEL,WAAO,4CAAC,OAAG,GAAG,EAAE,MAAM,GAAG,WAAW,GAAI,UAAS;AAAA,EACnD;AACF;AAIO,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAC5F,WACE,4CAAC,QAAK,MAAa,GAAG,YACnB,UACH;AAAA,EAEJ;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport { Admonition } from './Admonition';\nimport { Link } from './Link';\nimport { WikiLink } from './WikiLink';\n\n// The link primitives moved to ./Link so WikiLink can reuse Link without a\n// MDXComponents ↔ WikiLink import cycle (check:circular). Re-exported here so the\n// public `Link` / `InternalLink` entry points are unchanged.\nexport { InternalLink, Link } from './Link';\nexport { Admonition } from './Admonition';\nexport type { AdmonitionType } from './Admonition';\nexport { WikiLink } from './WikiLink';\n\n/** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These\n * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are\n * always present in the provider — even for a plain-markdown repo that never\n * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)\n * and `WikiLink` (§13) components resolve without the MDX missing-reference guard\n * firing, and Markdown links route in-app via {@link Link}. An app overrides any\n * of them by name via `boot({ mdxComponents })`, which *merges* over these\n * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n return (\n <Link href={href} {...properties}>\n {children}\n </Link>\n );\n },\n Admonition,\n WikiLink,\n} as Record<string, (props: any) => ReactNode>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BM;AA3BN,wBAA2B;AAC3B,kBAAqB;AACrB,sBAAyB;AAKzB,IAAAA,eAAmC;AACnC,IAAAC,qBAA2B;AAE3B,IAAAC,mBAAyB;AAUlB,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAC5F,WACE,4CAAC,oBAAK,MAAa,GAAG,YACnB,UACH;AAAA,EAEJ;AAAA,EACA;AAAA,EACA;AACF;","names":["import_Link","import_Admonition","import_WikiLink"]}
@@ -1,16 +1,16 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { ReactNode } from 'react';
2
+ export { InternalLink, Link } from './Link.cjs';
3
+ export { Admonition, AdmonitionType } from './Admonition.cjs';
4
+ export { WikiLink } from './WikiLink.cjs';
3
5
 
4
- /** An `<a>` that performs in-sandbox navigation on click (prevents the default
5
- * full-page load and routes via {@link navigate}). */
6
- declare const InternalLink: ({ href, children, ...props }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => ReactNode;
7
- /** A link that routes same-app hrefs through the sandbox router (as an
8
- * {@link InternalLink}) and renders external hrefs as a plain `<a>`. */
9
- declare const Link: ({ href, children, ...properties }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => ReactNode;
10
- /** Default MDX component overrides: routes `<a>` through {@link Link} so links in
11
- * MDX prose navigate within the app. Passed to {@link MDXProvider} by `boot`. */
12
- declare const DEFAULT_MDX_COMPONENTS: {
13
- a({ href, children, ...properties }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>): react_jsx_runtime.JSX.Element;
14
- };
6
+ /** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These
7
+ * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are
8
+ * always present in the provider — even for a plain-markdown repo that never
9
+ * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)
10
+ * and `WikiLink` (§13) components resolve without the MDX missing-reference guard
11
+ * firing, and Markdown links route in-app via {@link Link}. An app overrides any
12
+ * of them by name via `boot({ mdxComponents })`, which *merges* over these
13
+ * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */
14
+ declare const DEFAULT_MDX_COMPONENTS: Record<string, (props: any) => ReactNode>;
15
15
 
16
- export { DEFAULT_MDX_COMPONENTS, InternalLink, Link };
16
+ export { DEFAULT_MDX_COMPONENTS };
@@ -1,16 +1,16 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { ReactNode } from 'react';
2
+ export { InternalLink, Link } from './Link.js';
3
+ export { Admonition, AdmonitionType } from './Admonition.js';
4
+ export { WikiLink } from './WikiLink.js';
3
5
 
4
- /** An `<a>` that performs in-sandbox navigation on click (prevents the default
5
- * full-page load and routes via {@link navigate}). */
6
- declare const InternalLink: ({ href, children, ...props }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => ReactNode;
7
- /** A link that routes same-app hrefs through the sandbox router (as an
8
- * {@link InternalLink}) and renders external hrefs as a plain `<a>`. */
9
- declare const Link: ({ href, children, ...properties }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => ReactNode;
10
- /** Default MDX component overrides: routes `<a>` through {@link Link} so links in
11
- * MDX prose navigate within the app. Passed to {@link MDXProvider} by `boot`. */
12
- declare const DEFAULT_MDX_COMPONENTS: {
13
- a({ href, children, ...properties }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>): react_jsx_runtime.JSX.Element;
14
- };
6
+ /** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These
7
+ * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are
8
+ * always present in the provider — even for a plain-markdown repo that never
9
+ * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)
10
+ * and `WikiLink` (§13) components resolve without the MDX missing-reference guard
11
+ * firing, and Markdown links route in-app via {@link Link}. An app overrides any
12
+ * of them by name via `boot({ mdxComponents })`, which *merges* over these
13
+ * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */
14
+ declare const DEFAULT_MDX_COMPONENTS: Record<string, (props: any) => ReactNode>;
15
15
 
16
- export { DEFAULT_MDX_COMPONENTS, InternalLink, Link };
16
+ export { DEFAULT_MDX_COMPONENTS };
@@ -1,37 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { use, useCallback } from "react";
3
- import { navigate } from "../routing";
4
- import { TinkerableContext } from "../TinkerableContext";
5
- import { constructOuterUrl, isInternalHref } from "../urlUtils";
6
- const InternalLink = ({
7
- href,
8
- children,
9
- ...props
10
- }) => {
11
- const clickHandler = useCallback(
12
- (e) => {
13
- if (href) {
14
- e.preventDefault();
15
- navigate(href);
16
- }
17
- },
18
- [href]
19
- );
20
- return /* @__PURE__ */ jsx("a", { href, onClick: clickHandler, ...props, children });
21
- };
22
- const Link = ({
23
- href,
24
- children,
25
- ...properties
26
- }) => {
27
- const { outerHref, navigationState } = use(TinkerableContext);
28
- if (href && isInternalHref(outerHref, href, navigationState)) {
29
- const targetHref = constructOuterUrl(outerHref, href, navigationState);
30
- return /* @__PURE__ */ jsx(InternalLink, { href: targetHref, ...properties, children });
31
- } else {
32
- return /* @__PURE__ */ jsx("a", { ...{ href, ...properties }, children });
33
- }
34
- };
2
+ import { Admonition } from "./Admonition";
3
+ import { Link } from "./Link";
4
+ import { WikiLink } from "./WikiLink";
5
+ import { InternalLink, Link as Link2 } from "./Link";
6
+ import { Admonition as Admonition2 } from "./Admonition";
7
+ import { WikiLink as WikiLink2 } from "./WikiLink";
35
8
  const DEFAULT_MDX_COMPONENTS = {
36
9
  a({
37
10
  href,
@@ -39,11 +12,15 @@ const DEFAULT_MDX_COMPONENTS = {
39
12
  ...properties
40
13
  }) {
41
14
  return /* @__PURE__ */ jsx(Link, { href, ...properties, children });
42
- }
15
+ },
16
+ Admonition,
17
+ WikiLink
43
18
  };
44
19
  export {
20
+ Admonition2 as Admonition,
45
21
  DEFAULT_MDX_COMPONENTS,
46
22
  InternalLink,
47
- Link
23
+ Link2 as Link,
24
+ WikiLink2 as WikiLink
48
25
  };
49
26
  //# sourceMappingURL=MDXComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode, use, useCallback } from 'react';\nimport { navigate } from '../routing';\nimport { TinkerableContext } from '../TinkerableContext';\nimport { constructOuterUrl, constructUrl, isInternalHref, repositoryPrefixURL } from '../urlUtils';\n\n/** An `<a>` that performs in-sandbox navigation on click (prevents the default\n * full-page load and routes via {@link navigate}). */\nexport const InternalLink = ({\n href,\n children,\n ...props\n}: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>): ReactNode => {\n const clickHandler = useCallback(\n (e: any) => {\n if (href) {\n e.preventDefault();\n navigate(href);\n }\n },\n [href]\n );\n return (\n <a href={href} onClick={clickHandler} {...props}>\n {children}\n </a>\n );\n};\n\n/** A link that routes same-app hrefs through the sandbox router (as an\n * {@link InternalLink}) and renders external hrefs as a plain `<a>`. */\nexport const Link = ({\n href,\n children,\n ...properties\n}: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>): ReactNode => {\n const { outerHref, navigationState } = use(TinkerableContext);\n if (href && isInternalHref(outerHref, href, navigationState)) {\n const targetHref = constructOuterUrl(outerHref, href, navigationState);\n return (\n <InternalLink href={targetHref} {...properties}>\n {children}\n </InternalLink>\n );\n } else {\n // create a regular link to external resource\n return <a {...{ href, ...properties }}>{children}</a>;\n }\n};\n\n/** Default MDX component overrides: routes `<a>` through {@link Link} so links in\n * MDX prose navigate within the app. Passed to {@link MDXProvider} by `boot`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n return (\n <Link href={href} {...properties}>\n {children}\n </Link>\n );\n },\n};\n"],"mappings":"AAsBI;AAtBJ,SAAoB,KAAK,mBAAmB;AAC5C,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,mBAAiC,sBAA2C;AAI9E,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4G;AAC1G,QAAM,eAAe;AAAA,IACnB,CAAC,MAAW;AACV,UAAI,MAAM;AACR,UAAE,eAAe;AACjB,iBAAS,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AACA,SACE,oBAAC,OAAE,MAAY,SAAS,cAAe,GAAG,OACvC,UACH;AAEJ;AAIO,MAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4G;AAC1G,QAAM,EAAE,WAAW,gBAAgB,IAAI,IAAI,iBAAiB;AAC5D,MAAI,QAAQ,eAAe,WAAW,MAAM,eAAe,GAAG;AAC5D,UAAM,aAAa,kBAAkB,WAAW,MAAM,eAAe;AACrE,WACE,oBAAC,gBAAa,MAAM,YAAa,GAAG,YACjC,UACH;AAAA,EAEJ,OAAO;AAEL,WAAO,oBAAC,OAAG,GAAG,EAAE,MAAM,GAAG,WAAW,GAAI,UAAS;AAAA,EACnD;AACF;AAIO,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAC5F,WACE,oBAAC,QAAK,MAAa,GAAG,YACnB,UACH;AAAA,EAEJ;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/components/MDXComponents.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport { Admonition } from './Admonition';\nimport { Link } from './Link';\nimport { WikiLink } from './WikiLink';\n\n// The link primitives moved to ./Link so WikiLink can reuse Link without a\n// MDXComponents ↔ WikiLink import cycle (check:circular). Re-exported here so the\n// public `Link` / `InternalLink` entry points are unchanged.\nexport { InternalLink, Link } from './Link';\nexport { Admonition } from './Admonition';\nexport type { AdmonitionType } from './Admonition';\nexport { WikiLink } from './WikiLink';\n\n/** Default MDX component overrides passed to {@link MDXProvider} by `boot`. These\n * are the platform's *phantom defaults* (MARKDOWN_SYNTAX_SPEC §11.2): they are\n * always present in the provider — even for a plain-markdown repo that never\n * calls `boot({ mdxComponents })` — so the platform-emitted `Admonition` (§12)\n * and `WikiLink` (§13) components resolve without the MDX missing-reference guard\n * firing, and Markdown links route in-app via {@link Link}. An app overrides any\n * of them by name via `boot({ mdxComponents })`, which *merges* over these\n * defaults (§11.3) — overriding `WikiLink` alone still keeps `a` and `Admonition`. */\nexport const DEFAULT_MDX_COMPONENTS = {\n a({\n href,\n children,\n ...properties\n }: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) {\n return (\n <Link href={href} {...properties}>\n {children}\n </Link>\n );\n },\n Admonition,\n WikiLink,\n} as Record<string, (props: any) => ReactNode>;\n"],"mappings":"AA4BM;AA3BN,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAKzB,SAAS,cAAc,QAAAA,aAAY;AACnC,SAAS,cAAAC,mBAAkB;AAE3B,SAAS,YAAAC,iBAAgB;AAUlB,MAAM,yBAAyB;AAAA,EACpC,EAAE;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GAA8F;AAC5F,WACE,oBAAC,QAAK,MAAa,GAAG,YACnB,UACH;AAAA,EAEJ;AAAA,EACA;AAAA,EACA;AACF;","names":["Link","Admonition","WikiLink"]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var WikiLink_exports = {};
20
+ __export(WikiLink_exports, {
21
+ WikiLink: () => WikiLink
22
+ });
23
+ module.exports = __toCommonJS(WikiLink_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_react = require("react");
26
+ var import_Link = require("./Link");
27
+ var import_Include = require("./Include");
28
+ var import_TinkerableContext = require("../TinkerableContext");
29
+ const labelFromTarget = (target) => {
30
+ const base = target.split(/[\\/]/).pop() ?? target;
31
+ return base.replace(/\.mdx?$/i, "") || target;
32
+ };
33
+ const normalize = (path) => {
34
+ const out = [];
35
+ for (const seg of path.split("/")) {
36
+ if (seg === "" || seg === ".") continue;
37
+ if (seg === "..") out.pop();
38
+ else out.push(seg);
39
+ }
40
+ return "/" + out.join("/");
41
+ };
42
+ const resolveWikiTarget = (target, currentFile) => {
43
+ if (target.startsWith("/")) return normalize(target);
44
+ if (!currentFile) return void 0;
45
+ const dir = currentFile.slice(0, currentFile.lastIndexOf("/"));
46
+ return normalize(`${dir}/${target}`);
47
+ };
48
+ const WikiLink = ({
49
+ target,
50
+ label,
51
+ children,
52
+ ...rest
53
+ }) => {
54
+ const { filesMetadata } = (0, import_react.use)(import_TinkerableContext.TinkerableContext);
55
+ const renderContext = (0, import_react.use)(import_Include.RenderExportedComponentContext);
56
+ const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;
57
+ const rawTarget = target ?? "";
58
+ const text = children ?? label ?? (rawTarget ? labelFromTarget(rawTarget) : "");
59
+ if (!rawTarget) {
60
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ir-wikilink", ...rest, children: text });
61
+ }
62
+ const resolved = resolveWikiTarget(rawTarget, currentFile);
63
+ const files = filesMetadata ?? {};
64
+ const loaded = Object.keys(files).length > 0;
65
+ if (resolved !== void 0) {
66
+ if (currentFile && resolved === currentFile) {
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ir-wikilink ir-wikilink-self", "data-state": "self", ...rest, children: text });
68
+ }
69
+ const exists = !loaded || resolved in files;
70
+ if (!exists) {
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ "span",
73
+ {
74
+ className: "ir-wikilink ir-wikilink-broken",
75
+ "data-state": "broken",
76
+ title: `No file at ${resolved}`,
77
+ ...rest,
78
+ children: text
79
+ }
80
+ );
81
+ }
82
+ }
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Link.Link, { href: rawTarget, className: "ir-wikilink", "data-state": "resolved", ...rest, children: text });
84
+ };
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ WikiLink
88
+ });
89
+ //# sourceMappingURL=WikiLink.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/WikiLink.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Link } from './Link';\nimport { RenderExportedComponentContext } from './Include';\nimport { TinkerableContext } from '../TinkerableContext';\n\n/** Derive a human label from a target path: basename without the extension. */\nconst labelFromTarget = (target: string): string => {\n const base = target.split(/[\\\\/]/).pop() ?? target;\n return base.replace(/\\.mdx?$/i, '') || target;\n};\n\n/** Collapse `.`/`..`/empty segments into a clean absolute path. */\nconst normalize = (path: string): string => {\n const out: string[] = [];\n for (const seg of path.split('/')) {\n if (seg === '' || seg === '.') continue;\n if (seg === '..') out.pop();\n else out.push(seg);\n }\n return '/' + out.join('/');\n};\n\n/**\n * Resolve a wiki-link target to an absolute sandbox path, or `undefined` when it\n * cannot be resolved (a relative target with no known current file). An\n * **absolute** target (`/…`) is taken verbatim; a **relative** target resolves\n * against the current file's directory. Pure path arithmetic (MARKDOWN_SYNTAX_SPEC\n * §13.2) — it never touches the filesystem or any other file.\n */\nconst resolveWikiTarget = (target: string, currentFile?: string): string | undefined => {\n if (target.startsWith('/')) return normalize(target);\n if (!currentFile) return undefined;\n const dir = currentFile.slice(0, currentFile.lastIndexOf('/'));\n return normalize(`${dir}/${target}`);\n};\n\n/**\n * Default MDX `WikiLink` component — the render target for the `[[target]]` /\n * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)\n * compiles that syntax to `<WikiLink target=\"…\" label=\"…\">`, carrying the raw\n * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).\n *\n * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a\n * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —\n * relative (resolved against the current file's directory) or absolute — with\n * **no implicit search path** (§13.3, a deliberate departure from Obsidian).\n *\n * The **current file** — the one the link is *authored in* — is read from the\n * ambient `<Include>` render context. Every MDX file renders through `<Include>`\n * (`FileRouter` renders even the top-level file that way), and Include publishes\n * the rendered module's `EvaluationContext` to its subtree via\n * {@link RenderExportedComponentContext}; the nearest one's\n * `evaluation.module.filepath` is this file's own `/app/…` path. Because that\n * context nests with each `<Include>`, a relative target inside an included\n * fragment resolves against the **fragment**, not the top-level page in the URL.\n *\n * The resolved path is checked for **existence** against the live metadata store\n * (keyed by absolute `/app/…` paths) for the three states (§13.3):\n * - **self** — the resolved path is the current file: inert text, no link.\n * - **broken** — no file at the resolved path (and the store has loaded): rendered\n * as marked text, **not** a throw.\n * - **resolved** — routed through {@link Link} (in-app navigation for a same-app\n * href, a plain `<a>` otherwise).\n *\n * The check is **optimistic until the metadata store loads** (an empty store never\n * flashes \"broken\"), and a relative target with no ambient render context (MDX\n * rendered outside `<Include>`) routes optimistically. Such an app overrides this\n * component (§11) for precise resolution.\n */\nexport const WikiLink = ({\n target,\n label,\n children,\n ...rest\n}: {\n target?: string;\n label?: ReactNode;\n children?: ReactNode;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>): ReactNode => {\n const { filesMetadata } = use(TinkerableContext);\n const renderContext = use(RenderExportedComponentContext);\n const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;\n\n const rawTarget = target ?? '';\n const text = children ?? label ?? (rawTarget ? labelFromTarget(rawTarget) : '');\n\n // Defensive: the kernel never emits an empty target, but a hand-written\n // `<WikiLink>` might. Render inert text rather than a link to nowhere.\n if (!rawTarget) {\n return (\n <span className=\"ir-wikilink\" {...rest}>\n {text}\n </span>\n );\n }\n\n const resolved = resolveWikiTarget(rawTarget, currentFile);\n const files = filesMetadata ?? {};\n const loaded = Object.keys(files).length > 0;\n\n // `resolved === undefined` ⇒ a relative target with no known current file: route\n // it optimistically (can't check existence or self-ness generically).\n if (resolved !== undefined) {\n if (currentFile && resolved === currentFile) {\n return (\n <span className=\"ir-wikilink ir-wikilink-self\" data-state=\"self\" {...rest}>\n {text}\n </span>\n );\n }\n const exists = !loaded || resolved in files; // optimistic until loaded\n if (!exists) {\n return (\n <span\n className=\"ir-wikilink ir-wikilink-broken\"\n data-state=\"broken\"\n title={`No file at ${resolved}`}\n {...rest}\n >\n {text}\n </span>\n );\n }\n }\n return (\n <Link href={rawTarget} className=\"ir-wikilink\" data-state=\"resolved\" {...rest}>\n {text}\n </Link>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0FM;AA1FN,mBAA+B;AAC/B,kBAAqB;AACrB,qBAA+C;AAC/C,+BAAkC;AAGlC,MAAM,kBAAkB,CAAC,WAA2B;AAClD,QAAM,OAAO,OAAO,MAAM,OAAO,EAAE,IAAI,KAAK;AAC5C,SAAO,KAAK,QAAQ,YAAY,EAAE,KAAK;AACzC;AAGA,MAAM,YAAY,CAAC,SAAyB;AAC1C,QAAM,MAAgB,CAAC;AACvB,aAAW,OAAO,KAAK,MAAM,GAAG,GAAG;AACjC,QAAI,QAAQ,MAAM,QAAQ,IAAK;AAC/B,QAAI,QAAQ,KAAM,KAAI,IAAI;AAAA,QACrB,KAAI,KAAK,GAAG;AAAA,EACnB;AACA,SAAO,MAAM,IAAI,KAAK,GAAG;AAC3B;AASA,MAAM,oBAAoB,CAAC,QAAgB,gBAA6C;AACtF,MAAI,OAAO,WAAW,GAAG,EAAG,QAAO,UAAU,MAAM;AACnD,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,MAAM,YAAY,MAAM,GAAG,YAAY,YAAY,GAAG,CAAC;AAC7D,SAAO,UAAU,GAAG,GAAG,IAAI,MAAM,EAAE;AACrC;AAmCO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAI+E;AAC7E,QAAM,EAAE,cAAc,QAAI,kBAAI,0CAAiB;AAC/C,QAAM,oBAAgB,kBAAI,6CAA8B;AACxD,QAAM,cAAc,eAAe,mBAAmB,YAAY,QAAQ;AAE1E,QAAM,YAAY,UAAU;AAC5B,QAAM,OAAO,YAAY,UAAU,YAAY,gBAAgB,SAAS,IAAI;AAI5E,MAAI,CAAC,WAAW;AACd,WACE,4CAAC,UAAK,WAAU,eAAe,GAAG,MAC/B,gBACH;AAAA,EAEJ;AAEA,QAAM,WAAW,kBAAkB,WAAW,WAAW;AACzD,QAAM,QAAQ,iBAAiB,CAAC;AAChC,QAAM,SAAS,OAAO,KAAK,KAAK,EAAE,SAAS;AAI3C,MAAI,aAAa,QAAW;AAC1B,QAAI,eAAe,aAAa,aAAa;AAC3C,aACE,4CAAC,UAAK,WAAU,gCAA+B,cAAW,QAAQ,GAAG,MAClE,gBACH;AAAA,IAEJ;AACA,UAAM,SAAS,CAAC,UAAU,YAAY;AACtC,QAAI,CAAC,QAAQ;AACX,aACE;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,cAAW;AAAA,UACX,OAAO,cAAc,QAAQ;AAAA,UAC5B,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA,IAEJ;AAAA,EACF;AACA,SACE,4CAAC,oBAAK,MAAM,WAAW,WAAU,eAAc,cAAW,YAAY,GAAG,MACtE,gBACH;AAEJ;","names":[]}
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /**
4
+ * Default MDX `WikiLink` component — the render target for the `[[target]]` /
5
+ * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)
6
+ * compiles that syntax to `<WikiLink target="…" label="…">`, carrying the raw
7
+ * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).
8
+ *
9
+ * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a
10
+ * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —
11
+ * relative (resolved against the current file's directory) or absolute — with
12
+ * **no implicit search path** (§13.3, a deliberate departure from Obsidian).
13
+ *
14
+ * The **current file** — the one the link is *authored in* — is read from the
15
+ * ambient `<Include>` render context. Every MDX file renders through `<Include>`
16
+ * (`FileRouter` renders even the top-level file that way), and Include publishes
17
+ * the rendered module's `EvaluationContext` to its subtree via
18
+ * {@link RenderExportedComponentContext}; the nearest one's
19
+ * `evaluation.module.filepath` is this file's own `/app/…` path. Because that
20
+ * context nests with each `<Include>`, a relative target inside an included
21
+ * fragment resolves against the **fragment**, not the top-level page in the URL.
22
+ *
23
+ * The resolved path is checked for **existence** against the live metadata store
24
+ * (keyed by absolute `/app/…` paths) for the three states (§13.3):
25
+ * - **self** — the resolved path is the current file: inert text, no link.
26
+ * - **broken** — no file at the resolved path (and the store has loaded): rendered
27
+ * as marked text, **not** a throw.
28
+ * - **resolved** — routed through {@link Link} (in-app navigation for a same-app
29
+ * href, a plain `<a>` otherwise).
30
+ *
31
+ * The check is **optimistic until the metadata store loads** (an empty store never
32
+ * flashes "broken"), and a relative target with no ambient render context (MDX
33
+ * rendered outside `<Include>`) routes optimistically. Such an app overrides this
34
+ * component (§11) for precise resolution.
35
+ */
36
+ declare const WikiLink: ({ target, label, children, ...rest }: {
37
+ target?: string;
38
+ label?: ReactNode;
39
+ children?: ReactNode;
40
+ } & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href">) => ReactNode;
41
+
42
+ export { WikiLink };
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /**
4
+ * Default MDX `WikiLink` component — the render target for the `[[target]]` /
5
+ * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)
6
+ * compiles that syntax to `<WikiLink target="…" label="…">`, carrying the raw
7
+ * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).
8
+ *
9
+ * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a
10
+ * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —
11
+ * relative (resolved against the current file's directory) or absolute — with
12
+ * **no implicit search path** (§13.3, a deliberate departure from Obsidian).
13
+ *
14
+ * The **current file** — the one the link is *authored in* — is read from the
15
+ * ambient `<Include>` render context. Every MDX file renders through `<Include>`
16
+ * (`FileRouter` renders even the top-level file that way), and Include publishes
17
+ * the rendered module's `EvaluationContext` to its subtree via
18
+ * {@link RenderExportedComponentContext}; the nearest one's
19
+ * `evaluation.module.filepath` is this file's own `/app/…` path. Because that
20
+ * context nests with each `<Include>`, a relative target inside an included
21
+ * fragment resolves against the **fragment**, not the top-level page in the URL.
22
+ *
23
+ * The resolved path is checked for **existence** against the live metadata store
24
+ * (keyed by absolute `/app/…` paths) for the three states (§13.3):
25
+ * - **self** — the resolved path is the current file: inert text, no link.
26
+ * - **broken** — no file at the resolved path (and the store has loaded): rendered
27
+ * as marked text, **not** a throw.
28
+ * - **resolved** — routed through {@link Link} (in-app navigation for a same-app
29
+ * href, a plain `<a>` otherwise).
30
+ *
31
+ * The check is **optimistic until the metadata store loads** (an empty store never
32
+ * flashes "broken"), and a relative target with no ambient render context (MDX
33
+ * rendered outside `<Include>`) routes optimistically. Such an app overrides this
34
+ * component (§11) for precise resolution.
35
+ */
36
+ declare const WikiLink: ({ target, label, children, ...rest }: {
37
+ target?: string;
38
+ label?: ReactNode;
39
+ children?: ReactNode;
40
+ } & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href">) => ReactNode;
41
+
42
+ export { WikiLink };
@@ -0,0 +1,65 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { use } from "react";
3
+ import { Link } from "./Link";
4
+ import { RenderExportedComponentContext } from "./Include";
5
+ import { TinkerableContext } from "../TinkerableContext";
6
+ const labelFromTarget = (target) => {
7
+ const base = target.split(/[\\/]/).pop() ?? target;
8
+ return base.replace(/\.mdx?$/i, "") || target;
9
+ };
10
+ const normalize = (path) => {
11
+ const out = [];
12
+ for (const seg of path.split("/")) {
13
+ if (seg === "" || seg === ".") continue;
14
+ if (seg === "..") out.pop();
15
+ else out.push(seg);
16
+ }
17
+ return "/" + out.join("/");
18
+ };
19
+ const resolveWikiTarget = (target, currentFile) => {
20
+ if (target.startsWith("/")) return normalize(target);
21
+ if (!currentFile) return void 0;
22
+ const dir = currentFile.slice(0, currentFile.lastIndexOf("/"));
23
+ return normalize(`${dir}/${target}`);
24
+ };
25
+ const WikiLink = ({
26
+ target,
27
+ label,
28
+ children,
29
+ ...rest
30
+ }) => {
31
+ const { filesMetadata } = use(TinkerableContext);
32
+ const renderContext = use(RenderExportedComponentContext);
33
+ const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;
34
+ const rawTarget = target ?? "";
35
+ const text = children ?? label ?? (rawTarget ? labelFromTarget(rawTarget) : "");
36
+ if (!rawTarget) {
37
+ return /* @__PURE__ */ jsx("span", { className: "ir-wikilink", ...rest, children: text });
38
+ }
39
+ const resolved = resolveWikiTarget(rawTarget, currentFile);
40
+ const files = filesMetadata ?? {};
41
+ const loaded = Object.keys(files).length > 0;
42
+ if (resolved !== void 0) {
43
+ if (currentFile && resolved === currentFile) {
44
+ return /* @__PURE__ */ jsx("span", { className: "ir-wikilink ir-wikilink-self", "data-state": "self", ...rest, children: text });
45
+ }
46
+ const exists = !loaded || resolved in files;
47
+ if (!exists) {
48
+ return /* @__PURE__ */ jsx(
49
+ "span",
50
+ {
51
+ className: "ir-wikilink ir-wikilink-broken",
52
+ "data-state": "broken",
53
+ title: `No file at ${resolved}`,
54
+ ...rest,
55
+ children: text
56
+ }
57
+ );
58
+ }
59
+ }
60
+ return /* @__PURE__ */ jsx(Link, { href: rawTarget, className: "ir-wikilink", "data-state": "resolved", ...rest, children: text });
61
+ };
62
+ export {
63
+ WikiLink
64
+ };
65
+ //# sourceMappingURL=WikiLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/WikiLink.tsx"],"sourcesContent":["import { ReactNode, use } from 'react';\nimport { Link } from './Link';\nimport { RenderExportedComponentContext } from './Include';\nimport { TinkerableContext } from '../TinkerableContext';\n\n/** Derive a human label from a target path: basename without the extension. */\nconst labelFromTarget = (target: string): string => {\n const base = target.split(/[\\\\/]/).pop() ?? target;\n return base.replace(/\\.mdx?$/i, '') || target;\n};\n\n/** Collapse `.`/`..`/empty segments into a clean absolute path. */\nconst normalize = (path: string): string => {\n const out: string[] = [];\n for (const seg of path.split('/')) {\n if (seg === '' || seg === '.') continue;\n if (seg === '..') out.pop();\n else out.push(seg);\n }\n return '/' + out.join('/');\n};\n\n/**\n * Resolve a wiki-link target to an absolute sandbox path, or `undefined` when it\n * cannot be resolved (a relative target with no known current file). An\n * **absolute** target (`/…`) is taken verbatim; a **relative** target resolves\n * against the current file's directory. Pure path arithmetic (MARKDOWN_SYNTAX_SPEC\n * §13.2) — it never touches the filesystem or any other file.\n */\nconst resolveWikiTarget = (target: string, currentFile?: string): string | undefined => {\n if (target.startsWith('/')) return normalize(target);\n if (!currentFile) return undefined;\n const dir = currentFile.slice(0, currentFile.lastIndexOf('/'));\n return normalize(`${dir}/${target}`);\n};\n\n/**\n * Default MDX `WikiLink` component — the render target for the `[[target]]` /\n * `[[label|target]]` wiki-link syntax. The transpiler remark plugin (R3-153)\n * compiles that syntax to `<WikiLink target=\"…\" label=\"…\">`, carrying the raw\n * target/label verbatim; **resolution lives here** (MARKDOWN_SYNTAX_SPEC §13.2).\n *\n * Registered in {@link DEFAULT_MDX_COMPONENTS} so wiki-links render even in a\n * plain-markdown repo (§11.2 phantom defaults). Targets are **paths only** —\n * relative (resolved against the current file's directory) or absolute — with\n * **no implicit search path** (§13.3, a deliberate departure from Obsidian).\n *\n * The **current file** — the one the link is *authored in* — is read from the\n * ambient `<Include>` render context. Every MDX file renders through `<Include>`\n * (`FileRouter` renders even the top-level file that way), and Include publishes\n * the rendered module's `EvaluationContext` to its subtree via\n * {@link RenderExportedComponentContext}; the nearest one's\n * `evaluation.module.filepath` is this file's own `/app/…` path. Because that\n * context nests with each `<Include>`, a relative target inside an included\n * fragment resolves against the **fragment**, not the top-level page in the URL.\n *\n * The resolved path is checked for **existence** against the live metadata store\n * (keyed by absolute `/app/…` paths) for the three states (§13.3):\n * - **self** — the resolved path is the current file: inert text, no link.\n * - **broken** — no file at the resolved path (and the store has loaded): rendered\n * as marked text, **not** a throw.\n * - **resolved** — routed through {@link Link} (in-app navigation for a same-app\n * href, a plain `<a>` otherwise).\n *\n * The check is **optimistic until the metadata store loads** (an empty store never\n * flashes \"broken\"), and a relative target with no ambient render context (MDX\n * rendered outside `<Include>`) routes optimistically. Such an app overrides this\n * component (§11) for precise resolution.\n */\nexport const WikiLink = ({\n target,\n label,\n children,\n ...rest\n}: {\n target?: string;\n label?: ReactNode;\n children?: ReactNode;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>): ReactNode => {\n const { filesMetadata } = use(TinkerableContext);\n const renderContext = use(RenderExportedComponentContext);\n const currentFile = renderContext?.evaluationContext?.evaluation?.module?.filepath;\n\n const rawTarget = target ?? '';\n const text = children ?? label ?? (rawTarget ? labelFromTarget(rawTarget) : '');\n\n // Defensive: the kernel never emits an empty target, but a hand-written\n // `<WikiLink>` might. Render inert text rather than a link to nowhere.\n if (!rawTarget) {\n return (\n <span className=\"ir-wikilink\" {...rest}>\n {text}\n </span>\n );\n }\n\n const resolved = resolveWikiTarget(rawTarget, currentFile);\n const files = filesMetadata ?? {};\n const loaded = Object.keys(files).length > 0;\n\n // `resolved === undefined` ⇒ a relative target with no known current file: route\n // it optimistically (can't check existence or self-ness generically).\n if (resolved !== undefined) {\n if (currentFile && resolved === currentFile) {\n return (\n <span className=\"ir-wikilink ir-wikilink-self\" data-state=\"self\" {...rest}>\n {text}\n </span>\n );\n }\n const exists = !loaded || resolved in files; // optimistic until loaded\n if (!exists) {\n return (\n <span\n className=\"ir-wikilink ir-wikilink-broken\"\n data-state=\"broken\"\n title={`No file at ${resolved}`}\n {...rest}\n >\n {text}\n </span>\n );\n }\n }\n return (\n <Link href={rawTarget} className=\"ir-wikilink\" data-state=\"resolved\" {...rest}>\n {text}\n </Link>\n );\n};\n"],"mappings":"AA0FM;AA1FN,SAAoB,WAAW;AAC/B,SAAS,YAAY;AACrB,SAAS,sCAAsC;AAC/C,SAAS,yBAAyB;AAGlC,MAAM,kBAAkB,CAAC,WAA2B;AAClD,QAAM,OAAO,OAAO,MAAM,OAAO,EAAE,IAAI,KAAK;AAC5C,SAAO,KAAK,QAAQ,YAAY,EAAE,KAAK;AACzC;AAGA,MAAM,YAAY,CAAC,SAAyB;AAC1C,QAAM,MAAgB,CAAC;AACvB,aAAW,OAAO,KAAK,MAAM,GAAG,GAAG;AACjC,QAAI,QAAQ,MAAM,QAAQ,IAAK;AAC/B,QAAI,QAAQ,KAAM,KAAI,IAAI;AAAA,QACrB,KAAI,KAAK,GAAG;AAAA,EACnB;AACA,SAAO,MAAM,IAAI,KAAK,GAAG;AAC3B;AASA,MAAM,oBAAoB,CAAC,QAAgB,gBAA6C;AACtF,MAAI,OAAO,WAAW,GAAG,EAAG,QAAO,UAAU,MAAM;AACnD,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,MAAM,YAAY,MAAM,GAAG,YAAY,YAAY,GAAG,CAAC;AAC7D,SAAO,UAAU,GAAG,GAAG,IAAI,MAAM,EAAE;AACrC;AAmCO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAI+E;AAC7E,QAAM,EAAE,cAAc,IAAI,IAAI,iBAAiB;AAC/C,QAAM,gBAAgB,IAAI,8BAA8B;AACxD,QAAM,cAAc,eAAe,mBAAmB,YAAY,QAAQ;AAE1E,QAAM,YAAY,UAAU;AAC5B,QAAM,OAAO,YAAY,UAAU,YAAY,gBAAgB,SAAS,IAAI;AAI5E,MAAI,CAAC,WAAW;AACd,WACE,oBAAC,UAAK,WAAU,eAAe,GAAG,MAC/B,gBACH;AAAA,EAEJ;AAEA,QAAM,WAAW,kBAAkB,WAAW,WAAW;AACzD,QAAM,QAAQ,iBAAiB,CAAC;AAChC,QAAM,SAAS,OAAO,KAAK,KAAK,EAAE,SAAS;AAI3C,MAAI,aAAa,QAAW;AAC1B,QAAI,eAAe,aAAa,aAAa;AAC3C,aACE,oBAAC,UAAK,WAAU,gCAA+B,cAAW,QAAQ,GAAG,MAClE,gBACH;AAAA,IAEJ;AACA,UAAM,SAAS,CAAC,UAAU,YAAY;AACtC,QAAI,CAAC,QAAQ;AACX,aACE;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,cAAW;AAAA,UACX,OAAO,cAAc,QAAQ;AAAA,UAC5B,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA,IAEJ;AAAA,EACF;AACA,SACE,oBAAC,QAAK,MAAM,WAAW,WAAU,eAAc,cAAW,YAAY,GAAG,MACtE,gBACH;AAEJ;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { MDXProvider, useMDXComponents } from './MDXProvider.cjs';
2
2
  export { AppliedRoutingRule, Router, applyRoutingRule, navigate, renderRoute, useRoute, useRouteParams, useTinkerableLink } from './routing.cjs';
3
- export { BootProps, CATCH_ALL_ROUTING_SPEC, DEFAULT_ROUTING_SPEC, TinkerableApp, boot } from './boot.cjs';
3
+ export { BootProps, CATCH_ALL_ROUTING_SPEC, DEFAULT_ROUTING_SPEC, MdxComponents, TinkerableApp, boot, resolveMdxComponents } from './boot.cjs';
4
4
  export { Include, RenderExportedComponent, RenderExportedComponentContext, RenderFileContextType } from './components/Include.cjs';
5
- export { DEFAULT_MDX_COMPONENTS, InternalLink, Link } from './components/MDXComponents.cjs';
5
+ export { DEFAULT_MDX_COMPONENTS } from './components/MDXComponents.cjs';
6
6
  export { MountImage, MountImageProps } from './components/MountImage.cjs';
7
7
  export { Route, RouteProps, Routes } from './components/Routes.cjs';
8
8
  export { ObjectUrlState, useAllMetadata, useFileMetadata, useMetadataQuery, useObjectUrl } from './hooks.cjs';
@@ -31,8 +31,11 @@ export { ReadyState, __resetReady, __setReadyDeps, getReadyState, onReady, repor
31
31
  export { LOADING_TIMINGS, LoadingRegion, Skeleton, SkeletonArchetype, SkeletonRow, Spinner } from './loading.cjs';
32
32
  export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.cjs';
33
33
  export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryEntry, MetadataQueryFunction, MetadataQueryResult, ModuleExports } from './sandboxTypes.cjs';
34
+ export { Admonition, AdmonitionType } from './components/Admonition.cjs';
34
35
  export { ImmediatelyRunGlobal, getHostRuntime } from './hostRuntime.cjs';
36
+ export { InternalLink, Link } from './components/Link.cjs';
35
37
  export { SDK_VERSION } from './version.cjs';
38
+ export { WikiLink } from './components/WikiLink.cjs';
36
39
  import 'react';
37
40
  import './TinkerableContext.cjs';
38
41
  import './RoutingSpec.cjs';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { MDXProvider, useMDXComponents } from './MDXProvider.js';
2
2
  export { AppliedRoutingRule, Router, applyRoutingRule, navigate, renderRoute, useRoute, useRouteParams, useTinkerableLink } from './routing.js';
3
- export { BootProps, CATCH_ALL_ROUTING_SPEC, DEFAULT_ROUTING_SPEC, TinkerableApp, boot } from './boot.js';
3
+ export { BootProps, CATCH_ALL_ROUTING_SPEC, DEFAULT_ROUTING_SPEC, MdxComponents, TinkerableApp, boot, resolveMdxComponents } from './boot.js';
4
4
  export { Include, RenderExportedComponent, RenderExportedComponentContext, RenderFileContextType } from './components/Include.js';
5
- export { DEFAULT_MDX_COMPONENTS, InternalLink, Link } from './components/MDXComponents.js';
5
+ export { DEFAULT_MDX_COMPONENTS } from './components/MDXComponents.js';
6
6
  export { MountImage, MountImageProps } from './components/MountImage.js';
7
7
  export { Route, RouteProps, Routes } from './components/Routes.js';
8
8
  export { ObjectUrlState, useAllMetadata, useFileMetadata, useMetadataQuery, useObjectUrl } from './hooks.js';
@@ -31,8 +31,11 @@ export { ReadyState, __resetReady, __setReadyDeps, getReadyState, onReady, repor
31
31
  export { LOADING_TIMINGS, LoadingRegion, Skeleton, SkeletonArchetype, SkeletonRow, Spinner } from './loading.js';
32
32
  export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.js';
33
33
  export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryEntry, MetadataQueryFunction, MetadataQueryResult, ModuleExports } from './sandboxTypes.js';
34
+ export { Admonition, AdmonitionType } from './components/Admonition.js';
34
35
  export { ImmediatelyRunGlobal, getHostRuntime } from './hostRuntime.js';
36
+ export { InternalLink, Link } from './components/Link.js';
35
37
  export { SDK_VERSION } from './version.js';
38
+ export { WikiLink } from './components/WikiLink.js';
36
39
  import 'react';
37
40
  import './TinkerableContext.js';
38
41
  import './RoutingSpec.js';
package/dist/version.cjs CHANGED
@@ -21,7 +21,7 @@ __export(version_exports, {
21
21
  SDK_VERSION: () => SDK_VERSION
22
22
  });
23
23
  module.exports = __toCommonJS(version_exports);
24
- const SDK_VERSION = "0.22.0";
24
+ const SDK_VERSION = "0.24.0";
25
25
  // Annotate the CommonJS export names for ESM import in node:
26
26
  0 && (module.exports = {
27
27
  SDK_VERSION
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.22.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.24.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,cAAc;","names":[]}
@@ -1,4 +1,4 @@
1
1
  /** This SDK's package version, baked from package.json at build (SP2-6). */
2
- declare const SDK_VERSION = "0.22.0";
2
+ declare const SDK_VERSION = "0.24.0";
3
3
 
4
4
  export { SDK_VERSION };
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /** This SDK's package version, baked from package.json at build (SP2-6). */
2
- declare const SDK_VERSION = "0.22.0";
2
+ declare const SDK_VERSION = "0.24.0";
3
3
 
4
4
  export { SDK_VERSION };
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.22.0";
1
+ const SDK_VERSION = "0.24.0";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.22.0';\n"],"mappings":"AAIO,MAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.24.0';\n"],"mappings":"AAIO,MAAM,cAAc;","names":[]}