@silverpoint/core 0.3.0 → 0.7.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 (47) hide show
  1. package/README.md +18 -0
  2. package/dist/catalog.d.ts +97 -0
  3. package/dist/catalog.js +8004 -0
  4. package/dist/catalog.js.map +1 -0
  5. package/dist/{chunk-I6BAZ7MJ.js → chunk-46QELMCG.js} +41 -236
  6. package/dist/chunk-46QELMCG.js.map +1 -0
  7. package/dist/chunk-5MP3BLZK.js +48 -0
  8. package/dist/chunk-5MP3BLZK.js.map +1 -0
  9. package/dist/chunk-6YFO7OP3.js +84 -0
  10. package/dist/chunk-6YFO7OP3.js.map +1 -0
  11. package/dist/chunk-ANJSW5JX.js +93 -0
  12. package/dist/chunk-ANJSW5JX.js.map +1 -0
  13. package/dist/chunk-E5CC2NNQ.js +172 -0
  14. package/dist/chunk-E5CC2NNQ.js.map +1 -0
  15. package/dist/chunk-G7N4X5XD.js +12 -0
  16. package/dist/chunk-G7N4X5XD.js.map +1 -0
  17. package/dist/chunk-KFBSQH5G.js +34 -0
  18. package/dist/chunk-KFBSQH5G.js.map +1 -0
  19. package/dist/chunk-NI7B6UEO.js +24 -0
  20. package/dist/chunk-NI7B6UEO.js.map +1 -0
  21. package/dist/chunk-WYFRHI4S.js +179 -0
  22. package/dist/chunk-WYFRHI4S.js.map +1 -0
  23. package/dist/contrast-siWF_R5o.d.ts +30 -0
  24. package/dist/dashboard-demos.d.ts +2 -2
  25. package/dist/index.d.ts +16 -60
  26. package/dist/index.js +34 -179
  27. package/dist/index.js.map +1 -1
  28. package/dist/model-DVVt59AB.d.ts +53 -0
  29. package/dist/palettes.d.ts +29 -0
  30. package/dist/palettes.js +79 -0
  31. package/dist/palettes.js.map +1 -0
  32. package/dist/{props-3G1XYd-r.d.ts → props-BZ9CcrGv.d.ts} +394 -2
  33. package/dist/timeline.d.ts +90 -0
  34. package/dist/timeline.js +125 -0
  35. package/dist/timeline.js.map +1 -0
  36. package/dist/{types-CbVMKvyQ.d.ts → types-BT3Xm7fP.d.ts} +3 -1
  37. package/dist/types-D5ys35fF.d.ts +576 -0
  38. package/dist/types-DHBJ0PzV.d.ts +57 -0
  39. package/dist/ui-demos.d.ts +14 -3
  40. package/dist/ui-demos.js +163 -1
  41. package/dist/ui-demos.js.map +1 -1
  42. package/dist/ui.d.ts +346 -325
  43. package/dist/ui.js +933 -118
  44. package/dist/ui.js.map +1 -1
  45. package/dist/view-DteS9glE.d.ts +82 -0
  46. package/package.json +19 -1
  47. package/dist/chunk-I6BAZ7MJ.js.map +0 -1
