@k2b/ui 0.35.0 → 0.37.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 (87) hide show
  1. package/dist/browser/actions/Dropdown.js +132 -116
  2. package/dist/browser/actions/Dropdown.js.map +1 -1
  3. package/dist/browser/actions/Tabs.js +18 -15
  4. package/dist/browser/actions/Tabs.js.map +1 -1
  5. package/dist/browser/chat/ChatComposer.js +58 -25
  6. package/dist/browser/chat/ChatComposer.js.map +1 -1
  7. package/dist/browser/content/MapView.js +128 -13
  8. package/dist/browser/content/MapView.js.map +1 -1
  9. package/dist/browser/content/MapViewFrame.js +1 -1
  10. package/dist/browser/content/MapViewFrame.js.map +1 -1
  11. package/dist/browser/content/MessageRow.js +164 -152
  12. package/dist/browser/content/MessageRow.js.map +1 -1
  13. package/dist/browser/content/index.js +1 -0
  14. package/dist/browser/content/index.js.map +1 -1
  15. package/dist/browser/content/map-view-glyphs.js +23 -0
  16. package/dist/browser/content/map-view-glyphs.js.map +1 -0
  17. package/dist/browser/content/map-view-live.js +45 -22
  18. package/dist/browser/content/map-view-live.js.map +1 -1
  19. package/dist/browser/content/map-view-snapshot.js +191 -0
  20. package/dist/browser/content/map-view-snapshot.js.map +1 -0
  21. package/dist/browser/content/map-view-types.js.map +1 -1
  22. package/dist/browser/feedback/prompts.js +23 -9
  23. package/dist/browser/feedback/prompts.js.map +1 -1
  24. package/dist/browser/inputs/Combobox.js +164 -82
  25. package/dist/browser/inputs/Combobox.js.map +1 -1
  26. package/dist/browser/inputs/RichSelect.js +86 -67
  27. package/dist/browser/inputs/RichSelect.js.map +1 -1
  28. package/dist/browser/inputs/TextInput.js +1 -1
  29. package/dist/browser/inputs/TextInput.js.map +1 -1
  30. package/dist/browser/internal/keyed-for.js +47 -0
  31. package/dist/browser/internal/keyed-for.js.map +1 -0
  32. package/dist/browser/layout/AppWorkspace.js +73 -70
  33. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  34. package/dist/browser/layout/ScrollArea.js +4 -1
  35. package/dist/browser/layout/ScrollArea.js.map +1 -1
  36. package/dist/browser/text-editor/engine.js +13 -10
  37. package/dist/browser/text-editor/engine.js.map +1 -1
  38. package/dist/ssr/actions/Dropdown.js +101 -85
  39. package/dist/ssr/actions/Dropdown.js.map +1 -1
  40. package/dist/ssr/actions/Tabs.js +12 -9
  41. package/dist/ssr/actions/Tabs.js.map +1 -1
  42. package/dist/ssr/chat/ChatComposer.js +41 -15
  43. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  44. package/dist/ssr/content/MapView.js +128 -13
  45. package/dist/ssr/content/MapView.js.map +1 -1
  46. package/dist/ssr/content/MapViewFrame.js +1 -1
  47. package/dist/ssr/content/MapViewFrame.js.map +1 -1
  48. package/dist/ssr/content/MessageRow.js +9 -2
  49. package/dist/ssr/content/MessageRow.js.map +1 -1
  50. package/dist/ssr/content/index.js +1 -0
  51. package/dist/ssr/content/index.js.map +1 -1
  52. package/dist/ssr/content/map-view-glyphs.js +23 -0
  53. package/dist/ssr/content/map-view-glyphs.js.map +1 -0
  54. package/dist/ssr/content/map-view-snapshot.js +191 -0
  55. package/dist/ssr/content/map-view-snapshot.js.map +1 -0
  56. package/dist/ssr/content/map-view-types.js.map +1 -1
  57. package/dist/ssr/feedback/prompts.js +22 -8
  58. package/dist/ssr/feedback/prompts.js.map +1 -1
  59. package/dist/ssr/inputs/Combobox.js +79 -28
  60. package/dist/ssr/inputs/Combobox.js.map +1 -1
  61. package/dist/ssr/inputs/RichSelect.js +47 -28
  62. package/dist/ssr/inputs/RichSelect.js.map +1 -1
  63. package/dist/ssr/inputs/TextInput.js.map +1 -1
  64. package/dist/ssr/internal/keyed-for.js +47 -0
  65. package/dist/ssr/internal/keyed-for.js.map +1 -0
  66. package/dist/ssr/layout/AppWorkspace.js +1 -1
  67. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  68. package/dist/ssr/layout/ScrollArea.js +4 -1
  69. package/dist/ssr/layout/ScrollArea.js.map +1 -1
  70. package/dist/ssr/text-editor/engine.js +13 -10
  71. package/dist/ssr/text-editor/engine.js.map +1 -1
  72. package/dist/styles.css +1 -1
  73. package/dist/types/content/MapViewFrame.d.ts +1 -1
  74. package/dist/types/content/MessageRow.d.ts +1 -1
  75. package/dist/types/content/index.d.ts +2 -1
  76. package/dist/types/content/map-view-glyphs.d.ts +5 -0
  77. package/dist/types/content/map-view-live.d.ts +1 -1
  78. package/dist/types/content/map-view-snapshot.d.ts +13 -0
  79. package/dist/types/content/map-view-types.d.ts +15 -0
  80. package/dist/types/feedback/prompts.d.ts +5 -0
  81. package/dist/types/inputs/Combobox.d.ts +12 -0
  82. package/dist/types/inputs/TextInput.d.ts +2 -1
  83. package/dist/types/internal/keyed-for.d.ts +13 -0
  84. package/dist/types/layout/AppWorkspace.d.ts +4 -1
  85. package/dist/types/layout/ScrollArea.d.ts +2 -0
  86. package/dist/types/text-editor/engine.d.ts +1 -1
  87. package/package.json +4 -2
