@immediately-run/sdk 0.93.2 → 0.95.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 (43) hide show
  1. package/dist/components/FileRouter.cjs +4 -1
  2. package/dist/components/FileRouter.cjs.map +1 -1
  3. package/dist/components/FileRouter.js +4 -1
  4. package/dist/components/FileRouter.js.map +1 -1
  5. package/dist/components/HeadingAnchor.cjs.map +1 -1
  6. package/dist/components/HeadingAnchor.d.cts +4 -3
  7. package/dist/components/HeadingAnchor.d.ts +4 -3
  8. package/dist/components/HeadingAnchor.js.map +1 -1
  9. package/dist/components/Prose.cjs +39 -0
  10. package/dist/components/Prose.cjs.map +1 -0
  11. package/dist/components/Prose.d.cts +15 -0
  12. package/dist/components/Prose.d.ts +15 -0
  13. package/dist/components/Prose.js +16 -0
  14. package/dist/components/Prose.js.map +1 -0
  15. package/dist/index.cjs +6 -0
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +2 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.js +4 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/loading.cjs +2 -6
  22. package/dist/loading.cjs.map +1 -1
  23. package/dist/loading.js +2 -6
  24. package/dist/loading.js.map +1 -1
  25. package/dist/proseStyles.cjs +181 -0
  26. package/dist/proseStyles.cjs.map +1 -0
  27. package/dist/proseStyles.d.cts +36 -0
  28. package/dist/proseStyles.d.ts +36 -0
  29. package/dist/proseStyles.js +153 -0
  30. package/dist/proseStyles.js.map +1 -0
  31. package/dist/styleElement.cjs +37 -0
  32. package/dist/styleElement.cjs.map +1 -0
  33. package/dist/styleElement.d.cts +13 -0
  34. package/dist/styleElement.d.ts +13 -0
  35. package/dist/styleElement.js +14 -0
  36. package/dist/styleElement.js.map +1 -0
  37. package/dist/version.cjs +1 -1
  38. package/dist/version.cjs.map +1 -1
  39. package/dist/version.d.cts +1 -1
  40. package/dist/version.d.ts +1 -1
  41. package/dist/version.js +1 -1
  42. package/dist/version.js.map +1 -1
  43. package/package.json +1 -1