@@ -0,0 +1,90 @@
1
+ import { S as SpTimelineProps, T as TimelineData } from './types-DHBJ0PzV.js';
2
+ export { a as TimelineDate, b as TimelineEra, c as TimelineSlide, d as TimelineText } from './types-DHBJ0PzV.js';
3
+ import { U as UiResolved, a as UiElement } from './view-DteS9glE.js';
4
+ import './types-D5ys35fF.js';
5
+ import './props-BZ9CcrGv.js';
6
+
7
+ /** The frame kinds TimelineJS's pieces borrow, one hidden probe each (DD-042). */
8
+ declare const TIMELINE_FRAMES: readonly ["control", "card", "round", "box", "pill"];
9
+ /** The tonal levels its eras and selection borrow, one hidden probe each. */
10
+ declare const TIMELINE_TONES: readonly ["1", "2", "3", "4"];
11
+ /** A resolved style, as much of `CSSStyleDeclaration` as this reads. */
12
+ interface InkStyle {
13
+ getPropertyValue(name: string): string;
14
+ }
15
+ interface InkView {
16
+ getComputedStyle(element: never): InkStyle;
17
+ readonly MutationObserver: new (callback: () => void) => {
18
+ observe(target: never, options: {
19
+ readonly attributes: boolean;
20
+ readonly attributeFilter: string[];
21
+ }): void;
22
+ disconnect(): void;
23
+ };
24
+ }
25
+ /** The timeline's surface: where the `--sp-kl-*` properties are written. */
26
+ interface TimelineInkHost {
27
+ getAttribute(name: string): string | null;
28
+ setAttribute(name: string, value: string): void;
29
+ readonly style: {
30
+ setProperty(name: string, value: string): void;
31
+ };
32
+ readonly ownerDocument: {
33
+ readonly defaultView: InkView | null;
34
+ } | null;
35
+ }
36
+ /** The hidden probe holding one `sp-frame` per kind and one `sp-tone` per level. */
37
+ interface TimelineInkProbe {
38
+ querySelector(selector: string): unknown;
39
+ }
40
+ /**
41
+ * The hand on TimelineJS's own DOM (REQ-512, DD-042): reads the ground's resolved frame masks and
42
+ * tones from the probes and republishes them on the host as `--sp-kl-*`; every mask is `none`
43
+ * outside the `ink` mode or when `inked` is false. It re-reads when the host's ground, substrate,
44
+ * mode or frame changes, until the returned cleanup runs. Client only.
45
+ */
46
+ declare function timelineInk(host: TimelineInkHost, probe: TimelineInkProbe, inked?: boolean): () => void;
47
+
48
+ /**
49
+ * `SpTimeline`'s server markup (REQ-513, DD-042): the surface, the hidden probes `timelineInk`
50
+ * reads, and an empty mount TimelineJS fills on the client. Nothing of `data` is drawn here but the
51
+ * region's name; TimelineJS's DOM is third-party markup, outside the tree gate (Art. 3 as amended).
52
+ */
53
+ declare function timelineView(props: SpTimelineProps, r: UiResolved, state?: {
54
+ readonly failed?: boolean;
55
+ }): UiElement;
56
+
57
+ /** TimelineJS's events and the name each framework forwards them under (REQ-514). */
58
+ declare const TIMELINE_EVENTS: readonly [readonly ["change", "change"], readonly ["loaded", "loaded"], readonly ["nav_next", "navNext"], readonly ["nav_previous", "navPrevious"], readonly ["zoom_in", "zoomIn"], readonly ["zoom_out", "zoomOut"], readonly ["back_to_start", "backToStart"]];
59
+ /** The options TimelineJS receives: `font` and `theme` belong to the skin and are dropped (REQ-514). */
60
+ declare function timelineOptions(options?: Readonly<Record<string, unknown>>): Record<string, unknown>;
61
+ /** As much of TimelineJS's module as `timelineMount` uses. */
62
+ interface TimelineJsModule {
63
+ readonly Timeline: new (element: never, data: TimelineData, options: Record<string, unknown>) => {
64
+ on(event: string, handler: (payload: unknown) => void): unknown;
65
+ };
66
+ }
67
+ /** The surface `timelineView` drew, found in the page. */
68
+ interface TimelineMountHost extends TimelineInkHost {
69
+ querySelector(selector: string): unknown;
70
+ }
71
+ interface TimelineMountOptions {
72
+ readonly load: () => Promise<TimelineJsModule>;
73
+ readonly data: TimelineData;
74
+ readonly options?: Readonly<Record<string, unknown>>;
75
+ readonly inked?: boolean;
76
+ /** One of `TIMELINE_EVENTS`' forwarded names, with a payload only for `change` and `loaded`. */
77
+ readonly emit: (event: string, ...value: unknown[]) => void;
78
+ readonly failed: () => void;
79
+ }
80
+ /**
81
+ * The client half of `SpTimeline` (REQ-513..REQ-515, DD-042): inks the surface from its probes,
82
+ * loads TimelineJS through the adapter's `load`, builds it in the mount and forwards its events
83
+ * under `TIMELINE_EVENTS`' names, with a copy of the data. A load that fails, or a TimelineJS that
84
+ * throws as it is built, warns `SP025` and calls `failed`; nothing throws.
85
+ * TimelineJS is built in a container of its own inside the mount, since it rewrites its container's
86
+ * `className`; the returned cleanup cancels a pending load, stops the inking and removes that container.
87
+ */
88
+ declare function timelineMount(host: TimelineMountHost, mount: TimelineMountOptions): () => void;
89
+
90
+ export { SpTimelineProps, TIMELINE_EVENTS, TIMELINE_FRAMES, TIMELINE_TONES, TimelineData, type TimelineInkHost, type TimelineInkProbe, type TimelineJsModule, type TimelineMountHost, type TimelineMountOptions, timelineInk, timelineMount, timelineOptions, timelineView };
@@ -0,0 +1,125 @@
1
+ import { uiRequireName } from './chunk-G7N4X5XD.js';
2
+ import { cssLength, el, root, frame, slot } from './chunk-6YFO7OP3.js';
3
+ import { diagnose } from './chunk-WYFRHI4S.js';
4
+
5
+ // src/timeline/ink.ts
6
+ var TIMELINE_FRAMES = Object.freeze(["control", "card", "round", "box", "pill"]);
7
+ var TIMELINE_TONES = Object.freeze(["1", "2", "3", "4"]);
8
+ function timelineInk(host, probe, inked = true) {
9
+ const view = host.ownerDocument?.defaultView;
10
+ if (!view) return () => {
11
+ };
12
+ const read = (selector, name, fallback) => {
13
+ const piece = probe.querySelector(selector);
14
+ return (piece ? view.getComputedStyle(piece).getPropertyValue(name).trim() : "") || fallback;
15
+ };
16
+ const ink = () => {
17
+ const usable = inked && host.getAttribute("data-mode") === "ink";
18
+ let anyMask = false;
19
+ let anyTone = false;
20
+ for (const kind of TIMELINE_FRAMES) {
21
+ const piece = `[part='sp-frame'][data-kind='${kind}']`;
22
+ const mask = usable ? read(piece, "--sp-ui-mask", "none") : "none";
23
+ anyMask ||= mask !== "none";
24
+ host.style.setProperty(`--sp-kl-mask-${kind}`, mask);
25
+ host.style.setProperty(`--sp-kl-mask-position-${kind}`, read(piece, "--sp-ui-mask-position", "center"));
26
+ host.style.setProperty(`--sp-kl-mask-size-${kind}`, read(piece, "--sp-ui-mask-size", "100% 100%"));
27
+ }
28
+ for (const level of TIMELINE_TONES) {
29
+ const piece = `[part='sp-tone'][data-tone='${level}']`;
30
+ const tone = read(piece, "--sp-ui-tone", "none");
31
+ anyTone ||= tone !== "none";
32
+ host.style.setProperty(`--sp-kl-tone-${level}`, tone);
33
+ host.style.setProperty(`--sp-kl-tone-size-${level}`, read(piece, "--sp-ui-tone-size", "auto"));
34
+ }
35
+ host.setAttribute("data-kl-inked", String(anyMask));
36
+ host.setAttribute("data-kl-toned", String(anyTone));
37
+ };
38
+ ink();
39
+ const observer = new view.MutationObserver(ink);
40
+ observer.observe(host, { attributes: true, attributeFilter: ["data-mode", "data-substrate", "data-ground", "data-frame", "class"] });
41
+ return () => observer.disconnect();
42
+ }
43
+
44
+ // src/timeline/view.ts
45
+ function timelineView(props, r, state = {}) {
46
+ const card = props.card !== false;
47
+ const label = props.label ?? props.data.title?.text?.headline;
48
+ uiRequireName("SpTimeline", void 0, label);
49
+ const height = cssLength(props.height, "SpTimeline", "height") ?? "600px";
50
+ return el(
51
+ "section",
52
+ root("timeline", props, r, {
53
+ id: props.id,
54
+ "aria-label": label,
55
+ "data-kl-card": String(card),
56
+ // timelineInk sets it on the client, once a probe resolves a mask.
57
+ "data-kl-inked": "false",
58
+ style: `height:${height}`
59
+ }),
60
+ [
61
+ ...card ? [frame("card")] : [],
62
+ el(
63
+ "span",
64
+ { class: "sp-kl-probe", "aria-hidden": "true" },
65
+ [
66
+ ...TIMELINE_FRAMES.map((kind) => el("span", { part: "sp-frame", "data-kind": kind })),
67
+ ...TIMELINE_TONES.map((level) => el("span", { part: "sp-tone", "data-tone": level }))
68
+ ],
69
+ "probe"
70
+ ),
71
+ // Once the load has failed, the consumer's fallback fills the mount (REQ-515); never on the server.
72
+ el("div", { class: "sp-kl-mount" }, state.failed ? [slot("fallback")] : [], "mount")
73
+ ]
74
+ );
75
+ }
76
+
77
+ // src/timeline/mount.ts
78
+ var TIMELINE_EVENTS = Object.freeze([
79
+ ["change", "change"],
80
+ ["loaded", "loaded"],
81
+ ["nav_next", "navNext"],
82
+ ["nav_previous", "navPrevious"],
83
+ ["zoom_in", "zoomIn"],
84
+ ["zoom_out", "zoomOut"],
85
+ ["back_to_start", "backToStart"]
86
+ ]);
87
+ function timelineOptions(options) {
88
+ const { font: _font, theme: _theme, ...rest } = options ?? {};
89
+ return rest;
90
+ }
91
+ function timelineMount(host, mount) {
92
+ const stopInk = timelineInk(host, host.querySelector(".sp-kl-probe") ?? host, mount.inked);
93
+ const target = host.querySelector(".sp-kl-mount");
94
+ let live = true;
95
+ let box;
96
+ const fail = (error) => {
97
+ if (!live) return;
98
+ box?.remove();
99
+ box = void 0;
100
+ diagnose("SP025", "SpTimeline", { property: "load", message: error instanceof Error ? error.message : void 0 });
101
+ mount.failed();
102
+ };
103
+ mount.load().then(({ Timeline }) => {
104
+ if (!live || !target?.ownerDocument) return;
105
+ box = target.ownerDocument.createElement("div");
106
+ target.append(box);
107
+ const timeline = new Timeline(box, structuredClone(mount.data), timelineOptions(mount.options));
108
+ for (const [name, as] of TIMELINE_EVENTS) {
109
+ timeline.on(name, (payload) => {
110
+ if (name === "change") mount.emit(as, payload?.unique_id);
111
+ else if (name === "loaded") mount.emit(as, payload);
112
+ else mount.emit(as);
113
+ });
114
+ }
115
+ }).catch(fail);
116
+ return () => {
117
+ live = false;
118
+ stopInk();
119
+ box?.remove();
120
+ };
121
+ }
122
+
123
+ export { TIMELINE_EVENTS, TIMELINE_FRAMES, TIMELINE_TONES, timelineInk, timelineMount, timelineOptions, timelineView };
124
+ //# sourceMappingURL=timeline.js.map
125
+ //# sourceMappingURL=timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/timeline/ink.ts","../src/timeline/view.ts","../src/timeline/mount.ts"],"names":[],"mappings":";;;;;AACO,IAAM,eAAA,GAAkB,OAAO,MAAA,CAAO,CAAC,WAAW,MAAA,EAAQ,OAAA,EAAS,KAAA,EAAO,MAAM,CAAU;AAE1F,IAAM,cAAA,GAAiB,OAAO,MAAA,CAAO,CAAC,KAAK,GAAA,EAAK,GAAA,EAAK,GAAG,CAAU;AAkClE,SAAS,WAAA,CAAY,IAAA,EAAuB,KAAA,EAAyB,KAAA,GAAQ,IAAA,EAAkB;AACpG,EAAA,MAAM,IAAA,GAAO,KAAK,aAAA,EAAe,WAAA;AACjC,EAAA,IAAI,CAAC,IAAA,EAAM,OAAO,MAAM;AAAA,EAAC,CAAA;AACzB,EAAA,MAAM,IAAA,GAAO,CAAC,QAAA,EAAkB,IAAA,EAAc,QAAA,KAA6B;AACzE,IAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,aAAA,CAAc,QAAQ,CAAA;AAC1C,IAAA,OAAA,CAAQ,KAAA,GAAQ,IAAA,CAAK,gBAAA,CAAiB,KAAc,CAAA,CAAE,iBAAiB,IAAI,CAAA,CAAE,IAAA,EAAK,GAAI,EAAA,KAAO,QAAA;AAAA,EAC/F,CAAA;AACA,EAAA,MAAM,MAAM,MAAM;AAChB,IAAA,MAAM,MAAA,GAAS,KAAA,IAAS,IAAA,CAAK,YAAA,CAAa,WAAW,CAAA,KAAM,KAAA;AAC3D,IAAA,IAAI,OAAA,GAAU,KAAA;AACd,IAAA,IAAI,OAAA,GAAU,KAAA;AACd,IAAA,KAAA,MAAW,QAAQ,eAAA,EAAiB;AAClC,MAAA,MAAM,KAAA,GAAQ,gCAAgC,IAAI,CAAA,EAAA,CAAA;AA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MAAA,EAAO;AAAA,EACd,CAAA;AACF","file":"timeline.js","sourcesContent":["/** The frame kinds TimelineJS's pieces borrow, one hidden probe each (DD-042). */\nexport const TIMELINE_FRAMES = Object.freeze(['control', 'card', 'round', 'box', 'pill'] as const);\n/** The tonal levels its eras and selection borrow, one hidden probe each. */\nexport const TIMELINE_TONES = Object.freeze(['1', '2', '3', '4'] as const);\n\n/** A resolved style, as much of `CSSStyleDeclaration` as this reads. */\ninterface InkStyle {\n getPropertyValue(name: string): string;\n}\n\ninterface InkView {\n getComputedStyle(element: never): InkStyle;\n readonly MutationObserver: new (callback: () => void) => {\n observe(target: never, options: { readonly attributes: boolean; readonly attributeFilter: string[] }): void;\n disconnect(): void;\n };\n}\n\n/** The timeline's surface: where the `--sp-kl-*` properties are written. */\nexport interface TimelineInkHost {\n getAttribute(name: string): string | null;\n setAttribute(name: string, value: string): void;\n readonly style: { setProperty(name: string, value: string): void };\n readonly ownerDocument: { readonly defaultView: InkView | null } | null;\n}\n\n/** The hidden probe holding one `sp-frame` per kind and one `sp-tone` per level. */\nexport interface TimelineInkProbe {\n querySelector(selector: string): unknown;\n}\n\n/**\n * The hand on TimelineJS's own DOM (REQ-512, DD-042): reads the ground's resolved frame masks and\n * tones from the probes and republishes them on the host as `--sp-kl-*`; every mask is `none`\n * outside the `ink` mode or when `inked` is false. It re-reads when the host's ground, substrate,\n * mode or frame changes, until the returned cleanup runs. Client only.\n */\nexport function timelineInk(host: TimelineInkHost, probe: TimelineInkProbe, inked = true): () => void {\n const view = host.ownerDocument?.defaultView;\n if (!view) return () => {};\n const read = (selector: string, name: string, fallback: string): string => {\n const piece = probe.querySelector(selector);\n return (piece ? view.getComputedStyle(piece as never).getPropertyValue(name).trim() : '') || fallback;\n };\n const ink = () => {\n const usable = inked && host.getAttribute('data-mode') === 'ink';\n let anyMask = false;\n let anyTone = false;\n for (const kind of TIMELINE_FRAMES) {\n const piece = `[part='sp-frame'][data-kind='${kind}']`;\n const mask = usable ? read(piece, '--sp-ui-mask', 'none') : 'none';\n anyMask ||= mask !== 'none';\n host.style.setProperty(`--sp-kl-mask-${kind}`, mask);\n host.style.setProperty(`--sp-kl-mask-position-${kind}`, read(piece, '--sp-ui-mask-position', 'center'));\n host.style.setProperty(`--sp-kl-mask-size-${kind}`, read(piece, '--sp-ui-mask-size', '100% 100%'));\n }\n for (const level of TIMELINE_TONES) {\n const piece = `[part='sp-tone'][data-tone='${level}']`;\n const tone = read(piece, '--sp-ui-tone', 'none');\n anyTone ||= tone !== 'none';\n host.style.setProperty(`--sp-kl-tone-${level}`, tone);\n host.style.setProperty(`--sp-kl-tone-size-${level}`, read(piece, '--sp-ui-tone-size', 'auto'));\n }\n host.setAttribute('data-kl-inked', String(anyMask));\n host.setAttribute('data-kl-toned', String(anyTone));\n };\n ink();\n const observer = new view.MutationObserver(ink);\n observer.observe(host as never, { attributes: true, attributeFilter: ['data-mode', 'data-substrate', 'data-ground', 'data-frame', 'class'] });\n return () => observer.disconnect();\n}\n","import { uiRequireName } from '../ui/names';\nimport type { UiElement, UiResolved } from '../ui/view';\nimport { cssLength, el, frame, root, slot } from '../ui/view-kit';\nimport { TIMELINE_FRAMES, TIMELINE_TONES } from './ink';\nimport type { SpTimelineProps } from './types';\n\n/**\n * `SpTimeline`'s server markup (REQ-513, DD-042): the surface, the hidden probes `timelineInk`\n * reads, and an empty mount TimelineJS fills on the client. Nothing of `data` is drawn here but the\n * region's name; TimelineJS's DOM is third-party markup, outside the tree gate (Art. 3 as amended).\n */\nexport function timelineView(props: SpTimelineProps, r: UiResolved, state: { readonly failed?: boolean } = {}): UiElement {\n const card = props.card !== false;\n const label = props.label ?? props.data.title?.text?.headline;\n uiRequireName('SpTimeline', undefined, label);\n const height = cssLength(props.height, 'SpTimeline', 'height') ?? '600px';\n return el(\n 'section',\n root('timeline', props, r, {\n id: props.id,\n 'aria-label': label,\n 'data-kl-card': String(card),\n // timelineInk sets it on the client, once a probe resolves a mask.\n 'data-kl-inked': 'false',\n style: `height:${height}`,\n }),\n [\n ...(card ? [frame('card')] : []),\n el(\n 'span',\n { class: 'sp-kl-probe', 'aria-hidden': 'true' },\n [\n ...TIMELINE_FRAMES.map((kind) => el('span', { part: 'sp-frame', 'data-kind': kind })),\n ...TIMELINE_TONES.map((level) => el('span', { part: 'sp-tone', 'data-tone': level })),\n ],\n 'probe',\n ),\n // Once the load has failed, the consumer's fallback fills the mount (REQ-515); never on the server.\n el('div', { class: 'sp-kl-mount' }, state.failed ? [slot('fallback')] : [], 'mount'),\n ],\n );\n}\n","import { diagnose } from '../diagnostics/diagnose';\nimport { timelineInk, type TimelineInkHost, type TimelineInkProbe } from './ink';\nimport type { TimelineData } from './types';\n\n/** TimelineJS's events and the name each framework forwards them under (REQ-514). */\nexport const TIMELINE_EVENTS = Object.freeze([\n ['change', 'change'],\n ['loaded', 'loaded'],\n ['nav_next', 'navNext'],\n ['nav_previous', 'navPrevious'],\n ['zoom_in', 'zoomIn'],\n ['zoom_out', 'zoomOut'],\n ['back_to_start', 'backToStart'],\n] as const);\n\n/** The options TimelineJS receives: `font` and `theme` belong to the skin and are dropped (REQ-514). */\nexport function timelineOptions(options?: Readonly<Record<string, unknown>>): Record<string, unknown> {\n const { font: _font, theme: _theme, ...rest } = options ?? {};\n return rest;\n}\n\n/** As much of TimelineJS's module as `timelineMount` uses. */\nexport interface TimelineJsModule {\n readonly Timeline: new (element: never, data: TimelineData, options: Record<string, unknown>) => {\n on(event: string, handler: (payload: unknown) => void): unknown;\n };\n}\n\n/** TimelineJS's container. */\ninterface TimelineMountBox {\n remove(): void;\n}\n\n/** The surface's mount, as much of it as `timelineMount` uses. */\ninterface TimelineMountTarget {\n append(child: never): void;\n readonly ownerDocument: { createElement(tag: 'div'): TimelineMountBox } | null;\n}\n\n/** The surface `timelineView` drew, found in the page. */\nexport interface TimelineMountHost extends TimelineInkHost {\n querySelector(selector: string): unknown;\n}\n\nexport interface TimelineMountOptions {\n readonly load: () => Promise<TimelineJsModule>;\n readonly data: TimelineData;\n readonly options?: Readonly<Record<string, unknown>>;\n readonly inked?: boolean;\n /** One of `TIMELINE_EVENTS`' forwarded names, with a payload only for `change` and `loaded`. */\n readonly emit: (event: string, ...value: unknown[]) => void;\n readonly failed: () => void;\n}\n\n/**\n * The client half of `SpTimeline` (REQ-513..REQ-515, DD-042): inks the surface from its probes,\n * loads TimelineJS through the adapter's `load`, builds it in the mount and forwards its events\n * under `TIMELINE_EVENTS`' names, with a copy of the data. A load that fails, or a TimelineJS that\n * throws as it is built, warns `SP025` and calls `failed`; nothing throws.\n * TimelineJS is built in a container of its own inside the mount, since it rewrites its container's\n * `className`; the returned cleanup cancels a pending load, stops the inking and removes that container.\n */\nexport function timelineMount(host: TimelineMountHost, mount: TimelineMountOptions): () => void {\n const stopInk = timelineInk(host, host.querySelector('.sp-kl-probe') as TimelineInkProbe ?? host, mount.inked);\n const target = host.querySelector('.sp-kl-mount') as TimelineMountTarget | null;\n let live = true;\n /** TimelineJS's container: a `<div>` of its own, which it may restyle; the mount stays the framework's. */\n let box: TimelineMountBox | undefined;\n const fail = (error: unknown) => {\n if (!live) return;\n // Whatever TimelineJS wrote before it threw goes with its container: the mount is the fallback's.\n box?.remove();\n box = undefined;\n diagnose('SP025', 'SpTimeline', { property: 'load', message: error instanceof Error ? error.message : undefined });\n mount.failed();\n };\n mount\n .load()\n .then(({ Timeline }) => {\n if (!live || !target?.ownerDocument) return;\n box = target.ownerDocument.createElement('div');\n target.append(box as never);\n // TimelineJS writes into its data (each slide's `unique_id`): a copy, never the consumer's.\n const timeline = new Timeline(box as never, structuredClone(mount.data), timelineOptions(mount.options));\n for (const [name, as] of TIMELINE_EVENTS) {\n timeline.on(name, (payload) => {\n if (name === 'change') mount.emit(as, (payload as { unique_id?: string } | undefined)?.unique_id);\n else if (name === 'loaded') mount.emit(as, payload);\n else mount.emit(as);\n });\n }\n })\n .catch(fail);\n return () => {\n live = false;\n stopInk();\n box?.remove();\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { e as GroundRef, f as SubstrateName, I as InkMode, P as ProviderConfig } from './props-3G1XYd-r.js';
1
+ import { t as GroundRef, u as SubstrateName, q as InkMode, au as Palette, v as ProviderConfig } from './props-BZ9CcrGv.js';
2
2
 
3
3
  /** The three container breakpoints; their widths are fixed (TD DD-014). */
4
4
  type DashboardBreakpoint = 'sm' | 'md' | 'lg';
@@ -53,6 +53,8 @@ type DashboardProps = DashboardName & {
53
53
  substrate?: SubstrateName;
54
54
  mode?: InkMode;
55
55
  locale?: string;
56
+ /** The section's colours, written on its root and merged under every chart's and component's own (REQ-462). */
57
+ palette?: Palette;
56
58
  className?: string;
57
59
  };
58
60
  interface DashboardCellProps {