@@ -0,0 +1,191 @@
1
+ /** Same decoded RGBA budget as Cloud's isolated print-image worker (64 MiB). */
2
+ export const MAP_SNAPSHOT_MAX_PIXELS = 16 * 1024 * 1024;
3
+ export class MapSnapshotError extends Error {
4
+ constructor(code) {
5
+ super(`Map snapshot: ${code}`);
6
+ this.code = code;
7
+ this.name = "MapSnapshotError";
8
+ }
9
+ }
10
+ export function snapshotAborted(signal) {
11
+ return signal.reason instanceof MapSnapshotError ? signal.reason : new MapSnapshotError("aborted");
12
+ }
13
+
14
+ /** Also observes late rejection; a cancelled image/font/encoding operation never becomes unhandled. */
15
+ export function snapshotWait(promise, signal) {
16
+ return new Promise((resolve, reject) => {
17
+ const abort = () => reject(snapshotAborted(signal));
18
+ if (signal.aborted) return abort();
19
+ signal.addEventListener("abort", abort, {
20
+ once: true
21
+ });
22
+ promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
23
+ });
24
+ }
25
+ const svgNamespace = "http://www.w3.org/2000/svg";
26
+ // Only renderer-owned shapes and paint cross into the rasterizer; no foreignObject, links, images or CSS URLs.
27
+ const paints = ["fill", "fill-opacity", "stroke", "stroke-width", "stroke-opacity", "stroke-dasharray", "stroke-linecap", "stroke-linejoin"];
28
+ function geometryImage(root, bounds) {
29
+ const source = root.querySelector(".k2b-map-view__geometry");
30
+ if (!source) return;
31
+ const svg = document.createElementNS(svgNamespace, "svg");
32
+ svg.setAttribute("width", String(bounds.width));
33
+ svg.setAttribute("height", String(bounds.height));
34
+ const geometry = document.createElementNS(svgNamespace, "svg");
35
+ const box = source.getBoundingClientRect();
36
+ for (const [name, value] of Object.entries({
37
+ x: box.left - bounds.left,
38
+ y: box.top - bounds.top,
39
+ width: box.width,
40
+ height: box.height,
41
+ viewBox: source.getAttribute("viewBox") ?? "",
42
+ preserveAspectRatio: "none",
43
+ overflow: "visible"
44
+ })) geometry.setAttribute(name, String(value));
45
+ for (const shape of source.querySelectorAll("path")) {
46
+ const copy = document.createElementNS(svgNamespace, shape.localName);
47
+ for (const name of ["d", "cx", "cy", "r", "vector-effect"]) {
48
+ const value = shape.getAttribute(name);
49
+ if (value !== null) copy.setAttribute(name, value);
50
+ }
51
+ const style = getComputedStyle(shape);
52
+ for (const name of paints) {
53
+ const value = style.getPropertyValue(name);
54
+ if (value.includes("url(")) throw new MapSnapshotError("capture_failed");
55
+ copy.setAttribute(name, value);
56
+ }
57
+ geometry.append(copy);
58
+ }
59
+ svg.append(geometry);
60
+ const image = new Image();
61
+ image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;
62
+ return image;
63
+ }
64
+ function drawPins(ctx, root, bounds) {
65
+ const pins = Array.from(root.querySelectorAll(".k2b-map-view__pin"));
66
+ // The selected pin paints above the others, as in the DOM.
67
+ pins.sort((a, b) => Number(a.getAttribute("aria-pressed") === "true") - Number(b.getAttribute("aria-pressed") === "true"));
68
+ for (const pin of pins) {
69
+ const box = pin.getBoundingClientRect();
70
+ const style = getComputedStyle(pin);
71
+ const x = box.left - bounds.left,
72
+ y = box.top - bounds.top;
73
+ // Resolve CSS variables through a paint property, since custom properties can still contain var().
74
+ const selected = pin.getAttribute("aria-pressed") === "true" || pin.hasAttribute("data-selected");
75
+ const stop = pin.hasAttribute("data-stop");
76
+ const surface = getComputedStyle(root.querySelector(".k2b-map-view__attribution") ?? root).backgroundColor;
77
+ ctx.save();
78
+ if (pin.hasAttribute("data-drop")) {
79
+ const span = pin.querySelector("span");
80
+ ctx.fillStyle = getComputedStyle(span).backgroundColor;
81
+ ctx.beginPath();
82
+ ctx.ellipse(x + box.width / 2, y + box.height / 2, box.width / 2, box.height / 2, 0, Math.PI, Math.PI * 2);
83
+ ctx.lineTo(x + box.width, y + box.height * 0.68);
84
+ ctx.lineTo(x + box.width / 2, y + box.height);
85
+ ctx.lineTo(x, y + box.height * 0.68);
86
+ ctx.closePath();
87
+ ctx.fill();
88
+ if (selected) {
89
+ ctx.fillStyle = surface;
90
+ ctx.beginPath();
91
+ ctx.arc(x + box.width / 2, y + box.height * 0.34, 4, 0, Math.PI * 2);
92
+ ctx.fill();
93
+ }
94
+ } else {
95
+ ctx.beginPath();
96
+ ctx.arc(x + box.width / 2, y + box.height / 2, box.width / 2 + 2.5, 0, Math.PI * 2);
97
+ ctx.fillStyle = surface;
98
+ ctx.fill();
99
+ ctx.beginPath();
100
+ ctx.arc(x + box.width / 2, y + box.height / 2, box.width / 2, 0, Math.PI * 2);
101
+ ctx.fillStyle = style.backgroundColor;
102
+ ctx.fill();
103
+ // The first box-shadow is the resolved inset tone ring. Text ink can differ in dark mode.
104
+ const ring = style.boxShadow.match(/(?:rgba?|color|oklch|oklab)\([^)]*\)/)?.[0];
105
+ if (!ring && !stop && !selected) throw new MapSnapshotError("capture_failed");
106
+ ctx.strokeStyle = stop || selected ? style.backgroundColor : ring;
107
+ ctx.lineWidth = 2;
108
+ ctx.beginPath();
109
+ ctx.arc(x + box.width / 2, y + box.height / 2, box.width / 2 - 1, 0, Math.PI * 2);
110
+ ctx.stroke();
111
+ ctx.fillStyle = style.color;
112
+ ctx.font = `${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;
113
+ ctx.textAlign = "center";
114
+ ctx.textBaseline = "middle";
115
+ ctx.fillText(pin.textContent ?? "", x + box.width / 2, y + box.height / 2);
116
+ }
117
+ ctx.restore();
118
+ }
119
+ }
120
+ function drawAttribution(ctx, root, bounds) {
121
+ const attribution = root.querySelector(".k2b-map-view__attribution");
122
+ if (!attribution?.textContent?.trim()) throw new MapSnapshotError("capture_failed");
123
+ const box = attribution.getBoundingClientRect();
124
+ const style = getComputedStyle(attribution);
125
+ ctx.fillStyle = style.backgroundColor;
126
+ ctx.fillRect(box.left - bounds.left, box.top - bounds.top, box.width, box.height);
127
+ const walker = document.createTreeWalker(attribution, NodeFilter.SHOW_TEXT);
128
+ while (walker.nextNode()) {
129
+ const node = walker.currentNode;
130
+ const parent = node.parentElement;
131
+ const ink = getComputedStyle(parent);
132
+ ctx.fillStyle = ink.color;
133
+ ctx.font = `${ink.fontWeight} ${ink.fontSize} ${ink.fontFamily}`;
134
+ ctx.textBaseline = "top";
135
+ ctx.textAlign = "left";
136
+ // Per-character ranges preserve line breaks, wrapping, and bidi positions without capturing arbitrary HTML.
137
+ const range = document.createRange();
138
+ for (let i = 0; i < (node.textContent?.length ?? 0); i++) {
139
+ range.setStart(node, i);
140
+ range.setEnd(node, i + 1);
141
+ const r = range.getBoundingClientRect();
142
+ ctx.fillText(node.textContent[i], r.left - bounds.left, r.top - bounds.top);
143
+ }
144
+ }
145
+ }
146
+
147
+ /** Called synchronously in MapLibre's render event, before WebGL clears its drawing buffer. */
148
+ export async function rasterizeMapView(root, base, signal) {
149
+ const bounds = root.getBoundingClientRect();
150
+ const width = Math.round(bounds.width),
151
+ height = Math.round(bounds.height);
152
+ if (width < 1 || height < 1 || width > 16383 || height > 16383 || width * height > MAP_SNAPSHOT_MAX_PIXELS) throw new MapSnapshotError("too_large");
153
+ const canvas = document.createElement("canvas");
154
+ canvas.width = width;
155
+ canvas.height = height;
156
+ const ctx = canvas.getContext("2d");
157
+ if (!ctx) throw new MapSnapshotError("capture_failed");
158
+ try {
159
+ // Copy the GPU frame immediately. No preserveDrawingBuffer overhead for ordinary interactive maps.
160
+ ctx.drawImage(base, 0, 0, width, height);
161
+ const geometry = geometryImage(root, bounds);
162
+ // Save all overlay pixels before yielding, so subsequent DOM changes cannot mix revisions.
163
+ const overlay = document.createElement("canvas");
164
+ overlay.width = width;
165
+ overlay.height = height;
166
+ try {
167
+ const ink = overlay.getContext("2d");
168
+ drawPins(ink, root, bounds);
169
+ drawAttribution(ink, root, bounds);
170
+ if (geometry) {
171
+ await snapshotWait(geometry.decode(), signal);
172
+ ctx.drawImage(geometry, 0, 0, width, height);
173
+ }
174
+ ctx.drawImage(overlay, 0, 0);
175
+ } finally {
176
+ overlay.width = overlay.height = 0;
177
+ }
178
+ const data = await snapshotWait(new Promise((resolve, reject) => canvas.toBlob(blob => blob ? resolve(blob) : reject(new MapSnapshotError("capture_failed")), "image/png")), signal);
179
+ return {
180
+ data,
181
+ width,
182
+ height
183
+ };
184
+ } catch (error) {
185
+ if (error instanceof MapSnapshotError) throw error;
186
+ throw new MapSnapshotError("capture_failed");
187
+ } finally {
188
+ canvas.width = canvas.height = 0;
189
+ }
190
+ }
191
+ //# sourceMappingURL=map-view-snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["content/map-view-snapshot.ts"],"sourcesContent":["import type { MapViewSnapshot } from \"./map-view-types\";\n\n/** Same decoded RGBA budget as Cloud's isolated print-image worker (64 MiB). */\nexport const MAP_SNAPSHOT_MAX_PIXELS = 16 * 1024 * 1024;\nexport type MapSnapshotErrorCode =\n | \"not_ready\"\n | \"resource_failed\"\n | \"changed\"\n | \"disposed\"\n | \"busy\"\n | \"too_large\"\n | \"timed_out\"\n | \"aborted\"\n | \"capture_failed\";\nexport class MapSnapshotError extends Error {\n constructor(readonly code: MapSnapshotErrorCode) {\n super(`Map snapshot: ${code}`);\n this.name = \"MapSnapshotError\";\n }\n}\n\nexport function snapshotAborted(signal: AbortSignal): MapSnapshotError {\n return signal.reason instanceof MapSnapshotError ? signal.reason : new MapSnapshotError(\"aborted\");\n}\n\n/** Also observes late rejection; a cancelled image/font/encoding operation never becomes unhandled. */\nexport function snapshotWait<T>(promise: Promise<T>, signal: AbortSignal): Promise<T> {\n return new Promise((resolve, reject) => {\n const abort = () => reject(snapshotAborted(signal));\n if (signal.aborted) return abort();\n signal.addEventListener(\"abort\", abort, { once: true });\n promise.then(resolve, reject).finally(() => signal.removeEventListener(\"abort\", abort));\n });\n}\n\nconst svgNamespace = \"http://www.w3.org/2000/svg\";\n// Only renderer-owned shapes and paint cross into the rasterizer; no foreignObject, links, images or CSS URLs.\nconst paints = [\n \"fill\",\n \"fill-opacity\",\n \"stroke\",\n \"stroke-width\",\n \"stroke-opacity\",\n \"stroke-dasharray\",\n \"stroke-linecap\",\n \"stroke-linejoin\",\n] as const;\nfunction geometryImage(root: HTMLElement, bounds: DOMRect): HTMLImageElement | undefined {\n const source = root.querySelector<SVGSVGElement>(\".k2b-map-view__geometry\");\n if (!source) return;\n const svg = document.createElementNS(svgNamespace, \"svg\");\n svg.setAttribute(\"width\", String(bounds.width));\n svg.setAttribute(\"height\", String(bounds.height));\n const geometry = document.createElementNS(svgNamespace, \"svg\");\n const box = source.getBoundingClientRect();\n for (const [name, value] of Object.entries({\n x: box.left - bounds.left,\n y: box.top - bounds.top,\n width: box.width,\n height: box.height,\n viewBox: source.getAttribute(\"viewBox\") ?? \"\",\n preserveAspectRatio: \"none\",\n overflow: \"visible\",\n }))\n geometry.setAttribute(name, String(value));\n for (const shape of source.querySelectorAll(\"path\")) {\n const copy = document.createElementNS(svgNamespace, shape.localName);\n for (const name of [\"d\", \"cx\", \"cy\", \"r\", \"vector-effect\"]) {\n const value = shape.getAttribute(name);\n if (value !== null) copy.setAttribute(name, value);\n }\n const style = getComputedStyle(shape);\n for (const name of paints) {\n const value = style.getPropertyValue(name);\n if (value.includes(\"url(\")) throw new MapSnapshotError(\"capture_failed\");\n copy.setAttribute(name, value);\n }\n geometry.append(copy);\n }\n svg.append(geometry);\n const image = new Image();\n image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n return image;\n}\n\nfunction drawPins(ctx: CanvasRenderingContext2D, root: HTMLElement, bounds: DOMRect) {\n const pins = Array.from(root.querySelectorAll<HTMLElement>(\".k2b-map-view__pin\"));\n // The selected pin paints above the others, as in the DOM.\n pins.sort((a, b) => Number(a.getAttribute(\"aria-pressed\") === \"true\") - Number(b.getAttribute(\"aria-pressed\") === \"true\"));\n for (const pin of pins) {\n const box = pin.getBoundingClientRect();\n const style = getComputedStyle(pin);\n const x = box.left - bounds.left,\n y = box.top - bounds.top;\n // Resolve CSS variables through a paint property, since custom properties can still contain var().\n const selected = pin.getAttribute(\"aria-pressed\") === \"true\" || pin.hasAttribute(\"data-selected\");\n const stop = pin.hasAttribute(\"data-stop\");\n const surface = getComputedStyle(root.querySelector(\".k2b-map-view__attribution\") ?? root).backgroundColor;\n ctx.save();\n if (pin.hasAttribute(\"data-drop\")) {\n const span = pin.querySelector(\"span\")!;\n ctx.fillStyle = getComputedStyle(span).backgroundColor;\n ctx.beginPath();\n ctx.ellipse(x + box.width / 2, y + box.height / 2, box.width / 2, box.height / 2, 0, Math.PI, Math.PI * 2);\n ctx.lineTo(x + box.width, y + box.height * 0.68);\n ctx.lineTo(x + box.width / 2, y + box.height);\n ctx.lineTo(x, y + box.height * 0.68);\n ctx.closePath();\n ctx.fill();\n if (selected) {\n ctx.fillStyle = surface;\n ctx.beginPath();\n ctx.arc(x + box.width / 2, y + box.height * 0.34, 4, 0, Math.PI * 2);\n ctx.fill();\n }\n } else {\n ctx.beginPath();\n ctx.arc(x + box.width / 2, y + box.height / 2, box.width / 2 + 2.5, 0, Math.PI * 2);\n ctx.fillStyle = surface;\n ctx.fill();\n ctx.beginPath();\n ctx.arc(x + box.width / 2, y + box.height / 2, box.width / 2, 0, Math.PI * 2);\n ctx.fillStyle = style.backgroundColor;\n ctx.fill();\n // The first box-shadow is the resolved inset tone ring. Text ink can differ in dark mode.\n const ring = style.boxShadow.match(/(?:rgba?|color|oklch|oklab)\\([^)]*\\)/)?.[0];\n if (!ring && !stop && !selected) throw new MapSnapshotError(\"capture_failed\");\n ctx.strokeStyle = stop || selected ? style.backgroundColor : ring!;\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.arc(x + box.width / 2, y + box.height / 2, box.width / 2 - 1, 0, Math.PI * 2);\n ctx.stroke();\n ctx.fillStyle = style.color;\n ctx.font = `${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(pin.textContent ?? \"\", x + box.width / 2, y + box.height / 2);\n }\n ctx.restore();\n }\n}\n\nfunction drawAttribution(ctx: CanvasRenderingContext2D, root: HTMLElement, bounds: DOMRect) {\n const attribution = root.querySelector<HTMLElement>(\".k2b-map-view__attribution\");\n if (!attribution?.textContent?.trim()) throw new MapSnapshotError(\"capture_failed\");\n const box = attribution.getBoundingClientRect();\n const style = getComputedStyle(attribution);\n ctx.fillStyle = style.backgroundColor;\n ctx.fillRect(box.left - bounds.left, box.top - bounds.top, box.width, box.height);\n const walker = document.createTreeWalker(attribution, NodeFilter.SHOW_TEXT);\n while (walker.nextNode()) {\n const node = walker.currentNode;\n const parent = node.parentElement!;\n const ink = getComputedStyle(parent);\n ctx.fillStyle = ink.color;\n ctx.font = `${ink.fontWeight} ${ink.fontSize} ${ink.fontFamily}`;\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"left\";\n // Per-character ranges preserve line breaks, wrapping, and bidi positions without capturing arbitrary HTML.\n const range = document.createRange();\n for (let i = 0; i < (node.textContent?.length ?? 0); i++) {\n range.setStart(node, i);\n range.setEnd(node, i + 1);\n const r = range.getBoundingClientRect();\n ctx.fillText(node.textContent![i]!, r.left - bounds.left, r.top - bounds.top);\n }\n }\n}\n\n/** Called synchronously in MapLibre's render event, before WebGL clears its drawing buffer. */\nexport async function rasterizeMapView(root: HTMLElement, base: HTMLCanvasElement, signal: AbortSignal): Promise<MapViewSnapshot> {\n const bounds = root.getBoundingClientRect();\n const width = Math.round(bounds.width),\n height = Math.round(bounds.height);\n if (width < 1 || height < 1 || width > 16383 || height > 16383 || width * height > MAP_SNAPSHOT_MAX_PIXELS)\n throw new MapSnapshotError(\"too_large\");\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) throw new MapSnapshotError(\"capture_failed\");\n try {\n // Copy the GPU frame immediately. No preserveDrawingBuffer overhead for ordinary interactive maps.\n ctx.drawImage(base, 0, 0, width, height);\n const geometry = geometryImage(root, bounds);\n // Save all overlay pixels before yielding, so subsequent DOM changes cannot mix revisions.\n const overlay = document.createElement(\"canvas\");\n overlay.width = width;\n overlay.height = height;\n try {\n const ink = overlay.getContext(\"2d\")!;\n drawPins(ink, root, bounds);\n drawAttribution(ink, root, bounds);\n if (geometry) {\n await snapshotWait(geometry.decode(), signal);\n ctx.drawImage(geometry, 0, 0, width, height);\n }\n ctx.drawImage(overlay, 0, 0);\n } finally {\n overlay.width = overlay.height = 0;\n }\n const data = await snapshotWait(\n new Promise<Blob>((resolve, reject) =>\n canvas.toBlob((blob) => (blob ? resolve(blob) : reject(new MapSnapshotError(\"capture_failed\"))), \"image/png\"),\n ),\n signal,\n );\n return { data, width, height };\n } catch (error) {\n if (error instanceof MapSnapshotError) throw error;\n throw new MapSnapshotError(\"capture_failed\");\n } finally {\n canvas.width = canvas.height = 0;\n }\n}\n"],"mappings":"AAEA;AACA,OAAO,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI;AAWvD,OAAO,MAAM,gBAAgB,SAAS,KAAK,CAAC;EAC1C,WAAW,CAAU,IAA0B,EAAE;IAC/C,KAAK,CAAC,iBAAiB,IAAI,EA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AAE,KAAK,EAAE,MAAM,CAAC;MAC9C;MACA,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC,SAAS;MACR,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC;IACpC;IACA,MAAM,IAAI,GAAG,MAAM,YAAY,CAC7B,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,KAChC,MAAM,CAAC,MAAM,CAAE,IAAI,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAAE,EAAE,WAAW,CAC9G,CAAC,EACD,MACF,CAAC;IACD,OAAO;MAAE,IAAI;MAAE,KAAK;MAAE;IAAO,CAAC;EAChC,CAAC,CAAC,OAAO,KAAK,EAAE;IACd,IAAI,KAAK,YAAY,gBAAgB,EAAE,MAAM,KAAK;IAClD,MAAM,IAAI,gBAAgB,CAAC,gBAAgB,CAAC;EAC9C,CAAC,SAAS;IACR,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC;EAClC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/map-view-types.ts"],"sourcesContent":["import type { StyleSpecification } from \"maplibre-gl\";\nimport type { JSX } from \"solid-js\";\n\nexport type MapViewPoint = { lat: number; lon: number };\nexport type MapViewTone = \"accent\" | \"second\" | \"neutral\" | \"warning\";\nexport type MapViewMarker = {\n id: string;\n point: MapViewPoint;\n /** A number, a single letter, or \"+\". Omit for a drop pin. */\n mark?: number | string;\n label: string;\n tone?: MapViewTone;\n selected?: boolean;\n};\nexport type MapViewLineTone = \"accent\" | \"muted\" | \"preview\" | \"previous\";\nexport type MapViewLine = { id: string; tone?: MapViewLineTone } & ({ polyline6: string } | { points: MapViewPoint[] });\nexport type MapViewArea = { id: string; polygon: MapViewPoint[]; tone?: MapViewTone };\nexport type MapViewOwnLocation = { point: MapViewPoint; accuracyMeters?: number };\nexport type MapViewStyle = string | StyleSpecification;\nexport type MapViewStyleSource = MapViewStyle | { light: MapViewStyle; dark: MapViewStyle };\nexport type MapViewFit = \"all\" | \"markers\";\nexport type MapViewFrameProps = {\n markers?: MapViewMarker[];\n lines?: MapViewLine[];\n areas?: MapViewArea[];\n ownLocation?: MapViewOwnLocation;\n height: number;\n padding?: number;\n fit?: MapViewFit;\n selectedId?: string;\n attribution?: JSX.Element;\n class?: string;\n};\nexport type MapViewProps = Omit<MapViewFrameProps, \"attribution\"> & {\n style: MapViewStyleSource;\n attribution: JSX.Element;\n onSelect?: (id: string) => void;\n infoTile?: (marker: MapViewMarker) => JSX.Element;\n notice?: JSX.Element;\n empty?: JSX.Element;\n onLocate?: () => void;\n /** Observe rendering and resource failures without receiving provider responses or URLs. */\n onStateChange?: (state: \"static\" | \"loading\" | \"ready\" | \"error\" | \"no-webgl\" | \"empty\") => void;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/map-view-types.ts"],"sourcesContent":["import type { StyleSpecification } from \"maplibre-gl\";\nimport type { JSX } from \"solid-js\";\n\nexport type MapViewPoint = { lat: number; lon: number };\nexport type MapViewTone = \"accent\" | \"second\" | \"neutral\" | \"warning\";\nexport type MapViewMarker = {\n id: string;\n point: MapViewPoint;\n /** A number, a single letter, or \"+\". Omit for a drop pin. */\n mark?: number | string;\n label: string;\n tone?: MapViewTone;\n selected?: boolean;\n};\nexport type MapViewLineTone = \"accent\" | \"muted\" | \"preview\" | \"previous\";\nexport type MapViewLine = { id: string; tone?: MapViewLineTone } & ({ polyline6: string } | { points: MapViewPoint[] });\nexport type MapViewArea = { id: string; polygon: MapViewPoint[]; tone?: MapViewTone };\nexport type MapViewOwnLocation = { point: MapViewPoint; accuracyMeters?: number };\nexport type MapViewStyle = string | StyleSpecification;\nexport type MapViewStyleSource = MapViewStyle | { light: MapViewStyle; dark: MapViewStyle };\nexport type MapViewFit = \"all\" | \"markers\";\nexport type MapViewFrameProps = {\n markers?: MapViewMarker[];\n lines?: MapViewLine[];\n areas?: MapViewArea[];\n ownLocation?: MapViewOwnLocation;\n height: number;\n padding?: number;\n fit?: MapViewFit;\n selectedId?: string;\n attribution?: JSX.Element;\n class?: string;\n};\nexport type MapViewSnapshot = { data: Blob; width: number; height: number };\nexport type MapViewSnapshotOptions = { signal?: AbortSignal; timeoutMs?: number };\nexport type MapViewHandle = {\n /** Capture the current complete view; never loads, pans, refits, or retries provider resources. */\n snapshot: (options?: MapViewSnapshotOptions) => Promise<MapViewSnapshot>;\n};\nexport type MapViewProps = Omit<MapViewFrameProps, \"attribution\"> & {\n style: MapViewStyleSource;\n /** Browser-only handle; remains safely callable after disposal (rejects disposed). */\n ref?: (handle: MapViewHandle) => void;\n attribution: JSX.Element;\n onSelect?: (id: string) => void;\n infoTile?: (marker: MapViewMarker) => JSX.Element;\n notice?: JSX.Element;\n empty?: JSX.Element;\n onLocate?: () => void;\n /** Observe rendering and resource failures without receiving provider responses or URLs. */\n onStateChange?: (state: \"static\" | \"loading\" | \"ready\" | \"error\" | \"no-webgl\" | \"empty\") => void;\n};\n"],"mappings":"","ignoreList":[]}
@@ -42,6 +42,7 @@ import { Select } from "../inputs/Select";
42
42
  import { resolveSelectMessages } from "../inputs/select-messages";
43
43
  import { TagsInput } from "../inputs/TagsInput";
44
44
  import { TextInput } from "../inputs/TextInput";
45
+ import { KeyedFor } from "../internal/keyed-for";
45
46
  import { resolveUiMessages } from "../intl/messages";
46
47
  import { dialogCore } from "./dialog-core";
47
48
  import { resolvePromptMessages } from "./prompt-messages";
@@ -403,6 +404,18 @@ const PromptFormDialog = props => {
403
404
  }
404
405
  })), _$ssrAttribute("data-variant", _$escape(props.config.variant ?? "primary", true), false), _$escape(props.config.confirmText ?? resolveUiMessages().save));