@@ -0,0 +1,181 @@
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 proseStyles_exports = {};
20
+ __export(proseStyles_exports, {
21
+ PROSE_CLASS: () => PROSE_CLASS,
22
+ PROSE_STYLE_ID: () => PROSE_STYLE_ID,
23
+ PROSE_STYLE_TEXT: () => PROSE_STYLE_TEXT,
24
+ PROSE_TOKENS: () => PROSE_TOKENS,
25
+ ensureProseStyles: () => ensureProseStyles,
26
+ isProseFile: () => isProseFile
27
+ });
28
+ module.exports = __toCommonJS(proseStyles_exports);
29
+ var import_styleElement = require("./styleElement");
30
+ const PROSE_CLASS = "ir-prose";
31
+ const PROSE_STYLE_ID = "ir-sdk-prose-styles";
32
+ const SANS = 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif';
33
+ const MONO = 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace';
34
+ const same = (name, value) => ({ name, light: value, dark: value });
35
+ const PROSE_TOKENS = [
36
+ same("bg", "transparent"),
37
+ { name: "ink", light: "#1f2328", dark: "#d6dae0" },
38
+ { name: "ink-2", light: "#59636e", dark: "#8b949e" },
39
+ { name: "ink-3", light: "#8c959f", dark: "#6e7681" },
40
+ { name: "line", light: "#d8dee4", dark: "#2a2f37" },
41
+ { name: "panel", light: "#f3f4f6", dark: "#1a1e24" },
42
+ { name: "accent", light: "#0969da", dark: "#6cb6ff" },
43
+ same("sans", SANS),
44
+ same("disp", "var(--sans, var(--_ir-sans))"),
45
+ same("mono", MONO),
46
+ same("disp-weight", "700"),
47
+ same("prose-measure", "68ch"),
48
+ same("prose-leading", "1.65"),
49
+ same("page-gutter", "clamp(1.25rem, 5vw, 3rem)"),
50
+ same("radius-shape", "8px"),
51
+ same("prose-size", "1.0625rem"),
52
+ same("prose-flow", "1.1em")
53
+ ];
54
+ const t = (name) => `var(--${name}, var(--_ir-${name}))`;
55
+ const declarations = (pick, only) => PROSE_TOKENS.filter(only ?? (() => true)).map((token) => `--_ir-${token.name}: ${pick(token)};`).join(" ");
56
+ const P = `.${PROSE_CLASS}`;
57
+ const GUTTER_ANCHOR_MIN_WIDTH = "48rem";
58
+ const HEADINGS = ":is(h1, h2, h3, h4, h5, h6)";
59
+ const PROSE_STYLE_TEXT = `@layer ir.defaults {
60
+ ${P} { ${declarations((token) => token.light)} }
61
+ ${P}[data-theme="dark"] { ${declarations(
62
+ (token) => token.dark,
63
+ (token) => token.dark !== token.light
64
+ )} }
65
+ ${P} {
66
+ box-sizing: border-box;
67
+ min-height: 100dvh;
68
+ background: ${t("bg")};
69
+ color: ${t("ink")};
70
+ font: 400 ${t("prose-size")} / ${t("prose-leading")} ${t("sans")};
71
+ font-kerning: normal;
72
+ -webkit-font-smoothing: antialiased;
73
+ overflow-wrap: break-word;
74
+ padding-block: clamp(1.5rem, 6vw, 4rem) 6rem;
75
+ display: grid;
76
+ align-content: start;
77
+ grid-template-columns:
78
+ minmax(${t("page-gutter")}, 1fr)
79
+ min(${t("prose-measure")}, 100% - 2 * ${t("page-gutter")})
80
+ minmax(${t("page-gutter")}, 1fr);
81
+ }
82
+ ${P} > * { grid-column: 2; min-inline-size: 0; margin-block: 0; }
83
+ ${P} > * + * { margin-block-start: ${t("prose-flow")}; }
84
+
85
+ ${P} ${HEADINGS} {
86
+ position: relative;
87
+ font-family: ${t("disp")};
88
+ font-weight: ${t("disp-weight")};
89
+ color: ${t("ink")};
90
+ line-height: 1.25;
91
+ letter-spacing: -0.011em;
92
+ text-wrap: balance;
93
+ scroll-margin-top: 1.5rem;
94
+ }
95
+ ${P} h1 { font-size: 2.25em; letter-spacing: -0.022em; line-height: 1.15; }
96
+ ${P} h2 { font-size: 1.5em; padding-block-end: 0.3em; border-block-end: 1px solid ${t("line")}; }
97
+ ${P} h3 { font-size: 1.2em; }
98
+ ${P} h4 { font-size: 1em; }
99
+ ${P} :is(h5, h6) { font-size: 0.875em; text-transform: uppercase; letter-spacing: 0.04em; color: ${t("ink-2")}; }
100
+ ${P} > ${HEADINGS}:not(:first-child) { margin-block-start: 2.2em; }
101
+ ${P} > :is(h1, h2, h3, h4) + * { margin-block-start: 0.7em; }
102
+
103
+ ${P} .ir-heading-anchor { color: ${t("ink-3")}; text-decoration: none; font-weight: 400; }
104
+ ${P} .ir-heading-anchor:hover { color: ${t("accent")}; }
105
+ @media (hover: hover) and (width >= ${GUTTER_ANCHOR_MIN_WIDTH}) {
106
+ ${P} .ir-heading-anchor {
107
+ position: absolute;
108
+ inset-inline-end: 100%;
109
+ inline-size: 1.2em;
110
+ padding-inline-end: 0.35em;
111
+ text-align: end;
112
+ opacity: 0;
113
+ transition: opacity 120ms ease;
114
+ }
115
+ ${P} ${HEADINGS}:hover .ir-heading-anchor,
116
+ ${P} .ir-heading-anchor:focus-visible { opacity: 1; }
117
+ }
118
+ @media (hover: none), (width < ${GUTTER_ANCHOR_MIN_WIDTH}) {
119
+ ${P} .ir-heading-anchor {
120
+ float: inline-end;
121
+ min-inline-size: 24px;
122
+ min-block-size: 24px;
123
+ margin-inline-start: 0.5em;
124
+ text-align: center;
125
+ font-size: 0.8em;
126
+ opacity: 0.45;
127
+ }
128
+ }
129
+
130
+ ${P} a { color: ${t(
131
+ "accent"
132
+ )}; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
133
+ ${P} strong { font-weight: 650; }
134
+ ${P} :not(pre) > code {
135
+ font-family: ${t("mono")};
136
+ font-size: 0.86em;
137
+ background: ${t("panel")};
138
+ padding: 0.12em 0.36em;
139
+ border-radius: 5px;
140
+ }
141
+ ${P} a code { color: inherit; }
142
+ ${P} pre {
143
+ font-family: ${t("mono")};
144
+ font-size: 0.85em;
145
+ line-height: 1.55;
146
+ background: ${t("panel")};
147
+ padding: 1em 1.2em;
148
+ border-radius: ${t("radius-shape")};
149
+ overflow-x: auto;
150
+ tab-size: 2;
151
+ }
152
+ ${P} pre code { font: inherit; background: none; padding: 0; }
153
+ ${P} :is(ul, ol) { padding-inline-start: 1.5em; }
154
+ ${P} li + li, ${P} li > :is(ul, ol) { margin-block-start: 0.35em; }
155
+ ${P} li::marker { color: ${t("ink-2")}; }
156
+ ${P} li.task-list-item { list-style: none; margin-inline-start: -1.3em; }
157
+ ${P} input[type="checkbox"] { margin-inline-end: 0.5em; accent-color: ${t("accent")}; }
158
+ ${P} blockquote { padding-inline-start: 1em; border-inline-start: 3px solid ${t("line")}; color: ${t("ink-2")}; }
159
+ ${P} hr { border: 0; border-block-start: 1px solid ${t("line")}; }
160
+ ${P} > hr, ${P} > hr + * { margin-block-start: calc(2.5 * ${t("prose-size")}); }
161
+ ${P} > hr + ${HEADINGS}:not(:first-child) { margin-block-start: max(2.2em, 2.5 * ${t("prose-size")}); }
162
+ ${P} :is(img, video) { max-width: 100%; height: auto; border-radius: ${t("radius-shape")}; }
163
+ ${P} table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.94em; font-variant-numeric: tabular-nums; }
164
+ ${P} :is(th, td) { padding: 0.45em 0.8em; border: 1px solid ${t("line")}; text-align: start; }
165
+ ${P} th { background: ${t("panel")}; }
166
+ }
167
+ `;
168
+ const isProseFile = (path) => /\.mdx?$/i.test(path);
169
+ function ensureProseStyles() {
170
+ (0, import_styleElement.ensureStyleElement)(PROSE_STYLE_ID, PROSE_STYLE_TEXT, { first: true });
171
+ }
172
+ // Annotate the CommonJS export names for ESM import in node:
173
+ 0 && (module.exports = {
174
+ PROSE_CLASS,
175
+ PROSE_STYLE_ID,
176
+ PROSE_STYLE_TEXT,
177
+ PROSE_TOKENS,
178
+ ensureProseStyles,
179
+ isProseFile
180
+ });
181
+ //# sourceMappingURL=proseStyles.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/proseStyles.ts"],"sourcesContent":["// The default typography for rendered Markdown (MARKDOWN_SYNTAX_SPEC §16).\n//\n// A published library cannot `import './prose.css'` — the sandbox bundler evaluates a\n// dist CSS import as JavaScript — so the stylesheet is text generated here and injected\n// once through `ensureStyleElement`, the guard `loading.tsx` shares.\n\n//\n// Two properties carry the design:\n// - every rule sits in `@layer ir.defaults`, so any unlayered author rule beats it\n// whatever its specificity, with no `!important` on either side;\n// - the public tokens (Grove's names, 02-theme-contract §2) are only ever READ, as\n// `var(--ink, var(--_ir-ink))`. The defaults live in private `--_ir-*` properties.\n// An app or theme that already defines `--ink` higher in the tree therefore flows\n// into its prose, and an author's value set on the article wins over the default.\n\nimport { ensureStyleElement } from './styleElement';\n\n/** The class on the element that wraps rendered Markdown. */\nexport const PROSE_CLASS = 'ir-prose';\n\n/** The id of the injected `<style>` element (one per document). */\nexport const PROSE_STYLE_ID = 'ir-sdk-prose-styles';\n\n/** One public token: its name (no leading dashes) and its default per polarity. */\nexport interface ProseToken {\n readonly name: string;\n readonly light: string;\n readonly dark: string;\n}\n\nconst SANS = 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", sans-serif';\nconst MONO = 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace';\n\n/** Both polarities share one value. */\nconst same = (name: string, value: string): ProseToken => ({ name, light: value, dark: value });\n\n/**\n * The token table — the one home of every name an author may set (the author token file\n * reads its allow-list from here). Names are Grove's wherever Grove has one with the same\n * meaning; `prose-size` and `prose-flow` are the only new ones.\n *\n * `bg` defaults to transparent because the sandbox already paints `<html>` per polarity\n * (sandbox `themeCanvas.ts`); repeating its colours here would be a second copy.\n */\nexport const PROSE_TOKENS: readonly ProseToken[] = [\n same('bg', 'transparent'),\n { name: 'ink', light: '#1f2328', dark: '#d6dae0' },\n { name: 'ink-2', light: '#59636e', dark: '#8b949e' },\n { name: 'ink-3', light: '#8c959f', dark: '#6e7681' },\n { name: 'line', light: '#d8dee4', dark: '#2a2f37' },\n { name: 'panel', light: '#f3f4f6', dark: '#1a1e24' },\n { name: 'accent', light: '#0969da', dark: '#6cb6ff' },\n same('sans', SANS),\n same('disp', 'var(--sans, var(--_ir-sans))'),\n same('mono', MONO),\n same('disp-weight', '700'),\n same('prose-measure', '68ch'),\n same('prose-leading', '1.65'),\n same('page-gutter', 'clamp(1.25rem, 5vw, 3rem)'),\n same('radius-shape', '8px'),\n same('prose-size', '1.0625rem'),\n same('prose-flow', '1.1em'),\n];\n\n/** Read a public token with its private default behind it. */\nconst t = (name: string): string => `var(--${name}, var(--_ir-${name}))`;\n\nconst declarations = (pick: (token: ProseToken) => string, only?: (token: ProseToken) => boolean): string =>\n PROSE_TOKENS.filter(only ?? (() => true))\n .map((token) => `--_ir-${token.name}: ${pick(token)};`)\n .join(' ');\n\nconst P = `.${PROSE_CLASS}`;\n\n/**\n * The narrowest viewport that keeps the heading anchor in the gutter. Below it the side\n * column shrinks to `--page-gutter` (20px), narrower than an h1's `#`, so the anchor\n * floats to the line end as on touch devices instead of being clipped at the edge.\n */\nconst GUTTER_ANCHOR_MIN_WIDTH = '48rem';\nconst HEADINGS = ':is(h1, h2, h3, h4, h5, h6)';\n\n/** The whole default stylesheet. */\nexport const PROSE_STYLE_TEXT = `@layer ir.defaults {\n${P} { ${declarations((token) => token.light)} }\n${P}[data-theme=\"dark\"] { ${declarations(\n (token) => token.dark,\n (token) => token.dark !== token.light,\n)} }\n${P} {\n box-sizing: border-box;\n min-height: 100dvh;\n background: ${t('bg')};\n color: ${t('ink')};\n font: 400 ${t('prose-size')} / ${t('prose-leading')} ${t('sans')};\n font-kerning: normal;\n -webkit-font-smoothing: antialiased;\n overflow-wrap: break-word;\n padding-block: clamp(1.5rem, 6vw, 4rem) 6rem;\n display: grid;\n align-content: start;\n grid-template-columns:\n minmax(${t('page-gutter')}, 1fr)\n min(${t('prose-measure')}, 100% - 2 * ${t('page-gutter')})\n minmax(${t('page-gutter')}, 1fr);\n}\n${P} > * { grid-column: 2; min-inline-size: 0; margin-block: 0; }\n${P} > * + * { margin-block-start: ${t('prose-flow')}; }\n\n${P} ${HEADINGS} {\n position: relative;\n font-family: ${t('disp')};\n font-weight: ${t('disp-weight')};\n color: ${t('ink')};\n line-height: 1.25;\n letter-spacing: -0.011em;\n text-wrap: balance;\n scroll-margin-top: 1.5rem;\n}\n${P} h1 { font-size: 2.25em; letter-spacing: -0.022em; line-height: 1.15; }\n${P} h2 { font-size: 1.5em; padding-block-end: 0.3em; border-block-end: 1px solid ${t('line')}; }\n${P} h3 { font-size: 1.2em; }\n${P} h4 { font-size: 1em; }\n${P} :is(h5, h6) { font-size: 0.875em; text-transform: uppercase; letter-spacing: 0.04em; color: ${t('ink-2')}; }\n${P} > ${HEADINGS}:not(:first-child) { margin-block-start: 2.2em; }\n${P} > :is(h1, h2, h3, h4) + * { margin-block-start: 0.7em; }\n\n${P} .ir-heading-anchor { color: ${t('ink-3')}; text-decoration: none; font-weight: 400; }\n${P} .ir-heading-anchor:hover { color: ${t('accent')}; }\n@media (hover: hover) and (width >= ${GUTTER_ANCHOR_MIN_WIDTH}) {\n ${P} .ir-heading-anchor {\n position: absolute;\n inset-inline-end: 100%;\n inline-size: 1.2em;\n padding-inline-end: 0.35em;\n text-align: end;\n opacity: 0;\n transition: opacity 120ms ease;\n }\n ${P} ${HEADINGS}:hover .ir-heading-anchor,\n ${P} .ir-heading-anchor:focus-visible { opacity: 1; }\n}\n@media (hover: none), (width < ${GUTTER_ANCHOR_MIN_WIDTH}) {\n ${P} .ir-heading-anchor {\n float: inline-end;\n min-inline-size: 24px;\n min-block-size: 24px;\n margin-inline-start: 0.5em;\n text-align: center;\n font-size: 0.8em;\n opacity: 0.45;\n }\n}\n\n${P} a { color: ${t(\n 'accent',\n)}; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }\n${P} strong { font-weight: 650; }\n${P} :not(pre) > code {\n font-family: ${t('mono')};\n font-size: 0.86em;\n background: ${t('panel')};\n padding: 0.12em 0.36em;\n border-radius: 5px;\n}\n${P} a code { color: inherit; }\n${P} pre {\n font-family: ${t('mono')};\n font-size: 0.85em;\n line-height: 1.55;\n background: ${t('panel')};\n padding: 1em 1.2em;\n border-radius: ${t('radius-shape')};\n overflow-x: auto;\n tab-size: 2;\n}\n${P} pre code { font: inherit; background: none; padding: 0; }\n${P} :is(ul, ol) { padding-inline-start: 1.5em; }\n${P} li + li, ${P} li > :is(ul, ol) { margin-block-start: 0.35em; }\n${P} li::marker { color: ${t('ink-2')}; }\n${P} li.task-list-item { list-style: none; margin-inline-start: -1.3em; }\n${P} input[type=\"checkbox\"] { margin-inline-end: 0.5em; accent-color: ${t('accent')}; }\n${P} blockquote { padding-inline-start: 1em; border-inline-start: 3px solid ${t('line')}; color: ${t('ink-2')}; }\n${P} hr { border: 0; border-block-start: 1px solid ${t('line')}; }\n${P} > hr, ${P} > hr + * { margin-block-start: calc(2.5 * ${t('prose-size')}); }\n${P} > hr + ${HEADINGS}:not(:first-child) { margin-block-start: max(2.2em, 2.5 * ${t('prose-size')}); }\n${P} :is(img, video) { max-width: 100%; height: auto; border-radius: ${t('radius-shape')}; }\n${P} table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.94em; font-variant-numeric: tabular-nums; }\n${P} :is(th, td) { padding: 0.45em 0.8em; border: 1px solid ${t('line')}; text-align: start; }\n${P} th { background: ${t('panel')}; }\n}\n`;\n\n/** Markdown and MDX files get the prose wrapper; app components and HTML do not. The\n * extensions are the ones the transpiler compiles as MDX (`.md`, `.mdx`); a `.markdown`\n * file is not compiled, so wrapping it would style nothing it renders. */\nexport const isProseFile = (path: string): boolean => /\\.mdx?$/i.test(path);\n\n/**\n * Inject the default stylesheet once per document (idempotent, browser-only).\n *\n * It goes FIRST in `<head>`. Cascade layers rank by the order they first appear, later\n * layers winning, so a sheet appended after an app's own CSS would rank `ir.defaults`\n * above the app's layered rules (Tailwind's `base`/`components`/`utilities`, say).\n * First in the document makes it the lowest layer; unlayered rules beat it either way.\n */\nexport function ensureProseStyles(): void {\n ensureStyleElement(PROSE_STYLE_ID, PROSE_STYLE_TEXT, { first: true });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,0BAAmC;AAG5B,MAAM,cAAc;AAGpB,MAAM,iBAAiB;AAS9B,MAAM,OAAO;AACb,MAAM,OAAO;AAGb,MAAM,OAAO,CAAC,MAAc,WAA+B,EAAE,MAAM,OAAO,OAAO,MAAM,MAAM;AAUtF,MAAM,eAAsC;AAAA,EACjD,KAAK,MAAM,aAAa;AAAA,EACxB,EAAE,MAAM,OAAO,OAAO,WAAW,MAAM,UAAU;AAAA,EACjD,EAAE,MAAM,SAAS,OAAO,WAAW,MAAM,UAAU;AAAA,EACnD,EAAE,MAAM,SAAS,OAAO,WAAW,MAAM,UAAU;AAAA,EACnD,EAAE,MAAM,QAAQ,OAAO,WAAW,MAAM,UAAU;AAAA,EAClD,EAAE,MAAM,SAAS,OAAO,WAAW,MAAM,UAAU;AAAA,EACnD,EAAE,MAAM,UAAU,OAAO,WAAW,MAAM,UAAU;AAAA,EACpD,KAAK,QAAQ,IAAI;AAAA,EACjB,KAAK,QAAQ,8BAA8B;AAAA,EAC3C,KAAK,QAAQ,IAAI;AAAA,EACjB,KAAK,eAAe,KAAK;AAAA,EACzB,KAAK,iBAAiB,MAAM;AAAA,EAC5B,KAAK,iBAAiB,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AAoE,EAAE,cAAc,CAAC;AAAA,EACtF,CAAC;AAAA,EACD,CAAC,2DAA2D,EAAE,MAAM,CAAC;AAAA,EACrE,CAAC,qBAAqB,EAAE,OAAO,CAAC;AAAA;AAAA;AAO3B,MAAM,cAAc,CAAC,SAA0B,WAAW,KAAK,IAAI;AAUnE,SAAS,oBAA0B;AACxC,8CAAmB,gBAAgB,kBAAkB,EAAE,OAAO,KAAK,CAAC;AACtE;","names":[]}
@@ -0,0 +1,36 @@
1
+ /** The class on the element that wraps rendered Markdown. */
2
+ declare const PROSE_CLASS = "ir-prose";
3
+ /** The id of the injected `<style>` element (one per document). */
4
+ declare const PROSE_STYLE_ID = "ir-sdk-prose-styles";
5
+ /** One public token: its name (no leading dashes) and its default per polarity. */
6
+ interface ProseToken {
7
+ readonly name: string;
8
+ readonly light: string;
9
+ readonly dark: string;
10
+ }
11
+ /**
12
+ * The token table — the one home of every name an author may set (the author token file
13
+ * reads its allow-list from here). Names are Grove's wherever Grove has one with the same
14
+ * meaning; `prose-size` and `prose-flow` are the only new ones.
15
+ *
16
+ * `bg` defaults to transparent because the sandbox already paints `<html>` per polarity
17
+ * (sandbox `themeCanvas.ts`); repeating its colours here would be a second copy.
18
+ */
19
+ declare const PROSE_TOKENS: readonly ProseToken[];
20
+ /** The whole default stylesheet. */
21
+ declare const PROSE_STYLE_TEXT: string;
22
+ /** Markdown and MDX files get the prose wrapper; app components and HTML do not. The
23
+ * extensions are the ones the transpiler compiles as MDX (`.md`, `.mdx`); a `.markdown`
24
+ * file is not compiled, so wrapping it would style nothing it renders. */
25
+ declare const isProseFile: (path: string) => boolean;
26
+ /**
27
+ * Inject the default stylesheet once per document (idempotent, browser-only).
28
+ *
29
+ * It goes FIRST in `<head>`. Cascade layers rank by the order they first appear, later
30
+ * layers winning, so a sheet appended after an app's own CSS would rank `ir.defaults`
31
+ * above the app's layered rules (Tailwind's `base`/`components`/`utilities`, say).
32
+ * First in the document makes it the lowest layer; unlayered rules beat it either way.
33
+ */
34
+ declare function ensureProseStyles(): void;
35
+
36
+ export { PROSE_CLASS, PROSE_STYLE_ID, PROSE_STYLE_TEXT, PROSE_TOKENS, type ProseToken, ensureProseStyles, isProseFile };
@@ -0,0 +1,36 @@
1
+ /** The class on the element that wraps rendered Markdown. */
2
+ declare const PROSE_CLASS = "ir-prose";
3
+ /** The id of the injected `<style>` element (one per document). */
4
+ declare const PROSE_STYLE_ID = "ir-sdk-prose-styles";
5
+ /** One public token: its name (no leading dashes) and its default per polarity. */
6
+ interface ProseToken {
7
+ readonly name: string;
8
+ readonly light: string;
9
+ readonly dark: string;
10
+ }
11
+ /**
12
+ * The token table — the one home of every name an author may set (the author token file
13
+ * reads its allow-list from here). Names are Grove's wherever Grove has one with the same
14
+ * meaning; `prose-size` and `prose-flow` are the only new ones.
15
+ *
16
+ * `bg` defaults to transparent because the sandbox already paints `<html>` per polarity
17
+ * (sandbox `themeCanvas.ts`); repeating its colours here would be a second copy.
18
+ */
19
+ declare const PROSE_TOKENS: readonly ProseToken[];
20
+ /** The whole default stylesheet. */
21
+ declare const PROSE_STYLE_TEXT: string;
22
+ /** Markdown and MDX files get the prose wrapper; app components and HTML do not. The
23
+ * extensions are the ones the transpiler compiles as MDX (`.md`, `.mdx`); a `.markdown`
24
+ * file is not compiled, so wrapping it would style nothing it renders. */
25
+ declare const isProseFile: (path: string) => boolean;
26
+ /**
27
+ * Inject the default stylesheet once per document (idempotent, browser-only).
28
+ *
29
+ * It goes FIRST in `<head>`. Cascade layers rank by the order they first appear, later
30
+ * layers winning, so a sheet appended after an app's own CSS would rank `ir.defaults`
31
+ * above the app's layered rules (Tailwind's `base`/`components`/`utilities`, say).
32
+ * First in the document makes it the lowest layer; unlayered rules beat it either way.
33
+ */
34
+ declare function ensureProseStyles(): void;
35
+
36
+ export { PROSE_CLASS, PROSE_STYLE_ID, PROSE_STYLE_TEXT, PROSE_TOKENS, type ProseToken, ensureProseStyles, isProseFile };
@@ -0,0 +1,153 @@
1
+ import "./chunk-VHAA22YE.js";
2
+ import { ensureStyleElement } from "./styleElement.js";
3
+ const PROSE_CLASS = "ir-prose";
4
+ const PROSE_STYLE_ID = "ir-sdk-prose-styles";
5
+ const SANS = 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif';
6
+ const MONO = 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace';
7
+ const same = (name, value) => ({ name, light: value, dark: value });
8
+ const PROSE_TOKENS = [
9
+ same("bg", "transparent"),
10
+ { name: "ink", light: "#1f2328", dark: "#d6dae0" },
11
+ { name: "ink-2", light: "#59636e", dark: "#8b949e" },
12
+ { name: "ink-3", light: "#8c959f", dark: "#6e7681" },
13
+ { name: "line", light: "#d8dee4", dark: "#2a2f37" },
14
+ { name: "panel", light: "#f3f4f6", dark: "#1a1e24" },
15
+ { name: "accent", light: "#0969da", dark: "#6cb6ff" },
16
+ same("sans", SANS),
17
+ same("disp", "var(--sans, var(--_ir-sans))"),
18
+ same("mono", MONO),
19
+ same("disp-weight", "700"),
20
+ same("prose-measure", "68ch"),
21
+ same("prose-leading", "1.65"),
22
+ same("page-gutter", "clamp(1.25rem, 5vw, 3rem)"),
23
+ same("radius-shape", "8px"),
24
+ same("prose-size", "1.0625rem"),
25
+ same("prose-flow", "1.1em")
26
+ ];
27
+ const t = (name) => `var(--${name}, var(--_ir-${name}))`;
28
+ const declarations = (pick, only) => PROSE_TOKENS.filter(only ?? (() => true)).map((token) => `--_ir-${token.name}: ${pick(token)};`).join(" ");
29
+ const P = `.${PROSE_CLASS}`;
30
+ const GUTTER_ANCHOR_MIN_WIDTH = "48rem";
31
+ const HEADINGS = ":is(h1, h2, h3, h4, h5, h6)";
32
+ const PROSE_STYLE_TEXT = `@layer ir.defaults {
33
+ ${P} { ${declarations((token) => token.light)} }
34
+ ${P}[data-theme="dark"] { ${declarations(
35
+ (token) => token.dark,
36
+ (token) => token.dark !== token.light
37
+ )} }
38
+ ${P} {
39
+ box-sizing: border-box;
40
+ min-height: 100dvh;
41
+ background: ${t("bg")};
42
+ color: ${t("ink")};
43
+ font: 400 ${t("prose-size")} / ${t("prose-leading")} ${t("sans")};
44
+ font-kerning: normal;
45
+ -webkit-font-smoothing: antialiased;
46
+ overflow-wrap: break-word;
47
+ padding-block: clamp(1.5rem, 6vw, 4rem) 6rem;
48
+ display: grid;
49
+ align-content: start;
50
+ grid-template-columns:
51
+ minmax(${t("page-gutter")}, 1fr)
52
+ min(${t("prose-measure")}, 100% - 2 * ${t("page-gutter")})
53
+ minmax(${t("page-gutter")}, 1fr);
54
+ }
55
+ ${P} > * { grid-column: 2; min-inline-size: 0; margin-block: 0; }
56
+ ${P} > * + * { margin-block-start: ${t("prose-flow")}; }
57
+
58
+ ${P} ${HEADINGS} {
59
+ position: relative;
60
+ font-family: ${t("disp")};
61
+ font-weight: ${t("disp-weight")};
62
+ color: ${t("ink")};
63
+ line-height: 1.25;
64
+ letter-spacing: -0.011em;
65
+ text-wrap: balance;
66
+ scroll-margin-top: 1.5rem;
67
+ }
68
+ ${P} h1 { font-size: 2.25em; letter-spacing: -0.022em; line-height: 1.15; }
69
+ ${P} h2 { font-size: 1.5em; padding-block-end: 0.3em; border-block-end: 1px solid ${t("line")}; }
70
+ ${P} h3 { font-size: 1.2em; }
71
+ ${P} h4 { font-size: 1em; }
72
+ ${P} :is(h5, h6) { font-size: 0.875em; text-transform: uppercase; letter-spacing: 0.04em; color: ${t("ink-2")}; }
73
+ ${P} > ${HEADINGS}:not(:first-child) { margin-block-start: 2.2em; }
74
+ ${P} > :is(h1, h2, h3, h4) + * { margin-block-start: 0.7em; }
75
+
76
+ ${P} .ir-heading-anchor { color: ${t("ink-3")}; text-decoration: none; font-weight: 400; }
77
+ ${P} .ir-heading-anchor:hover { color: ${t("accent")}; }
78
+ @media (hover: hover) and (width >= ${GUTTER_ANCHOR_MIN_WIDTH}) {
79
+ ${P} .ir-heading-anchor {
80
+ position: absolute;
81
+ inset-inline-end: 100%;
82
+ inline-size: 1.2em;
83
+ padding-inline-end: 0.35em;
84
+ text-align: end;
85
+ opacity: 0;
86
+ transition: opacity 120ms ease;
87
+ }
88
+ ${P} ${HEADINGS}:hover .ir-heading-anchor,
89
+ ${P} .ir-heading-anchor:focus-visible { opacity: 1; }
90
+ }
91
+ @media (hover: none), (width < ${GUTTER_ANCHOR_MIN_WIDTH}) {
92
+ ${P} .ir-heading-anchor {
93
+ float: inline-end;
94
+ min-inline-size: 24px;
95
+ min-block-size: 24px;
96
+ margin-inline-start: 0.5em;
97
+ text-align: center;
98
+ font-size: 0.8em;
99
+ opacity: 0.45;
100
+ }
101
+ }
102
+
103
+ ${P} a { color: ${t(
104
+ "accent"
105
+ )}; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
106
+ ${P} strong { font-weight: 650; }
107
+ ${P} :not(pre) > code {
108
+ font-family: ${t("mono")};
109
+ font-size: 0.86em;
110
+ background: ${t("panel")};
111
+ padding: 0.12em 0.36em;
112
+ border-radius: 5px;
113
+ }
114
+ ${P} a code { color: inherit; }
115
+ ${P} pre {
116
+ font-family: ${t("mono")};
117
+ font-size: 0.85em;
118
+ line-height: 1.55;
119
+ background: ${t("panel")};
120
+ padding: 1em 1.2em;
121
+ border-radius: ${t("radius-shape")};
122
+ overflow-x: auto;
123
+ tab-size: 2;
124
+ }
125
+ ${P} pre code { font: inherit; background: none; padding: 0; }
126
+ ${P} :is(ul, ol) { padding-inline-start: 1.5em; }
127
+ ${P} li + li, ${P} li > :is(ul, ol) { margin-block-start: 0.35em; }
128
+ ${P} li::marker { color: ${t("ink-2")}; }
129
+ ${P} li.task-list-item { list-style: none; margin-inline-start: -1.3em; }
130
+ ${P} input[type="checkbox"] { margin-inline-end: 0.5em; accent-color: ${t("accent")}; }
131
+ ${P} blockquote { padding-inline-start: 1em; border-inline-start: 3px solid ${t("line")}; color: ${t("ink-2")}; }
132
+ ${P} hr { border: 0; border-block-start: 1px solid ${t("line")}; }
133
+ ${P} > hr, ${P} > hr + * { margin-block-start: calc(2.5 * ${t("prose-size")}); }
134
+ ${P} > hr + ${HEADINGS}:not(:first-child) { margin-block-start: max(2.2em, 2.5 * ${t("prose-size")}); }
135
+ ${P} :is(img, video) { max-width: 100%; height: auto; border-radius: ${t("radius-shape")}; }
136
+ ${P} table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.94em; font-variant-numeric: tabular-nums; }
137
+ ${P} :is(th, td) { padding: 0.45em 0.8em; border: 1px solid ${t("line")}; text-align: start; }
138
+ ${P} th { background: ${t("panel")}; }
139
+ }
140
+ `;
141
+ const isProseFile = (path) => /\.mdx?$/i.test(path);
142
+ function ensureProseStyles() {
143
+ ensureStyleElement(PROSE_STYLE_ID, PROSE_STYLE_TEXT, { first: true });
144
+ }
145
+ export {
146
+ PROSE_CLASS,
147
+ PROSE_STYLE_ID,
148
+ PROSE_STYLE_TEXT,
149
+ PROSE_TOKENS,
150
+ ensureProseStyles,
151
+ isProseFile
152
+ };
153
+ //# sourceMappingURL=proseStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/proseStyles.ts"],"sourcesContent":["// The default typography for rendered Markdown (MARKDOWN_SYNTAX_SPEC §16).\n//\n// A published library cannot `import './prose.css'` — the sandbox bundler evaluates a\n// dist CSS import as JavaScript — so the stylesheet is text generated here and injected\n// once through `ensureStyleElement`, the guard `loading.tsx` shares.\n\n//\n// Two properties carry the design:\n// - every rule sits in `@layer ir.defaults`, so any unlayered author rule beats it\n// whatever its specificity, with no `!important` on either side;\n// - the public tokens (Grove's names, 02-theme-contract §2) are only ever READ, as\n// `var(--ink, var(--_ir-ink))`. The defaults live in private `--_ir-*` properties.\n// An app or theme that already defines `--ink` higher in the tree therefore flows\n// into its prose, and an author's value set on the article wins over the default.\n\nimport { ensureStyleElement } from './styleElement';\n\n/** The class on the element that wraps rendered Markdown. */\nexport const PROSE_CLASS = 'ir-prose';\n\n/** The id of the injected `<style>` element (one per document). */\nexport const PROSE_STYLE_ID = 'ir-sdk-prose-styles';\n\n/** One public token: its name (no leading dashes) and its default per polarity. */\nexport interface ProseToken {\n readonly name: string;\n readonly light: string;\n readonly dark: string;\n}\n\nconst SANS = 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", sans-serif';\nconst MONO = 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace';\n\n/** Both polarities share one value. */\nconst same = (name: string, value: string): ProseToken => ({ name, light: value, dark: value });\n\n/**\n * The token table — the one home of every name an author may set (the author token file\n * reads its allow-list from here). Names are Grove's wherever Grove has one with the same\n * meaning; `prose-size` and `prose-flow` are the only new ones.\n *\n * `bg` defaults to transparent because the sandbox already paints `<html>` per polarity\n * (sandbox `themeCanvas.ts`); repeating its colours here would be a second copy.\n */\nexport const PROSE_TOKENS: readonly ProseToken[] = [\n same('bg', 'transparent'),\n { name: 'ink', light: '#1f2328', dark: '#d6dae0' },\n { name: 'ink-2', light: '#59636e', dark: '#8b949e' },\n { name: 'ink-3', light: '#8c959f', dark: '#6e7681' },\n { name: 'line', light: '#d8dee4', dark: '#2a2f37' },\n { name: 'panel', light: '#f3f4f6', dark: '#1a1e24' },\n { name: 'accent', light: '#0969da', dark: '#6cb6ff' },\n same('sans', SANS),\n same('disp', 'var(--sans, var(--_ir-sans))'),\n same('mono', MONO),\n same('disp-weight', '700'),\n same('prose-measure', '68ch'),\n same('prose-leading', '1.65'),\n same('page-gutter', 'clamp(1.25rem, 5vw, 3rem)'),\n same('radius-shape', '8px'),\n same('prose-size', '1.0625rem'),\n same('prose-flow', '1.1em'),\n];\n\n/** Read a public token with its private default behind it. */\nconst t = (name: string): string => `var(--${name}, var(--_ir-${name}))`;\n\nconst declarations = (pick: (token: ProseToken) => string, only?: (token: ProseToken) => boolean): string =>\n PROSE_TOKENS.filter(only ?? (() => true))\n .map((token) => `--_ir-${token.name}: ${pick(token)};`)\n .join(' ');\n\nconst P = `.${PROSE_CLASS}`;\n\n/**\n * The narrowest viewport that keeps the heading anchor in the gutter. Below it the side\n * column shrinks to `--page-gutter` (20px), narrower than an h1's `#`, so the anchor\n * floats to the line end as on touch devices instead of being clipped at the edge.\n */\nconst GUTTER_ANCHOR_MIN_WIDTH = '48rem';\nconst HEADINGS = ':is(h1, h2, h3, h4, h5, h6)';\n\n/** The whole default stylesheet. */\nexport const PROSE_STYLE_TEXT = `@layer ir.defaults {\n${P} { ${declarations((token) => token.light)} }\n${P}[data-theme=\"dark\"] { ${declarations(\n (token) => token.dark,\n (token) => token.dark !== token.light,\n)} }\n${P} {\n box-sizing: border-box;\n min-height: 100dvh;\n background: ${t('bg')};\n color: ${t('ink')};\n font: 400 ${t('prose-size')} / ${t('prose-leading')} ${t('sans')};\n font-kerning: normal;\n -webkit-font-smoothing: antialiased;\n overflow-wrap: break-word;\n padding-block: clamp(1.5rem, 6vw, 4rem) 6rem;\n display: grid;\n align-content: start;\n grid-template-columns:\n minmax(${t('page-gutter')}, 1fr)\n min(${t('prose-measure')}, 100% - 2 * ${t('page-gutter')})\n minmax(${t('page-gutter')}, 1fr);\n}\n${P} > * { grid-column: 2; min-inline-size: 0; margin-block: 0; }\n${P} > * + * { margin-block-start: ${t('prose-flow')}; }\n\n${P} ${HEADINGS} {\n position: relative;\n font-family: ${t('disp')};\n font-weight: ${t('disp-weight')};\n color: ${t('ink')};\n line-height: 1.25;\n letter-spacing: -0.011em;\n text-wrap: balance;\n scroll-margin-top: 1.5rem;\n}\n${P} h1 { font-size: 2.25em; letter-spacing: -0.022em; line-height: 1.15; }\n${P} h2 { font-size: 1.5em; padding-block-end: 0.3em; border-block-end: 1px solid ${t('line')}; }\n${P} h3 { font-size: 1.2em; }\n${P} h4 { font-size: 1em; }\n${P} :is(h5, h6) { font-size: 0.875em; text-transform: uppercase; letter-spacing: 0.04em; color: ${t('ink-2')}; }\n${P} > ${HEADINGS}:not(:first-child) { margin-block-start: 2.2em; }\n${P} > :is(h1, h2, h3, h4) + * { margin-block-start: 0.7em; }\n\n${P} .ir-heading-anchor { color: ${t('ink-3')}; text-decoration: none; font-weight: 400; }\n${P} .ir-heading-anchor:hover { color: ${t('accent')}; }\n@media (hover: hover) and (width >= ${GUTTER_ANCHOR_MIN_WIDTH}) {\n ${P} .ir-heading-anchor {\n position: absolute;\n inset-inline-end: 100%;\n inline-size: 1.2em;\n padding-inline-end: 0.35em;\n text-align: end;\n opacity: 0;\n transition: opacity 120ms ease;\n }\n ${P} ${HEADINGS}:hover .ir-heading-anchor,\n ${P} .ir-heading-anchor:focus-visible { opacity: 1; }\n}\n@media (hover: none), (width < ${GUTTER_ANCHOR_MIN_WIDTH}) {\n ${P} .ir-heading-anchor {\n float: inline-end;\n min-inline-size: 24px;\n min-block-size: 24px;\n margin-inline-start: 0.5em;\n text-align: center;\n font-size: 0.8em;\n opacity: 0.45;\n }\n}\n\n${P} a { color: ${t(\n 'accent',\n)}; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }\n${P} strong { font-weight: 650; }\n${P} :not(pre) > code {\n font-family: ${t('mono')};\n font-size: 0.86em;\n background: ${t('panel')};\n padding: 0.12em 0.36em;\n border-radius: 5px;\n}\n${P} a code { color: inherit; }\n${P} pre {\n font-family: ${t('mono')};\n font-size: 0.85em;\n line-height: 1.55;\n background: ${t('panel')};\n padding: 1em 1.2em;\n border-radius: ${t('radius-shape')};\n overflow-x: auto;\n tab-size: 2;\n}\n${P} pre code { font: inherit; background: none; padding: 0; }\n${P} :is(ul, ol) { padding-inline-start: 1.5em; }\n${P} li + li, ${P} li > :is(ul, ol) { margin-block-start: 0.35em; }\n${P} li::marker { color: ${t('ink-2')}; }\n${P} li.task-list-item { list-style: none; margin-inline-start: -1.3em; }\n${P} input[type=\"checkbox\"] { margin-inline-end: 0.5em; accent-color: ${t('accent')}; }\n${P} blockquote { padding-inline-start: 1em; border-inline-start: 3px solid ${t('line')}; color: ${t('ink-2')}; }\n${P} hr { border: 0; border-block-start: 1px solid ${t('line')}; }\n${P} > hr, ${P} > hr + * { margin-block-start: calc(2.5 * ${t('prose-size')}); }\n${P} > hr + ${HEADINGS}:not(:first-child) { margin-block-start: max(2.2em, 2.5 * ${t('prose-size')}); }\n${P} :is(img, video) { max-width: 100%; height: auto; border-radius: ${t('radius-shape')}; }\n${P} table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.94em; font-variant-numeric: tabular-nums; }\n${P} :is(th, td) { padding: 0.45em 0.8em; border: 1px solid ${t('line')}; text-align: start; }\n${P} th { background: ${t('panel')}; }\n}\n`;\n\n/** Markdown and MDX files get the prose wrapper; app components and HTML do not. The\n * extensions are the ones the transpiler compiles as MDX (`.md`, `.mdx`); a `.markdown`\n * file is not compiled, so wrapping it would style nothing it renders. */\nexport const isProseFile = (path: string): boolean => /\\.mdx?$/i.test(path);\n\n/**\n * Inject the default stylesheet once per document (idempotent, browser-only).\n *\n * It goes FIRST in `<head>`. Cascade layers rank by the order they first appear, later\n * layers winning, so a sheet appended after an app's own CSS would rank `ir.defaults`\n * above the app's layered rules (Tailwind's `base`/`components`/`utilities`, say).\n * First in the document makes it the lowest layer; unlayered rules beat it either way.\n */\nexport function ensureProseStyles(): void {\n ensureStyleElement(PROSE_STYLE_ID, PROSE_STYLE_TEXT, { first: true });\n}\n"],"mappings":";AAeA,SAAS,0BAA0B;AAG5B,MAAM,cAAc;AAGpB,MAAM,iBAAiB;AAS9B,MAAM,OAAO;AACb,MAAM,OAAO;AAGb,MAAM,OAAO,CAAC,MAAc,WAA+B,EAAE,MAAM,OAAO,OAAO,MAAM,MAAM;AAUtF,MAAM,eAAsC;AAAA,EACjD,KAAK,MAAM,aAAa;AAAA,EACxB,EAAE,MAAM,OAAO,OAAO,WAAW,MAAM,UAAU;AAAA,EACjD,EAAE,MAAM,SAAS,OAAO,WAAW,MAAM,UAAU;AAAA,EACnD,EAAE,MAAM,SAAS,OAAO,WAAW,MAAM,UAAU;AAAA,EACnD,EAAE,MAAM,QAAQ,OAAO,WAAW,MAAM,UAAU;AAAA,EAClD,EAAE,MAAM,S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,EAAE,QAAQ,CAAC;AAAA,EACjF,CAAC,2EAA2E,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC;AAAA,EAC3G,CAAC,kDAAkD,EAAE,MAAM,CAAC;AAAA,EAC5D,CAAC,UAAU,CAAC,8CAA8C,EAAE,YAAY,CAAC;AAAA,EACzE,CAAC,WAAW,QAAQ,6DAA6D,EAAE,YAAY,CAAC;AAAA,EAChG,CAAC,oEAAoE,EAAE,cAAc,CAAC;AAAA,EACtF,CAAC;AAAA,EACD,CAAC,2DAA2D,EAAE,MAAM,CAAC;AAAA,EACrE,CAAC,qBAAqB,EAAE,OAAO,CAAC;AAAA;AAAA;AAO3B,MAAM,cAAc,CAAC,SAA0B,WAAW,KAAK,IAAI;AAUnE,SAAS,oBAA0B;AACxC,qBAAmB,gBAAgB,kBAAkB,EAAE,OAAO,KAAK,CAAC;AACtE;","names":[]}
@@ -0,0 +1,37 @@
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 styleElement_exports = {};
20
+ __export(styleElement_exports, {
21
+ ensureStyleElement: () => ensureStyleElement
22
+ });
23
+ module.exports = __toCommonJS(styleElement_exports);
24
+ function ensureStyleElement(id, text, options = {}) {
25
+ if (typeof document === "undefined") return;
26
+ if (document.getElementById(id)) return;
27
+ const el = document.createElement("style");
28
+ el.id = id;
29
+ el.textContent = text;
30
+ if (options.first) document.head.prepend(el);
31
+ else document.head.appendChild(el);
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ ensureStyleElement
36
+ });
37
+ //# sourceMappingURL=styleElement.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/styleElement.ts"],"sourcesContent":["// The one inject-once `<style>` guard the SDK's self-styling components share\n// (`loading.tsx`, `proseStyles.ts`). A published library cannot import a CSS file in the\n// sandbox — the bundler evaluates a dist CSS import as JavaScript — so each stylesheet is\n// text the component injects itself.\n\n/**\n * Insert `<style id={id}>{text}</style>` into `<head>` unless one with that id exists.\n * Idempotent and browser-only (a no-op without `document`).\n *\n * `first: true` puts it before every other stylesheet. A sheet whose rules sit in a\n * cascade layer needs that: layers rank by the order they first appear, later layers\n * winning, so an appended layered sheet would outrank the app's own layers.\n */\nexport function ensureStyleElement(id: string, text: string, options: { first?: boolean } = {}): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById(id)) return;\n const el = document.createElement('style');\n el.id = id;\n el.textContent = text;\n if (options.first) document.head.prepend(el);\n else document.head.appendChild(el);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,mBAAmB,IAAY,MAAc,UAA+B,CAAC,GAAS;AACpG,MAAI,OAAO,aAAa,YAAa;AACrC,MAAI,SAAS,eAAe,EAAE,EAAG;AACjC,QAAM,KAAK,SAAS,cAAc,OAAO;AACzC,KAAG,KAAK;AACR,KAAG,cAAc;AACjB,MAAI,QAAQ,MAAO,UAAS,KAAK,QAAQ,EAAE;AAAA,MACtC,UAAS,KAAK,YAAY,EAAE;AACnC;","names":[]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Insert `<style id={id}>{text}</style>` into `<head>` unless one with that id exists.
3
+ * Idempotent and browser-only (a no-op without `document`).
4
+ *
5
+ * `first: true` puts it before every other stylesheet. A sheet whose rules sit in a
6
+ * cascade layer needs that: layers rank by the order they first appear, later layers
7
+ * winning, so an appended layered sheet would outrank the app's own layers.
8
+ */
9
+ declare function ensureStyleElement(id: string, text: string, options?: {
10
+ first?: boolean;
11
+ }): void;
12
+
13
+ export { ensureStyleElement };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Insert `<style id={id}>{text}</style>` into `<head>` unless one with that id exists.
3
+ * Idempotent and browser-only (a no-op without `document`).
4
+ *
5
+ * `first: true` puts it before every other stylesheet. A sheet whose rules sit in a
6
+ * cascade layer needs that: layers rank by the order they first appear, later layers
7
+ * winning, so an appended layered sheet would outrank the app's own layers.
8
+ */
9
+ declare function ensureStyleElement(id: string, text: string, options?: {
10
+ first?: boolean;
11
+ }): void;
12
+
13
+ export { ensureStyleElement };
@@ -0,0 +1,14 @@
1
+ import "./chunk-VHAA22YE.js";
2
+ function ensureStyleElement(id, text, options = {}) {
3
+ if (typeof document === "undefined") return;
4
+ if (document.getElementById(id)) return;
5
+ const el = document.createElement("style");
6
+ el.id = id;
7
+ el.textContent = text;
8
+ if (options.first) document.head.prepend(el);
9
+ else document.head.appendChild(el);
10
+ }
11
+ export {
12
+ ensureStyleElement
13
+ };
14
+ //# sourceMappingURL=styleElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/styleElement.ts"],"sourcesContent":["// The one inject-once `<style>` guard the SDK's self-styling components share\n// (`loading.tsx`, `proseStyles.ts`). A published library cannot import a CSS file in the\n// sandbox — the bundler evaluates a dist CSS import as JavaScript — so each stylesheet is\n// text the component injects itself.\n\n/**\n * Insert `<style id={id}>{text}</style>` into `<head>` unless one with that id exists.\n * Idempotent and browser-only (a no-op without `document`).\n *\n * `first: true` puts it before every other stylesheet. A sheet whose rules sit in a\n * cascade layer needs that: layers rank by the order they first appear, later layers\n * winning, so an appended layered sheet would outrank the app's own layers.\n */\nexport function ensureStyleElement(id: string, text: string, options: { first?: boolean } = {}): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById(id)) return;\n const el = document.createElement('style');\n el.id = id;\n el.textContent = text;\n if (options.first) document.head.prepend(el);\n else document.head.appendChild(el);\n}\n"],"mappings":";AAaO,SAAS,mBAAmB,IAAY,MAAc,UAA+B,CAAC,GAAS;AACpG,MAAI,OAAO,aAAa,YAAa;AACrC,MAAI,SAAS,eAAe,EAAE,EAAG;AACjC,QAAM,KAAK,SAAS,cAAc,OAAO;AACzC,KAAG,KAAK;AACR,KAAG,cAAc;AACjB,MAAI,QAAQ,MAAO,UAAS,KAAK,QAAQ,EAAE;AAAA,MACtC,UAAS,KAAK,YAAY,EAAE;AACnC;","names":[]}
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.93.2";
24
+ const SDK_VERSION = "0.95.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.93.2';\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.95.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.93.2";
2
+ declare const SDK_VERSION = "0.95.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.93.2";
2
+ declare const SDK_VERSION = "0.95.0";
3
3
 
4
4
  export { SDK_VERSION };
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./chunk-VHAA22YE.js";
2
- const SDK_VERSION = "0.93.2";
2
+ const SDK_VERSION = "0.95.0";
3
3
  export {
4
4
  SDK_VERSION
5
5
  };
@@ -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.93.2';\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.95.0';\n"],"mappings":";AAIO,MAAM,cAAc;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/sdk",
3
- "version": "0.93.2",
3
+ "version": "0.95.0",
4
4
  "description": "Runtime SDK for code executing inside an immediately.run sandbox.",
5
5
  "license": "MIT",
6
6
  "repository": "github:immediately-run/immediately-run-sdk",