@k2b/ui 0.61.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/actions/FilterChip.js +3 -0
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/content/ActivityList.js +379 -290
- package/dist/browser/content/ActivityList.js.map +1 -1
- package/dist/browser/content/FileView.js +0 -12
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/activity-messages.js +2 -2
- package/dist/browser/content/activity-messages.js.map +1 -1
- package/dist/browser/content/file-view-preview.js +13 -0
- package/dist/browser/content/file-view-preview.js.map +1 -1
- package/dist/browser/content/index.js +4 -4
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +24 -27
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/dialog-frame-motion.js +506 -15
- package/dist/browser/feedback/dialog-frame-motion.js.map +1 -1
- package/dist/browser/feedback/prompt-sheet.js +1 -0
- package/dist/browser/feedback/prompt-sheet.js.map +1 -1
- package/dist/browser/feedback/prompts.js +5 -1
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/layout/sheet-motion.js +3 -3
- package/dist/browser/layout/sheet-motion.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +3 -0
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/content/ActivityList.js +199 -114
- package/dist/ssr/content/ActivityList.js.map +1 -1
- package/dist/ssr/content/FileView.js +0 -12
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/activity-messages.js +2 -2
- package/dist/ssr/content/activity-messages.js.map +1 -1
- package/dist/ssr/content/file-view-preview.js +13 -0
- package/dist/ssr/content/file-view-preview.js.map +1 -1
- package/dist/ssr/content/index.js +4 -4
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +24 -27
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/dialog-frame-motion.js +506 -15
- package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -1
- package/dist/ssr/feedback/prompt-sheet.js +1 -0
- package/dist/ssr/feedback/prompt-sheet.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +5 -1
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/layout/sheet-motion.js +3 -3
- package/dist/ssr/layout/sheet-motion.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/FilterChip.d.ts +9 -0
- package/dist/types/content/ActivityList.d.ts +24 -6
- package/dist/types/content/FileView.d.ts +0 -5
- package/dist/types/content/file-view-preview.d.ts +5 -0
- package/dist/types/content/index.d.ts +3 -3
- package/dist/types/feedback/dialog-core.d.ts +3 -1
- package/dist/types/feedback/dialog-frame-motion.d.ts +26 -1
- package/dist/types/feedback/prompt-sheet.d.ts +1 -0
- package/dist/types/feedback/prompts.d.ts +4 -0
- package/dist/types/layout/sheet-motion.d.ts +2 -2
- package/package.json +1 -1
|
@@ -57,6 +57,19 @@ export const getFileViewPreviewKind = file => {
|
|
|
57
57
|
return kind;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* A file size such as "4.2 MB". With `locale`, the number follows that language ("4,2 MB") and drops a trailing
|
|
62
|
+
* zero ("64 KB"); without it, the output stays as before.
|
|
63
|
+
*/
|
|
64
|
+
export const formatFileViewSize = (bytes, locale) => {
|
|
65
|
+
const [value, unit] = bytes < 1024 ? [bytes, "B"] : bytes < 1024 * 1024 ? [bytes / 1024, "KB"] : [bytes / (1024 * 1024), "MB"];
|
|
66
|
+
if (unit === "B") return `${bytes} B`;
|
|
67
|
+
if (!locale) return `${value.toFixed(1)} ${unit}`;
|
|
68
|
+
return `${new Intl.NumberFormat(locale, {
|
|
69
|
+
maximumFractionDigits: 1
|
|
70
|
+
}).format(value)} ${unit}`;
|
|
71
|
+
};
|
|
72
|
+
|
|
60
73
|
/** Use this to expose preview actions only for files FileView can render. */
|
|
61
74
|
export const canPreviewFile = file => getFileViewPreviewKind(file) !== null;
|
|
62
75
|
export const parseDelimitedText = (input, delimiter, limits = {}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/file-view-preview.ts"],"sourcesContent":["export type FileViewFile = {\n path: string;\n mediaType?: string;\n size?: number;\n};\n\nexport type FileViewPreviewKind = \"markdown\" | \"image\" | \"pdf\" | \"json\" | \"delimited-text\" | \"audio\" | \"video\" | \"text\";\n\nconst MEBIBYTE = 1024 * 1024;\n\nconst maxPreviewBytes: Record<FileViewPreviewKind, number> = {\n markdown: 2 * MEBIBYTE,\n image: 25 * MEBIBYTE,\n pdf: 50 * MEBIBYTE,\n json: 2 * MEBIBYTE,\n \"delimited-text\": 2 * MEBIBYTE,\n audio: 50 * MEBIBYTE,\n video: 50 * MEBIBYTE,\n text: 2 * MEBIBYTE,\n};\n\n// SVG remains inert because FileView renders every image through <img>; never inject its markup into the DOM.\nconst imageMediaTypes = new Set([\n \"image/avif\",\n \"image/bmp\",\n \"image/gif\",\n \"image/jpeg\",\n \"image/png\",\n \"image/svg+xml\",\n \"image/webp\",\n \"image/x-icon\",\n]);\nconst audioMediaTypes = new Set([\n \"audio/aac\",\n \"audio/flac\",\n \"audio/mp4\",\n \"audio/mpeg\",\n \"audio/ogg\",\n \"audio/wav\",\n \"audio/webm\",\n \"audio/x-wav\",\n]);\nconst videoMediaTypes = new Set([\"video/mp4\", \"video/ogg\", \"video/quicktime\", \"video/webm\", \"video/x-m4v\"]);\n\nconst markdownExtensions = new Set([\"md\", \"markdown\"]);\nconst imageExtensions = new Set([\"avif\", \"bmp\", \"gif\", \"ico\", \"jpeg\", \"jpg\", \"png\", \"svg\", \"webp\"]);\nconst audioExtensions = new Set([\"aac\", \"flac\", \"m4a\", \"mp3\", \"oga\", \"ogg\", \"wav\", \"weba\"]);\nconst videoExtensions = new Set([\"m4v\", \"mov\", \"mp4\", \"ogv\", \"webm\"]);\nconst textExtensions = new Set([\n \"c\",\n \"conf\",\n \"cpp\",\n \"css\",\n \"env\",\n \"go\",\n \"h\",\n \"html\",\n \"ini\",\n \"java\",\n \"js\",\n \"jsx\",\n \"log\",\n \"mjs\",\n \"php\",\n \"py\",\n \"rb\",\n \"rs\",\n \"sh\",\n \"sql\",\n \"toml\",\n \"ts\",\n \"tsx\",\n \"txt\",\n \"xml\",\n \"yaml\",\n \"yml\",\n]);\n\nexport const fileViewExtension = (path: string): string => {\n const cleanPath = path.split(/[?#]/, 1)[0] ?? path;\n const name = cleanPath.slice(cleanPath.lastIndexOf(\"/\") + 1);\n const dot = name.lastIndexOf(\".\");\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : \"\";\n};\n\nconst normalizedMediaType = (mediaType?: string): string => mediaType?.split(\";\", 1)[0]?.trim().toLowerCase() ?? \"\";\n\nconst previewKindByType = (file: FileViewFile): FileViewPreviewKind | null => {\n const extension = fileViewExtension(file.path);\n const mediaType = normalizedMediaType(file.mediaType);\n\n if (mediaType === \"text/markdown\" || markdownExtensions.has(extension)) return \"markdown\";\n if (mediaType === \"application/json\" || mediaType.endsWith(\"+json\") || extension === \"json\") return \"json\";\n if (mediaType === \"text/csv\" || mediaType === \"text/tab-separated-values\" || extension === \"csv\" || extension === \"tsv\") {\n return \"delimited-text\";\n }\n if (mediaType === \"application/pdf\" || extension === \"pdf\") return \"pdf\";\n if (imageMediaTypes.has(mediaType) || imageExtensions.has(extension)) return \"image\";\n if (audioMediaTypes.has(mediaType) || audioExtensions.has(extension)) return \"audio\";\n if (videoMediaTypes.has(mediaType) || videoExtensions.has(extension)) return \"video\";\n if (\n mediaType.startsWith(\"text/\") ||\n mediaType === \"application/javascript\" ||\n mediaType === \"application/sql\" ||\n mediaType === \"application/xml\" ||\n textExtensions.has(extension)\n ) {\n return \"text\";\n }\n return null;\n};\n\n/**\n * Returns the built-in preview kind when FileView can render the file within\n * its bounded client-side limits. Custom renderers remain registry-driven.\n */\nexport const getFileViewPreviewKind = (file: FileViewFile): FileViewPreviewKind | null => {\n const kind = previewKindByType(file);\n if (!kind) return null;\n if (file.size !== undefined && (!Number.isFinite(file.size) || file.size < 0 || file.size > maxPreviewBytes[kind])) {\n return null;\n }\n return kind;\n};\n\n/** Use this to expose preview actions only for files FileView can render. */\nexport const canPreviewFile = (file: FileViewFile): boolean => getFileViewPreviewKind(file) !== null;\n\nexport type DelimitedTextPreview = {\n rows: string[][];\n truncated: boolean;\n totalRows: number;\n columnsTruncated: boolean;\n};\n\nexport const parseDelimitedText = (\n input: string,\n delimiter: string,\n limits: { rows?: number; columns?: number; offset?: number } = {},\n): DelimitedTextPreview => {\n const maxRows = Math.max(1, limits.rows ?? 201);\n const maxColumns = Math.max(1, limits.columns ?? 50);\n const rows: string[][] = [];\n let row: string[] = [];\n let field = \"\";\n let quoted = false;\n let truncated = false;\n let totalRows = 0;\n let columnsTruncated = false;\n\n const pushField = () => {\n if (row.length < maxColumns) row.push(field);\n else {\n truncated = true;\n columnsTruncated = true;\n }\n field = \"\";\n };\n const pushRow = () => {\n if (rows.length < maxRows && (totalRows === 0 || totalRows > (limits.offset ?? 0))) rows.push(row);\n else truncated = true;\n totalRows++;\n row = [];\n };\n\n for (let index = 0; index < input.length; index += 1) {\n const character = input[index]!;\n if (quoted) {\n if (character === '\"' && input[index + 1] === '\"') {\n field += '\"';\n index += 1;\n } else if (character === '\"') {\n quoted = false;\n } else {\n field += character;\n }\n continue;\n }\n\n if (character === '\"' && field.length === 0) quoted = true;\n else if (character === delimiter) pushField();\n else if (character === \"\\n\" || character === \"\\r\") {\n pushField();\n pushRow();\n if (character === \"\\r\" && input[index + 1] === \"\\n\") index += 1;\n } else {\n field += character;\n }\n }\n\n if (field.length > 0 || row.length > 0) {\n pushField();\n pushRow();\n }\n\n return { rows, truncated, totalRows, columnsTruncated };\n};\n"],"mappings":"AAQA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI;AAE5B,MAAM,eAAoD,GAAG;EAC3D,QAAQ,EA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D,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAE;IAC/B,IAAI,MAAM,EAAE;MACV,IAAI,SAAS,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QACjD,KAAK,IAAI,GAAG;QACZ,KAAK,IAAI,CAAC;MACZ,CAAC,MAAM,IAAI,SAAS,KAAK,GAAG,EAAE;QAC5B,MAAM,GAAG,KAAK;MAChB,CAAC,MAAM;QACL,KAAK,IAAI,SAAS;MACpB;MACA;IACF;IAEA,IAAI,SAAS,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,KACtD,IAAI,SAAS,KAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,KACzC,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI,EAAE;MACjD,SAAS,CAAC,CAAC;MACX,OAAO,CAAC,CAAC;MACT,IAAI,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,KAAK,IAAI,CAAC;IACjE,CAAC,MAAM;MACL,KAAK,IAAI,SAAS;IACpB;EACF;EAEA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;IACtC,SAAS,CAAC,CAAC;IACX,OAAO,CAAC,CAAC;EACX;EAEA,OAAO;IAAE,IAAI;IAAE,SAAS;IAAE,SAAS;IAAE;EAAiB,CAAC;AACzD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["content/file-view-preview.ts"],"sourcesContent":["export type FileViewFile = {\n path: string;\n mediaType?: string;\n size?: number;\n};\n\nexport type FileViewPreviewKind = \"markdown\" | \"image\" | \"pdf\" | \"json\" | \"delimited-text\" | \"audio\" | \"video\" | \"text\";\n\nconst MEBIBYTE = 1024 * 1024;\n\nconst maxPreviewBytes: Record<FileViewPreviewKind, number> = {\n markdown: 2 * MEBIBYTE,\n image: 25 * MEBIBYTE,\n pdf: 50 * MEBIBYTE,\n json: 2 * MEBIBYTE,\n \"delimited-text\": 2 * MEBIBYTE,\n audio: 50 * MEBIBYTE,\n video: 50 * MEBIBYTE,\n text: 2 * MEBIBYTE,\n};\n\n// SVG remains inert because FileView renders every image through <img>; never inject its markup into the DOM.\nconst imageMediaTypes = new Set([\n \"image/avif\",\n \"image/bmp\",\n \"image/gif\",\n \"image/jpeg\",\n \"image/png\",\n \"image/svg+xml\",\n \"image/webp\",\n \"image/x-icon\",\n]);\nconst audioMediaTypes = new Set([\n \"audio/aac\",\n \"audio/flac\",\n \"audio/mp4\",\n \"audio/mpeg\",\n \"audio/ogg\",\n \"audio/wav\",\n \"audio/webm\",\n \"audio/x-wav\",\n]);\nconst videoMediaTypes = new Set([\"video/mp4\", \"video/ogg\", \"video/quicktime\", \"video/webm\", \"video/x-m4v\"]);\n\nconst markdownExtensions = new Set([\"md\", \"markdown\"]);\nconst imageExtensions = new Set([\"avif\", \"bmp\", \"gif\", \"ico\", \"jpeg\", \"jpg\", \"png\", \"svg\", \"webp\"]);\nconst audioExtensions = new Set([\"aac\", \"flac\", \"m4a\", \"mp3\", \"oga\", \"ogg\", \"wav\", \"weba\"]);\nconst videoExtensions = new Set([\"m4v\", \"mov\", \"mp4\", \"ogv\", \"webm\"]);\nconst textExtensions = new Set([\n \"c\",\n \"conf\",\n \"cpp\",\n \"css\",\n \"env\",\n \"go\",\n \"h\",\n \"html\",\n \"ini\",\n \"java\",\n \"js\",\n \"jsx\",\n \"log\",\n \"mjs\",\n \"php\",\n \"py\",\n \"rb\",\n \"rs\",\n \"sh\",\n \"sql\",\n \"toml\",\n \"ts\",\n \"tsx\",\n \"txt\",\n \"xml\",\n \"yaml\",\n \"yml\",\n]);\n\nexport const fileViewExtension = (path: string): string => {\n const cleanPath = path.split(/[?#]/, 1)[0] ?? path;\n const name = cleanPath.slice(cleanPath.lastIndexOf(\"/\") + 1);\n const dot = name.lastIndexOf(\".\");\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : \"\";\n};\n\nconst normalizedMediaType = (mediaType?: string): string => mediaType?.split(\";\", 1)[0]?.trim().toLowerCase() ?? \"\";\n\nconst previewKindByType = (file: FileViewFile): FileViewPreviewKind | null => {\n const extension = fileViewExtension(file.path);\n const mediaType = normalizedMediaType(file.mediaType);\n\n if (mediaType === \"text/markdown\" || markdownExtensions.has(extension)) return \"markdown\";\n if (mediaType === \"application/json\" || mediaType.endsWith(\"+json\") || extension === \"json\") return \"json\";\n if (mediaType === \"text/csv\" || mediaType === \"text/tab-separated-values\" || extension === \"csv\" || extension === \"tsv\") {\n return \"delimited-text\";\n }\n if (mediaType === \"application/pdf\" || extension === \"pdf\") return \"pdf\";\n if (imageMediaTypes.has(mediaType) || imageExtensions.has(extension)) return \"image\";\n if (audioMediaTypes.has(mediaType) || audioExtensions.has(extension)) return \"audio\";\n if (videoMediaTypes.has(mediaType) || videoExtensions.has(extension)) return \"video\";\n if (\n mediaType.startsWith(\"text/\") ||\n mediaType === \"application/javascript\" ||\n mediaType === \"application/sql\" ||\n mediaType === \"application/xml\" ||\n textExtensions.has(extension)\n ) {\n return \"text\";\n }\n return null;\n};\n\n/**\n * Returns the built-in preview kind when FileView can render the file within\n * its bounded client-side limits. Custom renderers remain registry-driven.\n */\nexport const getFileViewPreviewKind = (file: FileViewFile): FileViewPreviewKind | null => {\n const kind = previewKindByType(file);\n if (!kind) return null;\n if (file.size !== undefined && (!Number.isFinite(file.size) || file.size < 0 || file.size > maxPreviewBytes[kind])) {\n return null;\n }\n return kind;\n};\n\n/**\n * A file size such as \"4.2 MB\". With `locale`, the number follows that language (\"4,2 MB\") and drops a trailing\n * zero (\"64 KB\"); without it, the output stays as before.\n */\nexport const formatFileViewSize = (bytes: number, locale?: string): string => {\n const [value, unit] = bytes < 1024 ? [bytes, \"B\"] : bytes < 1024 * 1024 ? [bytes / 1024, \"KB\"] : [bytes / (1024 * 1024), \"MB\"];\n if (unit === \"B\") return `${bytes} B`;\n if (!locale) return `${value.toFixed(1)} ${unit}`;\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(value)} ${unit}`;\n};\n\n/** Use this to expose preview actions only for files FileView can render. */\nexport const canPreviewFile = (file: FileViewFile): boolean => getFileViewPreviewKind(file) !== null;\n\nexport type DelimitedTextPreview = {\n rows: string[][];\n truncated: boolean;\n totalRows: number;\n columnsTruncated: boolean;\n};\n\nexport const parseDelimitedText = (\n input: string,\n delimiter: string,\n limits: { rows?: number; columns?: number; offset?: number } = {},\n): DelimitedTextPreview => {\n const maxRows = Math.max(1, limits.rows ?? 201);\n const maxColumns = Math.max(1, limits.columns ?? 50);\n const rows: string[][] = [];\n let row: string[] = [];\n let field = \"\";\n let quoted = false;\n let truncated = false;\n let totalRows = 0;\n let columnsTruncated = false;\n\n const pushField = () => {\n if (row.length < maxColumns) row.push(field);\n else {\n truncated = true;\n columnsTruncated = true;\n }\n field = \"\";\n };\n const pushRow = () => {\n if (rows.length < maxRows && (totalRows === 0 || totalRows > (limits.offset ?? 0))) rows.push(row);\n else truncated = true;\n totalRows++;\n row = [];\n };\n\n for (let index = 0; index < input.length; index += 1) {\n const character = input[index]!;\n if (quoted) {\n if (character === '\"' && input[index + 1] === '\"') {\n field += '\"';\n index += 1;\n } else if (character === '\"') {\n quoted = false;\n } else {\n field += character;\n }\n continue;\n }\n\n if (character === '\"' && field.length === 0) quoted = true;\n else if (character === delimiter) pushField();\n else if (character === \"\\n\" || character === \"\\r\") {\n pushField();\n pushRow();\n if (character === \"\\r\" && input[index + 1] === \"\\n\") index += 1;\n } else {\n field += character;\n }\n }\n\n if (field.length > 0 || row.length > 0) {\n pushField();\n pushRow();\n }\n\n return { rows, truncated, totalRows, columnsTruncated };\n};\n"],"mappings":"AAQA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI;AAE5B,MAAM,eAAoD,GAAG;EAC3D,QAAQ,EAAE,CAAC,GAA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C,CAAC;MACT,IAAI,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,KAAK,IAAI,CAAC;IACjE,CAAC,MAAM;MACL,KAAK,IAAI,SAAS;IACpB;EACF;EAEA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;IACtC,SAAS,CAAC,CAAC;IACX,OAAO,CAAC,CAAC;EACX;EAEA,OAAO;IAAE,IAAI;IAAE,SAAS;IAAE,SAAS;IAAE;EAAiB,CAAC;AACzD,CAAC","ignoreList":[]}
|
|
@@ -20,11 +20,11 @@ export { FileBrowserPanel, openFileBrowser } from "./FileBrowser";
|
|
|
20
20
|
export { FileGrid } from "./FileGrid";
|
|
21
21
|
export { default as FileTree } from "./FileTree";
|
|
22
22
|
export { FileTypeIcon, fileKindLabel, fileTypeOf } from "./FileTypeIcon";
|
|
23
|
-
export { default as FileView
|
|
23
|
+
export { default as FileView } from "./FileView";
|
|
24
24
|
export { FlowAmount, flowDirection } from "./FlowAmount";
|
|
25
|
-
// Choosing a renderer needs no renderer: these come from their own small module, so an app that only
|
|
26
|
-
// a file is never loads FileView and its PDF, video and code dependencies.
|
|
27
|
-
export { canPreviewFile, getFileViewPreviewKind } from "./file-view-preview";
|
|
25
|
+
// Choosing a renderer or labelling a size needs no renderer: these come from their own small module, so an app that only
|
|
26
|
+
// asks which kind a file is, or how large, never loads FileView and its PDF, video and code dependencies.
|
|
27
|
+
export { canPreviewFile, formatFileViewSize, getFileViewPreviewKind } from "./file-view-preview";
|
|
28
28
|
export { Kbd } from "./Kbd";
|
|
29
29
|
export { LabelChip } from "./LabelChip";
|
|
30
30
|
export { default as Lightbox } from "./Lightbox";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/index.ts"],"sourcesContent":["export type { ChartDateFormat, ChartDatum, ChartDatumRole, ChartFormat, ChartNumberFormat } from \"../charts/core\";\nexport {\n type ActivityAction,\n ActivityCard,\n type ActivityCardProps,\n type ActivityDensity,\n type ActivityDialogInput,\n type ActivityEntry,\n type ActivityKind,\n ActivityList,\n type ActivityListProps,\n type ActivityTone,\n openActivityDialog,\n} from \"./ActivityList\";\nexport { BalanceSummary, type BalanceSummaryProps } from \"./BalanceSummary\";\nexport type {\n CalendarAttendee,\n CalendarCommand,\n CalendarController,\n CalendarCustomView,\n CalendarDayBadge,\n CalendarEvent,\n CalendarEventColor,\n CalendarEventLink,\n CalendarEventRenderContext,\n CalendarEventTimeChange,\n CalendarExternalDrag,\n CalendarLabels,\n CalendarProps,\n CalendarQuickCreateControls,\n CalendarRange,\n CalendarRecurrence,\n CalendarResource,\n CalendarSelectionControls,\n CalendarView,\n} from \"./Calendar\";\nexport { default as Calendar } from \"./Calendar\";\n\nexport type { ChartKind, ChartKindProps, ChartLabels, ChartProps, ChartRenderOptions } from \"./Chart\";\nexport { default as Chart } from \"./Chart\";\nexport type { ChartExplorerColumn, ChartExplorerProps, ChartFrameRequest, ChartLegendEntry } from \"./ChartExplorer\";\nexport { ChartExplorer } from \"./ChartExplorer\";\nexport type { ChartExplorerControlsProps } from \"./ChartExplorerControls\";\nexport { ChartExplorerControls } from \"./ChartExplorerControls\";\nexport { ChartFilterControls, type ChartFilterControlsProps } from \"./ChartFilterControls\";\nexport { ChartSnapshotView } from \"./ChartSnapshotView\";\nexport type { CodeDisplayLanguage, CodeDisplayProps } from \"./CodeDisplay\";\nexport { default as CodeDisplay } from \"./CodeDisplay\";\nexport { type ChartCursor, createChartCursor } from \"./chart-cursor\";\nexport type {\n ChartExplorerCharts,\n ChartExplorerController,\n ChartExplorerData,\n ChartExplorerOptions,\n ChartExplorerRequest,\n ChartExplorerRow,\n ChartExplorerSnapshot,\n} from \"./chart-explorer\";\nexport { createChartExplorer } from \"./chart-explorer\";\nexport type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from \"./chart-inspection-core\";\nexport type { ChartSnapshot } from \"./chart-snapshot\";\nexport { prepareChartSnapshot } from \"./chart-snapshot\";\nexport type {\n StateTimelineChartOptions,\n StateTimelineDomain,\n StateTimelineInterval,\n StateTimelineRow,\n StateTimelineState,\n} from \"./chart-state-timeline\";\nexport type { ChartTimeAxis } from \"./chart-time-axis\";\nexport { highlightSql } from \"./code-highlight\";\nexport { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from \"./collection-selection\";\nexport type {\n DataTableColumn,\n DataTableControlsProps,\n DataTableFooter,\n DataTableHeaderProps,\n DataTablePanelFooterProps,\n DataTablePanelProps,\n DataTableProps,\n DataTableRenderCell,\n DataTableRenderHeader,\n DataTableSort,\n} from \"./DataTable\";\nexport { default as DataTable } from \"./DataTable\";\nexport type { DataTableToolsProps, DataTableView, DataTableViewOptions } from \"./DataTableTools\";\nexport { createDataTableView, DataTableTools } from \"./DataTableTools\";\nexport type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from \"./Docs\";\nexport { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from \"./Docs\";\nexport type {\n DataTableColumnType,\n DataTableNumberFormat,\n DataTableStatusState,\n DataTableTypedColumn,\n} from \"./data-table-columns\";\nexport { filterRows, sortRows } from \"./data-table-columns\";\nexport { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from \"./FileBrowser\";\nexport { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from \"./FileGrid\";\nexport { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from \"./FileTree\";\nexport { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from \"./FileTypeIcon\";\nexport {\n default as FileView,\n type FileViewContent,\n type FileViewProps,\n type FileViewRenderer,\n type FileViewRendererProps,\n formatFileViewSize,\n} from \"./FileView\";\nexport { FlowAmount, type FlowAmountDirection, type FlowAmountProps, flowDirection } from \"./FlowAmount\";\n// Choosing a renderer needs no renderer: these come from their own small module, so an app that only asks which kind\n// a file is never loads FileView and its PDF, video and code dependencies.\nexport { canPreviewFile, type FileViewFile, type FileViewPreviewKind, getFileViewPreviewKind } from \"./file-view-preview\";\nexport type { KbdProps } from \"./Kbd\";\nexport { Kbd } from \"./Kbd\";\nexport type { LabelChipProps } from \"./LabelChip\";\nexport { LabelChip } from \"./LabelChip\";\nexport type { LightboxAction, LightboxItem, LightboxProps } from \"./Lightbox\";\nexport { default as Lightbox } from \"./Lightbox\";\nexport type { LoadMoreProps } from \"./LoadMore\";\nexport { LoadMore } from \"./LoadMore\";\nexport type { LogTableEntry } from \"./LogEntriesTable\";\nexport { default as LogEntriesTable } from \"./LogEntriesTable\";\nexport { MapAttribution } from \"./MapAttribution\";\nexport {\n MapDialog,\n type MapDialogFact,\n type MapDialogMapView,\n type MapDialogMenuItem,\n type MapDialogProps,\n type MapPlace,\n type MapPlaceLink,\n type MapPlaceSource,\n} from \"./MapDialog\";\nexport { MAP_DIALOG_PARAM, MapTile, type MapTileProps, mapDialogOptions } from \"./MapTile\";\nexport { MapView } from \"./MapView\";\nexport { MapViewFrame } from \"./MapViewFrame\";\nexport { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from \"./MarkdownView\";\nexport { type MatchRange, MatchText, type MatchTextProps, matchParts } from \"./MatchText\";\nexport type {\n MessageEventGroupProps,\n MessageEventRowProps,\n MessageGroupEntry,\n MessageRowAction,\n MessageRowAttachment,\n MessageRowAuthor,\n MessageRowFile,\n MessageRowMedia,\n MessageRowOrigin,\n MessageRowProgress,\n MessageRowProps,\n MessageRowQuote,\n MessageRowReaction,\n MessageRowStatus,\n MessageRowThread,\n MessageSystemRowProps,\n} from \"./MessageRow\";\nexport { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from \"./MessageRow\";\nexport { type GeoNavigationPlatform, geoNavigationHref, geoNavigationPlatform } from \"./map-navigation\";\nexport { type MapPaletteColors, type MapTheme, mapPalette } from \"./map-palette\";\nexport { type MapStyleOptions, mapAttribution, mapStyle } from \"./map-style\";\nexport { MAP_SNAPSHOT_MAX_PIXELS, MapSnapshotError, type MapSnapshotErrorCode } from \"./map-view-snapshot\";\nexport type {\n MapViewArea,\n MapViewFit,\n MapViewFrameProps,\n MapViewHandle,\n MapViewLine,\n MapViewLineTone,\n MapViewMarker,\n MapViewOwnLocation,\n MapViewPoint,\n MapViewProps,\n MapViewSnapshot,\n MapViewSnapshotOptions,\n MapViewStyle,\n MapViewStyleSource,\n MapViewTone,\n} from \"./map-view-types\";\nexport {\n MARKDOWN_CALLOUT_CLASSES,\n MARKDOWN_CALLOUT_ICON_ATTRIBUTES,\n type MarkdownInfoBlock,\n type MarkdownInfoBlockRenderInput,\n type MarkdownInfoBlockType,\n markdownInfoBlocks,\n renderMarkdownInfoBlock,\n scanMarkdownInfoBlock,\n} from \"./markdown-info-blocks\";\nexport {\n type MarkdownLinkInput,\n type MarkdownReference,\n type MarkdownReferenceKind,\n type MarkdownReferenceType,\n markdownLinkReference,\n markdownReferenceIcon,\n markdownReferenceType,\n markdownReferenceTypeLabel,\n markStandaloneLinks,\n renderMarkdownLink,\n} from \"./markdown-links\";\nexport { Pagination, type PaginationProps } from \"./Pagination\";\nexport { PdfThumbnails, type PdfThumbnailsProps } from \"./PdfThumbnails\";\nexport type { PdfViewerProps, PdfViewerRequest } from \"./PdfViewer\";\nexport { default as PdfViewer } from \"./PdfViewer\";\nexport { ProgressPath, type ProgressPathProps, type ProgressPathStep } from \"./ProgressPath\";\nexport type { RangeOption, RangePickerProps } from \"./RangePicker\";\nexport { default as RangePicker } from \"./RangePicker\";\nexport { ReactionBar, type ReactionBarItem, type ReactionBarProps } from \"./ReactionBar\";\nexport type {\n ReferenceChipObjectProps,\n ReferenceChipPersonProps,\n ReferenceChipProps,\n ReferenceChipTimeProps,\n} from \"./ReferenceChip\";\nexport { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from \"./ReferenceChip\";\nexport {\n type RunEntry,\n type RunLevel,\n RunLog,\n type RunLogAction,\n type RunLogEntry,\n type RunLogProps,\n type RunLogState,\n type RunStepEntry,\n} from \"./RunLog\";\nexport type { StepsProps } from \"./Steps\";\nexport { Steps } from \"./Steps\";\nexport type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from \"./StructuredDataPreview\";\nexport { default as StructuredDataPreview, isStructuredDataValue } from \"./StructuredDataPreview\";\nexport { ThumbnailStrip, type ThumbnailStripItem, type ThumbnailStripProps } from \"./ThumbnailStrip\";\nexport type { TimelineColor, TimelineController, TimelineItem, TimelineProps } from \"./Timeline\";\nexport { default as Timeline } from \"./Timeline\";\nexport { VideoPlayer, type VideoPlayerProps } from \"./VideoPlayer\";\nexport type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from \"./VirtualFeed\";\nexport { VirtualFeed } from \"./VirtualFeed\";\nexport type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from \"./ZoomPanViewport\";\nexport { ZoomPanViewport } from \"./ZoomPanViewport\";\n"],"mappings":"AACA,SAEE,YAAY,EAMZ,YAAY,EAGZ,kBAAkB,QACb,gBAAgB;AACvB,SAAS,cAAc,QAAkC,kBAAkB;AAsB3E,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAGhD,SAAS,OAAO,IAAI,KAAK,QAAQ,SAAS;AAE1C,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,qBAAqB,QAAQ,yBAAyB;AAC/D,SAAS,mBAAmB,QAAuC,uBAAuB;AAC1F,SAAS,iBAAiB,QAAQ,qBAAqB;AAEvD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAA2B,iBAAiB,QAAQ,gBAAgB;AAUpE,SAAS,mBAAmB,QAAQ,kBAAkB;AAGtD,SAAS,oBAAoB,QAAQ,kBAAkB;AASvD,SAAS,YAAY,QAAQ,kBAAkB;AAC/C,SAAmC,yBA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E,qBAAqB,QAAQ,kBAAkB;AACvG,SAA+C,UAAU,QAAQ,eAAe;AAChF,SAA+B,cAAc,EAAE,QAAQ,QAAQ,aAAa;AAC5E,SAAS,uBAAuB,EAAE,gBAAgB,QAAmC,qBAAqB;AAkB1G,SACE,wBAAwB,EACxB,gCAAgC,EAIhC,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,QAChB,wBAAwB;AAC/B,SAKE,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,QACb,kBAAkB;AACzB,SAAS,UAAU,QAA8B,cAAc;AAC/D,SAAS,aAAa,QAAiC,iBAAiB;AAExE,SAAS,OAAO,IAAI,SAAS,QAAQ,aAAa;AAClD,SAAS,YAAY,QAAuD,gBAAgB;AAE5F,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAAS,WAAW,QAAqD,eAAe;AAOxF,SAAS,6BAA6B,EAAE,aAAa,EAAE,cAAc,QAAQ,iBAAiB;AAC9F,SAGE,MAAM,QAMD,UAAU;AAEjB,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,OAAO,IAAI,qBAAqB,EAAE,qBAAqB,QAAQ,yBAAyB;AACjG,SAAS,cAAc,QAA2D,kBAAkB;AAEpG,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAChD,SAAS,WAAW,QAA+B,eAAe;AAElE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["content/index.ts"],"sourcesContent":["export type { ChartDateFormat, ChartDatum, ChartDatumRole, ChartFormat, ChartNumberFormat } from \"../charts/core\";\nexport {\n type ActivityAction,\n type ActivityAvatar,\n ActivityCard,\n type ActivityCardProps,\n type ActivityDensity,\n type ActivityDialogInput,\n type ActivityEntry,\n type ActivityKind,\n ActivityList,\n type ActivityListProps,\n type ActivityRowProps,\n type ActivityTone,\n openActivityDialog,\n} from \"./ActivityList\";\nexport { BalanceSummary, type BalanceSummaryProps } from \"./BalanceSummary\";\nexport type {\n CalendarAttendee,\n CalendarCommand,\n CalendarController,\n CalendarCustomView,\n CalendarDayBadge,\n CalendarEvent,\n CalendarEventColor,\n CalendarEventLink,\n CalendarEventRenderContext,\n CalendarEventTimeChange,\n CalendarExternalDrag,\n CalendarLabels,\n CalendarProps,\n CalendarQuickCreateControls,\n CalendarRange,\n CalendarRecurrence,\n CalendarResource,\n CalendarSelectionControls,\n CalendarView,\n} from \"./Calendar\";\nexport { default as Calendar } from \"./Calendar\";\n\nexport type { ChartKind, ChartKindProps, ChartLabels, ChartProps, ChartRenderOptions } from \"./Chart\";\nexport { default as Chart } from \"./Chart\";\nexport type { ChartExplorerColumn, ChartExplorerProps, ChartFrameRequest, ChartLegendEntry } from \"./ChartExplorer\";\nexport { ChartExplorer } from \"./ChartExplorer\";\nexport type { ChartExplorerControlsProps } from \"./ChartExplorerControls\";\nexport { ChartExplorerControls } from \"./ChartExplorerControls\";\nexport { ChartFilterControls, type ChartFilterControlsProps } from \"./ChartFilterControls\";\nexport { ChartSnapshotView } from \"./ChartSnapshotView\";\nexport type { CodeDisplayLanguage, CodeDisplayProps } from \"./CodeDisplay\";\nexport { default as CodeDisplay } from \"./CodeDisplay\";\nexport { type ChartCursor, createChartCursor } from \"./chart-cursor\";\nexport type {\n ChartExplorerCharts,\n ChartExplorerController,\n ChartExplorerData,\n ChartExplorerOptions,\n ChartExplorerRequest,\n ChartExplorerRow,\n ChartExplorerSnapshot,\n} from \"./chart-explorer\";\nexport { createChartExplorer } from \"./chart-explorer\";\nexport type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from \"./chart-inspection-core\";\nexport type { ChartSnapshot } from \"./chart-snapshot\";\nexport { prepareChartSnapshot } from \"./chart-snapshot\";\nexport type {\n StateTimelineChartOptions,\n StateTimelineDomain,\n StateTimelineInterval,\n StateTimelineRow,\n StateTimelineState,\n} from \"./chart-state-timeline\";\nexport type { ChartTimeAxis } from \"./chart-time-axis\";\nexport { highlightSql } from \"./code-highlight\";\nexport { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from \"./collection-selection\";\nexport type {\n DataTableColumn,\n DataTableControlsProps,\n DataTableFooter,\n DataTableHeaderProps,\n DataTablePanelFooterProps,\n DataTablePanelProps,\n DataTableProps,\n DataTableRenderCell,\n DataTableRenderHeader,\n DataTableSort,\n} from \"./DataTable\";\nexport { default as DataTable } from \"./DataTable\";\nexport type { DataTableToolsProps, DataTableView, DataTableViewOptions } from \"./DataTableTools\";\nexport { createDataTableView, DataTableTools } from \"./DataTableTools\";\nexport type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from \"./Docs\";\nexport { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from \"./Docs\";\nexport type {\n DataTableColumnType,\n DataTableNumberFormat,\n DataTableStatusState,\n DataTableTypedColumn,\n} from \"./data-table-columns\";\nexport { filterRows, sortRows } from \"./data-table-columns\";\nexport { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from \"./FileBrowser\";\nexport { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from \"./FileGrid\";\nexport { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from \"./FileTree\";\nexport { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from \"./FileTypeIcon\";\nexport {\n default as FileView,\n type FileViewContent,\n type FileViewProps,\n type FileViewRenderer,\n type FileViewRendererProps,\n} from \"./FileView\";\nexport { FlowAmount, type FlowAmountDirection, type FlowAmountProps, flowDirection } from \"./FlowAmount\";\n// Choosing a renderer or labelling a size needs no renderer: these come from their own small module, so an app that only\n// asks which kind a file is, or how large, never loads FileView and its PDF, video and code dependencies.\nexport {\n canPreviewFile,\n type FileViewFile,\n type FileViewPreviewKind,\n formatFileViewSize,\n getFileViewPreviewKind,\n} from \"./file-view-preview\";\nexport type { KbdProps } from \"./Kbd\";\nexport { Kbd } from \"./Kbd\";\nexport type { LabelChipProps } from \"./LabelChip\";\nexport { LabelChip } from \"./LabelChip\";\nexport type { LightboxAction, LightboxItem, LightboxProps } from \"./Lightbox\";\nexport { default as Lightbox } from \"./Lightbox\";\nexport type { LoadMoreProps } from \"./LoadMore\";\nexport { LoadMore } from \"./LoadMore\";\nexport type { LogTableEntry } from \"./LogEntriesTable\";\nexport { default as LogEntriesTable } from \"./LogEntriesTable\";\nexport { MapAttribution } from \"./MapAttribution\";\nexport {\n MapDialog,\n type MapDialogFact,\n type MapDialogMapView,\n type MapDialogMenuItem,\n type MapDialogProps,\n type MapPlace,\n type MapPlaceLink,\n type MapPlaceSource,\n} from \"./MapDialog\";\nexport { MAP_DIALOG_PARAM, MapTile, type MapTileProps, mapDialogOptions } from \"./MapTile\";\nexport { MapView } from \"./MapView\";\nexport { MapViewFrame } from \"./MapViewFrame\";\nexport { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from \"./MarkdownView\";\nexport { type MatchRange, MatchText, type MatchTextProps, matchParts } from \"./MatchText\";\nexport type {\n MessageEventGroupProps,\n MessageEventRowProps,\n MessageGroupEntry,\n MessageRowAction,\n MessageRowAttachment,\n MessageRowAuthor,\n MessageRowFile,\n MessageRowMedia,\n MessageRowOrigin,\n MessageRowProgress,\n MessageRowProps,\n MessageRowQuote,\n MessageRowReaction,\n MessageRowStatus,\n MessageRowThread,\n MessageSystemRowProps,\n} from \"./MessageRow\";\nexport { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from \"./MessageRow\";\nexport { type GeoNavigationPlatform, geoNavigationHref, geoNavigationPlatform } from \"./map-navigation\";\nexport { type MapPaletteColors, type MapTheme, mapPalette } from \"./map-palette\";\nexport { type MapStyleOptions, mapAttribution, mapStyle } from \"./map-style\";\nexport { MAP_SNAPSHOT_MAX_PIXELS, MapSnapshotError, type MapSnapshotErrorCode } from \"./map-view-snapshot\";\nexport type {\n MapViewArea,\n MapViewFit,\n MapViewFrameProps,\n MapViewHandle,\n MapViewLine,\n MapViewLineTone,\n MapViewMarker,\n MapViewOwnLocation,\n MapViewPoint,\n MapViewProps,\n MapViewSnapshot,\n MapViewSnapshotOptions,\n MapViewStyle,\n MapViewStyleSource,\n MapViewTone,\n} from \"./map-view-types\";\nexport {\n MARKDOWN_CALLOUT_CLASSES,\n MARKDOWN_CALLOUT_ICON_ATTRIBUTES,\n type MarkdownInfoBlock,\n type MarkdownInfoBlockRenderInput,\n type MarkdownInfoBlockType,\n markdownInfoBlocks,\n renderMarkdownInfoBlock,\n scanMarkdownInfoBlock,\n} from \"./markdown-info-blocks\";\nexport {\n type MarkdownLinkInput,\n type MarkdownReference,\n type MarkdownReferenceKind,\n type MarkdownReferenceType,\n markdownLinkReference,\n markdownReferenceIcon,\n markdownReferenceType,\n markdownReferenceTypeLabel,\n markStandaloneLinks,\n renderMarkdownLink,\n} from \"./markdown-links\";\nexport { Pagination, type PaginationProps } from \"./Pagination\";\nexport { PdfThumbnails, type PdfThumbnailsProps } from \"./PdfThumbnails\";\nexport type { PdfViewerProps, PdfViewerRequest } from \"./PdfViewer\";\nexport { default as PdfViewer } from \"./PdfViewer\";\nexport { ProgressPath, type ProgressPathProps, type ProgressPathStep } from \"./ProgressPath\";\nexport type { RangeOption, RangePickerProps } from \"./RangePicker\";\nexport { default as RangePicker } from \"./RangePicker\";\nexport { ReactionBar, type ReactionBarItem, type ReactionBarProps } from \"./ReactionBar\";\nexport type {\n ReferenceChipObjectProps,\n ReferenceChipPersonProps,\n ReferenceChipProps,\n ReferenceChipTimeProps,\n} from \"./ReferenceChip\";\nexport { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from \"./ReferenceChip\";\nexport {\n type RunEntry,\n type RunLevel,\n RunLog,\n type RunLogAction,\n type RunLogEntry,\n type RunLogProps,\n type RunLogState,\n type RunStepEntry,\n} from \"./RunLog\";\nexport type { StepsProps } from \"./Steps\";\nexport { Steps } from \"./Steps\";\nexport type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from \"./StructuredDataPreview\";\nexport { default as StructuredDataPreview, isStructuredDataValue } from \"./StructuredDataPreview\";\nexport { ThumbnailStrip, type ThumbnailStripItem, type ThumbnailStripProps } from \"./ThumbnailStrip\";\nexport type { TimelineColor, TimelineController, TimelineItem, TimelineProps } from \"./Timeline\";\nexport { default as Timeline } from \"./Timeline\";\nexport { VideoPlayer, type VideoPlayerProps } from \"./VideoPlayer\";\nexport type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from \"./VirtualFeed\";\nexport { VirtualFeed } from \"./VirtualFeed\";\nexport type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from \"./ZoomPanViewport\";\nexport { ZoomPanViewport } from \"./ZoomPanViewport\";\n"],"mappings":"AACA,SAGE,YAAY,EAMZ,YAAY,EAIZ,kBAAkB,QACb,gBAAgB;AACvB,SAAS,cAAc,QAAkC,kBAAkB;AAsB3E,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAGhD,SAAS,OAAO,IAAI,KAAK,QAAQ,SAAS;AAE1C,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,qBAAqB,QAAQ,yBAAyB;AAC/D,SAAS,mBAAmB,QAAuC,uBAAuB;AAC1F,SAAS,iBAAiB,QAAQ,qBAAqB;AAEvD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAA2B,iBAAiB,QAAQ,gBAAgB;AAUpE,SAAS,mBAAmB,QAAQ,kBAAkB;AAGtD,SAAS,oBAAoB,QAAQ,kBAAkB;AASvD,SAAS,YAAY,QAAQ,kBAAkB;AAC/C,SAAmC,yBAAyB,QAAiC,wBAAwB;AAarH,SAAS,OAAO,IAAI,SAAS,QAAQ,aAAa;AAElD,SAAS,mBAAmB,EAAE,cAAc,QAAQ,kBA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,SAAS,uBAAuB,EAAE,gBAAgB,QAAmC,qBAAqB;AAkB1G,SACE,wBAAwB,EACxB,gCAAgC,EAIhC,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,QAChB,wBAAwB;AAC/B,SAKE,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,QACb,kBAAkB;AACzB,SAAS,UAAU,QAA8B,cAAc;AAC/D,SAAS,aAAa,QAAiC,iBAAiB;AAExE,SAAS,OAAO,IAAI,SAAS,QAAQ,aAAa;AAClD,SAAS,YAAY,QAAuD,gBAAgB;AAE5F,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAAS,WAAW,QAAqD,eAAe;AAOxF,SAAS,6BAA6B,EAAE,aAAa,EAAE,cAAc,QAAQ,iBAAiB;AAC9F,SAGE,MAAM,QAMD,UAAU;AAEjB,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,OAAO,IAAI,qBAAqB,EAAE,qBAAqB,QAAQ,yBAAyB;AACjG,SAAS,cAAc,QAA2D,kBAAkB;AAEpG,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAChD,SAAS,WAAW,QAA+B,eAAe;AAElE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
|
|
@@ -63,12 +63,17 @@ const applyAccessibleName = (dialog, entry) => {
|
|
|
63
63
|
*/
|
|
64
64
|
let frameMotion;
|
|
65
65
|
let frameMotionLoading;
|
|
66
|
-
const loadFrameMotion = (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
66
|
+
const loadFrameMotion = (state, announced) => {
|
|
67
|
+
const arrived = () => frameMotion?.connectFrameMotion(state, announced);
|
|
68
|
+
if (frameMotion) return arrived();
|
|
69
|
+
frameMotionLoading ??= import("./dialog-frame-motion").then(module => {
|
|
70
|
+
frameMotion = module;
|
|
71
|
+
}, () => {
|
|
72
|
+
// A failed chunk request may succeed on the next open.
|
|
73
|
+
frameMotionLoading = undefined;
|
|
74
|
+
});
|
|
75
|
+
void frameMotionLoading.then(arrived);
|
|
76
|
+
};
|
|
72
77
|
const schedule = callback => {
|
|
73
78
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(callback);else queueMicrotask(callback);
|
|
74
79
|
};
|
|
@@ -347,7 +352,6 @@ export const createDialogCore = () => {
|
|
|
347
352
|
// Each stack level carries its own palette, independently of the first opener.
|
|
348
353
|
getK2bPortalRoot(undefined, document.body).appendChild(element);
|
|
349
354
|
state.element = element;
|
|
350
|
-
void loadFrameMotion();
|
|
351
355
|
return element;
|
|
352
356
|
};
|
|
353
357
|
const lockPageScroll = () => {
|
|
@@ -372,8 +376,8 @@ export const createDialogCore = () => {
|
|
|
372
376
|
if (dialog.className !== entry.panelClassName) dialog.className = entry.panelClassName;
|
|
373
377
|
applyUiScope(dialog, entry.uiScope);
|
|
374
378
|
const position = entry.position;
|
|
379
|
+
if (position || dialog.style.position) dialog.style.inset = position ? `${position.y}px auto auto ${position.x}px` : "";
|
|
375
380
|
dialog.style.position = position ? "fixed" : "";
|
|
376
|
-
dialog.style.inset = position ? `${position.y}px auto auto ${position.x}px` : "";
|
|
377
381
|
dialog.style.margin = position ? "0" : "";
|
|
378
382
|
dialog.style.transform = position ? "none" : "";
|
|
379
383
|
dialog.dataset.modeless = String(!entry.modal);
|
|
@@ -443,18 +447,6 @@ export const createDialogCore = () => {
|
|
|
443
447
|
}
|
|
444
448
|
};
|
|
445
449
|
|
|
446
|
-
/** A level that replaces another says its name; before the module has loaded, as soon as it has, if it still shows. */
|
|
447
|
-
const announceLevel = entry => {
|
|
448
|
-
if (state.motion) state.motion.announce(entry.role);else {
|
|
449
|
-
const element = state.element;
|
|
450
|
-
void loadFrameMotion().then(() => {
|
|
451
|
-
if (!element || state.element !== element || state.stack.at(-1) !== entry || !frameMotion) return;
|
|
452
|
-
state.motion ??= frameMotion.createFrameMotion(element);
|
|
453
|
-
state.motion.announce(entry.role);
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
|
|
458
450
|
/** Closes the shown level. `below` are the levels under it that close with it (lowest last): they leave with the frame. */
|
|
459
451
|
const popTop = (result, below = []) => {
|
|
460
452
|
const top = state.stack.pop();
|
|
@@ -479,8 +471,8 @@ export const createDialogCore = () => {
|
|
|
479
471
|
applyPresentation(previous);
|
|
480
472
|
applyAccessibleName(dialog, previous);
|
|
481
473
|
applyCancelBehavior(dialog, () => void requestDismiss(previous), previous.cancelBehavior);
|
|
482
|
-
if (motion) motion.arrive(previous.container, discard);else discard();
|
|
483
|
-
|
|
474
|
+
if (motion) motion.arrive(previous.container, discard, previous.follow);else discard();
|
|
475
|
+
loadFrameMotion(state, previous);
|
|
484
476
|
schedule(() => {
|
|
485
477
|
if (!focusUnclaimed(dialog)) return;
|
|
486
478
|
if (top.opener?.isConnected) returnFocus(top.opener, top.openerRing);else resolveInitialFocusTarget(previous, dialog)?.focus();
|
|
@@ -569,7 +561,6 @@ export const createDialogCore = () => {
|
|
|
569
561
|
// A dialog that waited for history while islands were disposed would open over content it was never meant for.
|
|
570
562
|
if (disposals !== requested) return Promise.resolve(undefined);
|
|
571
563
|
const dialog = ensureDialogElement();
|
|
572
|
-
if (!state.motion && frameMotion) state.motion = frameMotion.createFrameMotion(dialog);
|
|
573
564
|
listen();
|
|
574
565
|
const previousTop = state.stack[state.stack.length - 1];
|
|
575
566
|
// The shown level fades out while the new one replaces it in the same frame; it is hidden once it has faded.
|
|
@@ -596,7 +587,8 @@ export const createDialogCore = () => {
|
|
|
596
587
|
ariaLabel: options.ariaLabel,
|
|
597
588
|
ariaDescribedBy: options.ariaDescribedBy,
|
|
598
589
|
role: options.role ?? "dialog",
|
|
599
|
-
modal: true
|
|
590
|
+
modal: true,
|
|
591
|
+
follow: options.followContent
|
|
600
592
|
};
|
|
601
593
|
return new Promise((resolve, reject) => {
|
|
602
594
|
const abort = () => {
|
|
@@ -640,7 +632,10 @@ export const createDialogCore = () => {
|
|
|
640
632
|
},
|
|
641
633
|
setPosition: position => {
|
|
642
634
|
if (position && (!Number.isFinite(position.x) || !Number.isFinite(position.y))) return;
|
|
643
|
-
entry.position
|
|
635
|
+
if (state.stack[state.stack.length - 1] === entry && state.motion?.position(entry.position, position) === false) return;
|
|
636
|
+
entry.position = position ? {
|
|
637
|
+
...position
|
|
638
|
+
} : null;
|
|
644
639
|
applyPresentation(entry);
|
|
645
640
|
},
|
|
646
641
|
requestDismiss: () => requestDismiss(entry),
|
|
@@ -662,8 +657,8 @@ export const createDialogCore = () => {
|
|
|
662
657
|
const hide = () => {
|
|
663
658
|
previousTop.container.style.display = "none";
|
|
664
659
|
};
|
|
665
|
-
if (state.motion) state.motion.arrive(container, hide);else hide();
|
|
666
|
-
|
|
660
|
+
if (state.motion) state.motion.arrive(container, hide, entry.follow);else hide();
|
|
661
|
+
loadFrameMotion(state, entry);
|
|
667
662
|
}
|
|
668
663
|
if (state.stack.length === 1) {
|
|
669
664
|
// The native dialog returns focus to the element focused when it
|
|
@@ -679,6 +674,8 @@ export const createDialogCore = () => {
|
|
|
679
674
|
if (entry.modal) dialog.showModal();else dialog.show();
|
|
680
675
|
} else dialog.setAttribute("open", "");
|
|
681
676
|
observeConnection();
|
|
677
|
+
// Only opted-in levels follow content; the first open itself does not animate.
|
|
678
|
+
loadFrameMotion(state);
|
|
682
679
|
}
|
|
683
680
|
options.signal?.addEventListener("abort", abort, {
|
|
684
681
|
once: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["feedback/dialog-core.ts"],"sourcesContent":["import { createComponent, type JSX } from \"solid-js\";\nimport { render } from \"solid-js/web\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { getK2bPortalRoot } from \"../internal/portal\";\nimport { applyUiScope, readUiScope } from \"../internal/portal-scope\";\nimport { RenderErrorBoundary } from \"../internal/render-error\";\nimport { keepScroll, restoreScroll } from \"../internal/scroll-places\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport type { FrameMotion } from \"./dialog-frame-motion\";\nimport { isPointInsideToast } from \"./toast-hit\";\n\nexport type DialogClose<T> = (result?: T) => void;\n\nexport type OpenDialogOptions = {\n /** Override the opener's primary palette for a dialog with its own purpose, such as a global session warning. */\n primary?: \"blue\" | \"ai\";\n /** Close only this dialog when its owning operation is cancelled. */\n signal?: AbortSignal;\n panelClassName?: string;\n contentClassName?: string;\n initialFocus?: \"first-input\" | \"none\" | ((dialog: HTMLDialogElement) => HTMLElement | null);\n cancelBehavior?: \"resolve-undefined\" | \"ignore\";\n ariaLabel?: string;\n ariaDescribedBy?: string;\n /** Use for a consequential confirmation that requires a response. Defaults to dialog. */\n role?: \"dialog\" | \"alertdialog\";\n /**\n * Add a same-URL history entry while the dialog is open, so the browser's or the phone's Back closes the dialog\n * instead of leaving the page. Normally closing the dialog removes the entry again; the returned promise settles after that.\n * With the Navigation API, same-URL traversals between this core's entries and the page do not reach application popstate listeners.\n * Without it, only the synthetic Back on close is suppressed.\n * Island disposal closes every open dialog immediately and forgets its marker without traversing history.\n * The same-URL entry remains for the router to replace and counts as a page entry for later dialogs.\n * A traversal that `@k2b/ssr/nav` hides from popstate listeners reaches this core through `ssr:nav-popstate`.\n */\n history?: boolean;\n /**\n * With `history`, the URL of the dialog's own entry, such as the page URL with a query parameter that names the\n * dialog. Closing returns to the entry below with its own URL. A reload on that entry keeps the URL; opening a\n * dialog with the same `historyUrl` then resumes the entry instead of adding another above it.\n */\n historyUrl?: string;\n};\n\nexport type DialogRender<T> = (\n close: DialogClose<T>,\n context: {\n dialog: HTMLDialogElement;\n /** Switch this entry between a modal and a modeless window without remounting. */\n setModal: (modal: boolean) => void;\n /** Set viewport coordinates, or restore the panel stylesheet position with null. */\n setPosition: (position: { x: number; y: number } | null) => void;\n /** Route Escape/backdrop through the same guarded handler as Cancel and X. */\n setDismissHandler: (handler: () => void | Promise<void>) => void;\n /** Request dismissal through this entry's cancellation policy and guard. */\n requestDismiss: () => Promise<void>;\n },\n) => JSX.Element;\n\nexport type DialogCore = {\n open: <T>(view: DialogRender<T>, options?: OpenDialogOptions) => Promise<T | undefined>;\n close: (result?: unknown) => void;\n isOpen: () => boolean;\n};\n\ntype DialogStackEntry = {\n uiScope: ReturnType<typeof readUiScope>;\n container: HTMLDivElement;\n dispose?: () => void;\n resolve?: (value: unknown) => void;\n panelClassName: string;\n cancelBehavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>;\n initialFocus: NonNullable<OpenDialogOptions[\"initialFocus\"]>;\n opener?: HTMLElement;\n openerRing: boolean;\n ariaLabel?: string;\n ariaDescribedBy?: string;\n role: \"dialog\" | \"alertdialog\";\n dismissHandler?: () => void | Promise<void>;\n dismissPending?: boolean;\n modal: boolean;\n position?: { x: number; y: number } | null;\n /** The marker of this dialog's history entry, for dialogs opened with `history`. */\n historyId?: number;\n};\n\ntype DialogState = {\n element?: HTMLDialogElement;\n /** The size and content motion of the open frame while levels replace each other. */\n motion?: FrameMotion;\n modal?: boolean;\n stack: DialogStackEntry[];\n scrollLocked?: boolean;\n previousBodyOverflow?: string;\n previousHtmlOverflow?: string;\n mouseDownOnDialog?: boolean;\n connectionObserver?: MutationObserver;\n};\n\nconst DEFAULT_PANEL_CLASS = \"k2b-dialog\";\nconst DEFAULT_CONTENT_CLASS = \"k2b-dialog__viewport\";\n/** The frame of a dialog whose content could not render: a custom or bare surface may draw no frame of its own. */\nconst RENDER_ERROR_PANEL_CLASS = \"k2b-dialog k2b-dialog--small\";\nlet nextDialogTitleId = 0;\nlet nextHistoryId = 0;\n/** The history state key that marks a dialog's same-URL entry. */\nconst HISTORY_MARKER = \"k2bDialog\";\n\nconst historyRecord = (): Record<string, unknown> =>\n typeof history.state === \"object\" && history.state !== null ? { ...history.state } : {};\nconst historyMarker = (): unknown => historyRecord()[HISTORY_MARKER];\nconst historySnapshot = () => ({ href: location.href, length: history.length });\n\nconst resolveInitialFocusTarget = (entry: DialogStackEntry, dialog: HTMLDialogElement): HTMLElement | null => {\n const { initialFocus } = entry;\n if (initialFocus === \"none\") return null;\n if (typeof initialFocus === \"function\") return initialFocus(dialog);\n const input = entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role='combobox']:not([disabled]):not([aria-disabled='true'])\",\n );\n return (\n input ??\n entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([tabindex='-1'])\",\n )\n );\n};\n\nconst applyAccessibleName = (dialog: HTMLDialogElement, entry: DialogStackEntry): void => {\n dialog.setAttribute(\"role\", entry.role);\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n dialog.removeAttribute(\"aria-describedby\");\n // A toned dialog names its tone in a hidden word that describes the dialog, so its heading keeps the title alone.\n const tone = entry.container.querySelector<HTMLElement>(\"[data-dialog-tone-label]\");\n if (tone) tone.id ||= `k2b-dialog-tone-${++nextDialogTitleId}`;\n const describedBy = [entry.ariaDescribedBy, tone?.id].filter(Boolean).join(\" \");\n if (describedBy) dialog.setAttribute(\"aria-describedby\", describedBy);\n if (entry.ariaLabel) {\n dialog.setAttribute(\"aria-label\", entry.ariaLabel);\n return;\n }\n const heading = entry.container.querySelector<HTMLElement>(\"h1, h2, h3\");\n if (!heading) {\n dialog.setAttribute(\"aria-label\", resolveUiMessages().dialog);\n return;\n }\n heading.id ||= `k2b-dialog-title-${++nextDialogTitleId}`;\n dialog.setAttribute(\"aria-labelledby\", heading.id);\n};\n\n/**\n * The exit fade and the level change (morph, announcement) load in one module when the first dialog opens, so islands\n * that open dialogs do not carry them in their first bundle. Nothing waits for it: a dialog that closes before it\n * arrived leaves at once, a level that replaces another changes at once (with its scroll places kept) and says its name\n * as soon as the module is there.\n */\nlet frameMotion: typeof import(\"./dialog-frame-motion\") | undefined;\nlet frameMotionLoading: Promise<void> | undefined;\nconst loadFrameMotion = (): Promise<void> =>\n (frameMotionLoading ??= import(\"./dialog-frame-motion\").then(\n (module) => {\n frameMotion = module;\n },\n () => {\n // A failed chunk request may succeed on the next open.\n frameMotionLoading = undefined;\n },\n ));\n\nconst schedule = (callback: () => void): void => {\n if (typeof requestAnimationFrame === \"function\") requestAnimationFrame(callback);\n else queueMicrotask(callback);\n};\n\n/**\n * Whether focus is still where closing a level left it, on the page or the\n * dialog: nothing took it before the next frame, neither a close handler nor a\n * Tab pressed right after Escape.\n */\nconst focusUnclaimed = (dialog: HTMLDialogElement): boolean => {\n const active = document.activeElement;\n return !active || active === document.body || active === dialog;\n};\n\n/** Checked by shape: a test harness or an iframe may create the event in another realm. */\nconst isPopState = (value: unknown): value is PopStateEvent =>\n typeof value === \"object\" && value !== null && \"type\" in value && value.type === \"popstate\" && \"state\" in value;\n\ntype HistoryEntry = { historyId?: number };\ntype HistoryHolder = HistoryEntry & { onBack: () => void };\n\nexport const createDialogCore = () => {\n const state: DialogState = { stack: [] };\n /** Markers of this core's entries in the browser history, oldest first. */\n let historyIds: number[] = [];\n const issued = new Set<number>();\n /**\n * Markers forgotten during island disposal. Their entries stay in `historyIds` as barriers: a synthetic Back never\n * crosses one, because the router may have replaced that entry with another page.\n */\n const forgotten = new Set<number>();\n const deadMarker = (marker: unknown): marker is number => typeof marker === \"number\" && forgotten.has(marker);\n /** How often islands were disposed, so a dialog that waits to open notices that a content swap happened meanwhile. */\n let disposals = 0;\n const ownMarker = (marker: unknown): marker is number => typeof marker === \"number\" && issued.has(marker);\n /** The address of each own entry that a dialog named with `historyUrl`. */\n const ownUrls = new Map<number, string>();\n let seen: ReturnType<typeof historySnapshot> | undefined;\n let traversalFrom: { href: string; marker: unknown } | undefined;\n let syntheticFrom: { href: string; marker: unknown } | undefined;\n const historyHolders = new Set<HistoryHolder>();\n let historySyncScheduled = false;\n let disposingIslands = false;\n /** Settles when the synthetic Back that removes closed dialogs' entries has arrived. */\n let returning: Promise<void> | undefined;\n let resolveReturning: (() => void) | undefined;\n /** Ends the fade-out of the frame whose last level closed: its content stays until the frame has left. */\n let leaving: (() => void) | undefined;\n const endLeaving = () => leaving?.();\n\n /** Outside island disposal, closed entries leave with one Back to the newest live dialog or holder, or to the page. */\n const syncHistory = () => {\n if (returning) {\n void returning.then(() => {\n if (historySyncScheduled) syncHistory();\n });\n return;\n }\n historySyncScheduled = false;\n const openIds = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n const current = historyIds.at(-1);\n let steps = 0;\n while (historyIds.length > 0 && !openIds.has(historyIds.at(-1)) && !deadMarker(historyIds.at(-1))) {\n historyIds.pop();\n steps++;\n }\n // Someone else moved the history meanwhile; leave it alone.\n if (steps === 0 || historyMarker() !== current || location.href !== seen?.href || history.length !== seen?.length) return;\n const back = new Promise<void>((resolve) => {\n resolveReturning = resolve;\n });\n returning = back;\n void back.then(() => {\n if (returning === back) returning = undefined;\n });\n syntheticFrom = { href: location.href, marker: current };\n history.go(-steps);\n };\n\n const releaseHistory = (entry: HistoryEntry) => {\n if (entry.historyId === undefined) return;\n // During a content swap the router owns history. Forget the marker without moving history; its entry stays a\n // barrier for later synthetic Backs and is left for the router to replace.\n if (disposingIslands) {\n issued.delete(entry.historyId);\n forgotten.add(entry.historyId);\n entry.historyId = undefined;\n return;\n }\n if (historySyncScheduled) return;\n historySyncScheduled = true;\n queueMicrotask(syncHistory);\n };\n\n /** Traversals this core already handled: a page swap router also reports the ones it hides from listeners. */\n const handled = new WeakSet<PopStateEvent>();\n /** Back or Forward moved to another entry: close dialogs and holders opened after the one it shows. */\n const onPopState = (event: PopStateEvent) => {\n if (handled.has(event)) return;\n handled.add(event);\n const resolveBack = resolveReturning;\n // Without the Navigation API, only our synthetic Back has a known departure.\n const from = typeof navigation !== \"undefined\" ? traversalFrom : resolveBack ? syntheticFrom : undefined;\n traversalFrom = undefined;\n syntheticFrom = undefined;\n resolveReturning = undefined;\n try {\n const marker = historyMarker();\n // A dialog's own address (`historyUrl`) changes only between its entry and the page: still a dialog-only traversal.\n const ownAddress = (entry: unknown, href: string) => ownMarker(entry) && ownUrls.get(entry) === href;\n const sameAddress = from && (from.href === location.href || ownAddress(from.marker, from.href) || ownAddress(marker, location.href));\n if (from && sameAddress && from.marker !== marker && (ownMarker(from.marker) || ownMarker(marker))) {\n event.stopImmediatePropagation();\n }\n // Own entries are ordered by id. A retired entry reached by Forward stays tracked, so closing the dialogs\n // beneath it also removes it. A forgotten entry keeps the holders opened before it and stays a barrier.\n historyIds = ownMarker(marker) || deadMarker(marker) ? [...historyIds.filter((id) => id < marker), marker] : [];\n const gone = (entry: DialogStackEntry) => entry.historyId !== undefined && !historyIds.includes(entry.historyId);\n while (state.stack.some(gone)) popTop(undefined);\n for (const holder of [...historyHolders].reverse()) {\n if (holder.historyId === undefined || historyIds.includes(holder.historyId)) continue;\n historyHolders.delete(holder);\n releaseHistory(holder);\n holder.onBack();\n }\n } finally {\n seen = historySnapshot();\n resolveBack?.();\n }\n };\n\n /**\n * Island disposal means the page content changes, as a document load would. Every dialog closes, top first, whichever\n * code opened it: which island calls open() is not knowable after an await, in onMount or from a timer, and a modal\n * left over the new content would block it.\n */\n const onIslandDispose = () => {\n if (!disposingIslands) {\n disposingIslands = true;\n queueMicrotask(() => {\n disposingIslands = false;\n });\n // Entries released just before, whose Back has not started yet, stay as well: the router owns history now.\n // A Back already on its way still settles through `returning`.\n historySyncScheduled = false;\n const live = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n for (const id of historyIds) {\n if (live.has(id) || !issued.delete(id)) continue;\n forgotten.add(id);\n }\n }\n disposals++;\n while (state.stack.length > 0) popTop(undefined);\n // New page content: a frame still fading out leaves at once, as if the document were replaced.\n endLeaving();\n };\n\n /** `@k2b/ssr/nav` stops a traversal to another server page before later listeners and reports it here. */\n const onHiddenPopState = (event: Event) => {\n const detail: unknown = \"detail\" in event ? event.detail : undefined;\n if (isPopState(detail)) onPopState(detail);\n };\n const onNavigate = (event: NavigateEvent) => {\n if (event.navigationType === \"traverse\") traversalFrom = { href: location.href, marker: historyMarker() };\n };\n /** The window whose history this core listens to; a test harness may replace the window between dialogs. */\n let listening: { window: Window; navigation?: Navigation } | undefined;\n const listen = () => {\n if (listening?.window === window) return;\n listening?.window.removeEventListener(\"popstate\", onPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n listening?.navigation?.removeEventListener(\"navigate\", onNavigate);\n window.addEventListener(\"popstate\", onPopState, { capture: true });\n window.addEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n // Capture opens the disposal window before target listeners can release history holders.\n window.addEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n const current = typeof navigation !== \"undefined\" ? navigation : undefined;\n current?.addEventListener(\"navigate\", onNavigate);\n listening = { window, navigation: current };\n };\n // Chromium runs a window's popstate listeners in the order they were added, capture or not. The shared core is\n // created before islands mount and add their navigation listeners, so it listens from the start.\n if (typeof window !== \"undefined\") listen();\n\n /** Returns whether the dialog's own address already was the page's address: a reload or a shared link brought it. */\n const pushHistory = (entry: HistoryEntry, url?: string): boolean => {\n listen();\n const previous = historyRecord();\n // A reload or Forward never brings back a dialog or its sensitive transient state.\n const stale = historyIds.length === 0 && previous[HISTORY_MARKER] !== undefined;\n if (stale) delete previous[HISTORY_MARKER];\n entry.historyId = ++nextHistoryId;\n issued.add(entry.historyId);\n historyIds.push(entry.historyId);\n // Only a dialog that names itself in the URL resumes the entry a reload left behind; the page entry stays below.\n const here = url !== undefined && new URL(url, location.href).href === location.href;\n const resume = stale && here;\n if (resume) history.replaceState({ ...previous, [HISTORY_MARKER]: entry.historyId }, \"\");\n else {\n if (stale) history.replaceState(previous, \"\");\n history.pushState({ ...previous, [HISTORY_MARKER]: entry.historyId }, \"\", url);\n }\n if (url !== undefined) ownUrls.set(entry.historyId, location.href);\n seen = historySnapshot();\n return here;\n };\n\n /** Internal non-dialog participation in the same history stack. Releasing never calls onBack. */\n const holdHistory = (onBack: () => void): (() => void) => {\n const holder: HistoryHolder = { onBack };\n historyHolders.add(holder);\n const pushWhenReady = () => {\n if (!historyHolders.has(holder)) return;\n // Just like open(): remove closed entries before adding another one.\n if (historySyncScheduled) syncHistory();\n if (returning) void returning.then(pushWhenReady);\n else pushHistory(holder);\n };\n pushWhenReady();\n return () => {\n if (!historyHolders.delete(holder)) return;\n releaseHistory(holder);\n };\n };\n\n /**\n * Settles once released entries have left history or were forgotten during island disposal. A caller that navigates waits\n * for it, as a dialog's result waits: a Back still on its way would otherwise land behind the new entry.\n */\n const historySettled = async (): Promise<void> => {\n while (historySyncScheduled || returning) {\n if (!returning) syncHistory();\n if (returning) await returning;\n }\n };\n\n const ensureDialogElement = () => {\n // A frame that is still fading out ends now; the new dialog gets a frame of its own.\n endLeaving();\n // Reuse the shared element whenever it is still in the document. Resolving\n // the portal root first would create a second <dialog> when focus has moved\n // into another `.k2b-ui` scope, orphaning the levels already on the stack.\n if (state.element?.isConnected) return state.element;\n\n const element = document.createElement(\"dialog\");\n element.onclose = () => {\n // Repeated Escape can force a non-cancelable native close. A retained\n // entry (ignore, an async guard, or a parent) still owns the modal.\n const top = state.stack[state.stack.length - 1];\n if (state.element !== element || element.open || !top) return;\n if (top.modal) element.showModal();\n else element.show();\n resolveInitialFocusTarget(top, element)?.focus();\n };\n // Each stack level carries its own palette, independently of the first opener.\n getK2bPortalRoot(undefined, document.body).appendChild(element);\n state.element = element;\n void loadFrameMotion();\n return element;\n };\n\n const lockPageScroll = () => {\n if (typeof document === \"undefined\" || state.scrollLocked) return;\n state.previousBodyOverflow = document.body.style.overflow;\n state.previousHtmlOverflow = document.documentElement.style.overflow;\n document.body.style.overflow = \"hidden\";\n document.documentElement.style.overflow = \"hidden\";\n state.scrollLocked = true;\n };\n\n const unlockPageScroll = () => {\n if (typeof document === \"undefined\" || !state.scrollLocked) return;\n document.body.style.overflow = state.previousBodyOverflow ?? \"\";\n document.documentElement.style.overflow = state.previousHtmlOverflow ?? \"\";\n state.scrollLocked = false;\n state.previousBodyOverflow = undefined;\n state.previousHtmlOverflow = undefined;\n };\n\n const applyPresentation = (entry: DialogStackEntry) => {\n const dialog = state.element;\n if (!dialog || state.stack[state.stack.length - 1] !== entry) return;\n if (dialog.className !== entry.panelClassName) dialog.className = entry.panelClassName;\n applyUiScope(dialog, entry.uiScope);\n const position = entry.position;\n dialog.style.position = position ? \"fixed\" : \"\";\n dialog.style.inset = position ? `${position.y}px auto auto ${position.x}px` : \"\";\n dialog.style.margin = position ? \"0\" : \"\";\n dialog.style.transform = position ? \"none\" : \"\";\n dialog.dataset.modeless = String(!entry.modal);\n dialog.setAttribute(\"aria-modal\", String(entry.modal));\n if (dialog.open && state.modal !== entry.modal) {\n const active = document.activeElement;\n dialog.close();\n if (entry.modal) dialog.showModal();\n else dialog.show();\n if (active instanceof HTMLElement && active.isConnected && (!entry.modal || dialog.contains(active))) {\n active.focus({ preventScroll: true });\n } else resolveInitialFocusTarget(entry, dialog)?.focus({ preventScroll: true });\n }\n state.modal = entry.modal;\n if (entry.modal) lockPageScroll();\n else unlockPageScroll();\n };\n\n const modelessEscape = (event: KeyboardEvent) => {\n const top = state.stack[state.stack.length - 1];\n if (!top || top.modal || event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n event.preventDefault();\n void requestDismiss(top);\n };\n\n const stopConnectionObserver = () => {\n document.removeEventListener(\"keydown\", modelessEscape);\n state.connectionObserver?.disconnect();\n state.connectionObserver = undefined;\n };\n\n const applyCancelBehavior = (\n dialog: HTMLDialogElement,\n close: () => void,\n behavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>,\n ) => {\n dialog.oncancel = (event) => {\n if (behavior === \"ignore\") {\n event.preventDefault();\n return;\n }\n event.preventDefault();\n close();\n };\n dialog.onmousedown = (event) => {\n state.mouseDownOnDialog = event.target === dialog;\n };\n dialog.onclick = (event) => {\n const realBackdropClick = state.mouseDownOnDialog === true;\n state.mouseDownOnDialog = false;\n if (event.target !== dialog || !state.modal) return;\n if (!realBackdropClick) return;\n if (behavior === \"ignore\") return;\n if (isPointInsideToast(event.clientX, event.clientY)) return;\n close();\n };\n };\n\n const requestDismiss = async (entry: DialogStackEntry) => {\n if (state.stack[state.stack.length - 1] !== entry || entry.dismissPending || entry.cancelBehavior === \"ignore\") return;\n if (!entry.dismissHandler) {\n popTop(undefined);\n return;\n }\n entry.dismissPending = true;\n try {\n await entry.dismissHandler();\n } catch (error) {\n // A failed guard must never discard the dialog's state.\n console.error(\"Dialog dismissal failed\", error);\n } finally {\n entry.dismissPending = false;\n }\n };\n\n /** A level that replaces another says its name; before the module has loaded, as soon as it has, if it still shows. */\n const announceLevel = (entry: DialogStackEntry) => {\n if (state.motion) state.motion.announce(entry.role);\n else {\n const element = state.element;\n void loadFrameMotion().then(() => {\n if (!element || state.element !== element || state.stack.at(-1) !== entry || !frameMotion) return;\n state.motion ??= frameMotion.createFrameMotion(element);\n state.motion.announce(entry.role);\n });\n }\n };\n\n /** Closes the shown level. `below` are the levels under it that close with it (lowest last): they leave with the frame. */\n const popTop = (result?: unknown, below: DialogStackEntry[] = []) => {\n const top = state.stack.pop();\n if (!top) return;\n releaseHistory(top);\n const discard = () => {\n for (const entry of [top, ...below]) {\n entry.dispose?.();\n entry.container.remove();\n }\n };\n\n const dialog = state.element;\n const previous = state.stack[state.stack.length - 1];\n if (previous && dialog) {\n // The same morph as forward, backwards: the closed level fades out over the one below, which shows as it was.\n const motion = state.motion;\n // Back: the closed level moves before the shown one, which stays the dialog's last child.\n keepScroll(top.container, dialog);\n motion?.begin(top.container, true);\n previous.container.style.display = \"\";\n restoreScroll(previous.container);\n applyPresentation(previous);\n applyAccessibleName(dialog, previous);\n applyCancelBehavior(dialog, () => void requestDismiss(previous), previous.cancelBehavior);\n if (motion) motion.arrive(previous.container, discard);\n else discard();\n announceLevel(previous);\n schedule(() => {\n if (!focusUnclaimed(dialog)) return;\n if (top.opener?.isConnected) returnFocus(top.opener, top.openerRing);\n else resolveInitialFocusTarget(previous, dialog)?.focus();\n });\n } else if (dialog) {\n dialog.oncancel = null;\n dialog.onmousedown = null;\n dialog.onclick = null;\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n dialog.removeAttribute(\"aria-describedby\");\n // State and focus change now; the frame only fades out. It leaves the top layer and the page is usable at once.\n // From this moment it no longer acts as open: inert (no input, focus, drop or submit) and out of the\n // accessibility tree, so neither a person nor a query by role or name finds it; only its picture fades.\n // A level change still under way stops where the eye sees it; its closed levels are disposed after the fade.\n const endings = state.motion?.freeze();\n state.motion = undefined;\n dialog.inert = true;\n dialog.setAttribute(\"aria-hidden\", \"true\");\n if (dialog.open && typeof dialog.close === \"function\") dialog.close();\n else dialog.removeAttribute(\"open\");\n state.element = undefined;\n stopConnectionObserver();\n unlockPageScroll();\n let left = false;\n let finish: (() => void) | undefined;\n const remove = () => {\n left = true;\n if (finish && leaving === finish) leaving = undefined;\n endings?.();\n discard();\n dialog.remove();\n };\n if (frameMotion) finish = frameMotion.afterExitTransitions(dialog, remove);\n else remove();\n if (!left) leaving = finish;\n // After the Escape that closed it: WebKit lights the ring of whatever\n // that key press leaves focused.\n // Focus returns to where the whole dialog was opened from, not into a level that closed with it.\n const first = below.at(-1) ?? top;\n schedule(() => {\n if (first.opener?.isConnected && focusUnclaimed(dialog)) returnFocus(first.opener, first.openerRing);\n });\n } else discard();\n\n top.resolve?.(result);\n };\n\n const resetDisconnectedDialog = () => {\n if (state.stack.length === 0 || state.element?.isConnected) return;\n const entries = state.stack.splice(0);\n const dialog = state.element;\n state.motion?.stop();\n state.motion = undefined;\n state.element = undefined;\n stopConnectionObserver();\n dialog?.remove();\n unlockPageScroll();\n for (const entry of entries.reverse()) {\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n\n const observeConnection = () => {\n if (state.connectionObserver || typeof MutationObserver === \"undefined\") return;\n document.addEventListener(\"keydown\", modelessEscape);\n state.connectionObserver = new MutationObserver(resetDisconnectedDialog);\n state.connectionObserver.observe(document.documentElement, { childList: true, subtree: true });\n };\n\n const open = <T>(view: DialogRender<T>, options: OpenDialogOptions = {}): Promise<T | undefined> => {\n if (typeof document === \"undefined\") throw new Error(\"@k2b/ui dialogs can only be opened in the browser\");\n const scope = readUiScope();\n return openAfter(view, options, disposals, { ...scope, primary: options.primary ?? scope.primary });\n };\n\n const openAfter = <T>(\n view: DialogRender<T>,\n options: OpenDialogOptions,\n requested: number,\n uiScope: ReturnType<typeof readUiScope>,\n ): Promise<T | undefined> => {\n if (options.signal?.aborted) return Promise.resolve(undefined);\n if (options.history) {\n // Dialogs closed just now leave the history first, or this dialog's entry would be the one removed.\n if (historySyncScheduled) syncHistory();\n if (returning) return returning.then(() => openAfter(view, options, requested, uiScope));\n }\n // A dialog that waited for history while islands were disposed would open over content it was never meant for.\n if (disposals !== requested) return Promise.resolve(undefined);\n const dialog = ensureDialogElement();\n if (!state.motion && frameMotion) state.motion = frameMotion.createFrameMotion(dialog);\n listen();\n const previousTop = state.stack[state.stack.length - 1];\n // The shown level fades out while the new one replaces it in the same frame; it is hidden once it has faded.\n if (previousTop) {\n // Its scroll places survive being hidden below the new level, and a move when it shows again.\n keepScroll(previousTop.container, dialog);\n state.motion?.begin(previousTop.container);\n }\n const activeElement = document.activeElement;\n\n const panelClassName = options.panelClassName ?? DEFAULT_PANEL_CLASS;\n const cancelBehavior = options.cancelBehavior ?? \"resolve-undefined\";\n const initialFocus = options.initialFocus ?? \"first-input\";\n\n const container = document.createElement(\"div\");\n container.className = options.contentClassName ?? DEFAULT_CONTENT_CLASS;\n dialog.appendChild(container);\n\n const entry: DialogStackEntry = {\n uiScope,\n container,\n panelClassName,\n cancelBehavior,\n initialFocus,\n opener: activeElement instanceof HTMLElement ? activeElement : undefined,\n openerRing: ringOnReturn(activeElement),\n ariaLabel: options.ariaLabel,\n ariaDescribedBy: options.ariaDescribedBy,\n role: options.role ?? \"dialog\",\n modal: true,\n };\n\n return new Promise((resolve, reject) => {\n const abort = () => {\n const index = state.stack.indexOf(entry);\n if (index < 0) return;\n if (index === state.stack.length - 1) popTop(undefined);\n else {\n state.stack.splice(index, 1);\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n entry.resolve = (value) => {\n options.signal?.removeEventListener(\"abort\", abort);\n if (!options.history) {\n resolve(value as T | undefined);\n return;\n }\n // After every pending history sync, so a caller that navigates or opens the next dialog finds the history settled.\n // This holds for a marker forgotten during island disposal too, while an earlier synthetic Back is on its way.\n queueMicrotask(() => void historySettled().then(() => resolve(value as T | undefined)));\n };\n const closeTyped: DialogClose<T> = (result) => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n popTop(result);\n };\n\n // A dialog that a reload or a shared link brings up with the page is there from the first frame, without an\n // entrance: its own address is already the page's address when it opens.\n const resumed = options.history ? pushHistory(entry, options.historyUrl) : false;\n state.stack.push(entry);\n try {\n applyPresentation(entry);\n entry.dispose = render(\n () =>\n createComponent(RenderErrorBoundary, {\n content: () =>\n view(closeTyped, {\n dialog,\n setModal: (modal) => {\n entry.modal = modal;\n applyPresentation(entry);\n },\n setPosition: (position) => {\n if (position && (!Number.isFinite(position.x) || !Number.isFinite(position.y))) return;\n entry.position = position;\n applyPresentation(entry);\n },\n requestDismiss: () => requestDismiss(entry),\n setDismissHandler: (handler) => {\n entry.dismissHandler = handler;\n },\n }),\n onClose: () => closeTyped(undefined),\n onError: () => {\n entry.panelClassName = RENDER_ERROR_PANEL_CLASS;\n container.className = DEFAULT_CONTENT_CLASS;\n applyPresentation(entry);\n },\n }),\n container,\n );\n applyPresentation(entry);\n applyAccessibleName(dialog, entry);\n applyCancelBehavior(dialog, () => void requestDismiss(entry), cancelBehavior);\n if (previousTop) {\n const hide = () => {\n previousTop.container.style.display = \"none\";\n };\n if (state.motion) state.motion.arrive(container, hide);\n else hide();\n announceLevel(entry);\n }\n\n if (state.stack.length === 1) {\n // The native dialog returns focus to the element focused when it\n // opened, with a ring of the browser's choosing. Opening from a\n // blurred document leaves the return to popTop and its opener ring.\n if (activeElement instanceof HTMLElement) activeElement.blur();\n if (resumed) {\n dialog.dataset.noEnter = \"\";\n // Two frames: the first frame's style still has to see the attribute.\n schedule(() => schedule(() => delete dialog.dataset.noEnter));\n }\n if (typeof dialog.showModal === \"function\") {\n if (entry.modal) dialog.showModal();\n else dialog.show();\n } else dialog.setAttribute(\"open\", \"\");\n observeConnection();\n }\n options.signal?.addEventListener(\"abort\", abort, { once: true });\n if (options.signal?.aborted) abort();\n // Where opening left focus, the native dialog's own pick included. Focus that the content or a person moved\n // before the next frame stays: a browser can hold that frame back while keys already arrive.\n const opened = document.activeElement;\n schedule(() => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n if (document.activeElement !== opened && !focusUnclaimed(dialog)) return;\n resolveInitialFocusTarget(entry, dialog)?.focus();\n });\n } catch (error) {\n entry.resolve = undefined;\n if (state.stack[state.stack.length - 1] === entry) popTop(undefined);\n reject(error);\n }\n });\n };\n\n const close: DialogCore[\"close\"] = (result) => {\n // Only the shown level closes visibly, without a morph; the levels below leave with the frame, since one that\n // still fades out from a level change is part of the picture that fades.\n const below = state.stack.splice(0, Math.max(0, state.stack.length - 1)).reverse();\n popTop(result, below);\n for (const entry of below) {\n releaseHistory(entry);\n entry.resolve?.(undefined);\n }\n };\n\n return {\n open,\n close,\n isOpen: () => state.stack.length > 0,\n holdHistory,\n historySettled,\n };\n};\n\nconst { holdHistory, historySettled, ...publicDialogCore } = createDialogCore();\nexport const dialogCore: DialogCore = publicDialogCore;\n\n/**\n * Internal: transient UI shares dialogs' Back handling without exposing another public dialog capability.\n * Same-URL traversals are suppressed with the Navigation API; without it, only the synthetic Back on release is suppressed.\n * Release during island disposal forgets the marker without traversing; the router may replace the remaining entry.\n */\nexport const holdDialogHistory = holdHistory;\n/** Internal: waits until released holders have left history or were forgotten during island disposal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AC;MACJ,CAAC,CAAC,OAAO,KAAK,EAAE;QACd,KAAK,CAAC,OAAO,GAAG,SAAS;QACzB,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;QACpE,MAAM,CAAC,KAAK,CAAC;MACf;IACF,CAAC,CAAC;EACJ,CAAC;EAED,MAAM,KAA0B,GAAI,MAAM,IAAK;IAC7C;IACA;IACA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAClF,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;MACzB,cAAc,CAAC,KAAK,CAAC;MACrB,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC;IAC5B;EACF,CAAC;EAED,OAAO;IACL,IAAI;IACJ,KAAK;IACL,MAAM,EAAE,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;IACpC,WAAW;IACX;EACF,CAAC;AACH,CAAC;AAED,MAAM;EAAE,WAAW;EAAE,cAAc;EAAE,GAAG;AAAiB,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/E,OAAO,MAAM,UAAsB,GAAG,gBAAgB;;AAEtD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,iBAAiB,GAAG,WAAW;AAC5C;AACA,OAAO,MAAM,oBAAoB,GAAG,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["feedback/dialog-core.ts"],"sourcesContent":["import { createComponent, type JSX } from \"solid-js\";\nimport { render } from \"solid-js/web\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { getK2bPortalRoot } from \"../internal/portal\";\nimport { applyUiScope, readUiScope } from \"../internal/portal-scope\";\nimport { RenderErrorBoundary } from \"../internal/render-error\";\nimport { keepScroll, restoreScroll } from \"../internal/scroll-places\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport type { FrameMotion } from \"./dialog-frame-motion\";\nimport { isPointInsideToast } from \"./toast-hit\";\n\nexport type DialogClose<T> = (result?: T) => void;\n\nexport type OpenDialogOptions = {\n /** Override the opener's primary palette for a dialog with its own purpose, such as a global session warning. */\n primary?: \"blue\" | \"ai\";\n /** Close only this dialog when its owning operation is cancelled. */\n signal?: AbortSignal;\n /** Hold and animate content height changes after first rest. Defaults to false; level morphs are independent. */\n followContent?: boolean;\n panelClassName?: string;\n contentClassName?: string;\n initialFocus?: \"first-input\" | \"none\" | ((dialog: HTMLDialogElement) => HTMLElement | null);\n cancelBehavior?: \"resolve-undefined\" | \"ignore\";\n ariaLabel?: string;\n ariaDescribedBy?: string;\n /** Use for a consequential confirmation that requires a response. Defaults to dialog. */\n role?: \"dialog\" | \"alertdialog\";\n /**\n * Add a same-URL history entry while the dialog is open, so the browser's or the phone's Back closes the dialog\n * instead of leaving the page. Normally closing the dialog removes the entry again; the returned promise settles after that.\n * With the Navigation API, same-URL traversals between this core's entries and the page do not reach application popstate listeners.\n * Without it, only the synthetic Back on close is suppressed.\n * Island disposal closes every open dialog immediately and forgets its marker without traversing history.\n * The same-URL entry remains for the router to replace and counts as a page entry for later dialogs.\n * A traversal that `@k2b/ssr/nav` hides from popstate listeners reaches this core through `ssr:nav-popstate`.\n */\n history?: boolean;\n /**\n * With `history`, the URL of the dialog's own entry, such as the page URL with a query parameter that names the\n * dialog. Closing returns to the entry below with its own URL. A reload on that entry keeps the URL; opening a\n * dialog with the same `historyUrl` then resumes the entry instead of adding another above it.\n */\n historyUrl?: string;\n};\n\nexport type DialogRender<T> = (\n close: DialogClose<T>,\n context: {\n dialog: HTMLDialogElement;\n /** Switch this entry between a modal and a modeless window without remounting. */\n setModal: (modal: boolean) => void;\n /** Set viewport coordinates, or restore stylesheet positioning with null. Repeating the current value preserves running motion. */\n setPosition: (position: { x: number; y: number } | null) => void;\n /** Route Escape/backdrop through the same guarded handler as Cancel and X. */\n setDismissHandler: (handler: () => void | Promise<void>) => void;\n /** Request dismissal through this entry's cancellation policy and guard. */\n requestDismiss: () => Promise<void>;\n },\n) => JSX.Element;\n\nexport type DialogCore = {\n open: <T>(view: DialogRender<T>, options?: OpenDialogOptions) => Promise<T | undefined>;\n close: (result?: unknown) => void;\n isOpen: () => boolean;\n};\n\ntype DialogStackEntry = {\n uiScope: ReturnType<typeof readUiScope>;\n container: HTMLDivElement;\n dispose?: () => void;\n resolve?: (value: unknown) => void;\n panelClassName: string;\n cancelBehavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>;\n initialFocus: NonNullable<OpenDialogOptions[\"initialFocus\"]>;\n opener?: HTMLElement;\n openerRing: boolean;\n ariaLabel?: string;\n ariaDescribedBy?: string;\n role: \"dialog\" | \"alertdialog\";\n dismissHandler?: () => void | Promise<void>;\n dismissPending?: boolean;\n follow?: boolean;\n modal: boolean;\n position?: { x: number; y: number } | null;\n /** The marker of this dialog's history entry, for dialogs opened with `history`. */\n historyId?: number;\n};\n\ntype DialogState = {\n element?: HTMLDialogElement;\n /** The size and content motion of the open frame while levels replace each other. */\n motion?: FrameMotion;\n modal?: boolean;\n stack: DialogStackEntry[];\n scrollLocked?: boolean;\n previousBodyOverflow?: string;\n previousHtmlOverflow?: string;\n mouseDownOnDialog?: boolean;\n connectionObserver?: MutationObserver;\n};\n\nconst DEFAULT_PANEL_CLASS = \"k2b-dialog\";\nconst DEFAULT_CONTENT_CLASS = \"k2b-dialog__viewport\";\n/** The frame of a dialog whose content could not render: a custom or bare surface may draw no frame of its own. */\nconst RENDER_ERROR_PANEL_CLASS = \"k2b-dialog k2b-dialog--small\";\nlet nextDialogTitleId = 0;\nlet nextHistoryId = 0;\n/** The history state key that marks a dialog's same-URL entry. */\nconst HISTORY_MARKER = \"k2bDialog\";\n\nconst historyRecord = (): Record<string, unknown> =>\n typeof history.state === \"object\" && history.state !== null ? { ...history.state } : {};\nconst historyMarker = (): unknown => historyRecord()[HISTORY_MARKER];\nconst historySnapshot = () => ({ href: location.href, length: history.length });\n\nconst resolveInitialFocusTarget = (entry: DialogStackEntry, dialog: HTMLDialogElement): HTMLElement | null => {\n const { initialFocus } = entry;\n if (initialFocus === \"none\") return null;\n if (typeof initialFocus === \"function\") return initialFocus(dialog);\n const input = entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role='combobox']:not([disabled]):not([aria-disabled='true'])\",\n );\n return (\n input ??\n entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([tabindex='-1'])\",\n )\n );\n};\n\nconst applyAccessibleName = (dialog: HTMLDialogElement, entry: DialogStackEntry): void => {\n dialog.setAttribute(\"role\", entry.role);\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n dialog.removeAttribute(\"aria-describedby\");\n // A toned dialog names its tone in a hidden word that describes the dialog, so its heading keeps the title alone.\n const tone = entry.container.querySelector<HTMLElement>(\"[data-dialog-tone-label]\");\n if (tone) tone.id ||= `k2b-dialog-tone-${++nextDialogTitleId}`;\n const describedBy = [entry.ariaDescribedBy, tone?.id].filter(Boolean).join(\" \");\n if (describedBy) dialog.setAttribute(\"aria-describedby\", describedBy);\n if (entry.ariaLabel) {\n dialog.setAttribute(\"aria-label\", entry.ariaLabel);\n return;\n }\n const heading = entry.container.querySelector<HTMLElement>(\"h1, h2, h3\");\n if (!heading) {\n dialog.setAttribute(\"aria-label\", resolveUiMessages().dialog);\n return;\n }\n heading.id ||= `k2b-dialog-title-${++nextDialogTitleId}`;\n dialog.setAttribute(\"aria-labelledby\", heading.id);\n};\n\n/**\n * The exit fade and the level change (morph, announcement) load in one module when the first dialog opens, so islands\n * that open dialogs do not carry them in their first bundle. Nothing waits for it: a dialog that closes before it\n * arrived leaves at once, a level that replaces another changes at once (with its scroll places kept) and says its name\n * as soon as the module is there.\n */\nlet frameMotion: typeof import(\"./dialog-frame-motion\") | undefined;\nlet frameMotionLoading: Promise<void> | undefined;\nconst loadFrameMotion = (state: DialogState, announced?: DialogStackEntry): void => {\n const arrived = () => frameMotion?.connectFrameMotion(state, announced);\n if (frameMotion) return arrived();\n frameMotionLoading ??= import(\"./dialog-frame-motion\").then(\n (module) => {\n frameMotion = module;\n },\n () => {\n // A failed chunk request may succeed on the next open.\n frameMotionLoading = undefined;\n },\n );\n void frameMotionLoading.then(arrived);\n};\n\nconst schedule = (callback: () => void): void => {\n if (typeof requestAnimationFrame === \"function\") requestAnimationFrame(callback);\n else queueMicrotask(callback);\n};\n\n/**\n * Whether focus is still where closing a level left it, on the page or the\n * dialog: nothing took it before the next frame, neither a close handler nor a\n * Tab pressed right after Escape.\n */\nconst focusUnclaimed = (dialog: HTMLDialogElement): boolean => {\n const active = document.activeElement;\n return !active || active === document.body || active === dialog;\n};\n\n/** Checked by shape: a test harness or an iframe may create the event in another realm. */\nconst isPopState = (value: unknown): value is PopStateEvent =>\n typeof value === \"object\" && value !== null && \"type\" in value && value.type === \"popstate\" && \"state\" in value;\n\ntype HistoryEntry = { historyId?: number };\ntype HistoryHolder = HistoryEntry & { onBack: () => void };\n\nexport const createDialogCore = () => {\n const state: DialogState = { stack: [] };\n /** Markers of this core's entries in the browser history, oldest first. */\n let historyIds: number[] = [];\n const issued = new Set<number>();\n /**\n * Markers forgotten during island disposal. Their entries stay in `historyIds` as barriers: a synthetic Back never\n * crosses one, because the router may have replaced that entry with another page.\n */\n const forgotten = new Set<number>();\n const deadMarker = (marker: unknown): marker is number => typeof marker === \"number\" && forgotten.has(marker);\n /** How often islands were disposed, so a dialog that waits to open notices that a content swap happened meanwhile. */\n let disposals = 0;\n const ownMarker = (marker: unknown): marker is number => typeof marker === \"number\" && issued.has(marker);\n /** The address of each own entry that a dialog named with `historyUrl`. */\n const ownUrls = new Map<number, string>();\n let seen: ReturnType<typeof historySnapshot> | undefined;\n let traversalFrom: { href: string; marker: unknown } | undefined;\n let syntheticFrom: { href: string; marker: unknown } | undefined;\n const historyHolders = new Set<HistoryHolder>();\n let historySyncScheduled = false;\n let disposingIslands = false;\n /** Settles when the synthetic Back that removes closed dialogs' entries has arrived. */\n let returning: Promise<void> | undefined;\n let resolveReturning: (() => void) | undefined;\n /** Ends the fade-out of the frame whose last level closed: its content stays until the frame has left. */\n let leaving: (() => void) | undefined;\n const endLeaving = () => leaving?.();\n\n /** Outside island disposal, closed entries leave with one Back to the newest live dialog or holder, or to the page. */\n const syncHistory = () => {\n if (returning) {\n void returning.then(() => {\n if (historySyncScheduled) syncHistory();\n });\n return;\n }\n historySyncScheduled = false;\n const openIds = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n const current = historyIds.at(-1);\n let steps = 0;\n while (historyIds.length > 0 && !openIds.has(historyIds.at(-1)) && !deadMarker(historyIds.at(-1))) {\n historyIds.pop();\n steps++;\n }\n // Someone else moved the history meanwhile; leave it alone.\n if (steps === 0 || historyMarker() !== current || location.href !== seen?.href || history.length !== seen?.length) return;\n const back = new Promise<void>((resolve) => {\n resolveReturning = resolve;\n });\n returning = back;\n void back.then(() => {\n if (returning === back) returning = undefined;\n });\n syntheticFrom = { href: location.href, marker: current };\n history.go(-steps);\n };\n\n const releaseHistory = (entry: HistoryEntry) => {\n if (entry.historyId === undefined) return;\n // During a content swap the router owns history. Forget the marker without moving history; its entry stays a\n // barrier for later synthetic Backs and is left for the router to replace.\n if (disposingIslands) {\n issued.delete(entry.historyId);\n forgotten.add(entry.historyId);\n entry.historyId = undefined;\n return;\n }\n if (historySyncScheduled) return;\n historySyncScheduled = true;\n queueMicrotask(syncHistory);\n };\n\n /** Traversals this core already handled: a page swap router also reports the ones it hides from listeners. */\n const handled = new WeakSet<PopStateEvent>();\n /** Back or Forward moved to another entry: close dialogs and holders opened after the one it shows. */\n const onPopState = (event: PopStateEvent) => {\n if (handled.has(event)) return;\n handled.add(event);\n const resolveBack = resolveReturning;\n // Without the Navigation API, only our synthetic Back has a known departure.\n const from = typeof navigation !== \"undefined\" ? traversalFrom : resolveBack ? syntheticFrom : undefined;\n traversalFrom = undefined;\n syntheticFrom = undefined;\n resolveReturning = undefined;\n try {\n const marker = historyMarker();\n // A dialog's own address (`historyUrl`) changes only between its entry and the page: still a dialog-only traversal.\n const ownAddress = (entry: unknown, href: string) => ownMarker(entry) && ownUrls.get(entry) === href;\n const sameAddress = from && (from.href === location.href || ownAddress(from.marker, from.href) || ownAddress(marker, location.href));\n if (from && sameAddress && from.marker !== marker && (ownMarker(from.marker) || ownMarker(marker))) {\n event.stopImmediatePropagation();\n }\n // Own entries are ordered by id. A retired entry reached by Forward stays tracked, so closing the dialogs\n // beneath it also removes it. A forgotten entry keeps the holders opened before it and stays a barrier.\n historyIds = ownMarker(marker) || deadMarker(marker) ? [...historyIds.filter((id) => id < marker), marker] : [];\n const gone = (entry: DialogStackEntry) => entry.historyId !== undefined && !historyIds.includes(entry.historyId);\n while (state.stack.some(gone)) popTop(undefined);\n for (const holder of [...historyHolders].reverse()) {\n if (holder.historyId === undefined || historyIds.includes(holder.historyId)) continue;\n historyHolders.delete(holder);\n releaseHistory(holder);\n holder.onBack();\n }\n } finally {\n seen = historySnapshot();\n resolveBack?.();\n }\n };\n\n /**\n * Island disposal means the page content changes, as a document load would. Every dialog closes, top first, whichever\n * code opened it: which island calls open() is not knowable after an await, in onMount or from a timer, and a modal\n * left over the new content would block it.\n */\n const onIslandDispose = () => {\n if (!disposingIslands) {\n disposingIslands = true;\n queueMicrotask(() => {\n disposingIslands = false;\n });\n // Entries released just before, whose Back has not started yet, stay as well: the router owns history now.\n // A Back already on its way still settles through `returning`.\n historySyncScheduled = false;\n const live = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n for (const id of historyIds) {\n if (live.has(id) || !issued.delete(id)) continue;\n forgotten.add(id);\n }\n }\n disposals++;\n while (state.stack.length > 0) popTop(undefined);\n // New page content: a frame still fading out leaves at once, as if the document were replaced.\n endLeaving();\n };\n\n /** `@k2b/ssr/nav` stops a traversal to another server page before later listeners and reports it here. */\n const onHiddenPopState = (event: Event) => {\n const detail: unknown = \"detail\" in event ? event.detail : undefined;\n if (isPopState(detail)) onPopState(detail);\n };\n const onNavigate = (event: NavigateEvent) => {\n if (event.navigationType === \"traverse\") traversalFrom = { href: location.href, marker: historyMarker() };\n };\n /** The window whose history this core listens to; a test harness may replace the window between dialogs. */\n let listening: { window: Window; navigation?: Navigation } | undefined;\n const listen = () => {\n if (listening?.window === window) return;\n listening?.window.removeEventListener(\"popstate\", onPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n listening?.navigation?.removeEventListener(\"navigate\", onNavigate);\n window.addEventListener(\"popstate\", onPopState, { capture: true });\n window.addEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n // Capture opens the disposal window before target listeners can release history holders.\n window.addEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n const current = typeof navigation !== \"undefined\" ? navigation : undefined;\n current?.addEventListener(\"navigate\", onNavigate);\n listening = { window, navigation: current };\n };\n // Chromium runs a window's popstate listeners in the order they were added, capture or not. The shared core is\n // created before islands mount and add their navigation listeners, so it listens from the start.\n if (typeof window !== \"undefined\") listen();\n\n /** Returns whether the dialog's own address already was the page's address: a reload or a shared link brought it. */\n const pushHistory = (entry: HistoryEntry, url?: string): boolean => {\n listen();\n const previous = historyRecord();\n // A reload or Forward never brings back a dialog or its sensitive transient state.\n const stale = historyIds.length === 0 && previous[HISTORY_MARKER] !== undefined;\n if (stale) delete previous[HISTORY_MARKER];\n entry.historyId = ++nextHistoryId;\n issued.add(entry.historyId);\n historyIds.push(entry.historyId);\n // Only a dialog that names itself in the URL resumes the entry a reload left behind; the page entry stays below.\n const here = url !== undefined && new URL(url, location.href).href === location.href;\n const resume = stale && here;\n if (resume) history.replaceState({ ...previous, [HISTORY_MARKER]: entry.historyId }, \"\");\n else {\n if (stale) history.replaceState(previous, \"\");\n history.pushState({ ...previous, [HISTORY_MARKER]: entry.historyId }, \"\", url);\n }\n if (url !== undefined) ownUrls.set(entry.historyId, location.href);\n seen = historySnapshot();\n return here;\n };\n\n /** Internal non-dialog participation in the same history stack. Releasing never calls onBack. */\n const holdHistory = (onBack: () => void): (() => void) => {\n const holder: HistoryHolder = { onBack };\n historyHolders.add(holder);\n const pushWhenReady = () => {\n if (!historyHolders.has(holder)) return;\n // Just like open(): remove closed entries before adding another one.\n if (historySyncScheduled) syncHistory();\n if (returning) void returning.then(pushWhenReady);\n else pushHistory(holder);\n };\n pushWhenReady();\n return () => {\n if (!historyHolders.delete(holder)) return;\n releaseHistory(holder);\n };\n };\n\n /**\n * Settles once released entries have left history or were forgotten during island disposal. A caller that navigates waits\n * for it, as a dialog's result waits: a Back still on its way would otherwise land behind the new entry.\n */\n const historySettled = async (): Promise<void> => {\n while (historySyncScheduled || returning) {\n if (!returning) syncHistory();\n if (returning) await returning;\n }\n };\n\n const ensureDialogElement = () => {\n // A frame that is still fading out ends now; the new dialog gets a frame of its own.\n endLeaving();\n // Reuse the shared element whenever it is still in the document. Resolving\n // the portal root first would create a second <dialog> when focus has moved\n // into another `.k2b-ui` scope, orphaning the levels already on the stack.\n if (state.element?.isConnected) return state.element;\n\n const element = document.createElement(\"dialog\");\n element.onclose = () => {\n // Repeated Escape can force a non-cancelable native close. A retained\n // entry (ignore, an async guard, or a parent) still owns the modal.\n const top = state.stack[state.stack.length - 1];\n if (state.element !== element || element.open || !top) return;\n if (top.modal) element.showModal();\n else element.show();\n resolveInitialFocusTarget(top, element)?.focus();\n };\n // Each stack level carries its own palette, independently of the first opener.\n getK2bPortalRoot(undefined, document.body).appendChild(element);\n state.element = element;\n return element;\n };\n\n const lockPageScroll = () => {\n if (typeof document === \"undefined\" || state.scrollLocked) return;\n state.previousBodyOverflow = document.body.style.overflow;\n state.previousHtmlOverflow = document.documentElement.style.overflow;\n document.body.style.overflow = \"hidden\";\n document.documentElement.style.overflow = \"hidden\";\n state.scrollLocked = true;\n };\n\n const unlockPageScroll = () => {\n if (typeof document === \"undefined\" || !state.scrollLocked) return;\n document.body.style.overflow = state.previousBodyOverflow ?? \"\";\n document.documentElement.style.overflow = state.previousHtmlOverflow ?? \"\";\n state.scrollLocked = false;\n state.previousBodyOverflow = undefined;\n state.previousHtmlOverflow = undefined;\n };\n\n const applyPresentation = (entry: DialogStackEntry) => {\n const dialog = state.element;\n if (!dialog || state.stack[state.stack.length - 1] !== entry) return;\n if (dialog.className !== entry.panelClassName) dialog.className = entry.panelClassName;\n applyUiScope(dialog, entry.uiScope);\n const position = entry.position;\n if (position || dialog.style.position) dialog.style.inset = position ? `${position.y}px auto auto ${position.x}px` : \"\";\n dialog.style.position = position ? \"fixed\" : \"\";\n dialog.style.margin = position ? \"0\" : \"\";\n dialog.style.transform = position ? \"none\" : \"\";\n dialog.dataset.modeless = String(!entry.modal);\n dialog.setAttribute(\"aria-modal\", String(entry.modal));\n if (dialog.open && state.modal !== entry.modal) {\n const active = document.activeElement;\n dialog.close();\n if (entry.modal) dialog.showModal();\n else dialog.show();\n if (active instanceof HTMLElement && active.isConnected && (!entry.modal || dialog.contains(active))) {\n active.focus({ preventScroll: true });\n } else resolveInitialFocusTarget(entry, dialog)?.focus({ preventScroll: true });\n }\n state.modal = entry.modal;\n if (entry.modal) lockPageScroll();\n else unlockPageScroll();\n };\n\n const modelessEscape = (event: KeyboardEvent) => {\n const top = state.stack[state.stack.length - 1];\n if (!top || top.modal || event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n event.preventDefault();\n void requestDismiss(top);\n };\n\n const stopConnectionObserver = () => {\n document.removeEventListener(\"keydown\", modelessEscape);\n state.connectionObserver?.disconnect();\n state.connectionObserver = undefined;\n };\n\n const applyCancelBehavior = (\n dialog: HTMLDialogElement,\n close: () => void,\n behavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>,\n ) => {\n dialog.oncancel = (event) => {\n if (behavior === \"ignore\") {\n event.preventDefault();\n return;\n }\n event.preventDefault();\n close();\n };\n dialog.onmousedown = (event) => {\n state.mouseDownOnDialog = event.target === dialog;\n };\n dialog.onclick = (event) => {\n const realBackdropClick = state.mouseDownOnDialog === true;\n state.mouseDownOnDialog = false;\n if (event.target !== dialog || !state.modal) return;\n if (!realBackdropClick) return;\n if (behavior === \"ignore\") return;\n if (isPointInsideToast(event.clientX, event.clientY)) return;\n close();\n };\n };\n\n const requestDismiss = async (entry: DialogStackEntry) => {\n if (state.stack[state.stack.length - 1] !== entry || entry.dismissPending || entry.cancelBehavior === \"ignore\") return;\n if (!entry.dismissHandler) {\n popTop(undefined);\n return;\n }\n entry.dismissPending = true;\n try {\n await entry.dismissHandler();\n } catch (error) {\n // A failed guard must never discard the dialog's state.\n console.error(\"Dialog dismissal failed\", error);\n } finally {\n entry.dismissPending = false;\n }\n };\n\n /** Closes the shown level. `below` are the levels under it that close with it (lowest last): they leave with the frame. */\n const popTop = (result?: unknown, below: DialogStackEntry[] = []) => {\n const top = state.stack.pop();\n if (!top) return;\n releaseHistory(top);\n const discard = () => {\n for (const entry of [top, ...below]) {\n entry.dispose?.();\n entry.container.remove();\n }\n };\n\n const dialog = state.element;\n const previous = state.stack[state.stack.length - 1];\n if (previous && dialog) {\n // The same morph as forward, backwards: the closed level fades out over the one below, which shows as it was.\n const motion = state.motion;\n // Back: the closed level moves before the shown one, which stays the dialog's last child.\n keepScroll(top.container, dialog);\n motion?.begin(top.container, true);\n previous.container.style.display = \"\";\n restoreScroll(previous.container);\n applyPresentation(previous);\n applyAccessibleName(dialog, previous);\n applyCancelBehavior(dialog, () => void requestDismiss(previous), previous.cancelBehavior);\n if (motion) motion.arrive(previous.container, discard, previous.follow);\n else discard();\n loadFrameMotion(state, previous);\n schedule(() => {\n if (!focusUnclaimed(dialog)) return;\n if (top.opener?.isConnected) returnFocus(top.opener, top.openerRing);\n else resolveInitialFocusTarget(previous, dialog)?.focus();\n });\n } else if (dialog) {\n dialog.oncancel = null;\n dialog.onmousedown = null;\n dialog.onclick = null;\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n dialog.removeAttribute(\"aria-describedby\");\n // State and focus change now; the frame only fades out. It leaves the top layer and the page is usable at once.\n // From this moment it no longer acts as open: inert (no input, focus, drop or submit) and out of the\n // accessibility tree, so neither a person nor a query by role or name finds it; only its picture fades.\n // A level change still under way stops where the eye sees it; its closed levels are disposed after the fade.\n const endings = state.motion?.freeze();\n state.motion = undefined;\n dialog.inert = true;\n dialog.setAttribute(\"aria-hidden\", \"true\");\n if (dialog.open && typeof dialog.close === \"function\") dialog.close();\n else dialog.removeAttribute(\"open\");\n state.element = undefined;\n stopConnectionObserver();\n unlockPageScroll();\n let left = false;\n let finish: (() => void) | undefined;\n const remove = () => {\n left = true;\n if (finish && leaving === finish) leaving = undefined;\n endings?.();\n discard();\n dialog.remove();\n };\n if (frameMotion) finish = frameMotion.afterExitTransitions(dialog, remove);\n else remove();\n if (!left) leaving = finish;\n // After the Escape that closed it: WebKit lights the ring of whatever\n // that key press leaves focused.\n // Focus returns to where the whole dialog was opened from, not into a level that closed with it.\n const first = below.at(-1) ?? top;\n schedule(() => {\n if (first.opener?.isConnected && focusUnclaimed(dialog)) returnFocus(first.opener, first.openerRing);\n });\n } else discard();\n\n top.resolve?.(result);\n };\n\n const resetDisconnectedDialog = () => {\n if (state.stack.length === 0 || state.element?.isConnected) return;\n const entries = state.stack.splice(0);\n const dialog = state.element;\n state.motion?.stop();\n state.motion = undefined;\n state.element = undefined;\n stopConnectionObserver();\n dialog?.remove();\n unlockPageScroll();\n for (const entry of entries.reverse()) {\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n\n const observeConnection = () => {\n if (state.connectionObserver || typeof MutationObserver === \"undefined\") return;\n document.addEventListener(\"keydown\", modelessEscape);\n state.connectionObserver = new MutationObserver(resetDisconnectedDialog);\n state.connectionObserver.observe(document.documentElement, { childList: true, subtree: true });\n };\n\n const open = <T>(view: DialogRender<T>, options: OpenDialogOptions = {}): Promise<T | undefined> => {\n if (typeof document === \"undefined\") throw new Error(\"@k2b/ui dialogs can only be opened in the browser\");\n const scope = readUiScope();\n return openAfter(view, options, disposals, { ...scope, primary: options.primary ?? scope.primary });\n };\n\n const openAfter = <T>(\n view: DialogRender<T>,\n options: OpenDialogOptions,\n requested: number,\n uiScope: ReturnType<typeof readUiScope>,\n ): Promise<T | undefined> => {\n if (options.signal?.aborted) return Promise.resolve(undefined);\n if (options.history) {\n // Dialogs closed just now leave the history first, or this dialog's entry would be the one removed.\n if (historySyncScheduled) syncHistory();\n if (returning) return returning.then(() => openAfter(view, options, requested, uiScope));\n }\n // A dialog that waited for history while islands were disposed would open over content it was never meant for.\n if (disposals !== requested) return Promise.resolve(undefined);\n const dialog = ensureDialogElement();\n listen();\n const previousTop = state.stack[state.stack.length - 1];\n // The shown level fades out while the new one replaces it in the same frame; it is hidden once it has faded.\n if (previousTop) {\n // Its scroll places survive being hidden below the new level, and a move when it shows again.\n keepScroll(previousTop.container, dialog);\n state.motion?.begin(previousTop.container);\n }\n const activeElement = document.activeElement;\n\n const panelClassName = options.panelClassName ?? DEFAULT_PANEL_CLASS;\n const cancelBehavior = options.cancelBehavior ?? \"resolve-undefined\";\n const initialFocus = options.initialFocus ?? \"first-input\";\n\n const container = document.createElement(\"div\");\n container.className = options.contentClassName ?? DEFAULT_CONTENT_CLASS;\n dialog.appendChild(container);\n\n const entry: DialogStackEntry = {\n uiScope,\n container,\n panelClassName,\n cancelBehavior,\n initialFocus,\n opener: activeElement instanceof HTMLElement ? activeElement : undefined,\n openerRing: ringOnReturn(activeElement),\n ariaLabel: options.ariaLabel,\n ariaDescribedBy: options.ariaDescribedBy,\n role: options.role ?? \"dialog\",\n modal: true,\n follow: options.followContent,\n };\n\n return new Promise((resolve, reject) => {\n const abort = () => {\n const index = state.stack.indexOf(entry);\n if (index < 0) return;\n if (index === state.stack.length - 1) popTop(undefined);\n else {\n state.stack.splice(index, 1);\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n entry.resolve = (value) => {\n options.signal?.removeEventListener(\"abort\", abort);\n if (!options.history) {\n resolve(value as T | undefined);\n return;\n }\n // After every pending history sync, so a caller that navigates or opens the next dialog finds the history settled.\n // This holds for a marker forgotten during island disposal too, while an earlier synthetic Back is on its way.\n queueMicrotask(() => void historySettled().then(() => resolve(value as T | undefined)));\n };\n const closeTyped: DialogClose<T> = (result) => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n popTop(result);\n };\n\n // A dialog that a reload or a shared link brings up with the page is there from the first frame, without an\n // entrance: its own address is already the page's address when it opens.\n const resumed = options.history ? pushHistory(entry, options.historyUrl) : false;\n state.stack.push(entry);\n try {\n applyPresentation(entry);\n entry.dispose = render(\n () =>\n createComponent(RenderErrorBoundary, {\n content: () =>\n view(closeTyped, {\n dialog,\n setModal: (modal) => {\n entry.modal = modal;\n applyPresentation(entry);\n },\n setPosition: (position) => {\n if (position && (!Number.isFinite(position.x) || !Number.isFinite(position.y))) return;\n if (state.stack[state.stack.length - 1] === entry && state.motion?.position(entry.position, position) === false) return;\n entry.position = position ? { ...position } : null;\n applyPresentation(entry);\n },\n requestDismiss: () => requestDismiss(entry),\n setDismissHandler: (handler) => {\n entry.dismissHandler = handler;\n },\n }),\n onClose: () => closeTyped(undefined),\n onError: () => {\n entry.panelClassName = RENDER_ERROR_PANEL_CLASS;\n container.className = DEFAULT_CONTENT_CLASS;\n applyPresentation(entry);\n },\n }),\n container,\n );\n applyPresentation(entry);\n applyAccessibleName(dialog, entry);\n applyCancelBehavior(dialog, () => void requestDismiss(entry), cancelBehavior);\n if (previousTop) {\n const hide = () => {\n previousTop.container.style.display = \"none\";\n };\n if (state.motion) state.motion.arrive(container, hide, entry.follow);\n else hide();\n loadFrameMotion(state, entry);\n }\n\n if (state.stack.length === 1) {\n // The native dialog returns focus to the element focused when it\n // opened, with a ring of the browser's choosing. Opening from a\n // blurred document leaves the return to popTop and its opener ring.\n if (activeElement instanceof HTMLElement) activeElement.blur();\n if (resumed) {\n dialog.dataset.noEnter = \"\";\n // Two frames: the first frame's style still has to see the attribute.\n schedule(() => schedule(() => delete dialog.dataset.noEnter));\n }\n if (typeof dialog.showModal === \"function\") {\n if (entry.modal) dialog.showModal();\n else dialog.show();\n } else dialog.setAttribute(\"open\", \"\");\n observeConnection();\n // Only opted-in levels follow content; the first open itself does not animate.\n loadFrameMotion(state);\n }\n options.signal?.addEventListener(\"abort\", abort, { once: true });\n if (options.signal?.aborted) abort();\n // Where opening left focus, the native dialog's own pick included. Focus that the content or a person moved\n // before the next frame stays: a browser can hold that frame back while keys already arrive.\n const opened = document.activeElement;\n schedule(() => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n if (document.activeElement !== opened && !focusUnclaimed(dialog)) return;\n resolveInitialFocusTarget(entry, dialog)?.focus();\n });\n } catch (error) {\n entry.resolve = undefined;\n if (state.stack[state.stack.length - 1] === entry) popTop(undefined);\n reject(error);\n }\n });\n };\n\n const close: DialogCore[\"close\"] = (result) => {\n // Only the shown level closes visibly, without a morph; the levels below leave with the frame, since one that\n // still fades out from a level change is part of the picture that fades.\n const below = state.stack.splice(0, Math.max(0, state.stack.length - 1)).reverse();\n popTop(result, below);\n for (const entry of below) {\n releaseHistory(entry);\n entry.resolve?.(undefined);\n }\n };\n\n return {\n open,\n close,\n isOpen: () => state.stack.length > 0,\n holdHistory,\n historySettled,\n };\n};\n\nconst { holdHistory, historySettled, ...publicDialogCore } = createDialogCore();\nexport const dialogCore: DialogCore = publicDialogCore;\n\n/**\n * Internal: transient UI shares dialogs' Back handling without exposing another public dialog capability.\n * Same-URL traversals are suppressed with the Navigation API; without it, only the synthetic Back on release is suppressed.\n * Release during island disposal forgets the marker without traversing; the router may replace the remaining entry.\n */\nexport const holdDialogHistory = holdHistory;\n/** Internal: waits until released holders have left history or were forgotten during island disposal. */\nexport const dialogHistorySettled = historySettled;\n"],"mappings":"AAAA,SAAS,eAAe,QAAkB,UAAU;AACpD,SAAS,MAAM,QAAQ,cAAc;AACrC,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AACpE,SAAS,gBAAgB,QAAQ,oBAAoB;AACrD,SAAS,YAAY,EAAE,WAAW,QAAQ,0BAA0B;AACpE,SAAS,mBAAmB,QAAQ,0BAA0B;AAC9D,SAAS,UAAU,EAAE,aAAa,QAAQ,2BAA2B;AACrE,SAAS,iBAAiB,QAAQ,kBAAkB;AAEpD,SAAS,kBAAkB,QAAQ,aAAa;AA6FhD,MAAM,mBAAmB,GAAG,YAAY;AACxC,MAAM,qBAAqB,GAAG,sBAAsB;AACpD;AACA,MAAM,wBAAwB,GAAG,8BAA8B;AAC/D,IAAI,iBAAiB,GAAG,CAAC;AACzB,IAAI,aAAa,GAAG,CAAC;AACrB;AACA,MAAM,cAAc,GAAG,WAAW;AAElC,MAAM,aAAa,GAAG,MACpB,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,GAAG;EAAE,GAAG,OAAO,CAAC;AAAM,CAAC,GAAG,CAAC,CAAC;AACzF,MAAM,aAAa,GAAG,MAAe,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;AACpE,MAAM,eAAe,GAAG,OAAO;EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI;EAAE,MAAM,EAAE,OAAO,CAAC;AAAO,CAAC,CAAC;AAE/E,MAAM,yBAAyB,GAAG,CAAC,KAAuB,EAAE,MAAyB,KAAyB;EAC5G,MAAM;IAAE;EAAa,CAAC,GAAG,KAAK;EAC9B,IAAI,YAAY,KAAK,MAAM,EAAE,OAAO,IAAI;EACxC,IAAI,OAAO,YAAY,KA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