405
406
  };
407
+
408
+ // Results without an ID keep today's behavior: each object is its own identity, so a new answer replaces the row.
409
+ const anonymousRows = new WeakMap();
410
+ let anonymousRow = 0;
411
+ const searchRowIdentity = item => {
412
+ if (item.id !== undefined) return `id:${item.id}`;
413
+ const known = anonymousRows.get(item);
414
+ if (known !== undefined) return known;
415
+ const key = `object:${anonymousRow++}`;
416
+ anonymousRows.set(item, key);
417
+ return key;
418
+ };
406
419
  const openSearchPrompt = (resolver, options) => dialogCore.open(close => {
407
420
  const [query, setQuery] = createSignal(options?.initialQuery ?? "");
408
421
  const [items, setItems] = createSignal([]);
@@ -528,30 +541,31 @@ const openSearchPrompt = (resolver, options) => dialogCore.open(close => {
528
541
  return _$ssr(_tmpl$12, _$escape(emptyStateText()));
529
542
  },
530
543
  get children() {
531
- return _$ssr(_tmpl$0, _$ssrAttribute("id", _$escape(listboxId, true), false), _$ssrAttribute("aria-label", _$escape(resolveUiMessages().searchResults, true), false), _$escape(_$createComponent(For, {
544
+ return _$ssr(_tmpl$0, _$ssrAttribute("id", _$escape(listboxId, true), false), _$ssrAttribute("aria-label", _$escape(resolveUiMessages().searchResults, true), false), _$escape(_$createComponent(KeyedFor, {
532
545
  get each() {
533
546
  return items();
534
547
  },
535
- children: (item, index) => _$ssr(_tmpl$15, _$ssrAttribute("id", _$escape(optionId(index()), true), false), _$ssrAttribute("aria-selected", _$escape(activeIndex(), true) === _$escape(index(), true), false) + _$ssrAttribute("data-active", activeIndex() === index() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-has-description", item.desc ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
548
+ by: searchRowIdentity,
549
+ children: (item, index) => _$ssr(_tmpl$15, _$ssrAttribute("id", _$escape(optionId(index()), true), false), _$ssrAttribute("aria-selected", _$escape(activeIndex(), true) === _$escape(index(), true), false) + _$ssrAttribute("data-active", activeIndex() === index() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-has-description", item().desc ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
536
550
  get when() {
537
- return item.previewUrl?.startsWith("/") || item.icon;
551
+ return item().previewUrl?.startsWith("/") || item().icon;
538
552
  },
539
553
  get children() {
540
554
  return _$ssr(_tmpl$14, _$escape(_$createComponent(Show, {
541
555
  get when() {
542
- return _$memo(() => !!item.previewUrl?.startsWith("/"))() && !failedPreviews[index()];
556
+ return _$memo(() => !!item().previewUrl?.startsWith("/"))() && !failedPreviews[index()];
543
557
  },
544
558
  get fallback() {
545
- return _$ssr(_tmpl$2, _$ssrAttribute("class", _$escape(item.icon ?? "ti ti-file", true), false));
559
+ return _$ssr(_tmpl$2, _$ssrAttribute("class", _$escape(item().icon ?? "ti ti-file", true), false));
546
560
  },
547
561
  get children() {
548
- return _$ssr(_tmpl$13, _$ssrAttribute("src", _$escape(item.previewUrl, true), false));
562
+ return _$ssr(_tmpl$13, _$ssrAttribute("src", _$escape(item().previewUrl, true), false));
549
563
  }
550
564
  })));
551
565
  }
552
- })), _$escape(item.label), _$escape(_$createComponent(Show, {
566
+ })), _$escape(item().label), _$escape(_$createComponent(Show, {
553
567
  get when() {
554
- return item.desc;
568
+ return item().desc;
555
569
  },
556
570
  children: description => _$ssr(_tmpl$16, _$escape(description()))
557
571
  })))
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["feedback/prompts.tsx"],"sourcesContent":["import { mutation, timed } from \"@k2b/stdlib/solid\";\nimport { createEffect, createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { createStore } from \"solid-js/store\";\nimport { Checkbox } from \"../inputs/Checkbox\";\nimport { PinInput } from \"../inputs/ChoiceInputs\";\nimport { DatePicker, DateTimePicker } from \"../inputs/DatePicker\";\nimport { ImageInput } from \"../inputs/FileInputs\";\nimport { NumberInput } from \"../inputs/NumberInput\";\nimport { Select } from \"../inputs/Select\";\nimport { resolveSelectMessages } from \"../inputs/select-messages\";\nimport { TagsInput } from \"../inputs/TagsInput\";\nimport { TextInput } from \"../inputs/TextInput\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { type DialogRender, dialogCore, type OpenDialogOptions } from \"./dialog-core\";\nimport { resolvePromptMessages } from \"./prompt-messages\";\n\nexport interface DialogOptions {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\";\n /** `full` fills the available viewport and becomes edge-to-edge on narrow screens. */\n size?: \"small\" | \"medium\" | \"large\" | \"wide\" | \"full\";\n surface?: \"default\" | \"bare\";\n header?: false;\n cancelBehavior?: OpenDialogOptions[\"cancelBehavior\"];\n /** Back closes the prompt like Cancel, as in a phone app; see `OpenDialogOptions.history`. */\n history?: boolean;\n}\n\nexport interface ConfirmOptions extends DialogOptions {\n confirmationPhrase?: string;\n}\n\ntype PromptContent = string | HTMLElement | JSX.Element;\n\nexport type PromptSearchItem<T = unknown> = {\n label: string;\n desc?: string;\n icon?: string;\n previewUrl?: string;\n value?: T;\n};\n\nexport type PromptSearchInput = {\n query: string;\n abortSignal: AbortSignal;\n};\n\nexport type PromptSearchOptions = DialogOptions & {\n placeholder?: string;\n icon?: string;\n initialQuery?: string;\n minQueryLength?: number;\n debounceMs?: number;\n emptyText?: string;\n noResultsText?: string;\n};\n\nexport type PromptFieldBase<T = any> = {\n label?: string | false;\n description?: string;\n placeholder?: string;\n required?: boolean;\n default?: T;\n validate?: (value: T | undefined) => string | null;\n};\n\nexport type FieldSchema =\n | (PromptFieldBase<string> & {\n type: \"text\";\n multiline?: boolean;\n lines?: number;\n maxLength?: number;\n minLength?: number;\n icon?: string;\n activeIcon?: string;\n password?: boolean;\n markdown?: boolean;\n })\n | (PromptFieldBase<number> & {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n })\n | (PromptFieldBase<string> & {\n type: \"image\";\n round?: boolean;\n ariaLabel?: string;\n accept?: string;\n })\n | (PromptFieldBase<string> & {\n type: \"pin\";\n length?: number;\n stretch?: boolean;\n })\n | (PromptFieldBase<string> & {\n type: \"select\";\n options: string[] | { id: string; label?: string; description?: string; icon?: string }[];\n icon?: string;\n activeIcon?: string;\n clearable?: boolean;\n })\n | (PromptFieldBase<string[]> & {\n type: \"tags\";\n maxTags?: number;\n minTags?: number;\n icon?: string;\n activeIcon?: string;\n })\n | (PromptFieldBase<boolean> & {\n type: \"boolean\";\n })\n | (PromptFieldBase<string> & {\n type: \"datetime\";\n dateOnly?: boolean;\n /** A date whose time is optional, as `DateTimePicker`'s `optionalTime`. */\n optionalTime?: boolean;\n })\n | {\n type: \"info\";\n content: string | JSX.Element | (() => JSX.Element);\n };\n\ntype InferFieldType<T extends FieldSchema> = T extends { type: \"text\" }\n ? string\n : T extends { type: \"number\" }\n ? number\n : T extends { type: \"image\" }\n ? string\n : T extends { type: \"pin\" }\n ? string\n : T extends { type: \"select\" }\n ? string\n : T extends { type: \"tags\" }\n ? string[]\n : T extends { type: \"boolean\" }\n ? boolean\n : T extends { type: \"datetime\" }\n ? string\n : T extends { type: \"currency\" }\n ? number\n : T extends { type: \"info\" }\n ? never\n : never;\n\ntype InferFormValues<T extends Record<string, FieldSchema>> = {\n [K in keyof T as T[K] extends { type: \"info\" } ? never : K]: T[K] extends { required: true }\n ? InferFieldType<T[K]>\n : InferFieldType<T[K]> | undefined;\n};\n\ntype PromptFormValue = string | number | boolean | string[] | undefined;\ntype PromptFormOptions<T extends Record<string, FieldSchema>> = {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n fields: T;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\";\n size?: DialogOptions[\"size\"];\n cancelBehavior?: DialogOptions[\"cancelBehavior\"];\n};\n\nconst PHRASE_SLOT = \"\\u0000\";\n\nconst isEmpty = (value: unknown): boolean =>\n value === undefined || value === null || value === \"\" || (Array.isArray(value) && value.length === 0);\n\nexport const createFormState = <T extends Record<string, FieldSchema>>(schema: T) => {\n const messages = resolveUiMessages();\n const promptMessages = resolvePromptMessages();\n const [values, setValues] = createStore<Record<string, PromptFormValue>>({});\n const [errors, setErrors] = createStore<Record<string, string | undefined>>({});\n // Errors appear with the first submit and then follow every change. Before that, a check that fails mid-input,\n // such as a URL still being typed, would interrupt the user with an alert on the first character.\n let submitted = false;\n\n for (const [key, field] of Object.entries(schema)) {\n if (field.type !== \"info\" && \"default\" in field) setValues(key, field.default as PromptFormValue);\n }\n\n const validateField = (key: string, value: PromptFormValue): string | null => {\n const field = schema[key];\n if (!field || field.type === \"info\") return null;\n if (field.type === \"boolean\" && field.required && value !== true) return messages.required;\n if (field.required && isEmpty(value)) return messages.required;\n if (\"validate\" in field && field.validate) {\n const customError = (field.validate as (next: never) => string | null)(value as never);\n if (customError) return customError;\n }\n if (field.type === \"text\" && typeof value === \"string\" && value.length > 0) {\n if (field.minLength !== undefined && value.length < field.minLength) return promptMessages.minCharacters({ count: field.minLength });\n if (field.maxLength !== undefined && value.length > field.maxLength) return promptMessages.maxCharacters({ count: field.maxLength });\n }\n if (field.type === \"tags\" && Array.isArray(value) && value.length > 0) {\n if (field.minTags !== undefined && value.length < field.minTags) return promptMessages.minTags({ count: field.minTags });\n if (field.maxTags !== undefined && value.length > field.maxTags) return promptMessages.maxTags({ count: field.maxTags });\n }\n return null;\n };\n\n const updateField = (key: string, value: PromptFormValue) => {\n setValues(key, value);\n if (submitted) setErrors(key, validateField(key, value) ?? undefined);\n };\n\n const validateAll = (): boolean => {\n submitted = true;\n let valid = true;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n const error = validateField(key, values[key]);\n setErrors(key, error ?? undefined);\n if (error) valid = false;\n }\n return valid;\n };\n\n const reset = () => {\n submitted = false;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n setValues(key, \"default\" in field ? (field.default as PromptFormValue) : undefined);\n setErrors(key, undefined);\n }\n };\n\n return { values, errors, updateField, validateAll, reset };\n};\n\nexport const DialogHeader = (props: { close: () => void; title?: string; icon?: string }): JSX.Element => (\n <header class=\"k2b-dialog__header\">\n <Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <Show when={props.title} fallback={<span class=\"k2b-dialog__header-spacer\" />}>\n {(title) => <h2>{title()}</h2>}\n </Show>\n <button type=\"button\" class=\"k2b-dialog__close\" aria-label={resolveUiMessages().closeDialog} onClick={props.close}>\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </header>\n);\n\nconst panelClass = (options?: Pick<DialogOptions, \"size\" | \"surface\" | \"variant\">): string => {\n const size = options?.size ?? \"medium\";\n const variant = options?.variant && options.variant !== \"primary\" ? ` k2b-dialog--${options.variant}` : \"\";\n return `k2b-dialog k2b-dialog--${size}${variant}${options?.surface === \"bare\" ? \" is-bare\" : \"\"}`;\n};\n\nconst contentClass = (surface?: DialogOptions[\"surface\"]): string =>\n surface === \"bare\" ? \"k2b-dialog__viewport is-bare\" : \"k2b-dialog__viewport\";\n\nconst renderInfo = (content: Extract<FieldSchema, { type: \"info\" }>[\"content\"]): JSX.Element => {\n if (typeof content === \"string\") return <p>{content}</p>;\n if (typeof content === \"function\") return content();\n return content;\n};\n\nconst PromptControl = (props: {\n field: Exclude<FieldSchema, { type: \"info\" }>;\n value: () => PromptFormValue;\n update: (value: PromptFormValue) => void;\n error: () => string | undefined;\n submit: () => void;\n}): JSX.Element => {\n const label = props.field.label || undefined;\n\n switch (props.field.type) {\n case \"text\":\n return (\n <TextInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={String(props.value() ?? \"\")}\n onValueChange={(value) => props.update(value ?? undefined)}\n onSubmit={props.submit}\n multiline={props.field.multiline}\n lines={props.field.lines}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n password={props.field.password}\n markdown={props.field.markdown}\n minLength={props.field.minLength}\n maxLength={props.field.maxLength}\n />\n );\n case \"number\":\n return (\n <NumberInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={typeof props.value() === \"number\" ? (props.value() as number) : null}\n onValueChange={(value) => props.update(value ?? undefined)}\n min={props.field.min}\n max={props.field.max}\n step={props.field.step}\n />\n );\n case \"image\":\n return (\n <ImageInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n round={props.field.round}\n aria-label={props.field.ariaLabel}\n accept={props.field.accept}\n />\n );\n case \"pin\":\n return (\n <PinInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => String(props.value() ?? \"\")}\n onValueChange={props.update}\n length={props.field.length}\n stretch={props.field.stretch}\n />\n );\n case \"select\":\n return (\n <Select\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n options={props.field.options}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n clearable={props.field.clearable}\n />\n );\n case \"tags\":\n return (\n <TagsInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (Array.isArray(props.value()) ? (props.value() as string[]) : [])}\n onValueChange={props.update}\n maxTags={props.field.maxTags}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n />\n );\n case \"boolean\":\n return (\n <Checkbox\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => Boolean(props.value())}\n onValueChange={props.update}\n />\n );\n case \"datetime\": {\n const pickerProps = {\n label,\n description: props.field.description,\n required: props.field.required,\n placeholder: props.field.placeholder,\n error: props.error,\n value: () => (typeof props.value() === \"string\" ? (props.value() as string) : null),\n onValueChange: (value: string | null) => props.update(value ?? \"\"),\n clearable: true,\n };\n return props.field.dateOnly ? (\n <DatePicker {...pickerProps} />\n ) : (\n <DateTimePicker {...pickerProps} optionalTime={props.field.optionalTime} />\n );\n }\n }\n};\n\nconst PromptFormDialog = <T extends Record<string, FieldSchema>>(props: {\n config: PromptFormOptions<T>;\n close: (value: InferFormValues<T> | null) => void;\n}): JSX.Element => {\n const state = createFormState(props.config.fields);\n const submit = () => {\n if (state.validateAll()) props.close(state.values as InferFormValues<T>);\n };\n const handleSubmit = (event: SubmitEvent) => {\n event.preventDefault();\n submit();\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={handleSubmit}>\n <DialogHeader title={props.config.title} icon={props.config.icon} close={() => props.close(null)} />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <For each={Object.entries(props.config.fields)}>\n {([key, field]) => {\n if (field.type === \"info\") return <div class=\"k2b-prompt-form__info\">{renderInfo(field.content)}</div>;\n return (\n <PromptControl\n field={field}\n value={() => state.values[key]}\n update={(value) => state.updateField(key, value)}\n error={() => state.errors[key]}\n submit={submit}\n />\n );\n }}\n </For>\n </div>\n <footer class=\"k2b-dialog__actions\">\n <Show when={props.config.cancelText !== false}>\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => props.close(null)}>\n {props.config.cancelText || resolveUiMessages().cancel}\n </button>\n </Show>\n <button type=\"submit\" class=\"k2b-button\" data-variant={props.config.variant ?? \"primary\"}>\n {props.config.confirmText ?? resolveUiMessages().save}\n </button>\n </footer>\n </form>\n );\n};\n\ntype CloudSearchResolver<T> = (input: PromptSearchInput) => Promise<PromptSearchItem<T>[]> | PromptSearchItem<T>[];\n\nconst openSearchPrompt = <T extends unknown = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) =>\n dialogCore.open<PromptSearchItem<T>>(\n (close) => {\n const [query, setQuery] = createSignal(options?.initialQuery ?? \"\");\n const [items, setItems] = createSignal<PromptSearchItem<T>[]>([]);\n const [activeIndex, setActiveIndex] = createSignal(0);\n const [hasLoaded, setHasLoaded] = createSignal(false);\n const [failedPreviews, setFailedPreviews] = createStore<Record<number, true>>({});\n const [activeSearchQuery, setActiveSearchQuery] = createSignal(\"\");\n const rowRefs = new Map<number, HTMLButtonElement>();\n const searchId = `k2b-prompt-search-${createUniqueId()}`;\n const listboxId = `${searchId}-listbox`;\n const optionId = (index: number) => `${searchId}-option-${index}`;\n\n const minQueryLength = options?.minQueryLength ?? 0;\n const debounceMs = options?.debounceMs ?? 180;\n const searchMutation = mutation.create<{ query: string; items: PromptSearchItem<T>[] }, string, { requestQuery: string }>({\n onBefore: (requestQuery) => ({ requestQuery }),\n mutation: async (requestQuery, context) => {\n const result = await resolver({\n query: requestQuery,\n abortSignal: context.abortSignal,\n });\n return { query: requestQuery, items: (result ?? []).slice() };\n },\n onSuccess: (result, context) => {\n if (!context || context.requestQuery !== activeSearchQuery()) return;\n setItems(result.items);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n onError: (error, context) => {\n if (!context || context.requestQuery !== activeSearchQuery() || error.name === \"AbortError\") return;\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n });\n const searchError = createMemo(() => {\n const error = searchMutation.error();\n if (!error || error.name === \"AbortError\") return null;\n return error.message || resolvePromptMessages().searchFailed;\n });\n const shouldShowResults = createMemo(() => {\n if (query().trim().length < minQueryLength) return false;\n return hasLoaded() || searchError() !== null || items().length > 0;\n });\n const emptyStateText = createMemo(() => {\n if (!hasLoaded()) return options?.emptyText ?? resolveSelectMessages().typeToSearch;\n return options?.noResultsText ?? resolveUiMessages().noResults;\n });\n const { debouncedFn: debounceSearch, cancel: cancelDebounce } = timed.debounce((nextQuery: string) => {\n setActiveSearchQuery(nextQuery);\n searchMutation.abort();\n void searchMutation.mutate(nextQuery);\n }, debounceMs);\n\n const execute = (item?: PromptSearchItem<T>) => {\n if (!item) return;\n close(item);\n };\n const moveSelection = (delta: -1 | 1) => {\n const list = items();\n if (list.length === 0) return;\n setActiveIndex((activeIndex() + delta + list.length) % list.length);\n };\n\n createEffect(() => {\n const list = items();\n const maxIndex = list.length - 1;\n if (maxIndex < 0) {\n setActiveIndex(0);\n return;\n }\n if (activeIndex() > maxIndex) setActiveIndex(maxIndex);\n rowRefs.get(activeIndex())?.scrollIntoView({ block: \"nearest\" });\n });\n createEffect(() => {\n const nextQuery = query().trim();\n setFailedPreviews({});\n if (nextQuery.length < minQueryLength) {\n cancelDebounce();\n searchMutation.abort();\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(false);\n setActiveSearchQuery(\"\");\n return;\n }\n debounceSearch(nextQuery);\n });\n onCleanup(() => {\n cancelDebounce();\n searchMutation.abort();\n });\n\n return (\n <div class=\"k2b-prompt-search-shell\">\n <Show when={options?.title}>{(title) => <p class=\"k2b-prompt-search-shell__title\">{title()}</p>}</Show>\n <div class=\"k2b-prompt-search\">\n <label class=\"k2b-prompt-search__input\">\n <i class={options?.icon ?? \"ti ti-search\"} aria-hidden=\"true\" />\n <input\n id={searchId}\n type=\"search\"\n role=\"combobox\"\n aria-label={options?.ariaLabel ?? options?.title ?? resolveUiMessages().search}\n aria-autocomplete=\"list\"\n aria-controls={listboxId}\n aria-expanded={shouldShowResults()}\n aria-activedescendant={shouldShowResults() && items().length > 0 ? optionId(activeIndex()) : undefined}\n aria-busy={searchMutation.loading()}\n value={query()}\n onInput={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n moveSelection(1);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n moveSelection(-1);\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n execute(items()[activeIndex()]);\n }\n }}\n placeholder={options?.placeholder ?? resolveUiMessages().search}\n spellcheck={false}\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n />\n <Show when={searchMutation.loading()}>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n </Show>\n </label>\n <div\n class=\"k2b-prompt-search__collapse\"\n style={{\n height: shouldShowResults() ? \"var(--k2b-search-body-max)\" : \"0px\",\n opacity: shouldShowResults() ? \"1\" : \"0\",\n }}\n >\n <div class=\"k2b-prompt-search__results\" onWheel={(event) => event.stopPropagation()}>\n <Show when={searchError()}>\n {(message) => (\n <div class=\"k2b-prompt-search__error\" role=\"status\" aria-live=\"polite\">\n {message()}\n </div>\n )}\n </Show>\n <Show\n when={items().length > 0}\n fallback={\n <p role=\"status\" aria-live=\"polite\">\n {emptyStateText()}\n </p>\n }\n >\n <div id={listboxId} class=\"k2b-prompt-search__list\" role=\"listbox\" aria-label={resolveUiMessages().searchResults}>\n <For each={items()}>\n {(item, index) => (\n <button\n ref={(element) => {\n if (!element) rowRefs.delete(index());\n else rowRefs.set(index(), element);\n }}\n type=\"button\"\n id={optionId(index())}\n role=\"option\"\n aria-selected={activeIndex() === index()}\n data-active={activeIndex() === index() ? \"true\" : undefined}\n data-has-description={item.desc ? \"true\" : undefined}\n onMouseEnter={() => setActiveIndex(index())}\n onClick={() => execute(item)}\n >\n {/* Cloud keeps the preview box mounted once a row declares an image, so a\n failed load swaps in the fallback glyph instead of collapsing the row. */}\n <Show when={item.previewUrl?.startsWith(\"/\") || item.icon}>\n <span class=\"k2b-prompt-search__preview\">\n <Show\n when={item.previewUrl?.startsWith(\"/\") && !failedPreviews[index()]}\n fallback={<i class={item.icon ?? \"ti ti-file\"} aria-hidden=\"true\" />}\n >\n <img src={item.previewUrl} alt=\"\" onError={() => setFailedPreviews(index(), true)} />\n </Show>\n </span>\n </Show>\n <span class=\"k2b-prompt-search__copy\">\n <strong>{item.label}</strong>\n <Show when={item.desc}>{(description) => <small>{description()}</small>}</Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </Show>\n </div>\n </div>\n </div>\n </div>\n );\n },\n {\n panelClassName: \"k2b-dialog k2b-dialog--search is-bare\",\n contentClassName: \"k2b-dialog__viewport is-search\",\n initialFocus: \"first-input\",\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().search,\n },\n );\n\nconst promptText = (content: string, defaultValue?: string, options?: DialogOptions) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"text\",\n label: false,\n default: defaultValue || \"\",\n },\n },\n })\n .then((result) => result?.value ?? null);\n\nconst promptNumber = (\n content: string,\n defaultValue?: number,\n options?: DialogOptions & {\n min?: number;\n max?: number;\n },\n) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"number\",\n label: false,\n default: defaultValue || 0,\n min: options?.min,\n max: options?.max,\n },\n },\n })\n .then((result) => result?.value ?? null);\n\nexport const prompts = {\n alert: (content: PromptContent, options?: DialogOptions): Promise<void | undefined> =>\n dialogCore.open<void>(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title || resolveUiMessages().info} icon={options?.icon} close={() => close()} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().ok}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().info,\n },\n ),\n\n success: (content: PromptContent, options?: Omit<DialogOptions, \"variant\">): Promise<void | undefined> =>\n prompts.alert(content, {\n ...options,\n variant: \"success\",\n title: options?.title ?? resolveUiMessages().success,\n icon: options?.icon ?? \"ti ti-check\",\n }),\n\n confirm: (content: PromptContent, options?: ConfirmOptions): Promise<boolean | undefined> => {\n const confirmationPhrase = options?.confirmationPhrase;\n if (confirmationPhrase !== undefined && (confirmationPhrase.trim().length === 0 || /[\\r\\n\\t]/.test(confirmationPhrase))) {\n throw new Error(\"confirmationPhrase must be non-empty, visible, and single-line\");\n }\n let confirmationInput: HTMLInputElement | undefined;\n\n return dialogCore.open<boolean>(\n (close) => {\n if (!confirmationPhrase) {\n return (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title} icon={options?.icon} close={() => close(false)} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"button\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} onClick={() => close(true)}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </div>\n );\n }\n\n // The catalog owns word order; the slot marks where the verbatim phrase is rendered as code.\n const [labelBefore, labelAfter] = resolvePromptMessages().typeToConfirm({ phrase: PHRASE_SLOT }).split(PHRASE_SLOT);\n const [confirmationValue, setConfirmationValue] = createSignal(\"\");\n const canConfirm = () => confirmationValue() === confirmationPhrase;\n const submit = (event: SubmitEvent) => {\n event.preventDefault();\n if (canConfirm()) close(true);\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={submit}>\n <DialogHeader title={options?.title} icon={options?.icon} close={() => close(false)} />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <div class=\"k2b-prompt-copy\">{content}</div>\n <TextInput\n ref={(element) => {\n confirmationInput = element;\n }}\n label={\n <>\n {labelBefore}\n <code class=\"k2b-confirmation-phrase\">{confirmationPhrase}</code>\n {labelAfter}\n </>\n }\n value={confirmationValue}\n onValueChange={setConfirmationValue}\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck={false}\n monospace\n required\n />\n </div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"submit\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} disabled={!canConfirm()}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </form>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n initialFocus: confirmationPhrase ? () => confirmationInput ?? null : undefined,\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolvePromptMessages().confirmation,\n },\n );\n },\n\n prompt: promptText,\n promptNumber,\n\n form: async <T extends Record<string, FieldSchema>>(config: PromptFormOptions<T>): Promise<InferFormValues<T> | null> =>\n (await dialogCore.open<InferFormValues<T> | null>((close) => <PromptFormDialog config={config} close={(value) => close(value)} />, {\n panelClassName: panelClass(config),\n contentClassName: contentClass(),\n signal: config.signal,\n cancelBehavior: config.cancelBehavior,\n ariaLabel: config.ariaLabel ?? config.title ?? resolvePromptMessages().form,\n })) ?? null,\n\n /**\n * Open custom content with a typed close callback and the dialog render context.\n * Register a dismiss handler to guard Escape, backdrop clicks and the supplied header's close button,\n * for example while saving. Explicit close(result) bypasses the guard. Without a handler, dismissal\n * keeps its existing behavior, including a header close button independent of cancelBehavior.\n */\n dialog: <T extends unknown = unknown>(component: DialogRender<T>, options?: DialogOptions): Promise<T | undefined> =>\n dialogCore.open<T>(\n (close, context) => {\n // A dismiss handler the component sets guards the header's close button as well as Escape and the backdrop.\n let dismiss = () => close(undefined);\n const body = component(close, {\n ...context,\n setDismissHandler: (handler) => {\n context.setDismissHandler(handler);\n dismiss = () => void context.requestDismiss();\n },\n });\n if (options?.surface === \"bare\" && options.header === false) return body;\n return (\n <div class=\"k2b-dialog__panel k2b-dialog__stack\">\n <Show when={options?.header !== false}>\n <DialogHeader title={options?.title} icon={options?.icon} close={() => dismiss()} />\n </Show>\n <div class=\"k2b-dialog__content\">{body}</div>\n </div>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().dialog,\n },\n ),\n\n search: openSearchPrompt,\n\n error: (content: string | HTMLElement, options?: DialogOptions) =>\n dialogCore.open(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title ?? resolveUiMessages().error} icon={options?.icon ?? \"ti ti-alert-circle\"} close={close} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().close}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass({ ...options, variant: \"danger\" }),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().error,\n },\n ),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,KAAK,QAAQ,mBAAmB;AACnD,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,SAAS,EAAE,IAAI,QAAQ,UAAU;AACjH,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,QAAQ,QAAQ,oBAAoB;AAC7C,SAAS,QAAQ,QAAQ,wBAAwB;AACjD,SAAS,UAAU,EAAE,cAAc,QAAQ,sBAAsB;AACjE,SAAS,UAAU,QAAQ,sBAAsB;AACjD,SAAS,WAAW,QAAQ,uBAAuB;AACnD,SAAS,MAAM,QAAQ,kBAAkB;AACzC,SAAS,qBAAqB,QAAQ,2BAA2B;AACjE,SAAS,SAAS,QAAQ,qBAAqB;AAC/C,SAAS,SAAS,QAAQ,qBAAqB;AAC/C,SAAS,iBAAiB,QAAQ,kBAAkB;AACpD,SAA4B,UAAU,QAAgC,eAAe;AACrF,SAAS,qBAAqB,QAAQ,mBAAmB;AA4JzD,MAAM,WAAW,GAAG,QAAQ;AAE5B,MAAM,OAAO,GAAI,KAAc,IAC7B,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,K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;IACvC,OAAO,EAAE,OAAO,EAAE,OAAO;IACzB,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,IAAI,iBAAiB,CAAC,CAAC,CAAC;EACzE,CACF,CAAC;EAEH,MAAM,EAAE,gBAAgB;EAExB,KAAK,EAAE,CAAC,OAA6B,EAAE,OAAuB,KAC5D,UAAU,CAAC,IAAI,CACZ,KAAK,+CAED,YAAY;IAAA,IAAC,KAAK;MAAA,OAAE,OAAO,EAAE,KAAK,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK;IAAA;IAAA,IAAE,IAAI;MAAA,OAAE,OAAO,EAAE,IAAI,IAAI,oBAAoB;IAAA;IAAE,KAAK,EAAE;EAAK,cAC5F,OAAO,YAGjC,OAAO,EAAE,WAAW,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK,EAIzD,EACD;IACE,cAAc,EAAE,UAAU,CAAC;MAAE,GAAG,OAAO;MAAE,OAAO,EAAE;IAAS,CAAC,CAAC;IAC7D,gBAAgB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,MAAM,EAAE,OAAO,EAAE,MAAM;IACvB,cAAc,EAAE,OAAO,EAAE,cAAc;IACvC,OAAO,EAAE,OAAO,EAAE,OAAO;IACzB,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,IAAI,iBAAiB,CAAC,CAAC,CAAC;EACzE,CACF;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["feedback/prompts.tsx"],"sourcesContent":["import { mutation, timed } from \"@k2b/stdlib/solid\";\nimport { createEffect, createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { createStore } from \"solid-js/store\";\nimport { Checkbox } from \"../inputs/Checkbox\";\nimport { PinInput } from \"../inputs/ChoiceInputs\";\nimport { DatePicker, DateTimePicker } from \"../inputs/DatePicker\";\nimport { ImageInput } from \"../inputs/FileInputs\";\nimport { NumberInput } from \"../inputs/NumberInput\";\nimport { Select } from \"../inputs/Select\";\nimport { resolveSelectMessages } from \"../inputs/select-messages\";\nimport { TagsInput } from \"../inputs/TagsInput\";\nimport { TextInput } from \"../inputs/TextInput\";\nimport { KeyedFor } from \"../internal/keyed-for\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { type DialogRender, dialogCore, type OpenDialogOptions } from \"./dialog-core\";\nimport { resolvePromptMessages } from \"./prompt-messages\";\n\nexport interface DialogOptions {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\";\n /** `full` fills the available viewport and becomes edge-to-edge on narrow screens. */\n size?: \"small\" | \"medium\" | \"large\" | \"wide\" | \"full\";\n surface?: \"default\" | \"bare\";\n header?: false;\n cancelBehavior?: OpenDialogOptions[\"cancelBehavior\"];\n /** Back closes the prompt like Cancel, as in a phone app; see `OpenDialogOptions.history`. */\n history?: boolean;\n}\n\nexport interface ConfirmOptions extends DialogOptions {\n confirmationPhrase?: string;\n}\n\ntype PromptContent = string | HTMLElement | JSX.Element;\n\nexport type PromptSearchItem<T = unknown> = {\n /**\n * Stable identity of the result, such as its record ID. With it, a newer answer that contains the same result keeps\n * its row, so a click in progress still lands. Without it, each answer replaces the rows.\n */\n id?: string;\n label: string;\n desc?: string;\n icon?: string;\n previewUrl?: string;\n value?: T;\n};\n\nexport type PromptSearchInput = {\n query: string;\n abortSignal: AbortSignal;\n};\n\nexport type PromptSearchOptions = DialogOptions & {\n placeholder?: string;\n icon?: string;\n initialQuery?: string;\n minQueryLength?: number;\n debounceMs?: number;\n emptyText?: string;\n noResultsText?: string;\n};\n\nexport type PromptFieldBase<T = any> = {\n label?: string | false;\n description?: string;\n placeholder?: string;\n required?: boolean;\n default?: T;\n validate?: (value: T | undefined) => string | null;\n};\n\nexport type FieldSchema =\n | (PromptFieldBase<string> & {\n type: \"text\";\n multiline?: boolean;\n lines?: number;\n maxLength?: number;\n minLength?: number;\n icon?: string;\n activeIcon?: string;\n password?: boolean;\n markdown?: boolean;\n })\n | (PromptFieldBase<number> & {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n })\n | (PromptFieldBase<string> & {\n type: \"image\";\n round?: boolean;\n ariaLabel?: string;\n accept?: string;\n })\n | (PromptFieldBase<string> & {\n type: \"pin\";\n length?: number;\n stretch?: boolean;\n })\n | (PromptFieldBase<string> & {\n type: \"select\";\n options: string[] | { id: string; label?: string; description?: string; icon?: string }[];\n icon?: string;\n activeIcon?: string;\n clearable?: boolean;\n })\n | (PromptFieldBase<string[]> & {\n type: \"tags\";\n maxTags?: number;\n minTags?: number;\n icon?: string;\n activeIcon?: string;\n })\n | (PromptFieldBase<boolean> & {\n type: \"boolean\";\n })\n | (PromptFieldBase<string> & {\n type: \"datetime\";\n dateOnly?: boolean;\n /** A date whose time is optional, as `DateTimePicker`'s `optionalTime`. */\n optionalTime?: boolean;\n })\n | {\n type: \"info\";\n content: string | JSX.Element | (() => JSX.Element);\n };\n\ntype InferFieldType<T extends FieldSchema> = T extends { type: \"text\" }\n ? string\n : T extends { type: \"number\" }\n ? number\n : T extends { type: \"image\" }\n ? string\n : T extends { type: \"pin\" }\n ? string\n : T extends { type: \"select\" }\n ? string\n : T extends { type: \"tags\" }\n ? string[]\n : T extends { type: \"boolean\" }\n ? boolean\n : T extends { type: \"datetime\" }\n ? string\n : T extends { type: \"currency\" }\n ? number\n : T extends { type: \"info\" }\n ? never\n : never;\n\ntype InferFormValues<T extends Record<string, FieldSchema>> = {\n [K in keyof T as T[K] extends { type: \"info\" } ? never : K]: T[K] extends { required: true }\n ? InferFieldType<T[K]>\n : InferFieldType<T[K]> | undefined;\n};\n\ntype PromptFormValue = string | number | boolean | string[] | undefined;\ntype PromptFormOptions<T extends Record<string, FieldSchema>> = {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n fields: T;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\";\n size?: DialogOptions[\"size\"];\n cancelBehavior?: DialogOptions[\"cancelBehavior\"];\n};\n\nconst PHRASE_SLOT = \"\\u0000\";\n\nconst isEmpty = (value: unknown): boolean =>\n value === undefined || value === null || value === \"\" || (Array.isArray(value) && value.length === 0);\n\nexport const createFormState = <T extends Record<string, FieldSchema>>(schema: T) => {\n const messages = resolveUiMessages();\n const promptMessages = resolvePromptMessages();\n const [values, setValues] = createStore<Record<string, PromptFormValue>>({});\n const [errors, setErrors] = createStore<Record<string, string | undefined>>({});\n // Errors appear with the first submit and then follow every change. Before that, a check that fails mid-input,\n // such as a URL still being typed, would interrupt the user with an alert on the first character.\n let submitted = false;\n\n for (const [key, field] of Object.entries(schema)) {\n if (field.type !== \"info\" && \"default\" in field) setValues(key, field.default as PromptFormValue);\n }\n\n const validateField = (key: string, value: PromptFormValue): string | null => {\n const field = schema[key];\n if (!field || field.type === \"info\") return null;\n if (field.type === \"boolean\" && field.required && value !== true) return messages.required;\n if (field.required && isEmpty(value)) return messages.required;\n if (\"validate\" in field && field.validate) {\n const customError = (field.validate as (next: never) => string | null)(value as never);\n if (customError) return customError;\n }\n if (field.type === \"text\" && typeof value === \"string\" && value.length > 0) {\n if (field.minLength !== undefined && value.length < field.minLength) return promptMessages.minCharacters({ count: field.minLength });\n if (field.maxLength !== undefined && value.length > field.maxLength) return promptMessages.maxCharacters({ count: field.maxLength });\n }\n if (field.type === \"tags\" && Array.isArray(value) && value.length > 0) {\n if (field.minTags !== undefined && value.length < field.minTags) return promptMessages.minTags({ count: field.minTags });\n if (field.maxTags !== undefined && value.length > field.maxTags) return promptMessages.maxTags({ count: field.maxTags });\n }\n return null;\n };\n\n const updateField = (key: string, value: PromptFormValue) => {\n setValues(key, value);\n if (submitted) setErrors(key, validateField(key, value) ?? undefined);\n };\n\n const validateAll = (): boolean => {\n submitted = true;\n let valid = true;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n const error = validateField(key, values[key]);\n setErrors(key, error ?? undefined);\n if (error) valid = false;\n }\n return valid;\n };\n\n const reset = () => {\n submitted = false;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n setValues(key, \"default\" in field ? (field.default as PromptFormValue) : undefined);\n setErrors(key, undefined);\n }\n };\n\n return { values, errors, updateField, validateAll, reset };\n};\n\nexport const DialogHeader = (props: { close: () => void; title?: string; icon?: string }): JSX.Element => (\n <header class=\"k2b-dialog__header\">\n <Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <Show when={props.title} fallback={<span class=\"k2b-dialog__header-spacer\" />}>\n {(title) => <h2>{title()}</h2>}\n </Show>\n <button type=\"button\" class=\"k2b-dialog__close\" aria-label={resolveUiMessages().closeDialog} onClick={props.close}>\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </header>\n);\n\nconst panelClass = (options?: Pick<DialogOptions, \"size\" | \"surface\" | \"variant\">): string => {\n const size = options?.size ?? \"medium\";\n const variant = options?.variant && options.variant !== \"primary\" ? ` k2b-dialog--${options.variant}` : \"\";\n return `k2b-dialog k2b-dialog--${size}${variant}${options?.surface === \"bare\" ? \" is-bare\" : \"\"}`;\n};\n\nconst contentClass = (surface?: DialogOptions[\"surface\"]): string =>\n surface === \"bare\" ? \"k2b-dialog__viewport is-bare\" : \"k2b-dialog__viewport\";\n\nconst renderInfo = (content: Extract<FieldSchema, { type: \"info\" }>[\"content\"]): JSX.Element => {\n if (typeof content === \"string\") return <p>{content}</p>;\n if (typeof content === \"function\") return content();\n return content;\n};\n\nconst PromptControl = (props: {\n field: Exclude<FieldSchema, { type: \"info\" }>;\n value: () => PromptFormValue;\n update: (value: PromptFormValue) => void;\n error: () => string | undefined;\n submit: () => void;\n}): JSX.Element => {\n const label = props.field.label || undefined;\n\n switch (props.field.type) {\n case \"text\":\n return (\n <TextInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={String(props.value() ?? \"\")}\n onValueChange={(value) => props.update(value ?? undefined)}\n onSubmit={props.submit}\n multiline={props.field.multiline}\n lines={props.field.lines}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n password={props.field.password}\n markdown={props.field.markdown}\n minLength={props.field.minLength}\n maxLength={props.field.maxLength}\n />\n );\n case \"number\":\n return (\n <NumberInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={typeof props.value() === \"number\" ? (props.value() as number) : null}\n onValueChange={(value) => props.update(value ?? undefined)}\n min={props.field.min}\n max={props.field.max}\n step={props.field.step}\n />\n );\n case \"image\":\n return (\n <ImageInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n round={props.field.round}\n aria-label={props.field.ariaLabel}\n accept={props.field.accept}\n />\n );\n case \"pin\":\n return (\n <PinInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => String(props.value() ?? \"\")}\n onValueChange={props.update}\n length={props.field.length}\n stretch={props.field.stretch}\n />\n );\n case \"select\":\n return (\n <Select\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n options={props.field.options}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n clearable={props.field.clearable}\n />\n );\n case \"tags\":\n return (\n <TagsInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (Array.isArray(props.value()) ? (props.value() as string[]) : [])}\n onValueChange={props.update}\n maxTags={props.field.maxTags}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n />\n );\n case \"boolean\":\n return (\n <Checkbox\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => Boolean(props.value())}\n onValueChange={props.update}\n />\n );\n case \"datetime\": {\n const pickerProps = {\n label,\n description: props.field.description,\n required: props.field.required,\n placeholder: props.field.placeholder,\n error: props.error,\n value: () => (typeof props.value() === \"string\" ? (props.value() as string) : null),\n onValueChange: (value: string | null) => props.update(value ?? \"\"),\n clearable: true,\n };\n return props.field.dateOnly ? (\n <DatePicker {...pickerProps} />\n ) : (\n <DateTimePicker {...pickerProps} optionalTime={props.field.optionalTime} />\n );\n }\n }\n};\n\nconst PromptFormDialog = <T extends Record<string, FieldSchema>>(props: {\n config: PromptFormOptions<T>;\n close: (value: InferFormValues<T> | null) => void;\n}): JSX.Element => {\n const state = createFormState(props.config.fields);\n const submit = () => {\n if (state.validateAll()) props.close(state.values as InferFormValues<T>);\n };\n const handleSubmit = (event: SubmitEvent) => {\n event.preventDefault();\n submit();\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={handleSubmit}>\n <DialogHeader title={props.config.title} icon={props.config.icon} close={() => props.close(null)} />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <For each={Object.entries(props.config.fields)}>\n {([key, field]) => {\n if (field.type === \"info\") return <div class=\"k2b-prompt-form__info\">{renderInfo(field.content)}</div>;\n return (\n <PromptControl\n field={field}\n value={() => state.values[key]}\n update={(value) => state.updateField(key, value)}\n error={() => state.errors[key]}\n submit={submit}\n />\n );\n }}\n </For>\n </div>\n <footer class=\"k2b-dialog__actions\">\n <Show when={props.config.cancelText !== false}>\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => props.close(null)}>\n {props.config.cancelText || resolveUiMessages().cancel}\n </button>\n </Show>\n <button type=\"submit\" class=\"k2b-button\" data-variant={props.config.variant ?? \"primary\"}>\n {props.config.confirmText ?? resolveUiMessages().save}\n </button>\n </footer>\n </form>\n );\n};\n\n// Results without an ID keep today's behavior: each object is its own identity, so a new answer replaces the row.\nconst anonymousRows = new WeakMap<object, string>();\nlet anonymousRow = 0;\nconst searchRowIdentity = (item: PromptSearchItem<unknown>): string => {\n if (item.id !== undefined) return `id:${item.id}`;\n const known = anonymousRows.get(item);\n if (known !== undefined) return known;\n const key = `object:${anonymousRow++}`;\n anonymousRows.set(item, key);\n return key;\n};\n\ntype CloudSearchResolver<T> = (input: PromptSearchInput) => Promise<PromptSearchItem<T>[]> | PromptSearchItem<T>[];\n\nconst openSearchPrompt = <T extends unknown = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) =>\n dialogCore.open<PromptSearchItem<T>>(\n (close) => {\n const [query, setQuery] = createSignal(options?.initialQuery ?? \"\");\n const [items, setItems] = createSignal<PromptSearchItem<T>[]>([]);\n const [activeIndex, setActiveIndex] = createSignal(0);\n const [hasLoaded, setHasLoaded] = createSignal(false);\n const [failedPreviews, setFailedPreviews] = createStore<Record<number, true>>({});\n const [activeSearchQuery, setActiveSearchQuery] = createSignal(\"\");\n const rowRefs = new Map<number, HTMLButtonElement>();\n const searchId = `k2b-prompt-search-${createUniqueId()}`;\n const listboxId = `${searchId}-listbox`;\n const optionId = (index: number) => `${searchId}-option-${index}`;\n\n const minQueryLength = options?.minQueryLength ?? 0;\n const debounceMs = options?.debounceMs ?? 180;\n const searchMutation = mutation.create<{ query: string; items: PromptSearchItem<T>[] }, string, { requestQuery: string }>({\n onBefore: (requestQuery) => ({ requestQuery }),\n mutation: async (requestQuery, context) => {\n const result = await resolver({\n query: requestQuery,\n abortSignal: context.abortSignal,\n });\n return { query: requestQuery, items: (result ?? []).slice() };\n },\n onSuccess: (result, context) => {\n if (!context || context.requestQuery !== activeSearchQuery()) return;\n setItems(result.items);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n onError: (error, context) => {\n if (!context || context.requestQuery !== activeSearchQuery() || error.name === \"AbortError\") return;\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n });\n const searchError = createMemo(() => {\n const error = searchMutation.error();\n if (!error || error.name === \"AbortError\") return null;\n return error.message || resolvePromptMessages().searchFailed;\n });\n const shouldShowResults = createMemo(() => {\n if (query().trim().length < minQueryLength) return false;\n return hasLoaded() || searchError() !== null || items().length > 0;\n });\n const emptyStateText = createMemo(() => {\n if (!hasLoaded()) return options?.emptyText ?? resolveSelectMessages().typeToSearch;\n return options?.noResultsText ?? resolveUiMessages().noResults;\n });\n const { debouncedFn: debounceSearch, cancel: cancelDebounce } = timed.debounce((nextQuery: string) => {\n setActiveSearchQuery(nextQuery);\n searchMutation.abort();\n void searchMutation.mutate(nextQuery);\n }, debounceMs);\n\n const execute = (item?: PromptSearchItem<T>) => {\n if (!item) return;\n close(item);\n };\n const moveSelection = (delta: -1 | 1) => {\n const list = items();\n if (list.length === 0) return;\n setActiveIndex((activeIndex() + delta + list.length) % list.length);\n };\n\n createEffect(() => {\n const list = items();\n const maxIndex = list.length - 1;\n if (maxIndex < 0) {\n setActiveIndex(0);\n return;\n }\n if (activeIndex() > maxIndex) setActiveIndex(maxIndex);\n rowRefs.get(activeIndex())?.scrollIntoView({ block: \"nearest\" });\n });\n createEffect(() => {\n const nextQuery = query().trim();\n setFailedPreviews({});\n if (nextQuery.length < minQueryLength) {\n cancelDebounce();\n searchMutation.abort();\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(false);\n setActiveSearchQuery(\"\");\n return;\n }\n debounceSearch(nextQuery);\n });\n onCleanup(() => {\n cancelDebounce();\n searchMutation.abort();\n });\n\n return (\n <div class=\"k2b-prompt-search-shell\">\n <Show when={options?.title}>{(title) => <p class=\"k2b-prompt-search-shell__title\">{title()}</p>}</Show>\n <div class=\"k2b-prompt-search\">\n <label class=\"k2b-prompt-search__input\">\n <i class={options?.icon ?? \"ti ti-search\"} aria-hidden=\"true\" />\n <input\n id={searchId}\n type=\"search\"\n role=\"combobox\"\n aria-label={options?.ariaLabel ?? options?.title ?? resolveUiMessages().search}\n aria-autocomplete=\"list\"\n aria-controls={listboxId}\n aria-expanded={shouldShowResults()}\n aria-activedescendant={shouldShowResults() && items().length > 0 ? optionId(activeIndex()) : undefined}\n aria-busy={searchMutation.loading()}\n value={query()}\n onInput={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n moveSelection(1);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n moveSelection(-1);\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n execute(items()[activeIndex()]);\n }\n }}\n placeholder={options?.placeholder ?? resolveUiMessages().search}\n spellcheck={false}\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n />\n <Show when={searchMutation.loading()}>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n </Show>\n </label>\n <div\n class=\"k2b-prompt-search__collapse\"\n style={{\n height: shouldShowResults() ? \"var(--k2b-search-body-max)\" : \"0px\",\n opacity: shouldShowResults() ? \"1\" : \"0\",\n }}\n >\n <div class=\"k2b-prompt-search__results\" onWheel={(event) => event.stopPropagation()}>\n <Show when={searchError()}>\n {(message) => (\n <div class=\"k2b-prompt-search__error\" role=\"status\" aria-live=\"polite\">\n {message()}\n </div>\n )}\n </Show>\n <Show\n when={items().length > 0}\n fallback={\n <p role=\"status\" aria-live=\"polite\">\n {emptyStateText()}\n </p>\n }\n >\n <div id={listboxId} class=\"k2b-prompt-search__list\" role=\"listbox\" aria-label={resolveUiMessages().searchResults}>\n <KeyedFor each={items()} by={searchRowIdentity}>\n {(item, index) => (\n <button\n ref={(element) => {\n if (!element) rowRefs.delete(index());\n else rowRefs.set(index(), element);\n }}\n type=\"button\"\n id={optionId(index())}\n role=\"option\"\n aria-selected={activeIndex() === index()}\n data-active={activeIndex() === index() ? \"true\" : undefined}\n data-has-description={item().desc ? \"true\" : undefined}\n onMouseEnter={() => setActiveIndex(index())}\n onClick={() => execute(item())}\n >\n {/* Cloud keeps the preview box mounted once a row declares an image, so a\n failed load swaps in the fallback glyph instead of collapsing the row. */}\n <Show when={item().previewUrl?.startsWith(\"/\") || item().icon}>\n <span class=\"k2b-prompt-search__preview\">\n <Show\n when={item().previewUrl?.startsWith(\"/\") && !failedPreviews[index()]}\n fallback={<i class={item().icon ?? \"ti ti-file\"} aria-hidden=\"true\" />}\n >\n <img src={item().previewUrl} alt=\"\" onError={() => setFailedPreviews(index(), true)} />\n </Show>\n </span>\n </Show>\n <span class=\"k2b-prompt-search__copy\">\n <strong>{item().label}</strong>\n <Show when={item().desc}>{(description) => <small>{description()}</small>}</Show>\n </span>\n </button>\n )}\n </KeyedFor>\n </div>\n </Show>\n </div>\n </div>\n </div>\n </div>\n );\n },\n {\n panelClassName: \"k2b-dialog k2b-dialog--search is-bare\",\n contentClassName: \"k2b-dialog__viewport is-search\",\n initialFocus: \"first-input\",\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().search,\n },\n );\n\nconst promptText = (content: string, defaultValue?: string, options?: DialogOptions) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"text\",\n label: false,\n default: defaultValue || \"\",\n },\n },\n })\n .then((result) => result?.value ?? null);\n\nconst promptNumber = (\n content: string,\n defaultValue?: number,\n options?: DialogOptions & {\n min?: number;\n max?: number;\n },\n) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"number\",\n label: false,\n default: defaultValue || 0,\n min: options?.min,\n max: options?.max,\n },\n },\n })\n .then((result) => result?.value ?? null);\n\nexport const prompts = {\n alert: (content: PromptContent, options?: DialogOptions): Promise<void | undefined> =>\n dialogCore.open<void>(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title || resolveUiMessages().info} icon={options?.icon} close={() => close()} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().ok}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().info,\n },\n ),\n\n success: (content: PromptContent, options?: Omit<DialogOptions, \"variant\">): Promise<void | undefined> =>\n prompts.alert(content, {\n ...options,\n variant: \"success\",\n title: options?.title ?? resolveUiMessages().success,\n icon: options?.icon ?? \"ti ti-check\",\n }),\n\n confirm: (content: PromptContent, options?: ConfirmOptions): Promise<boolean | undefined> => {\n const confirmationPhrase = options?.confirmationPhrase;\n if (confirmationPhrase !== undefined && (confirmationPhrase.trim().length === 0 || /[\\r\\n\\t]/.test(confirmationPhrase))) {\n throw new Error(\"confirmationPhrase must be non-empty, visible, and single-line\");\n }\n let confirmationInput: HTMLInputElement | undefined;\n\n return dialogCore.open<boolean>(\n (close) => {\n if (!confirmationPhrase) {\n return (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title} icon={options?.icon} close={() => close(false)} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"button\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} onClick={() => close(true)}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </div>\n );\n }\n\n // The catalog owns word order; the slot marks where the verbatim phrase is rendered as code.\n const [labelBefore, labelAfter] = resolvePromptMessages().typeToConfirm({ phrase: PHRASE_SLOT }).split(PHRASE_SLOT);\n const [confirmationValue, setConfirmationValue] = createSignal(\"\");\n const canConfirm = () => confirmationValue() === confirmationPhrase;\n const submit = (event: SubmitEvent) => {\n event.preventDefault();\n if (canConfirm()) close(true);\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={submit}>\n <DialogHeader title={options?.title} icon={options?.icon} close={() => close(false)} />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <div class=\"k2b-prompt-copy\">{content}</div>\n <TextInput\n ref={(element) => {\n confirmationInput = element;\n }}\n label={\n <>\n {labelBefore}\n <code class=\"k2b-confirmation-phrase\">{confirmationPhrase}</code>\n {labelAfter}\n </>\n }\n value={confirmationValue}\n onValueChange={setConfirmationValue}\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck={false}\n monospace\n required\n />\n </div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"submit\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} disabled={!canConfirm()}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </form>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n initialFocus: confirmationPhrase ? () => confirmationInput ?? null : undefined,\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolvePromptMessages().confirmation,\n },\n );\n },\n\n prompt: promptText,\n promptNumber,\n\n form: async <T extends Record<string, FieldSchema>>(config: PromptFormOptions<T>): Promise<InferFormValues<T> | null> =>\n (await dialogCore.open<InferFormValues<T> | null>((close) => <PromptFormDialog config={config} close={(value) => close(value)} />, {\n panelClassName: panelClass(config),\n contentClassName: contentClass(),\n signal: config.signal,\n cancelBehavior: config.cancelBehavior,\n ariaLabel: config.ariaLabel ?? config.title ?? resolvePromptMessages().form,\n })) ?? null,\n\n /**\n * Open custom content with a typed close callback and the dialog render context.\n * Register a dismiss handler to guard Escape, backdrop clicks and the supplied header's close button,\n * for example while saving. Explicit close(result) bypasses the guard. Without a handler, dismissal\n * keeps its existing behavior, including a header close button independent of cancelBehavior.\n */\n dialog: <T extends unknown = unknown>(component: DialogRender<T>, options?: DialogOptions): Promise<T | undefined> =>\n dialogCore.open<T>(\n (close, context) => {\n // A dismiss handler the component sets guards the header's close button as well as Escape and the backdrop.\n let dismiss = () => close(undefined);\n const body = component(close, {\n ...context,\n setDismissHandler: (handler) => {\n context.setDismissHandler(handler);\n dismiss = () => void context.requestDismiss();\n },\n });\n if (options?.surface === \"bare\" && options.header === false) return body;\n return (\n <div class=\"k2b-dialog__panel k2b-dialog__stack\">\n <Show when={options?.header !== false}>\n <DialogHeader title={options?.title} icon={options?.icon} close={() => dismiss()} />\n </Show>\n <div class=\"k2b-dialog__content\">{body}</div>\n </div>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().dialog,\n },\n ),\n\n search: openSearchPrompt,\n\n error: (content: string | HTMLElement, options?: DialogOptions) =>\n dialogCore.open(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title ?? resolveUiMessages().error} icon={options?.icon ?? \"ti ti-alert-circle\"} close={close} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().close}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass({ ...options, variant: \"danger\" }),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().error,\n },\n ),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,KAAK,QAAQ,mBAAmB;AACnD,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,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