@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.
Files changed (56) hide show
  1. package/dist/browser/actions/FilterChip.js +3 -0
  2. package/dist/browser/actions/FilterChip.js.map +1 -1
  3. package/dist/browser/content/ActivityList.js +379 -290
  4. package/dist/browser/content/ActivityList.js.map +1 -1
  5. package/dist/browser/content/FileView.js +0 -12
  6. package/dist/browser/content/FileView.js.map +1 -1
  7. package/dist/browser/content/activity-messages.js +2 -2
  8. package/dist/browser/content/activity-messages.js.map +1 -1
  9. package/dist/browser/content/file-view-preview.js +13 -0
  10. package/dist/browser/content/file-view-preview.js.map +1 -1
  11. package/dist/browser/content/index.js +4 -4
  12. package/dist/browser/content/index.js.map +1 -1
  13. package/dist/browser/feedback/dialog-core.js +24 -27
  14. package/dist/browser/feedback/dialog-core.js.map +1 -1
  15. package/dist/browser/feedback/dialog-frame-motion.js +506 -15
  16. package/dist/browser/feedback/dialog-frame-motion.js.map +1 -1
  17. package/dist/browser/feedback/prompt-sheet.js +1 -0
  18. package/dist/browser/feedback/prompt-sheet.js.map +1 -1
  19. package/dist/browser/feedback/prompts.js +5 -1
  20. package/dist/browser/feedback/prompts.js.map +1 -1
  21. package/dist/browser/layout/sheet-motion.js +3 -3
  22. package/dist/browser/layout/sheet-motion.js.map +1 -1
  23. package/dist/ssr/actions/FilterChip.js +3 -0
  24. package/dist/ssr/actions/FilterChip.js.map +1 -1
  25. package/dist/ssr/content/ActivityList.js +199 -114
  26. package/dist/ssr/content/ActivityList.js.map +1 -1
  27. package/dist/ssr/content/FileView.js +0 -12
  28. package/dist/ssr/content/FileView.js.map +1 -1
  29. package/dist/ssr/content/activity-messages.js +2 -2
  30. package/dist/ssr/content/activity-messages.js.map +1 -1
  31. package/dist/ssr/content/file-view-preview.js +13 -0
  32. package/dist/ssr/content/file-view-preview.js.map +1 -1
  33. package/dist/ssr/content/index.js +4 -4
  34. package/dist/ssr/content/index.js.map +1 -1
  35. package/dist/ssr/feedback/dialog-core.js +24 -27
  36. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  37. package/dist/ssr/feedback/dialog-frame-motion.js +506 -15
  38. package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -1
  39. package/dist/ssr/feedback/prompt-sheet.js +1 -0
  40. package/dist/ssr/feedback/prompt-sheet.js.map +1 -1
  41. package/dist/ssr/feedback/prompts.js +5 -1
  42. package/dist/ssr/feedback/prompts.js.map +1 -1
  43. package/dist/ssr/layout/sheet-motion.js +3 -3
  44. package/dist/ssr/layout/sheet-motion.js.map +1 -1
  45. package/dist/styles.css +1 -1
  46. package/dist/types/actions/FilterChip.d.ts +9 -0
  47. package/dist/types/content/ActivityList.d.ts +24 -6
  48. package/dist/types/content/FileView.d.ts +0 -5
  49. package/dist/types/content/file-view-preview.d.ts +5 -0
  50. package/dist/types/content/index.d.ts +3 -3
  51. package/dist/types/feedback/dialog-core.d.ts +3 -1
  52. package/dist/types/feedback/dialog-frame-motion.d.ts +26 -1
  53. package/dist/types/feedback/prompt-sheet.d.ts +1 -0
  54. package/dist/types/feedback/prompts.d.ts +4 -0
  55. package/dist/types/layout/sheet-motion.d.ts +2 -2
  56. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/ActivityList.tsx"],"sourcesContent":["import type { DateContext } from \"@k2b/stdlib\";\nimport { createMemo, createSignal, For, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { InlineGuidance } from \"../feedback/InlineGuidance\";\nimport { prompts } from \"../feedback/prompts\";\nimport { ChoiceChips } from \"../inputs/ChoiceChips\";\nimport { useDateConfigLocale } from \"../intl/locale\";\nimport { Section } from \"../surfaces/Section\";\nimport { Skeleton } from \"../surfaces/Skeleton\";\nimport { resolveActivityMessages, useActivityMessages } from \"./activity-messages\";\nimport {\n type ActivityGroup,\n type ActivityRow,\n activityAgo,\n activityDayLabel,\n activityInstant,\n activityRows,\n activityWhen,\n} from \"./activity-timeline\";\n\n/** Only the icon carries a tone: grey by default, green for a completion, amber for a notice, red only while an action is needed. */\nexport type ActivityTone = \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n/** At most one action per entry, a link with an icon in the last line, only while the state needs it. */\nexport type ActivityAction = {\n icon: string;\n label: string;\n /** A link when set and not disabled; otherwise a button. */\n href?: string;\n target?: string;\n onClick?: (event: MouseEvent) => void;\n disabled?: boolean;\n /** For tests: rendered as `data-activity-action`. */\n data?: string;\n};\n\nexport type ActivityEntry = {\n /**\n * Stable key of the entry, such as its record id; unique within the list. With it a row keeps its node, folded-out\n * details, and focus when the caller rebuilds the entries, such as after a refresh. Without it the entry object is\n * the key.\n */\n id?: string;\n /** ISO instant. */\n at: string;\n /** Icon class of the kind, such as `ti ti-mail`; one fixed icon per kind. */\n icon: string;\n tone?: ActivityTone;\n /** Name of the icon for tooltip and screen readers, when the sentence does not say it already. */\n iconLabel?: string;\n /** One sentence, such as \"Invitation sent\". */\n text: JSX.Element;\n /**\n * Equal entries (one key) after each other on the same day become one row; `text` says it with the count\n * (\"Draft changed 4 times\") and gets every entry of the bundle, newest first. A bundle keeps the detail line only\n * when it is the same text for all entries.\n */\n bundle?: { key: string; text: (count: number, all: readonly ActivityEntry[]) => JSX.Element } | null;\n /** Only a result, the reason of a failure, a quote, or \"before → now\" (`ActivityList.Change`). */\n detail?: JSX.Element;\n /** Who did it, a text of the application; without one the meta line reads \"automatic\". */\n actor?: JSX.Element | null;\n action?: ActivityAction | null;\n /** A click on the entry opens it, such as its dialog. */\n onOpen?: () => void;\n /**\n * The entry's object as a link: the sentence becomes the link, a click anywhere on the row follows it, and a middle\n * click or a click with Ctrl, Cmd, or Shift opens it in a new tab. Takes the place of `onOpen`; ignored with\n * `details`.\n */\n href?: string;\n /** A click on the entry folds out its details below it; for a bundle with all of its entries. */\n details?: (all: readonly ActivityEntry[]) => JSX.Element;\n /** Kind for the filter in the \"All N\" dialog. */\n kind?: string;\n /** Attributes on the list item, such as `data-email` for focus after a reload. */\n attrs?: Record<`data-${string}`, string | number | undefined>;\n};\n\n/** `compact` for a card or side column (meta under the sentence); `wide` for a dialog or page (meta on the right). */\nexport type ActivityDensity = \"compact\" | \"wide\";\n\ntype ActivityTimeProps = {\n /**\n * The current time. Pass the server's time so the server and the first browser render show the same text; the\n * browser then moves it on every minute.\n */\n now?: Date | string;\n /** Date context of the application; days count in its time zone. */\n dateConfig?: DateContext;\n /** Convenience override for `dateConfig.timeZone`. Defaults to UTC, so server and browser agree. */\n timeZone?: string;\n};\n\nexport type ActivityListProps = ActivityTimeProps & {\n entries: readonly ActivityEntry[];\n density?: ActivityDensity;\n /** Shows only the newest rows; the rail then fades out below them. */\n limit?: number;\n /** More follows below the last visible row (further pages from the server); the rail fades out. */\n more?: boolean;\n /** Accessible name of the list. Defaults to \"History\". */\n label?: string;\n class?: string;\n};\n\n/** Bundle key of an entry: its bundle key and its actor; without `bundle` never bundled. */\nconst activityBundleKey = (entry: ActivityEntry): string | null =>\n entry.bundle ? `${entry.bundle.key}|${typeof entry.actor === \"string\" ? entry.actor : \"\"}` : null;\n\n/** The list's clock: first `start` (from the server, the same first render), then in the browser every minute anew. */\nconst createNow = (start: () => Date | string | undefined) => {\n const initial = start();\n const [now, setNow] = createSignal(initial ? new Date(initial) : new Date());\n onMount(() => {\n setNow(new Date());\n const timer = setInterval(() => setNow(new Date()), 60_000);\n onCleanup(() => clearInterval(timer));\n });\n return now;\n};\n\nconst useActivityContext = (props: ActivityTimeProps) => {\n const context = useDateConfigLocale(() => props.dateConfig);\n return {\n locale: () => context().locale ?? \"en\",\n timeZone: () => props.timeZone ?? props.dateConfig?.timeZone ?? \"UTC\",\n };\n};\n\n/** The key a row hangs on: the entry's `id`, or the entry object itself. */\nconst rowKey = (entry: ActivityEntry): string | ActivityEntry => entry.id ?? entry;\n\n/** Two bundles are the same when they hold the same entries in the same order. */\nconst sameEntries = (a: readonly ActivityEntry[], b: readonly ActivityEntry[]): boolean =>\n a.length === b.length && a.every((entry, index) => entry === b[index]);\n\n/** A click that must not act on the row: on a control inside it, inside folded-out details, or the end of a text selection. */\nconst ignoresRowClick = (event: MouseEvent): boolean =>\n Boolean((event.target as Element | null)?.closest(\"a, button, input, textarea, select, label, [role=button], .k2b-activity__details\")) ||\n window.getSelection()?.isCollapsed === false;\n\n/** Text of a detail line when it is only text; JSX cannot be compared. */\nconst detailText = (detail: JSX.Element | undefined): string | null => (typeof detail === \"string\" ? detail : null);\n\nconst TONES: Record<ActivityTone, string | undefined> = { neutral: undefined, success: \"success\", warning: \"warning\", danger: \"danger\" };\n\n/**\n * A vertical timeline: newest at the top, the start at the bottom. Dashed dividers name \"Today\", \"Yesterday\", and\n * each day of the last week; everything older stands under one divider \"More than a week ago\".\n *\n * A row: the icon of the kind (20 px, grey, without a circle; only the icon carries a tone), one sentence, and the\n * meta line \"time · distance · person\" (\"automatic\" without a person). Rarely a detail line below, and at most one\n * action. Equal entries after each other on the same day become one row with a count (`bundle`). Every row hangs on\n * its newest entry (its `id`, or the object): the minute clock changes only times and dividers, folded-out details,\n * bundle sentences, and focus stay.\n */\nfunction ActivityListRoot(props: ActivityListProps): JSX.Element {\n const t = useActivityMessages();\n const context = useActivityContext(props);\n const now = createNow(() => props.now);\n // Read the entries apart from the clock: a caller that builds them in a getter does not rebuild them every minute.\n const list = createMemo(() => props.entries);\n const allRows = createMemo(() => activityRows(list(), { now: now(), timeZone: context.timeZone(), key: activityBundleKey }));\n const rows = createMemo(() => (props.limit ? allRows().slice(0, props.limit) : allRows()));\n const rowOf = createMemo(() => new Map(rows().map((row) => [rowKey(row.entry), row] as const)));\n const keys = createMemo(() => rows().map((row) => rowKey(row.entry)));\n const fades = () => props.more === true || (props.limit !== undefined && allRows().length > props.limit);\n const divider = (group: ActivityGroup) =>\n group.kind === \"today\"\n ? t().activityToday\n : group.kind === \"yesterday\"\n ? t().activityYesterday\n : group.kind === \"older\"\n ? t().activityOlder\n : activityDayLabel(group.day, now(), context.locale(), context.timeZone());\n return (\n <ol\n class={props.class ? `k2b-activity ${props.class}` : \"k2b-activity\"}\n data-density={props.density ?? \"compact\"}\n aria-label={props.label ?? t().activityTitle}\n >\n <For each={keys()}>\n {(key, index) => {\n // `keys` and `rowOf` come from the same rows, so the key has its row; while a removed key is disposed the\n // row keeps its last value.\n const initial = rowOf().get(key);\n if (!initial) throw new Error(\"ActivityList: a row key without its row.\");\n const row = createMemo((previous: ActivityRow<ActivityEntry>) => rowOf().get(key) ?? previous, initial);\n // The clock rebuilds the rows every minute; the entry and its bundle change only when their entries do, so a\n // bundle sentence and folded-out details keep their nodes.\n const entry = createMemo(() => row().entry);\n const all = createMemo(() => row().all, undefined, { equals: sameEntries });\n const last = () => index() === rows().length - 1;\n return (\n <>\n <Show when={row().divider}>\n {(group) => (\n <li class=\"k2b-activity__day\" aria-hidden=\"true\">\n <span class=\"k2b-activity__day-line\" />\n {divider(group())}\n </li>\n )}\n </Show>\n <ActivityRowItem\n entry={entry()}\n all={all()}\n now={now()}\n first={index() === 0}\n end={last() ? (fades() ? \"more\" : \"last\") : undefined}\n wide={props.density === \"wide\"}\n locale={context.locale()}\n timeZone={context.timeZone()}\n />\n </>\n );\n }}\n </For>\n </ol>\n );\n}\n\nfunction ActivityRowItem(props: {\n entry: ActivityEntry;\n all: readonly ActivityEntry[];\n now: Date;\n first: boolean;\n end: \"last\" | \"more\" | undefined;\n wide: boolean;\n locale: string;\n timeZone: string;\n}): JSX.Element {\n const t = useActivityMessages();\n const [open, setOpen] = createSignal(false);\n const e = () => props.entry;\n const count = () => props.all.length;\n const bundled = () => (count() > 1 ? e().bundle : null);\n const text = () => {\n const bundle = bundled();\n return bundle ? bundle.text(count(), props.all) : e().text;\n };\n // A bundle keeps the detail line only when every entry has the same text.\n const detail = () =>\n count() === 1 || props.all.every((entry) => detailText(entry.detail) !== null && detailText(entry.detail) === detailText(e().detail))\n ? e().detail\n : undefined;\n const href = () => (e().details ? undefined : e().href);\n const clickable = () => Boolean(e().onOpen || e().details || href());\n // Folds out the details, or opens the entry.\n const trigger = () => {\n if (e().details) setOpen(!open());\n else e().onOpen?.();\n };\n let link: HTMLAnchorElement | undefined;\n // A click anywhere on the row acts like the sentence, but not on controls, inside folded-out details, or after\n // selecting text. A linked row follows its link; with a modifier or the middle button in a new tab, as the link would.\n const onRowClick = (event: MouseEvent) => {\n if (!clickable() || ignoresRowClick(event)) return;\n const target = href();\n if (!target) return trigger();\n if (event.button === 1 || event.ctrlKey || event.metaKey || event.shiftKey) window.open(target, \"_blank\", \"noopener\");\n else link?.click();\n };\n const meta = () => (\n <div class=\"k2b-activity__meta\">\n <time datetime={e().at} title={activityInstant(e().at, props.locale, props.timeZone)}>\n {activityWhen(e().at, props.now, props.locale, props.timeZone)}\n </time>\n {\" · \"}\n {activityAgo(e().at, props.now, props.locale, props.timeZone)}\n {\" · \"}\n {e().actor ?? t().activityAutomatic}\n </div>\n );\n const action = () => {\n const current = e().action;\n if (!current) return null;\n const content = (\n <>\n <i class={current.icon} aria-hidden=\"true\" />\n {current.label}\n </>\n );\n return current.href && !current.disabled ? (\n <a\n class=\"k2b-activity__action\"\n href={current.href}\n target={current.target}\n rel={current.target ? \"noopener\" : undefined}\n onClick={(event) => current.onClick?.(event)}\n data-activity-action={current.data}\n >\n {content}\n </a>\n ) : (\n <button\n type=\"button\"\n class=\"k2b-activity__action\"\n disabled={current.disabled}\n onClick={(event) => current.onClick?.(event)}\n data-activity-action={current.data}\n >\n {content}\n </button>\n );\n };\n return (\n // tabindex -1: the target for focus after a reload, never in the tab order.\n // biome-ignore lint/a11y/useKeyWithClickEvents: the sentence's own button is the keyboard target; a row click only widens the pointer target.\n <li\n {...e().attrs}\n tabindex=\"-1\"\n class=\"k2b-activity__entry\"\n data-first={props.first ? \"\" : undefined}\n data-end={props.end}\n data-clickable={clickable() ? \"\" : undefined}\n data-count={count() > 1 ? count() : undefined}\n onClick={onRowClick}\n onAuxClick={(event) => {\n if (event.button === 1 && href()) onRowClick(event);\n }}\n >\n <span class=\"k2b-activity__icon\" data-tone={TONES[e().tone ?? \"neutral\"]}>\n {/* biome-ignore lint/a11y/useAriaPropsSupportedByRole: with a label the icon is an image (`role=\"img\"`), which takes a name. */}\n <i\n class={e().icon}\n role={e().iconLabel ? \"img\" : undefined}\n aria-label={e().iconLabel}\n aria-hidden={e().iconLabel ? undefined : \"true\"}\n title={e().iconLabel}\n />\n </span>\n <div class=\"k2b-activity__body\">\n <div class=\"k2b-activity__text\">\n <Show when={clickable()} fallback={text()}>\n <Show\n when={href()}\n fallback={\n <button\n type=\"button\"\n class=\"k2b-activity__text-button\"\n aria-expanded={e().details ? open() : undefined}\n onClick={(event) => {\n event.stopPropagation();\n trigger();\n }}\n >\n {text()}\n </button>\n }\n >\n {(target) => (\n <a ref={link} class=\"k2b-activity__text-link\" href={target()}>\n {text()}\n </a>\n )}\n </Show>\n </Show>\n </div>\n <Show when={detail()}>\n <div class=\"k2b-activity__detail\">{detail()}</div>\n </Show>\n <Show when={!props.wide}>{meta()}</Show>\n <Show when={e().action}>\n <div>{action()}</div>\n </Show>\n <Show when={open() && e().details}>{(show) => <div class=\"k2b-activity__details\">{show()(props.all)}</div>}</Show>\n </div>\n <Show when={props.wide}>{meta()}</Show>\n </li>\n );\n}\n\n/** \"before → now\" of a detail line, the old value quiet. With `term` in front (\"Plan: Basic → Team\"). */\nfunction ActivityChange(props: { before: JSX.Element; now: JSX.Element; term?: string }): JSX.Element {\n return (\n <>\n {props.term ? `${props.term}: ` : \"\"}\n <span class=\"k2b-activity__before\">{props.before}</span>\n {\" → \"}\n {props.now}\n </>\n );\n}\n\nconst LOADING_WIDTHS = [150, 110, 170] as const;\n\n/** Loading: three quiet rows on the rail, announced to screen readers. */\nfunction ActivityLoading(props: { label?: string }): JSX.Element {\n const t = useActivityMessages();\n return (\n <div role=\"status\" aria-label={props.label ?? t().activityTitle}>\n <ol class=\"k2b-activity\" aria-hidden=\"true\">\n <For each={LOADING_WIDTHS}>\n {(width, index) => (\n <li\n class=\"k2b-activity__entry\"\n data-first={index() === 0 ? \"\" : undefined}\n data-end={index() === LOADING_WIDTHS.length - 1 ? \"last\" : undefined}\n >\n <span class=\"k2b-activity__icon\" data-placeholder=\"\" />\n <div class=\"k2b-activity__placeholder\">\n <div style={{ width: `${width}px` }}>\n <Skeleton class=\"k2b-activity__placeholder-line\" />\n </div>\n <div style={{ width: \"120px\" }}>\n <Skeleton class=\"k2b-activity__placeholder-meta\" />\n </div>\n </div>\n </li>\n )}\n </For>\n </ol>\n </div>\n );\n}\n\n/** Error: one sentence with \"Reload\". */\nfunction ActivityError(props: { onReload?: () => void; text?: JSX.Element }): JSX.Element {\n const t = useActivityMessages();\n return (\n <InlineGuidance tone=\"warning\" icon=\"ti ti-alert-triangle\" role=\"alert\">\n {props.text ?? t().activityError}{\" \"}\n <Show when={props.onReload}>\n {(reload) => (\n <button type=\"button\" class=\"k2b-activity__reload\" onClick={() => reload()()}>\n {t().activityReload}\n </button>\n )}\n </Show>\n </InlineGuidance>\n );\n}\n\n/** Empty: one sentence. */\nfunction ActivityEmpty(props: { text?: JSX.Element }): JSX.Element {\n const t = useActivityMessages();\n return <p class=\"k2b-activity-empty\">{props.text ?? t().activityEmpty}</p>;\n}\n\ntype ActivityListComponent = ((props: ActivityListProps) => JSX.Element) & {\n Loading: typeof ActivityLoading;\n Empty: typeof ActivityEmpty;\n Error: typeof ActivityError;\n Change: typeof ActivityChange;\n};\n\nexport const ActivityList: ActivityListComponent = Object.assign(ActivityListRoot, {\n Loading: ActivityLoading,\n Empty: ActivityEmpty,\n Error: ActivityError,\n Change: ActivityChange,\n});\n\n/** Newest rows a card shows; \"All N\" opens the rest. */\nconst ACTIVITY_CARD_LIMIT = 6;\n\n/** A kind for the filter of the \"All N\" dialog; only kinds with entries appear. */\nexport type ActivityKind = { key: string; label: string };\n\nexport type ActivityDialogInput = ActivityTimeProps & {\n /** Read on open; build the entries in the getter, so the dialog gets nodes of its own. */\n entries: () => readonly ActivityEntry[];\n /** Defaults to \"History\". */\n title?: string;\n /** Icon class beside the title, such as `ti ti-activity`; none by default. */\n icon?: string;\n /** Second line, such as the object the history belongs to. */\n subtitle?: string;\n kinds?: readonly ActivityKind[];\n /** Shown when there are no entries; defaults to \"Nothing has happened yet.\". */\n emptyText?: JSX.Element;\n};\n\nexport type ActivityCardProps = ActivityTimeProps & {\n /** `null`: nothing loaded yet (loading or error). */\n entries: readonly ActivityEntry[] | null;\n /** Rows the card shows. Defaults to 6. */\n limit?: number;\n loading?: boolean;\n error?: boolean;\n onReload?: () => void;\n emptyText?: JSX.Element;\n /** Defaults to \"History\". */\n title?: string;\n /** Heading level of the title; 2 by default, 3 for a card under a section heading of the page. */\n level?: 2 | 3;\n /** Second line in the \"All N\" dialog, such as \"Invoice RE-2610-00042 · Lindner\". */\n subtitle?: string;\n /** Filter by kind in the dialog; only kinds with entries appear. */\n kinds?: readonly ActivityKind[];\n /** More at the end of the heading, before \"All N\", such as \"reloading\". */\n actions?: JSX.Element;\n /** Above the timeline, such as a quiet line \"Waiting for approval\"; replaces the empty text. */\n lead?: JSX.Element;\n /** For tests: rendered as `data-activity-card`. */\n name?: string;\n id?: string;\n};\n\n/**\n * The history as a card of a detail page: a section with \"History\", and \"All N\" at the end of the heading when\n * there are more than `limit` rows; below it the list in the compact density. \"All N\" opens the full history as a\n * dialog in the wide density, with a filter by kind when `kinds` is set.\n *\n * Build `entries` in the getter (`entries={list()}` with a function, never from `createMemo`): sentence, detail, and\n * person are JSX, and card and dialog each need nodes of their own.\n */\nexport function ActivityCard(props: ActivityCardProps): JSX.Element {\n const t = useActivityMessages();\n const context = useActivityContext(props);\n const limit = () => props.limit ?? ACTIVITY_CARD_LIMIT;\n // Only times and keys count; no JSX needed, so the card's own list serves.\n const count = createMemo(\n () =>\n activityRows(props.entries ?? [], {\n now: props.now ? new Date(props.now) : new Date(),\n timeZone: context.timeZone(),\n key: activityBundleKey,\n }).length,\n );\n const openAll = () =>\n void openActivityDialog({\n entries: () => props.entries ?? [],\n title: props.title ?? t().activityTitle,\n subtitle: props.subtitle,\n kinds: props.kinds,\n now: props.now,\n dateConfig: props.dateConfig,\n timeZone: props.timeZone,\n });\n return (\n <Section\n size=\"md\"\n level={props.level ?? 2}\n title={props.title ?? t().activityTitle}\n icon=\"ti ti-history\"\n id={props.id}\n data-activity-card={props.name}\n aria-busy={props.loading ? \"true\" : undefined}\n actions={\n <>\n {props.actions}\n <Show when={count() > limit()}>\n <Button variant=\"text\" size=\"sm\" class=\"k2b-activity-card__all\" onClick={openAll} data-activity-all=\"\">\n {t().activityAll({ count: count() })}\n </Button>\n </Show>\n </>\n }\n >\n <div class=\"k2b-activity-card__body\">\n {props.lead}\n <Show\n when={props.entries}\n fallback={\n <Show when={props.error} fallback={<ActivityLoading label={props.title} />}>\n <ActivityError onReload={props.onReload} />\n </Show>\n }\n >\n {(list) => (\n <>\n <Show when={props.error}>\n <div class=\"k2b-activity-card__alert\">\n <ActivityError onReload={props.onReload} />\n </div>\n </Show>\n <Show when={list().length > 0} fallback={<Show when={!props.lead}>{<ActivityEmpty text={props.emptyText} />}</Show>}>\n <ActivityListRoot\n entries={list()}\n limit={limit()}\n now={props.now}\n dateConfig={props.dateConfig}\n timeZone={props.timeZone}\n label={props.title}\n />\n </Show>\n </>\n )}\n </Show>\n </div>\n </Section>\n );\n}\n\n/** The full history as a dialog: the title, the object below it, a filter by kind, and the list in the wide density. */\nexport const openActivityDialog = (input: ActivityDialogInput): Promise<void | undefined> =>\n prompts.dialog<void>(() => <ActivityDialogContent {...input} />, {\n title: input.title ?? resolveActivityMessages(input.dateConfig?.locale).activityTitle,\n icon: input.icon,\n size: \"large\",\n });\n\nfunction ActivityDialogContent(props: ActivityDialogInput): JSX.Element {\n const t = useActivityMessages();\n const [kind, setKind] = createSignal(\"all\");\n // The filter counts entries, not bundled rows, and appears only from three choices on.\n const total = (key: string) => props.entries().filter((entry) => key === \"all\" || entry.kind === key).length;\n const options = () => [\n { value: \"all\", label: t().activityAll({ count: total(\"all\") }) },\n ...(props.kinds ?? [])\n .filter((item) => total(item.key) > 0)\n .map((item) => ({ value: item.key, label: `${item.label} ${total(item.key)}` })),\n ];\n const shown = () => props.entries().filter((entry) => kind() === \"all\" || entry.kind === kind());\n return (\n <div class=\"k2b-activity-dialog\" data-activity-dialog=\"\">\n <Show when={props.subtitle}>\n <p class=\"k2b-activity-dialog__subtitle\">{props.subtitle}</p>\n </Show>\n <Show when={options().length > 2}>\n <ChoiceChips aria-label={t().activityFilter} value={kind()} options={options()} onValueChange={setKind} />\n </Show>\n <Show when={props.entries().length > 0} fallback={<ActivityEmpty text={props.emptyText} />}>\n <ActivityListRoot\n entries={shown()}\n density=\"wide\"\n now={props.now}\n dateConfig={props.dateConfig}\n timeZone={props.timeZone}\n label={props.title}\n />\n </Show>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC5F,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,cAAc,QAAQ,4BAA4B;AAC3D,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,WAAW,QAAQ,uBAAuB;AACnD,SAAS,mBAAmB,QAAQ,gBAAgB;AACpD,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,QAAQ,QAAQ,sBAAsB;AAC/C,SAAS,uBAAuB,EAAE,mBAAmB,QAAQ,qBAAqB;AAClF,SAGE,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,YAAY,QACP,qBAAqB;;AAE5B;;AAGA;;AAwDA;;AA2BA;AACA,MAAM,iBAAiB,GAAI,KAAoB,IAC7C,KAAK,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG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
1
+ {"version":3,"names":[],"sources":["content/ActivityList.tsx"],"sourcesContent":["import type { DateContext } from \"@k2b/stdlib\";\nimport { createMemo, createSignal, For, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { InlineGuidance } from \"../feedback/InlineGuidance\";\nimport { prompts } from \"../feedback/prompts\";\nimport { ChoiceChips } from \"../inputs/ChoiceChips\";\nimport { useDateConfigLocale } from \"../intl/locale\";\nimport { ScrollArea } from \"../layout/ScrollArea\";\nimport { Avatar } from \"../surfaces/Avatar\";\nimport { Section } from \"../surfaces/Section\";\nimport { Skeleton } from \"../surfaces/Skeleton\";\nimport { resolveActivityMessages, useActivityMessages } from \"./activity-messages\";\nimport {\n type ActivityGroup,\n type ActivityRow,\n activityAgo,\n activityDayLabel,\n activityInstant,\n activityRows,\n activityWhen,\n} from \"./activity-timeline\";\n\n/** Warning and danger appear as a small mark at the avatar; ordinary kind icons stay out of the sentence. */\nexport type ActivityTone = \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n/** At most one action per entry, a link with an icon in the last line, only while the state needs it. */\nexport type ActivityAction = {\n icon: string;\n label: string;\n /** A link when set and not disabled; otherwise a button. */\n href?: string;\n target?: string;\n onClick?: (event: MouseEvent) => void;\n disabled?: boolean;\n /** For tests: rendered as `data-activity-action`. */\n data?: string;\n};\n\n/** Identity for the avatar; the actor text stays application-owned. Deleted people use `deleted`; system events keep their own glyph. */\nexport type ActivityAvatar = {\n name: string;\n kind: \"person\" | \"service\" | \"system\" | \"deleted\";\n src?: string | null;\n};\n\nexport type ActivityEntry = {\n /**\n * Stable key of the entry, such as its record id; unique within the list. With it a row keeps its node, folded-out\n * details, and focus when the caller rebuilds the entries, such as after a refresh. Without it the entry object is\n * the key.\n */\n id?: string;\n /** ISO instant. */\n at: string;\n /** Kind icon, shown as a status mark for warning, danger, or an explicit `iconLabel`. */\n icon?: string;\n tone?: ActivityTone;\n /** Name of the icon for screen readers, when the sentence does not say it already. */\n iconLabel?: string;\n /** One sentence, such as \"Invitation sent\". */\n text: JSX.Element;\n /**\n * Equal entries (one key) after each other on the same day become one row; `text` says it with the count\n * (\"Draft changed 4 times\") and gets every entry of the bundle, newest first. A bundle keeps the detail line only\n * when it is the same text for all entries.\n */\n bundle?: { key: string; text: (count: number, all: readonly ActivityEntry[]) => JSX.Element } | null;\n /** Only a result, the reason of a failure, a quote, or \"before → now\" (`ActivityList.Change`). */\n detail?: JSX.Element;\n /** Who did it, shown before the sentence; without one the row reads \"Automatic\". */\n actor?: JSX.Element | null;\n avatar?: ActivityAvatar;\n action?: ActivityAction | null;\n /** A click on the entry opens it, such as its dialog. */\n onOpen?: () => void;\n /**\n * The entry's object as a link: the sentence becomes the link, a click anywhere on the row follows it, and a middle\n * click or a click with Ctrl, Cmd, or Shift opens it in a new tab. Takes the place of `onOpen`; ignored with\n * `details`.\n */\n href?: string;\n /** A click on the entry folds out its details below it; for a bundle with all of its entries. */\n details?: (all: readonly ActivityEntry[]) => JSX.Element;\n /** Kind for the filter in the \"All N\" dialog. */\n kind?: string;\n /** Attributes on the list item, such as `data-email` for focus after a reload. */\n attrs?: Record<`data-${string}`, string | number | undefined>;\n};\n\n/** `compact` for a card or side column; `wide` for a dialog or page. Both keep time at the end of the row. */\nexport type ActivityDensity = \"compact\" | \"wide\";\n\ntype ActivityTimeProps = {\n /**\n * The current time. Pass the server's time so the server and the first browser render show the same text; the\n * browser then moves it on every minute.\n */\n now?: Date | string;\n /** Date context of the application; days count in its time zone. */\n dateConfig?: DateContext;\n /** Convenience override for `dateConfig.timeZone`. Defaults to UTC, so server and browser agree. */\n timeZone?: string;\n};\n\nexport type ActivityListProps = ActivityTimeProps & {\n entries: readonly ActivityEntry[];\n density?: ActivityDensity;\n /** Shows only the newest rows; the rail then fades out below them. */\n limit?: number;\n /** More follows below the last visible row (further pages from the server); the rail fades out. */\n more?: boolean;\n /** Accessible name of the list. Defaults to \"History\". */\n label?: string;\n class?: string;\n};\n\n/** A single row inside a feed. The caller owns ordering, grouping, pagination, and the clock. */\nexport type ActivityRowProps = ActivityTimeProps & {\n entry: ActivityEntry;\n /** Marks the currently open object, independently of expanded details. */\n selected?: boolean;\n /** Handles the sentence link, including keyboard activation. Leave modified clicks to the browser. */\n onNavigate?: (event: MouseEvent) => void;\n class?: string;\n};\n\nfunction ActivityStandaloneRow(props: ActivityRowProps): JSX.Element {\n const context = useActivityContext(props);\n const initial = new Date();\n return (\n <ActivityRowItem\n entry={props.entry}\n all={[props.entry]}\n now={props.now ? new Date(props.now) : initial}\n locale={context.locale()}\n timeZone={context.timeZone()}\n selected={props.selected}\n onNavigate={props.onNavigate}\n class={props.class}\n />\n );\n}\n\n/** Bundle key of an entry: its bundle key and its actor; without `bundle` never bundled. */\nconst activityBundleKey = (entry: ActivityEntry): string | null =>\n entry.bundle ? `${entry.bundle.key}|${typeof entry.actor === \"string\" ? entry.actor : \"\"}` : null;\n\n/** The list's clock: first `start` (from the server, the same first render), then in the browser every minute anew. */\nconst createNow = (start: () => Date | string | undefined) => {\n const initial = start();\n const [now, setNow] = createSignal(initial ? new Date(initial) : new Date());\n onMount(() => {\n setNow(new Date());\n const timer = setInterval(() => setNow(new Date()), 60_000);\n onCleanup(() => clearInterval(timer));\n });\n return now;\n};\n\nconst useActivityContext = (props: ActivityTimeProps) => {\n const context = useDateConfigLocale(() => props.dateConfig);\n return {\n locale: () => context().locale ?? \"en\",\n timeZone: () => props.timeZone ?? props.dateConfig?.timeZone ?? \"UTC\",\n };\n};\n\n/** The key a row hangs on: the entry's `id`, or the entry object itself. */\nconst rowKey = (entry: ActivityEntry): string | ActivityEntry => entry.id ?? entry;\n\n/** Two bundles are the same when they hold the same entries in the same order. */\nconst sameEntries = (a: readonly ActivityEntry[], b: readonly ActivityEntry[]): boolean =>\n a.length === b.length && a.every((entry, index) => entry === b[index]);\n\n/** A click that must not act on the row: on a control inside it, inside folded-out details, or the end of a text selection. */\nconst ignoresRowClick = (event: MouseEvent): boolean =>\n Boolean((event.target as Element | null)?.closest(\"a, button, input, textarea, select, label, [role=button], .k2b-activity__details\")) ||\n window.getSelection()?.isCollapsed === false;\n\n/** Text of a detail line when it is only text; JSX cannot be compared. */\nconst detailText = (detail: JSX.Element | undefined): string | null => (typeof detail === \"string\" ? detail : null);\n\nconst TONES: Record<ActivityTone, string | undefined> = { neutral: undefined, success: \"success\", warning: \"warning\", danger: \"danger\" };\n\n/**\n * A vertical timeline: newest at the top, the start at the bottom. Dashed dividers name \"Today\", \"Yesterday\", and\n * each day of the last week; everything older stands under one divider \"More than a week ago\".\n *\n * A row: a small avatar, the actor and one sentence, then the time. Only warnings, failures, and explicitly named\n * icons get a small mark at the avatar. Rarely a detail line below, and at most one action. Equal entries after each\n * other on the same day become one row with a count (`bundle`). Every row hangs on\n * its newest entry (its `id`, or the object): the minute clock changes only times and dividers, folded-out details,\n * bundle sentences, and focus stay.\n */\nfunction ActivityListRoot(props: ActivityListProps): JSX.Element {\n const t = useActivityMessages();\n const context = useActivityContext(props);\n const now = createNow(() => props.now);\n // Read the entries apart from the clock: a caller that builds them in a getter does not rebuild them every minute.\n const list = createMemo(() => props.entries);\n const allRows = createMemo(() => activityRows(list(), { now: now(), timeZone: context.timeZone(), key: activityBundleKey }));\n const rows = createMemo(() => (props.limit ? allRows().slice(0, props.limit) : allRows()));\n const rowOf = createMemo(() => new Map(rows().map((row) => [rowKey(row.entry), row] as const)));\n const keys = createMemo(() => rows().map((row) => rowKey(row.entry)));\n const fades = () => props.more === true || (props.limit !== undefined && allRows().length > props.limit);\n const divider = (group: ActivityGroup) =>\n group.kind === \"today\"\n ? t().activityToday\n : group.kind === \"yesterday\"\n ? t().activityYesterday\n : group.kind === \"older\"\n ? t().activityOlder\n : activityDayLabel(group.day, now(), context.locale(), context.timeZone());\n return (\n <ol\n class={props.class ? `k2b-activity ${props.class}` : \"k2b-activity\"}\n data-density={props.density ?? \"compact\"}\n aria-label={props.label ?? t().activityTitle}\n >\n <For each={keys()}>\n {(key, index) => {\n // `keys` and `rowOf` come from the same rows, so the key has its row; while a removed key is disposed the\n // row keeps its last value.\n const initial = rowOf().get(key);\n if (!initial) throw new Error(\"ActivityList: a row key without its row.\");\n const row = createMemo((previous: ActivityRow<ActivityEntry>) => rowOf().get(key) ?? previous, initial);\n // The clock rebuilds the rows every minute; the entry and its bundle change only when their entries do, so a\n // bundle sentence and folded-out details keep their nodes.\n const entry = createMemo(() => row().entry);\n const all = createMemo(() => row().all, undefined, { equals: sameEntries });\n const last = () => index() === rows().length - 1;\n return (\n <>\n <Show when={row().divider}>\n {(group) => (\n <li class=\"k2b-activity__day\" aria-hidden=\"true\">\n <span class=\"k2b-activity__day-line\" />\n {divider(group())}\n </li>\n )}\n </Show>\n <ActivityRowItem\n entry={entry()}\n all={all()}\n now={now()}\n listItem\n first={index() === 0}\n end={last() ? (fades() ? \"more\" : \"last\") : undefined}\n locale={context.locale()}\n timeZone={context.timeZone()}\n />\n </>\n );\n }}\n </For>\n </ol>\n );\n}\n\nfunction ActivityRowItem(props: {\n entry: ActivityEntry;\n all: readonly ActivityEntry[];\n now: Date;\n listItem?: boolean;\n first?: boolean;\n end?: \"last\" | \"more\";\n selected?: boolean;\n onNavigate?: (event: MouseEvent) => void;\n class?: string;\n locale: string;\n timeZone: string;\n}): JSX.Element {\n const t = useActivityMessages();\n const [open, setOpen] = createSignal(false);\n const e = () => props.entry;\n const count = () => props.all.length;\n const bundled = () => (count() > 1 ? e().bundle : null);\n const text = () => {\n const bundle = bundled();\n return bundle ? bundle.text(count(), props.all) : e().text;\n };\n // A bundle keeps the detail line only when every entry has the same text.\n const detail = () =>\n count() === 1 || props.all.every((entry) => detailText(entry.detail) !== null && detailText(entry.detail) === detailText(e().detail))\n ? e().detail\n : undefined;\n const href = () => (e().details ? undefined : e().href);\n const clickable = () => Boolean(e().onOpen || e().details || href());\n // Folds out the details, or opens the entry.\n const trigger = () => {\n if (e().details) setOpen(!open());\n else e().onOpen?.();\n };\n let link: HTMLAnchorElement | undefined;\n // A click anywhere on the row acts like the sentence, but not on controls, inside folded-out details, or after\n // selecting text. A linked row follows its link; with a modifier or the middle button in a new tab, as the link would.\n const onRowClick = (event: MouseEvent) => {\n if (!clickable() || ignoresRowClick(event)) return;\n const target = href();\n if (!target) return trigger();\n if (event.button === 1 || event.ctrlKey || event.metaKey || event.shiftKey) window.open(target, \"_blank\", \"noopener\");\n else link?.click();\n };\n const actor = () => e().actor ?? t().activityAutomatic;\n const avatar = (): ActivityAvatar => {\n const entry = e();\n const actor = entry.actor;\n return entry.avatar ?? { name: typeof actor === \"string\" ? actor : \"\", kind: typeof actor === \"string\" ? \"person\" : \"system\" };\n };\n const marked = () => e().tone === \"warning\" || e().tone === \"danger\" || Boolean(e().iconLabel);\n const meta = () => (\n <div class=\"k2b-activity__meta\">\n <time datetime={e().at}>\n <span aria-hidden=\"true\">{activityWhen(e().at, props.now, props.locale, props.timeZone)}</span>\n <span class=\"k2b-sr-only\">\n {activityInstant(e().at, props.locale, props.timeZone)} · {activityAgo(e().at, props.now, props.locale, props.timeZone)}\n </span>\n </time>\n </div>\n );\n const action = () => {\n const current = e().action;\n if (!current) return null;\n const content = (\n <>\n <i class={current.icon} aria-hidden=\"true\" />\n {current.label}\n </>\n );\n return current.href && !current.disabled ? (\n <a\n class=\"k2b-activity__action\"\n href={current.href}\n target={current.target}\n rel={current.target ? \"noopener\" : undefined}\n onClick={(event) => current.onClick?.(event)}\n data-activity-action={current.data}\n >\n {content}\n </a>\n ) : (\n <button\n type=\"button\"\n class=\"k2b-activity__action\"\n disabled={current.disabled}\n onClick={(event) => current.onClick?.(event)}\n data-activity-action={current.data}\n >\n {content}\n </button>\n );\n };\n return (\n // tabindex -1: the target for focus after a reload, never in the tab order.\n <Dynamic\n component={props.listItem ? \"li\" : \"div\"}\n {...e().attrs}\n tabindex=\"-1\"\n class={props.class ? `k2b-activity__entry ${props.class}` : \"k2b-activity__entry\"}\n data-tone={TONES[e().tone ?? \"neutral\"]}\n data-selected={props.selected ? \"\" : undefined}\n data-first={props.first ? \"\" : undefined}\n data-end={props.end}\n data-clickable={clickable() ? \"\" : undefined}\n data-count={count() > 1 ? count() : undefined}\n data-expanded={open() ? \"\" : undefined}\n onClick={onRowClick}\n onAuxClick={(event: MouseEvent) => {\n if (event.button === 1 && href()) onRowClick(event);\n }}\n >\n <span class=\"k2b-activity__avatar\">\n <span aria-hidden=\"true\">\n <Avatar\n name={avatar().name}\n src={avatar().src}\n size=\"xs\"\n shape={avatar().kind === \"service\" ? \"square\" : \"circle\"}\n tone={avatar().kind === \"person\" ? \"person\" : \"neutral\"}\n icon={\n avatar().kind === \"service\"\n ? \"ti ti-robot\"\n : avatar().kind === \"system\"\n ? \"ti ti-settings\"\n : avatar().kind === \"deleted\"\n ? \"ti ti-user-off\"\n : undefined\n }\n />\n </span>\n <Show when={marked()}>\n <span class=\"k2b-activity__icon\" data-tone={TONES[e().tone ?? \"neutral\"]}>\n {/* biome-ignore lint/a11y/useAriaPropsSupportedByRole: a named icon is an image. */}\n <i\n class={e().icon ?? \"ti ti-alert-triangle\"}\n role={e().iconLabel ? \"img\" : undefined}\n aria-label={e().iconLabel}\n aria-hidden={e().iconLabel ? undefined : \"true\"}\n />\n </span>\n </Show>\n </span>\n <div class=\"k2b-activity__body\">\n <div class=\"k2b-activity__text\">\n <span class=\"k2b-activity__actor\">\n <span class=\"k2b-activity__actor-name\">{actor()}</span>\n <span>{\" · \"}</span>\n </span>\n <Show when={clickable()} fallback={text()}>\n <Show\n when={href()}\n fallback={\n <button\n type=\"button\"\n class=\"k2b-activity__text-button\"\n aria-expanded={e().details ? open() : undefined}\n onClick={(event) => {\n event.stopPropagation();\n trigger();\n }}\n >\n {text()}\n </button>\n }\n >\n {(target) => (\n <a\n ref={link}\n class=\"k2b-activity__text-link\"\n href={target()}\n aria-current={props.selected ? \"true\" : undefined}\n onClick={(event) => props.onNavigate?.(event)}\n >\n {text()}\n </a>\n )}\n </Show>\n </Show>\n </div>\n <Show when={detail()}>\n <div class=\"k2b-activity__detail\">{detail()}</div>\n </Show>\n <Show when={e().action}>\n <div>{action()}</div>\n </Show>\n <Show when={open() && e().details}>{(show) => <div class=\"k2b-activity__details\">{show()(props.all)}</div>}</Show>\n </div>\n {meta()}\n </Dynamic>\n );\n}\n\n/** \"before → now\" of a detail line, the old value quiet. With `term` in front (\"Plan: Basic → Team\"). */\nfunction ActivityChange(props: { before: JSX.Element; now: JSX.Element; term?: string }): JSX.Element {\n return (\n <>\n {props.term ? `${props.term}: ` : \"\"}\n <span class=\"k2b-activity__before\">{props.before}</span>\n {\" → \"}\n {props.now}\n </>\n );\n}\n\nconst LOADING_WIDTHS = [150, 110, 170] as const;\n\n/** Loading: three quiet rows on the rail, announced to screen readers. */\nfunction ActivityLoading(props: { label?: string }): JSX.Element {\n const t = useActivityMessages();\n return (\n <div role=\"status\" aria-label={props.label ?? t().activityTitle}>\n <ol class=\"k2b-activity\" aria-hidden=\"true\">\n <For each={LOADING_WIDTHS}>\n {(width, index) => (\n <li\n class=\"k2b-activity__entry\"\n data-first={index() === 0 ? \"\" : undefined}\n data-end={index() === LOADING_WIDTHS.length - 1 ? \"last\" : undefined}\n >\n <span class=\"k2b-activity__avatar\" data-placeholder=\"\" />\n <div class=\"k2b-activity__placeholder\">\n <div style={{ width: `${width}px` }}>\n <Skeleton class=\"k2b-activity__placeholder-line\" />\n </div>\n </div>\n <div class=\"k2b-activity__placeholder\">\n <div style={{ width: \"5ch\" }}>\n <Skeleton class=\"k2b-activity__placeholder-meta\" />\n </div>\n </div>\n </li>\n )}\n </For>\n </ol>\n </div>\n );\n}\n\n/** Error: one sentence with \"Reload\". */\nfunction ActivityError(props: { onReload?: () => void; text?: JSX.Element }): JSX.Element {\n const t = useActivityMessages();\n return (\n <InlineGuidance tone=\"warning\" icon=\"ti ti-alert-triangle\" role=\"alert\">\n {props.text ?? t().activityError}{\" \"}\n <Show when={props.onReload}>\n {(reload) => (\n <button type=\"button\" class=\"k2b-activity__reload\" onClick={() => reload()()}>\n {t().activityReload}\n </button>\n )}\n </Show>\n </InlineGuidance>\n );\n}\n\n/** Empty: one sentence. */\nfunction ActivityEmpty(props: { text?: JSX.Element }): JSX.Element {\n const t = useActivityMessages();\n return <p class=\"k2b-activity-empty\">{props.text ?? t().activityEmpty}</p>;\n}\n\ntype ActivityListComponent = ((props: ActivityListProps) => JSX.Element) & {\n Row: typeof ActivityStandaloneRow;\n Loading: typeof ActivityLoading;\n Empty: typeof ActivityEmpty;\n Error: typeof ActivityError;\n Change: typeof ActivityChange;\n};\n\nexport const ActivityList: ActivityListComponent = Object.assign(ActivityListRoot, {\n Row: ActivityStandaloneRow,\n Loading: ActivityLoading,\n Empty: ActivityEmpty,\n Error: ActivityError,\n Change: ActivityChange,\n});\n\n/** Newest rows a card shows; \"All N\" opens the rest. */\nconst ACTIVITY_CARD_LIMIT = 6;\n\n/** A kind for the filter of the \"All N\" dialog; only kinds with entries appear. */\nexport type ActivityKind = { key: string; label: string };\n\nexport type ActivityDialogInput = ActivityTimeProps & {\n /** Read on open; build the entries in the getter, so the dialog gets nodes of its own. */\n entries: () => readonly ActivityEntry[];\n /** Defaults to \"History\". */\n title?: string;\n /** Icon class beside the title, such as `ti ti-activity`; none by default. */\n icon?: string;\n /** Second line, such as the object the history belongs to. */\n subtitle?: string;\n kinds?: readonly ActivityKind[];\n /** Shown when there are no entries; defaults to \"Nothing has happened yet.\". */\n emptyText?: JSX.Element;\n};\n\nexport type ActivityCardProps = ActivityTimeProps & {\n /** `null`: nothing loaded yet (loading or error). */\n entries: readonly ActivityEntry[] | null;\n /** Rows the card shows. Defaults to 6. */\n limit?: number;\n loading?: boolean;\n error?: boolean;\n onReload?: () => void;\n emptyText?: JSX.Element;\n /** Defaults to \"History\". */\n title?: string;\n /** Heading level of the title; 2 by default, 3 for a card under a section heading of the page. */\n level?: 2 | 3;\n /** Second line in the \"All N\" dialog, such as \"Invoice RE-2610-00042 · Lindner\". */\n subtitle?: string;\n /** Filter by kind in the dialog; only kinds with entries appear. */\n kinds?: readonly ActivityKind[];\n /** More at the end of the heading, before \"All N\", such as \"reloading\". */\n actions?: JSX.Element;\n /** Above the timeline, such as a quiet line \"Waiting for approval\"; replaces the empty text. */\n lead?: JSX.Element;\n /** For tests: rendered as `data-activity-card`. */\n name?: string;\n id?: string;\n};\n\n/**\n * The history as a card of a detail page: a section with \"History\", and \"All N\" at the end of the heading when\n * there are more than `limit` rows; below it the list in the compact density. \"All N\" opens the full history as a\n * dialog in the wide density, with a filter by kind when `kinds` is set.\n *\n * Build `entries` in the getter (`entries={list()}` with a function, never from `createMemo`): sentence, detail, and\n * person are JSX, and card and dialog each need nodes of their own.\n */\nexport function ActivityCard(props: ActivityCardProps): JSX.Element {\n const t = useActivityMessages();\n const context = useActivityContext(props);\n const limit = () => props.limit ?? ACTIVITY_CARD_LIMIT;\n // Only times and keys count; no JSX needed, so the card's own list serves.\n const count = createMemo(\n () =>\n activityRows(props.entries ?? [], {\n now: props.now ? new Date(props.now) : new Date(),\n timeZone: context.timeZone(),\n key: activityBundleKey,\n }).length,\n );\n const openAll = () =>\n void openActivityDialog({\n entries: () => props.entries ?? [],\n title: props.title ?? t().activityTitle,\n subtitle: props.subtitle,\n kinds: props.kinds,\n now: props.now,\n dateConfig: props.dateConfig,\n timeZone: props.timeZone,\n });\n return (\n <Section\n size=\"md\"\n level={props.level ?? 2}\n title={props.title ?? t().activityTitle}\n icon=\"ti ti-history\"\n id={props.id}\n data-activity-card={props.name}\n aria-busy={props.loading ? \"true\" : undefined}\n actions={\n <>\n {props.actions}\n <Show when={count() > limit()}>\n <Button variant=\"text\" size=\"sm\" class=\"k2b-activity-card__all\" onClick={openAll} data-activity-all=\"\">\n {t().activityAll({ count: count() })}\n </Button>\n </Show>\n </>\n }\n >\n <div class=\"k2b-activity-card__body\">\n {props.lead}\n <Show\n when={props.entries}\n fallback={\n <Show when={props.error} fallback={<ActivityLoading label={props.title} />}>\n <ActivityError onReload={props.onReload} />\n </Show>\n }\n >\n {(list) => (\n <>\n <Show when={props.error}>\n <div class=\"k2b-activity-card__alert\">\n <ActivityError onReload={props.onReload} />\n </div>\n </Show>\n <Show when={list().length > 0} fallback={<Show when={!props.lead}>{<ActivityEmpty text={props.emptyText} />}</Show>}>\n <ActivityListRoot\n entries={list()}\n limit={limit()}\n now={props.now}\n dateConfig={props.dateConfig}\n timeZone={props.timeZone}\n label={props.title}\n />\n </Show>\n </>\n )}\n </Show>\n </div>\n </Section>\n );\n}\n\n/** The full history as a dialog: the title, the object below it, a filter by kind, and the list in the wide density. */\nexport const openActivityDialog = (input: ActivityDialogInput): Promise<void | undefined> =>\n prompts.dialog<void>(() => <ActivityDialogContent {...input} />, {\n title: input.title ?? resolveActivityMessages(input.dateConfig?.locale).activityTitle,\n icon: input.icon,\n size: \"large\",\n });\n\nfunction ActivityDialogContent(props: ActivityDialogInput): JSX.Element {\n const t = useActivityMessages();\n const [kind, setKind] = createSignal(\"all\");\n // The filter counts entries, not bundled rows, and appears only from three choices on.\n const total = (key: string) => props.entries().filter((entry) => key === \"all\" || entry.kind === key).length;\n const options = () => [\n { value: \"all\", label: t().activityAll({ count: total(\"all\") }) },\n ...(props.kinds ?? [])\n .filter((item) => total(item.key) > 0)\n .map((item) => ({ value: item.key, label: `${item.label} ${total(item.key)}` })),\n ];\n const shown = () => props.entries().filter((entry) => kind() === \"all\" || entry.kind === kind());\n return (\n <div class=\"k2b-activity-dialog\" data-activity-dialog=\"\">\n <Show when={props.subtitle}>\n <p class=\"k2b-activity-dialog__subtitle\">{props.subtitle}</p>\n </Show>\n <Show when={options().length > 2}>\n <div class=\"k2b-activity-dialog__filters\">\n <ChoiceChips aria-label={t().activityFilter} value={kind()} options={options()} onValueChange={setKind} />\n </div>\n </Show>\n <ScrollArea inset class=\"k2b-activity-dialog__list\">\n <Show when={props.entries().length > 0} fallback={<ActivityEmpty text={props.emptyText} />}>\n <ActivityListRoot\n entries={shown()}\n density=\"wide\"\n now={props.now}\n dateConfig={props.dateConfig}\n timeZ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KAAK;UAAA,OAAE,IAAI,CAAC,CAAC;QAAA;QAAA,IAAE,OAAO;UAAA,OAAE,OAAO,CAAC,CAAC;QAAA;QAAE,aAAa,EAAE;MAAO;IAAA;EAAA,gCAGzG,UAAU;IAAC,KAAK;IAAA;IAAA;MAAA,yBACd,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;QAAA;QAAA,IAAE,QAAQ;UAAA,yBAAG,aAAa;YAAA,IAAC,IAAI;cAAA,OAAE,KAAK,CAAC,SAAS;YAAA;UAAA;QAAA;QAAA;UAAA,yBACnF,gBAAgB;YAAA,IACf,OAAO;cAAA,OAAE,KAAK,CAAC,CAAC;YAAA;YAChB,OAAO;YAAA,IACP,GAAG;cAAA,OAAE,KAAK,CAAC,GAAG;YAAA;YAAA,IACd,UAAU;cAAA,OAAE,KAAK,CAAC,UAAU;YAAA;YAAA,IAC5B,QAAQ;cAAA,OAAE,KAAK,CAAC,QAAQ;YAAA;YAAA,IACxB,KAAK;cAAA,OAAE,KAAK,CAAC,KAAK;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAM9B","ignoreList":[]}
@@ -944,18 +944,6 @@ const BUILTIN_RENDERERS = [{
944
944
 
945
945
  // ── Component ───────────────────────────────────────────────────────────────
946
946
 
947
- /**
948
- * A file size such as "4.2 MB". With `locale`, the number follows that language ("4,2 MB") and drops a trailing
949
- * zero ("64 KB"); without it, the output stays as before.
950
- */
951
- export const formatFileViewSize = (bytes, locale) => {
952
- const [value, unit] = bytes < 1024 ? [bytes, "B"] : bytes < 1024 * 1024 ? [bytes / 1024, "KB"] : [bytes / (1024 * 1024), "MB"];
953
- if (unit === "B") return `${bytes} B`;
954
- if (!locale) return `${value.toFixed(1)} ${unit}`;
955
- return `${new Intl.NumberFormat(locale, {
956
- maximumFractionDigits: 1
957
- }).format(value)} ${unit}`;
958
- };
959
947
  export default function FileView(props) {
960
948
  const messages = useUiMessages();
961
949
  const fileViewMessages = useFileViewMessages();
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/FileView.tsx"],"sourcesContent":["import { useMarkdownEditorMessages } from \"../inputs/markdown/editor-messages\";\nimport { useDataTableMessages } from \"./data-table-messages\";\nimport { useFileViewMessages } from \"./file-view-messages\";\n/**\n * FileView — renders one file through a small renderer registry keyed by\n * media type / path. Editing is enabled purely by the presence of `save`;\n * without it every renderer is read-only. IDE-style chrome: editors reuse\n * the markdown editor's surface (toolbar with an in-toolbar save, Ctrl/Cmd+S),\n * previews are quiet paper panels with icon-only actions overlaid top-right.\n * A plain preview drops the panel and sits on its host's surface instead.\n * Custom renderers are passed per instance, which keeps SSR requests and\n * independently mounted applications isolated.\n */\n\nimport { mutation } from \"@k2b/stdlib/solid\";\nimport {\n type Component,\n createContext,\n createEffect,\n createMemo,\n createResource,\n createSignal,\n For,\n type JSX,\n Match,\n onCleanup,\n onMount,\n Show,\n Switch,\n untrack,\n useContext,\n} from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { prompts } from \"../feedback/prompts\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { toast } from \"../feedback/toast\";\nimport { MarkdownEditor } from \"../inputs/markdown/MarkdownEditor\";\nimport { Select } from \"../inputs/Select\";\nimport { useUiMessages } from \"../intl/messages\";\nimport Placeholder from \"../surfaces/Placeholder\";\nimport CodeDisplay, { type CodeDisplayLanguage } from \"./CodeDisplay\";\nimport { type DelimitedPreferences, decodeDelimitedContent, readDelimitedPreferences } from \"./delimited-preferences\";\nimport { type FileViewFile, fileViewExtension, getFileViewPreviewKind, parseDelimitedText } from \"./file-view-preview\";\nimport MarkdownView from \"./MarkdownView\";\nimport { leadingMarkdownTitle } from \"./markdown-title\";\nimport PdfViewer from \"./PdfViewer\";\nimport StructuredDataPreview, { type StructuredDataValue } from \"./StructuredDataPreview\";\nimport VideoPlayer from \"./VideoPlayer\";\n\nexport type { FileViewFile, FileViewPreviewKind } from \"./file-view-preview\";\nexport { canPreviewFile, getFileViewPreviewKind } from \"./file-view-preview\";\nexport type FileViewContent = { encoding: \"utf8\" | \"base64\"; content: string; mediaType: string };\n\nexport type FileViewProps = {\n /**\n * Plain previews inherit the surrounding surface without a frame or inset padding. They keep their natural height,\n * so the host scrolls them and owns the actions around them; a host that stretches one gets its scrolling back.\n */\n variant?: \"default\" | \"plain\";\n /**\n * Lifts a leading Markdown level-one heading into the host, for example a dialog title. Reports its plain text and\n * leaves that heading out of the preview, or reports null when the shown file has none, the heading holds a link or\n * image or is the whole document, or the file fails to load.\n */\n onDocumentTitle?: (title: string | null) => void;\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n load: () => Promise<FileViewContent>;\n /** Refetch the current path when this host-owned revision changes. */\n revision?: unknown;\n /** Register an awaitable refresh for the currently visible preview. */\n registerRefresh?: (refresh: () => Promise<void>) => void | (() => void);\n /** Presence enables editing for text-based renderers. */\n save?: (content: string) => Promise<void>;\n /** Authenticated inline URL used by browser-native image, PDF, audio, and video previews. */\n previewHref?: string | null;\n /** CORS mode for native image/audio/video previews. Omit to preserve browser defaults. */\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n /** Native media failed to load; the host can renew a signed URL and offer retry. */\n onPreviewError?: () => void;\n /** Download actions only; never a preview source, because an attachment response does not render inline. */\n downloadHref?: string | null;\n /** App-specific renderers matched before the built-ins for this instance. */\n renderers?: readonly FileViewRenderer[];\n /** Reports local edit state so a parent browser can guard navigation. */\n onDirtyChange?: (dirty: boolean) => void;\n class?: string;\n};\n\nexport type FileViewRendererProps = {\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n content: FileViewContent;\n previewHref: string | null;\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n onPreviewError?: () => void;\n downloadHref: string | null;\n /** Null when the file is read-only. */\n editor: {\n draft: () => string;\n setDraft: (value: string) => void;\n dirty: () => boolean;\n saving: () => boolean;\n save: () => Promise<void>;\n } | null;\n};\n\nexport type FileViewRenderer = {\n id: string;\n match: (file: FileViewFile, content: FileViewContent) => boolean;\n component: Component<FileViewRendererProps>;\n /** Text renderers that support the edit affordance when `save` is present. */\n editable?: boolean;\n};\n\n/** Instance options that reach the built-in renderers without widening the public renderer props. */\nconst FileViewHost = createContext({ plain: false, liftTitle: false });\n\nconst codeLanguage = (path: string): CodeDisplayLanguage => {\n const extension = fileViewExtension(path);\n if (extension === \"ts\" || extension === \"mts\" || extension === \"cts\") return \"ts\";\n if (extension === \"tsx\") return \"tsx\";\n if (extension === \"js\" || extension === \"mjs\" || extension === \"cjs\") return \"js\";\n if (extension === \"jsx\") return \"jsx\";\n if (extension === \"md\" || extension === \"markdown\") return \"md\";\n return \"text\";\n};\n\nconst isMarkdown = (file: FileViewFile, content: FileViewContent) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"markdown\";\n\n/** Rendered previews hide a leading YAML frontmatter block — it's metadata, not content. */\nconst stripFrontmatter = (text: string): string => {\n const match = /^---\\r?\\n[\\s\\S]*?\\r?\\n---\\r?\\n?/.exec(text.trimStart());\n return match ? text.trimStart().slice(match[0].length) : text;\n};\n\n/** Icon-only download link with the shared tooltip, for toolbars that style their own controls. */\nfunction DownloadLink(props: { class: string; href: string; download: string; label: string; icon: string }) {\n let link: HTMLAnchorElement | undefined;\n return (\n <>\n <a ref={link} class={props.class} href={props.href} download={props.download} aria-label={props.label}>\n <i class={props.icon} aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{props.label}</span>\n </a>\n <Tooltip content={props.label} target={() => link} />\n </>\n );\n}\n\n/** Icon-only action, IDE style — sits in the floating top-right cluster of previews. */\nfunction OverlayAction(props: { icon: string; title: string; onClick?: () => void; href?: string; download?: string }) {\n const classes = \"k2b-content-file-view__action\";\n return (\n <Show\n when={props.href}\n fallback={\n <Tooltip.Trigger type=\"button\" class={classes} content={props.title} aria-label={props.title} onClick={props.onClick}>\n <i class={`ti ${props.icon}`} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n }\n >\n {(href) => (\n <DownloadLink class={classes} href={href()} download={props.download ?? \"\"} label={props.title} icon={`ti ${props.icon}`} />\n )}\n </Show>\n );\n}\n\n/**\n * Scrollable preview panel with the floating action cluster overlaid top-right. Over a picture or a video the\n * cluster is glass; over text, tables, and documents it stays solid, because blurred text reads as a fault.\n */\nfunction OverlayPanel(props: { actions?: JSX.Element; overMedia?: boolean; children: JSX.Element }) {\n return (\n <div class=\"k2b-content-file-view__panel\">\n <div class=\"k2b-content-file-view__preview\">{props.children}</div>\n <Show when={props.actions}>\n <div class={`k2b-content-file-view__overlay${props.overMedia ? \" k2b-overlay-surface\" : \"\"}`}>{props.actions}</div>\n </Show>\n </div>\n );\n}\n\nconst DownloadAction = (props: FileViewRendererProps): JSX.Element => {\n const messages = useUiMessages();\n return (\n <Show when={props.downloadHref}>\n {(href) => (\n <OverlayAction\n icon=\"ti-download\"\n title={messages().download}\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n />\n )}\n </Show>\n );\n};\n\n/** Toolbar-styled icon button — reuses the package markdown-editor tool primitive. */\nfunction EditorToolButton(props: { icon: string; title: string; onClick: () => void; disabled?: boolean }) {\n return (\n <Tooltip.Trigger\n type=\"button\"\n class=\"k2b-markdown-editor__tool\"\n content={props.title}\n aria-label={props.title}\n tabIndex={-1}\n disabled={props.disabled}\n onMouseDown={(e) => e.preventDefault()}\n onClick={props.onClick}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n );\n}\n\n// ── Built-in renderers ──────────────────────────────────────────────────────\n\nfunction MoreLines(props: { count: number; onClick?: () => void }) {\n const fileViewMessages = useFileViewMessages();\n return (\n <Show when={props.count > 0}>\n <div class=\"k2b-content-file-view__truncated\">\n <Show when={props.onClick} fallback={<span>{fileViewMessages().previewMoreLines(props.count)}</span>}>\n <Button size=\"sm\" variant=\"ghost\" onClick={props.onClick}>\n {fileViewMessages().previewMoreLines(props.count)}\n </Button>\n </Show>\n </div>\n </Show>\n );\n}\nfunction TextExcerpt(props: { renderer: FileViewRendererProps; text: string; markdown?: boolean }) {\n const lines = createMemo(() => props.text.replace(/\\r\\n?/g, \"\\n\").replace(/\\n$/, \"\").split(\"\\n\"));\n const limit = () => (props.renderer.previewLines === undefined ? lines().length : Math.max(1, props.renderer.previewLines));\n const text = () => lines().slice(0, limit()).join(\"\\n\");\n const host = useContext(FileViewHost);\n // A plain preview has no code box: the host frames the file and owns its copy action.\n const content = () => (\n <Show\n when={props.markdown}\n fallback={<CodeDisplay code={text()} language={codeLanguage(props.renderer.file.path)} copy={host.plain ? false : undefined} />}\n >\n <MarkdownView markdown={text()} headingScale={props.renderer.headingScale ?? \"compact\"} />\n </Show>\n );\n // Only an excerpt needs a clipping box; a complete preview keeps its content\n // a direct child of the preview frame, which the frame's styles expect.\n return (\n <>\n <Show when={props.renderer.previewLines !== undefined} fallback={content()}>\n <div class=\"k2b-content-file-view__excerpt\">{content()}</div>\n </Show>\n <MoreLines count={lines().length - limit()} onClick={props.renderer.onExpandPreview} />\n </>\n );\n}\n\nfunction MarkdownRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const host = useContext(FileViewHost);\n const [editing, setEditing] = createSignal(false);\n const markdown = () => {\n const text = stripFrontmatter(props.editor?.draft() ?? props.content.content);\n return host.liftTitle ? (leadingMarkdownTitle(text)?.body ?? text) : text;\n };\n return (\n <Show\n when={props.editor && editing()}\n fallback={\n <OverlayPanel\n actions={\n <>\n <Show when={props.editor}>\n <OverlayAction icon=\"ti-pencil\" title={messages().edit} onClick={() => setEditing(true)} />\n </Show>\n <DownloadAction {...props} />\n </>\n }\n >\n <div class=\"k2b-content-file-view__document\">\n <TextExcerpt renderer={props} text={markdown()} markdown />\n </div>\n </OverlayPanel>\n }\n >\n {(_) => {\n const editor = props.editor!;\n return (\n <div class=\"k2b-content-file-view__editor\">\n <MarkdownEditor\n class=\"k2b-content-file-view__markdown-field\"\n aria-label={`Edit ${props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}`}\n fill\n value={editor.draft()}\n onValueChange={editor.setDraft}\n showStats={false}\n onSave={() => void editor.save()}\n saveDisabled={!editor.dirty()}\n saving={editor.saving()}\n toolbarTrailing={<EditorToolButton icon=\"ti ti-eye\" title={messages().preview} onClick={() => setEditing(false)} />}\n />\n </div>\n );\n }}\n </Show>\n );\n}\n\nfunction TextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const markdownEditorMessages = useMarkdownEditorMessages();\n return (\n <Show\n when={props.editor}\n fallback={\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <TextExcerpt renderer={props} text={props.content.content} />\n </OverlayPanel>\n }\n >\n {(editor) => (\n // Same chrome as the markdown editor — literally the same classes, so\n // border, radius, focus ring, toolbar height and text metrics cannot drift.\n <div class=\"k2b-content-file-view__editor\">\n <div\n class=\"k2b-markdown-editor\"\n data-fill=\"true\"\n role=\"group\"\n aria-label={fileViewMessages().textEditor}\n onKeyDown={(event) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === \"s\") {\n event.preventDefault();\n if (editor().dirty() && !editor().saving()) void editor().save();\n }\n }}\n >\n {/* No formatting tools here — the divider under an actions-only bar reads lost. */}\n <div class=\"k2b-markdown-editor__toolbar k2b-content-file-view__code-toolbar\">\n <span class=\"k2b-content-file-view__code-language\">{codeLanguage(props.file.path)}</span>\n <span class=\"k2b-markdown-editor__trailing\">\n <Show when={props.downloadHref}>\n {(href) => (\n <DownloadLink\n class=\"k2b-markdown-editor__tool\"\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n label={messages().download}\n icon=\"ti ti-download\"\n />\n )}\n </Show>\n <EditorToolButton\n icon={editor().saving() ? \"ti ti-loader-2 k2b-spin\" : \"ti ti-device-floppy\"}\n title={markdownEditorMessages().saveShortcut}\n disabled={!editor().dirty() || editor().saving()}\n onClick={() => void editor().save()}\n />\n </span>\n </div>\n <div class=\"k2b-markdown-editor__surface\">\n <textarea\n class=\"k2b-content-file-view__code-input\"\n value={editor().draft()}\n spellcheck={false}\n onInput={(event) => editor().setDraft(event.currentTarget.value)}\n />\n </div>\n </div>\n </div>\n )}\n </Show>\n );\n}\n\nfunction JsonRenderer(props: FileViewRendererProps) {\n const parsed = createMemo(() => {\n try {\n return { ok: true as const, value: JSON.parse(props.content.content) as StructuredDataValue };\n } catch {\n return { ok: false as const };\n }\n });\n const parsedValue = (): StructuredDataValue => {\n const result = parsed();\n return result.ok ? result.value : null;\n };\n\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__document\">\n <Show when={parsed().ok} fallback={<TextExcerpt renderer={props} text={props.content.content} />}>\n <Show\n when={props.previewLines === undefined}\n fallback={<TextExcerpt renderer={props} text={JSON.stringify(parsedValue(), null, 2)} />}\n >\n <StructuredDataPreview data={parsedValue()} maxRows={200} />\n </Show>\n </Show>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction DelimitedTextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const dataTableMessages = useDataTableMessages();\n const [preferences, setPreferences] = createSignal<DelimitedPreferences>({ encoding: \"utf-8\", delimiter: \"auto\", view: \"table\" });\n onMount(() => {\n if (!props.previewPreferencesKey) return;\n try {\n setPreferences(readDelimitedPreferences(localStorage.getItem(props.previewPreferencesKey)));\n } catch {\n /* Storage may be disabled. */\n }\n });\n const update = (patch: Partial<DelimitedPreferences>) => {\n const next = { ...preferences(), ...patch };\n setPreferences(next);\n if (props.previewPreferencesKey) {\n try {\n localStorage.setItem(props.previewPreferencesKey, JSON.stringify(next));\n } catch {\n /* Keep the local selection. */\n }\n }\n };\n const text = createMemo(() => decodeDelimitedContent(props.content, preferences().encoding));\n const delimiter = () =>\n preferences().delimiter === \"auto\"\n ? fileViewExtension(props.file.path) === \"tsv\" || props.content.mediaType === \"text/tab-separated-values\"\n ? \"\\t\"\n : \",\"\n : preferences().delimiter;\n const [page, setPage] = createSignal(0);\n createEffect(() => {\n text();\n delimiter();\n props.previewLines;\n setPage(0);\n });\n const pageSize = () => (props.previewLines === undefined ? 200 : Math.max(1, props.previewLines));\n const preview = createMemo(() => parseDelimitedText(text(), delimiter(), { rows: pageSize() + 1, offset: page() * pageSize() }));\n const settings = () =>\n prompts.dialog(\n () => (\n <div class=\"k2b-content-file-view__settings\">\n <Select\n label={fileViewMessages().csvEncoding}\n value={preferences().encoding}\n disabled={props.content.encoding !== \"base64\"}\n options={[\"utf-8\", \"windows-1252\", \"utf-16le\", \"utf-16be\"]}\n onValueChange={(value) => {\n if (value) update({ encoding: value });\n }}\n />\n <Select\n label={fileViewMessages().csvSeparator}\n value={preferences().delimiter}\n options={[\n { value: \"auto\", label: fileViewMessages().csvDefaultSeparator },\n { value: \",\", label: fileViewMessages().csvComma },\n { value: \";\", label: fileViewMessages().csvSemicolon },\n { value: \"\\t\", label: fileViewMessages().csvTab },\n { value: \"|\", label: \"|\" },\n ]}\n onValueChange={(value) => {\n if (value) update({ delimiter: value });\n }}\n />\n <Select\n label={fileViewMessages().csvView}\n value={preferences().view}\n options={[\n { value: \"table\", label: dataTableMessages().dataTable },\n { value: \"raw\", label: fileViewMessages().csvRaw },\n ]}\n onValueChange={(value) => {\n if (value === \"table\" || value === \"raw\") update({ view: value });\n }}\n />\n </div>\n ),\n { title: fileViewMessages().csvSettings },\n );\n const headers = createMemo(() => preview().rows[0] ?? []);\n const rows = createMemo(() => preview().rows.slice(1));\n\n return (\n <OverlayPanel\n actions={\n <>\n <OverlayAction icon=\"ti-adjustments-horizontal\" title={fileViewMessages().csvSettings} onClick={() => void settings()} />\n <DownloadAction {...props} />\n </>\n }\n >\n <Show when={preferences().view === \"table\"} fallback={<TextExcerpt renderer={props} text={text()} />}>\n <Show\n when={headers().length > 0}\n fallback={\n <Placeholder icon=\"ti ti-table\" title={fileViewMessages().emptyFile} description={fileViewMessages().delimitedFileEmpty} />\n }\n >\n <div class=\"k2b-content-file-view__sheet\">\n <table class=\"k2b-content-file-view__table\">\n <thead>\n <tr>\n <For each={headers()}>\n {(header, index) => (\n <th scope=\"col\">\n <span>{header || fileViewMessages().column({ number: index() + 1 })}</span>\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={rows()}>\n {(row) => (\n <tr>\n <For each={headers()}>{(_, index) => <td>{row[index()] ?? \"\"}</td>}</For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n <Show when={preview().columnsTruncated}>\n <div class=\"k2b-content-file-view__truncated\">{fileViewMessages().previewColumnsLimited}</div>\n </Show>\n <Show\n when={props.previewLines !== undefined}\n fallback={\n <Show when={preview().totalRows > 201}>\n <div class=\"k2b-content-file-view__pagination\">\n <Button size=\"sm\" variant=\"ghost\" disabled={page() === 0} onClick={() => setPage(page() - 1)}>\n {messages().previous}\n </Button>\n <span>\n {page() * pageSize() + 1}–{Math.min((page() + 1) * pageSize(), preview().totalRows - 1)} / {preview().totalRows - 1}\n </span>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n disabled={(page() + 1) * pageSize() >= preview().totalRows - 1}\n onClick={() => setPage(page() + 1)}\n >\n {messages().next}\n </Button>\n </div>\n </Show>\n }\n >\n <MoreLines count={preview().totalRows - rows().length - 1} onClick={props.onExpandPreview} />\n </Show>\n </div>\n </Show>\n </Show>\n </OverlayPanel>\n );\n}\n\nconst mediaSource = (props: FileViewRendererProps): string =>\n props.previewHref ?? `data:${props.content.mediaType};base64,${props.content.content}`;\n\nfunction ImageRenderer(props: FileViewRendererProps) {\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\">\n <img crossOrigin={props.crossOrigin} onError={props.onPreviewError} src={mediaSource(props)} alt={props.file.path} />\n </div>\n </OverlayPanel>\n );\n}\n\nconst pdfBlob = (content: FileViewContent): Blob => {\n if (content.encoding === \"utf8\") return new Blob([content.content], { type: \"application/pdf\" });\n const binary = atob(content.content);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);\n return new Blob([bytes], { type: \"application/pdf\" });\n};\n\n/**\n * Both ways end in `PdfViewer`, which draws with pdf.js. A host inline URL is fetched from there and stays the address\n * the pill's open action shows. Without one, the loaded bytes become a local PDF\n * Blob: a download URL is an attachment and would leave a viewer empty.\n */\nconst sameOrigin = (href: string): boolean => {\n if (typeof location === \"undefined\") return true;\n try {\n return new URL(href, location.href).origin === location.origin;\n } catch {\n return false;\n }\n};\n\nfunction PdfRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n // A new Blob remounts the preview, so changed bytes show the new file. A revision refetch\n // often returns the same bytes (the Assistant refetches on every tool step); keeping the\n // Blob then keeps the reader's page instead of reloading the viewer.\n const bytes = createMemo(() => props.content, undefined, {\n equals: (previous, next) => previous.encoding === next.encoding && previous.content === next.content,\n });\n const blob = createMemo(() => (props.previewHref || !bytes().content ? null : pdfBlob(bytes())));\n return (\n <Show\n when={props.previewHref}\n fallback={\n <Show\n keyed\n when={blob()}\n fallback={<Placeholder icon=\"ti ti-file-type-pdf\" title=\"PDF\" description={fileViewMessages().noInlinePreview} />}\n >\n {(pdf) => (\n // The host already names the file; the viewer keeps the file name as its accessible title.\n <PdfViewer\n class=\"k2b-content-file-view__pdf-viewer\"\n open\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n data={pdf}\n />\n )}\n </Show>\n }\n >\n {(href) => (\n // Keyed by the address: a new revision of the file loads the new document.\n <Show keyed when={href()}>\n {(current) => (\n // A page may fetch only its own origin's PDFs without CORS; another origin's address stays with the\n // browser's viewer, which embeds it as before. The viewer fetches a same-origin address itself and stops\n // when the preview closes or a new revision arrives.\n <Show\n when={sameOrigin(current)}\n fallback={<object data={current} type=\"application/pdf\" class=\"k2b-content-file-view__pdf\" aria-label={props.file.path} />}\n >\n <PdfViewer\n class=\"k2b-content-file-view__pdf-viewer\"\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n open={current}\n data={current}\n />\n </Show>\n )}\n </Show>\n )}\n </Show>\n );\n}\n\nfunction AudioRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"audio\">\n <audio\n crossOrigin={props.crossOrigin}\n onError={props.onPreviewError}\n controls\n preload=\"metadata\"\n src={mediaSource(props)}\n aria-label={props.file.path}\n >\n {fileViewMessages().audioUnsupported}\n </audio>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction VideoRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const name = () => props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1);\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"video\">\n <VideoPlayer\n src={mediaSource(props)}\n label={name()}\n crossOrigin={props.crossOrigin}\n onFallback={props.onPreviewError}\n fallbackAction={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download={name()}>\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n </div>\n </OverlayPanel>\n );\n}\n\nfunction BinaryRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n return (\n <Placeholder\n icon=\"ti ti-file-unknown\"\n title={fileViewMessages().noPreview}\n description={props.content.mediaType || fileViewMessages().binaryFile}\n action={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download=\"\">\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n );\n}\n\nconst BUILTIN_RENDERERS: FileViewRenderer[] = [\n { id: \"markdown\", match: isMarkdown, component: MarkdownRenderer, editable: true },\n {\n id: \"image\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"image\",\n component: ImageRenderer,\n },\n {\n id: \"pdf\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"pdf\",\n component: PdfRenderer,\n },\n {\n id: \"json\",\n match: (file, content) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"json\",\n component: JsonRenderer,\n },\n {\n id: \"delimited-text\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"delimited-text\",\n component: DelimitedTextRenderer,\n },\n {\n id: \"audio\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"audio\",\n component: AudioRenderer,\n },\n {\n id: \"video\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"video\",\n component: VideoRenderer,\n },\n { id: \"text\", match: (_file, content) => content.encoding === \"utf8\", component: TextRenderer, editable: true },\n { id: \"binary\", match: () => true, component: BinaryRenderer },\n];\n\n// ── Component ───────────────────────────────────────────────────────────────\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\nexport default function FileView(props: FileViewProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const [draft, setDraft] = createSignal(\"\");\n const [savedDraft, setSavedDraft] = createSignal(\"\");\n const [nativeRevision, setNativeRevision] = createSignal(0);\n const dirty = createMemo(() => draft() !== savedDraft());\n const instanceRenderers = () => props.renderers ?? [];\n const saveMutation = mutation.create<{ path: string; content: string }, { path: string; content: string }>({\n mutation: async (input) => {\n await props.save!(input.content);\n return input;\n },\n onSuccess: (saved) => {\n if (props.file.path === saved.path) setSavedDraft(saved.content);\n toast.success(fileViewMessages().fileSaved);\n },\n onError: (error) => toast.error(error.message),\n });\n const nativePreviewHref = createMemo(() => {\n const href = props.previewHref;\n if (!href) return null;\n const separator = href.includes(\"?\") ? \"&\" : \"?\";\n return `${href}${separator}preview-revision=${nativeRevision()}`;\n });\n const browserPreviewContent = createMemo<FileViewContent | null>(() => {\n const kind = getFileViewPreviewKind(props.file);\n if (kind !== \"image\" && kind !== \"pdf\" && kind !== \"audio\" && kind !== \"video\") return null;\n const href = nativePreviewHref();\n if (!href) return null;\n\n const candidate: FileViewContent = {\n encoding: \"base64\",\n content: \"\",\n mediaType: props.file.mediaType ?? \"application/octet-stream\",\n };\n return instanceRenderers().some((renderer) => renderer.match(props.file, candidate)) ? null : candidate;\n });\n const [content, { refetch }] = createResource(\n () => (browserPreviewContent() ? null : { path: props.file.path, revision: props.revision }),\n async () => {\n saveMutation.abort();\n // `load` is an imperative source adapter. Host signal reads inside it\n // must not turn this resource into a hidden reactive feedback loop.\n const loaded = await untrack(() => props.load());\n const loadedDraft = loaded.encoding === \"utf8\" ? loaded.content : \"\";\n setDraft(loadedDraft);\n setSavedDraft(loadedDraft);\n return loaded;\n },\n );\n createEffect(() => {\n if (!props.registerRefresh) return;\n const unregister = props.registerRefresh(async () => {\n if (browserPreviewContent()) setNativeRevision((value) => value + 1);\n else await refetch();\n });\n if (unregister) onCleanup(unregister);\n });\n // An errored resource throws when read; the error state below shows it instead.\n const resolvedContent = createMemo(() => browserPreviewContent() ?? (content.error ? undefined : content()));\n\n const renderer = createMemo(() => {\n const loaded = resolvedContent();\n if (!loaded) return null;\n return [...instanceRenderers(), ...BUILTIN_RENDERERS].find((candidate) => candidate.match(props.file, loaded)) ?? null;\n });\n\n createEffect(() => {\n props.onDirtyChange?.(dirty());\n });\n\n const save = async () => {\n if (!props.save || saveMutation.loading()) return;\n await saveMutation.mutate({ path: props.file.path, content: draft() });\n };\n\n const editor = () =>\n props.save && renderer()?.editable && resolvedContent()?.encoding === \"utf8\"\n ? {\n draft,\n setDraft,\n dirty,\n saving: saveMutation.loading,\n save,\n }\n : null;\n\n // Undefined while loading; the host keeps its own placeholder until the shown file decides.\n const documentTitle = createMemo<string | null | undefined>(() => {\n if (!props.onDocumentTitle) return undefined;\n if (content.error) return null;\n const loaded = resolvedContent();\n if (!loaded) return undefined;\n if (renderer()?.component !== MarkdownRenderer) return null;\n return leadingMarkdownTitle(stripFrontmatter(editor()?.draft() ?? loaded.content))?.title ?? null;\n });\n createEffect(() => {\n const title = documentTitle();\n if (title !== undefined) props.onDocumentTitle?.(title);\n });\n\n return (\n <div\n class={`k2b-content-file-view ${props.class ?? \"\"}`}\n data-variant={props.variant}\n data-excerpt={props.previewLines !== undefined ? \"true\" : undefined}\n >\n <FileViewHost.Provider\n value={{\n get plain() {\n return props.variant === \"plain\";\n },\n get liftTitle() {\n return Boolean(props.onDocumentTitle);\n },\n }}\n >\n <Switch>\n <Match when={content.loading && content() === undefined}>\n <Placeholder state=\"loading\" title={messages().loading} />\n </Match>\n <Match when={content.error}>\n <Placeholder state=\"error\" title={fileViewMessages().failedLoadFile} description={String(content.error?.message ?? \"\")} />\n </Match>\n <Match when={resolvedContent() && renderer()}>\n {(active) => {\n const Renderer = active().component;\n return (\n <Renderer\n previewLines={props.previewLines}\n onExpandPreview={props.onExpandPreview}\n headingScale={props.headingScale}\n previewPreferencesKey={props.previewPreferencesKey}\n file={props.file}\n content={resolvedContent()!}\n previewHref={nativePreviewHref()}\n crossOrigin={props.crossOrigin}\n onPreviewError={props.onPreviewError}\n downloadHref={props.downloadHref ?? null}\n editor={editor()}\n />\n );\n }}\n </Match>\n </Switch>\n </FileViewHost.Provider>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,yBAAyB,QAAQ,oCAAoC;AAC9E,SAAS,oBAAoB,QAAQ,uBAAuB;AAC5D,SAAS,mBAAmB,QAAQ,sBAAsB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,QAAQ,QAAQ,mBAAmB;AAC5C,SAEE,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,GAAG,EAEH,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,MAAM,EACN,OAAO,EACP,UAAU,QACL,UAAU;AACjB,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,KAAK,QAAQ,mBAAmB;AACzC,SAAS,cAAc,QAAQ,mCAAmC;AAClE,SAAS,MAAM,QAAQ,kBAAkB;AACzC,SAAS,aAAa,QAAQ,kBAAkB;AAChD,OAAO,WAAW,MAAM,yBAAyB;AACjD,OAAO,WAAW,MAAoC,eAAe;AACrE,SAAoC,sBAAsB,EAAE,wBAAwB,QAAQ,yBAAyB;AACrH,SAA4B,iBAAiB,EAAE,sBAAsB,EAAE,kBAAkB,QAAQ,qBAAqB;AACtH,OAAO,YAAY,MAAM,gBAAgB;AACzC,SAAS,oBAAoB,QAAQ,kBAAkB;AACvD,OAAO,SAAS,MAAM,aAAa;AACnC,OAAO,qBAAqB,MAAoC,yBAA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gBAAA,IAChC,qBAAqB;kBAAA,OAAE,KAAK,CAAC,qBAAqB;gBAAA;gBAAA,IAClD,IAAI;kBAAA,OAAE,KAAK,CAAC,IAAI;gBAAA;gBAAA,IAChB,OAAO;kBAAA,OAAE,eAAe,CAAC,CAAC;gBAAA;gBAAA,IAC1B,WAAW;kBAAA,OAAE,iBAAiB,CAAC,CAAC;gBAAA;gBAAA,IAChC,WAAW;kBAAA,OAAE,KAAK,CAAC,WAAW;gBAAA;gBAAA,IAC9B,cAAc;kBAAA,OAAE,KAAK,CAAC,cAAc;gBAAA;gBAAA,IACpC,YAAY;kBAAA,OAAE,KAAK,CAAC,YAAY,IAAI,IAAI;gBAAA;gBAAA,IACxC,MAAM;kBAAA,OAAE,MAAM,CAAC,CAAC;gBAAA;cAAA;YAGtB;UAAC;QAAA;MAAA;IAAA;EAAA;AAMb","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/FileView.tsx"],"sourcesContent":["import { useMarkdownEditorMessages } from \"../inputs/markdown/editor-messages\";\nimport { useDataTableMessages } from \"./data-table-messages\";\nimport { useFileViewMessages } from \"./file-view-messages\";\n/**\n * FileView — renders one file through a small renderer registry keyed by\n * media type / path. Editing is enabled purely by the presence of `save`;\n * without it every renderer is read-only. IDE-style chrome: editors reuse\n * the markdown editor's surface (toolbar with an in-toolbar save, Ctrl/Cmd+S),\n * previews are quiet paper panels with icon-only actions overlaid top-right.\n * A plain preview drops the panel and sits on its host's surface instead.\n * Custom renderers are passed per instance, which keeps SSR requests and\n * independently mounted applications isolated.\n */\n\nimport { mutation } from \"@k2b/stdlib/solid\";\nimport {\n type Component,\n createContext,\n createEffect,\n createMemo,\n createResource,\n createSignal,\n For,\n type JSX,\n Match,\n onCleanup,\n onMount,\n Show,\n Switch,\n untrack,\n useContext,\n} from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { prompts } from \"../feedback/prompts\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { toast } from \"../feedback/toast\";\nimport { MarkdownEditor } from \"../inputs/markdown/MarkdownEditor\";\nimport { Select } from \"../inputs/Select\";\nimport { useUiMessages } from \"../intl/messages\";\nimport Placeholder from \"../surfaces/Placeholder\";\nimport CodeDisplay, { type CodeDisplayLanguage } from \"./CodeDisplay\";\nimport { type DelimitedPreferences, decodeDelimitedContent, readDelimitedPreferences } from \"./delimited-preferences\";\nimport { type FileViewFile, fileViewExtension, getFileViewPreviewKind, parseDelimitedText } from \"./file-view-preview\";\nimport MarkdownView from \"./MarkdownView\";\nimport { leadingMarkdownTitle } from \"./markdown-title\";\nimport PdfViewer from \"./PdfViewer\";\nimport StructuredDataPreview, { type StructuredDataValue } from \"./StructuredDataPreview\";\nimport VideoPlayer from \"./VideoPlayer\";\n\nexport type { FileViewFile, FileViewPreviewKind } from \"./file-view-preview\";\nexport { canPreviewFile, getFileViewPreviewKind } from \"./file-view-preview\";\nexport type FileViewContent = { encoding: \"utf8\" | \"base64\"; content: string; mediaType: string };\n\nexport type FileViewProps = {\n /**\n * Plain previews inherit the surrounding surface without a frame or inset padding. They keep their natural height,\n * so the host scrolls them and owns the actions around them; a host that stretches one gets its scrolling back.\n */\n variant?: \"default\" | \"plain\";\n /**\n * Lifts a leading Markdown level-one heading into the host, for example a dialog title. Reports its plain text and\n * leaves that heading out of the preview, or reports null when the shown file has none, the heading holds a link or\n * image or is the whole document, or the file fails to load.\n */\n onDocumentTitle?: (title: string | null) => void;\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n load: () => Promise<FileViewContent>;\n /** Refetch the current path when this host-owned revision changes. */\n revision?: unknown;\n /** Register an awaitable refresh for the currently visible preview. */\n registerRefresh?: (refresh: () => Promise<void>) => void | (() => void);\n /** Presence enables editing for text-based renderers. */\n save?: (content: string) => Promise<void>;\n /** Authenticated inline URL used by browser-native image, PDF, audio, and video previews. */\n previewHref?: string | null;\n /** CORS mode for native image/audio/video previews. Omit to preserve browser defaults. */\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n /** Native media failed to load; the host can renew a signed URL and offer retry. */\n onPreviewError?: () => void;\n /** Download actions only; never a preview source, because an attachment response does not render inline. */\n downloadHref?: string | null;\n /** App-specific renderers matched before the built-ins for this instance. */\n renderers?: readonly FileViewRenderer[];\n /** Reports local edit state so a parent browser can guard navigation. */\n onDirtyChange?: (dirty: boolean) => void;\n class?: string;\n};\n\nexport type FileViewRendererProps = {\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n content: FileViewContent;\n previewHref: string | null;\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n onPreviewError?: () => void;\n downloadHref: string | null;\n /** Null when the file is read-only. */\n editor: {\n draft: () => string;\n setDraft: (value: string) => void;\n dirty: () => boolean;\n saving: () => boolean;\n save: () => Promise<void>;\n } | null;\n};\n\nexport type FileViewRenderer = {\n id: string;\n match: (file: FileViewFile, content: FileViewContent) => boolean;\n component: Component<FileViewRendererProps>;\n /** Text renderers that support the edit affordance when `save` is present. */\n editable?: boolean;\n};\n\n/** Instance options that reach the built-in renderers without widening the public renderer props. */\nconst FileViewHost = createContext({ plain: false, liftTitle: false });\n\nconst codeLanguage = (path: string): CodeDisplayLanguage => {\n const extension = fileViewExtension(path);\n if (extension === \"ts\" || extension === \"mts\" || extension === \"cts\") return \"ts\";\n if (extension === \"tsx\") return \"tsx\";\n if (extension === \"js\" || extension === \"mjs\" || extension === \"cjs\") return \"js\";\n if (extension === \"jsx\") return \"jsx\";\n if (extension === \"md\" || extension === \"markdown\") return \"md\";\n return \"text\";\n};\n\nconst isMarkdown = (file: FileViewFile, content: FileViewContent) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"markdown\";\n\n/** Rendered previews hide a leading YAML frontmatter block — it's metadata, not content. */\nconst stripFrontmatter = (text: string): string => {\n const match = /^---\\r?\\n[\\s\\S]*?\\r?\\n---\\r?\\n?/.exec(text.trimStart());\n return match ? text.trimStart().slice(match[0].length) : text;\n};\n\n/** Icon-only download link with the shared tooltip, for toolbars that style their own controls. */\nfunction DownloadLink(props: { class: string; href: string; download: string; label: string; icon: string }) {\n let link: HTMLAnchorElement | undefined;\n return (\n <>\n <a ref={link} class={props.class} href={props.href} download={props.download} aria-label={props.label}>\n <i class={props.icon} aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{props.label}</span>\n </a>\n <Tooltip content={props.label} target={() => link} />\n </>\n );\n}\n\n/** Icon-only action, IDE style — sits in the floating top-right cluster of previews. */\nfunction OverlayAction(props: { icon: string; title: string; onClick?: () => void; href?: string; download?: string }) {\n const classes = \"k2b-content-file-view__action\";\n return (\n <Show\n when={props.href}\n fallback={\n <Tooltip.Trigger type=\"button\" class={classes} content={props.title} aria-label={props.title} onClick={props.onClick}>\n <i class={`ti ${props.icon}`} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n }\n >\n {(href) => (\n <DownloadLink class={classes} href={href()} download={props.download ?? \"\"} label={props.title} icon={`ti ${props.icon}`} />\n )}\n </Show>\n );\n}\n\n/**\n * Scrollable preview panel with the floating action cluster overlaid top-right. Over a picture or a video the\n * cluster is glass; over text, tables, and documents it stays solid, because blurred text reads as a fault.\n */\nfunction OverlayPanel(props: { actions?: JSX.Element; overMedia?: boolean; children: JSX.Element }) {\n return (\n <div class=\"k2b-content-file-view__panel\">\n <div class=\"k2b-content-file-view__preview\">{props.children}</div>\n <Show when={props.actions}>\n <div class={`k2b-content-file-view__overlay${props.overMedia ? \" k2b-overlay-surface\" : \"\"}`}>{props.actions}</div>\n </Show>\n </div>\n );\n}\n\nconst DownloadAction = (props: FileViewRendererProps): JSX.Element => {\n const messages = useUiMessages();\n return (\n <Show when={props.downloadHref}>\n {(href) => (\n <OverlayAction\n icon=\"ti-download\"\n title={messages().download}\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n />\n )}\n </Show>\n );\n};\n\n/** Toolbar-styled icon button — reuses the package markdown-editor tool primitive. */\nfunction EditorToolButton(props: { icon: string; title: string; onClick: () => void; disabled?: boolean }) {\n return (\n <Tooltip.Trigger\n type=\"button\"\n class=\"k2b-markdown-editor__tool\"\n content={props.title}\n aria-label={props.title}\n tabIndex={-1}\n disabled={props.disabled}\n onMouseDown={(e) => e.preventDefault()}\n onClick={props.onClick}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n );\n}\n\n// ── Built-in renderers ──────────────────────────────────────────────────────\n\nfunction MoreLines(props: { count: number; onClick?: () => void }) {\n const fileViewMessages = useFileViewMessages();\n return (\n <Show when={props.count > 0}>\n <div class=\"k2b-content-file-view__truncated\">\n <Show when={props.onClick} fallback={<span>{fileViewMessages().previewMoreLines(props.count)}</span>}>\n <Button size=\"sm\" variant=\"ghost\" onClick={props.onClick}>\n {fileViewMessages().previewMoreLines(props.count)}\n </Button>\n </Show>\n </div>\n </Show>\n );\n}\nfunction TextExcerpt(props: { renderer: FileViewRendererProps; text: string; markdown?: boolean }) {\n const lines = createMemo(() => props.text.replace(/\\r\\n?/g, \"\\n\").replace(/\\n$/, \"\").split(\"\\n\"));\n const limit = () => (props.renderer.previewLines === undefined ? lines().length : Math.max(1, props.renderer.previewLines));\n const text = () => lines().slice(0, limit()).join(\"\\n\");\n const host = useContext(FileViewHost);\n // A plain preview has no code box: the host frames the file and owns its copy action.\n const content = () => (\n <Show\n when={props.markdown}\n fallback={<CodeDisplay code={text()} language={codeLanguage(props.renderer.file.path)} copy={host.plain ? false : undefined} />}\n >\n <MarkdownView markdown={text()} headingScale={props.renderer.headingScale ?? \"compact\"} />\n </Show>\n );\n // Only an excerpt needs a clipping box; a complete preview keeps its content\n // a direct child of the preview frame, which the frame's styles expect.\n return (\n <>\n <Show when={props.renderer.previewLines !== undefined} fallback={content()}>\n <div class=\"k2b-content-file-view__excerpt\">{content()}</div>\n </Show>\n <MoreLines count={lines().length - limit()} onClick={props.renderer.onExpandPreview} />\n </>\n );\n}\n\nfunction MarkdownRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const host = useContext(FileViewHost);\n const [editing, setEditing] = createSignal(false);\n const markdown = () => {\n const text = stripFrontmatter(props.editor?.draft() ?? props.content.content);\n return host.liftTitle ? (leadingMarkdownTitle(text)?.body ?? text) : text;\n };\n return (\n <Show\n when={props.editor && editing()}\n fallback={\n <OverlayPanel\n actions={\n <>\n <Show when={props.editor}>\n <OverlayAction icon=\"ti-pencil\" title={messages().edit} onClick={() => setEditing(true)} />\n </Show>\n <DownloadAction {...props} />\n </>\n }\n >\n <div class=\"k2b-content-file-view__document\">\n <TextExcerpt renderer={props} text={markdown()} markdown />\n </div>\n </OverlayPanel>\n }\n >\n {(_) => {\n const editor = props.editor!;\n return (\n <div class=\"k2b-content-file-view__editor\">\n <MarkdownEditor\n class=\"k2b-content-file-view__markdown-field\"\n aria-label={`Edit ${props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}`}\n fill\n value={editor.draft()}\n onValueChange={editor.setDraft}\n showStats={false}\n onSave={() => void editor.save()}\n saveDisabled={!editor.dirty()}\n saving={editor.saving()}\n toolbarTrailing={<EditorToolButton icon=\"ti ti-eye\" title={messages().preview} onClick={() => setEditing(false)} />}\n />\n </div>\n );\n }}\n </Show>\n );\n}\n\nfunction TextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const markdownEditorMessages = useMarkdownEditorMessages();\n return (\n <Show\n when={props.editor}\n fallback={\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <TextExcerpt renderer={props} text={props.content.content} />\n </OverlayPanel>\n }\n >\n {(editor) => (\n // Same chrome as the markdown editor — literally the same classes, so\n // border, radius, focus ring, toolbar height and text metrics cannot drift.\n <div class=\"k2b-content-file-view__editor\">\n <div\n class=\"k2b-markdown-editor\"\n data-fill=\"true\"\n role=\"group\"\n aria-label={fileViewMessages().textEditor}\n onKeyDown={(event) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === \"s\") {\n event.preventDefault();\n if (editor().dirty() && !editor().saving()) void editor().save();\n }\n }}\n >\n {/* No formatting tools here — the divider under an actions-only bar reads lost. */}\n <div class=\"k2b-markdown-editor__toolbar k2b-content-file-view__code-toolbar\">\n <span class=\"k2b-content-file-view__code-language\">{codeLanguage(props.file.path)}</span>\n <span class=\"k2b-markdown-editor__trailing\">\n <Show when={props.downloadHref}>\n {(href) => (\n <DownloadLink\n class=\"k2b-markdown-editor__tool\"\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n label={messages().download}\n icon=\"ti ti-download\"\n />\n )}\n </Show>\n <EditorToolButton\n icon={editor().saving() ? \"ti ti-loader-2 k2b-spin\" : \"ti ti-device-floppy\"}\n title={markdownEditorMessages().saveShortcut}\n disabled={!editor().dirty() || editor().saving()}\n onClick={() => void editor().save()}\n />\n </span>\n </div>\n <div class=\"k2b-markdown-editor__surface\">\n <textarea\n class=\"k2b-content-file-view__code-input\"\n value={editor().draft()}\n spellcheck={false}\n onInput={(event) => editor().setDraft(event.currentTarget.value)}\n />\n </div>\n </div>\n </div>\n )}\n </Show>\n );\n}\n\nfunction JsonRenderer(props: FileViewRendererProps) {\n const parsed = createMemo(() => {\n try {\n return { ok: true as const, value: JSON.parse(props.content.content) as StructuredDataValue };\n } catch {\n return { ok: false as const };\n }\n });\n const parsedValue = (): StructuredDataValue => {\n const result = parsed();\n return result.ok ? result.value : null;\n };\n\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__document\">\n <Show when={parsed().ok} fallback={<TextExcerpt renderer={props} text={props.content.content} />}>\n <Show\n when={props.previewLines === undefined}\n fallback={<TextExcerpt renderer={props} text={JSON.stringify(parsedValue(), null, 2)} />}\n >\n <StructuredDataPreview data={parsedValue()} maxRows={200} />\n </Show>\n </Show>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction DelimitedTextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const dataTableMessages = useDataTableMessages();\n const [preferences, setPreferences] = createSignal<DelimitedPreferences>({ encoding: \"utf-8\", delimiter: \"auto\", view: \"table\" });\n onMount(() => {\n if (!props.previewPreferencesKey) return;\n try {\n setPreferences(readDelimitedPreferences(localStorage.getItem(props.previewPreferencesKey)));\n } catch {\n /* Storage may be disabled. */\n }\n });\n const update = (patch: Partial<DelimitedPreferences>) => {\n const next = { ...preferences(), ...patch };\n setPreferences(next);\n if (props.previewPreferencesKey) {\n try {\n localStorage.setItem(props.previewPreferencesKey, JSON.stringify(next));\n } catch {\n /* Keep the local selection. */\n }\n }\n };\n const text = createMemo(() => decodeDelimitedContent(props.content, preferences().encoding));\n const delimiter = () =>\n preferences().delimiter === \"auto\"\n ? fileViewExtension(props.file.path) === \"tsv\" || props.content.mediaType === \"text/tab-separated-values\"\n ? \"\\t\"\n : \",\"\n : preferences().delimiter;\n const [page, setPage] = createSignal(0);\n createEffect(() => {\n text();\n delimiter();\n props.previewLines;\n setPage(0);\n });\n const pageSize = () => (props.previewLines === undefined ? 200 : Math.max(1, props.previewLines));\n const preview = createMemo(() => parseDelimitedText(text(), delimiter(), { rows: pageSize() + 1, offset: page() * pageSize() }));\n const settings = () =>\n prompts.dialog(\n () => (\n <div class=\"k2b-content-file-view__settings\">\n <Select\n label={fileViewMessages().csvEncoding}\n value={preferences().encoding}\n disabled={props.content.encoding !== \"base64\"}\n options={[\"utf-8\", \"windows-1252\", \"utf-16le\", \"utf-16be\"]}\n onValueChange={(value) => {\n if (value) update({ encoding: value });\n }}\n />\n <Select\n label={fileViewMessages().csvSeparator}\n value={preferences().delimiter}\n options={[\n { value: \"auto\", label: fileViewMessages().csvDefaultSeparator },\n { value: \",\", label: fileViewMessages().csvComma },\n { value: \";\", label: fileViewMessages().csvSemicolon },\n { value: \"\\t\", label: fileViewMessages().csvTab },\n { value: \"|\", label: \"|\" },\n ]}\n onValueChange={(value) => {\n if (value) update({ delimiter: value });\n }}\n />\n <Select\n label={fileViewMessages().csvView}\n value={preferences().view}\n options={[\n { value: \"table\", label: dataTableMessages().dataTable },\n { value: \"raw\", label: fileViewMessages().csvRaw },\n ]}\n onValueChange={(value) => {\n if (value === \"table\" || value === \"raw\") update({ view: value });\n }}\n />\n </div>\n ),\n { title: fileViewMessages().csvSettings },\n );\n const headers = createMemo(() => preview().rows[0] ?? []);\n const rows = createMemo(() => preview().rows.slice(1));\n\n return (\n <OverlayPanel\n actions={\n <>\n <OverlayAction icon=\"ti-adjustments-horizontal\" title={fileViewMessages().csvSettings} onClick={() => void settings()} />\n <DownloadAction {...props} />\n </>\n }\n >\n <Show when={preferences().view === \"table\"} fallback={<TextExcerpt renderer={props} text={text()} />}>\n <Show\n when={headers().length > 0}\n fallback={\n <Placeholder icon=\"ti ti-table\" title={fileViewMessages().emptyFile} description={fileViewMessages().delimitedFileEmpty} />\n }\n >\n <div class=\"k2b-content-file-view__sheet\">\n <table class=\"k2b-content-file-view__table\">\n <thead>\n <tr>\n <For each={headers()}>\n {(header, index) => (\n <th scope=\"col\">\n <span>{header || fileViewMessages().column({ number: index() + 1 })}</span>\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={rows()}>\n {(row) => (\n <tr>\n <For each={headers()}>{(_, index) => <td>{row[index()] ?? \"\"}</td>}</For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n <Show when={preview().columnsTruncated}>\n <div class=\"k2b-content-file-view__truncated\">{fileViewMessages().previewColumnsLimited}</div>\n </Show>\n <Show\n when={props.previewLines !== undefined}\n fallback={\n <Show when={preview().totalRows > 201}>\n <div class=\"k2b-content-file-view__pagination\">\n <Button size=\"sm\" variant=\"ghost\" disabled={page() === 0} onClick={() => setPage(page() - 1)}>\n {messages().previous}\n </Button>\n <span>\n {page() * pageSize() + 1}–{Math.min((page() + 1) * pageSize(), preview().totalRows - 1)} / {preview().totalRows - 1}\n </span>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n disabled={(page() + 1) * pageSize() >= preview().totalRows - 1}\n onClick={() => setPage(page() + 1)}\n >\n {messages().next}\n </Button>\n </div>\n </Show>\n }\n >\n <MoreLines count={preview().totalRows - rows().length - 1} onClick={props.onExpandPreview} />\n </Show>\n </div>\n </Show>\n </Show>\n </OverlayPanel>\n );\n}\n\nconst mediaSource = (props: FileViewRendererProps): string =>\n props.previewHref ?? `data:${props.content.mediaType};base64,${props.content.content}`;\n\nfunction ImageRenderer(props: FileViewRendererProps) {\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\">\n <img crossOrigin={props.crossOrigin} onError={props.onPreviewError} src={mediaSource(props)} alt={props.file.path} />\n </div>\n </OverlayPanel>\n );\n}\n\nconst pdfBlob = (content: FileViewContent): Blob => {\n if (content.encoding === \"utf8\") return new Blob([content.content], { type: \"application/pdf\" });\n const binary = atob(content.content);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);\n return new Blob([bytes], { type: \"application/pdf\" });\n};\n\n/**\n * Both ways end in `PdfViewer`, which draws with pdf.js. A host inline URL is fetched from there and stays the address\n * the pill's open action shows. Without one, the loaded bytes become a local PDF\n * Blob: a download URL is an attachment and would leave a viewer empty.\n */\nconst sameOrigin = (href: string): boolean => {\n if (typeof location === \"undefined\") return true;\n try {\n return new URL(href, location.href).origin === location.origin;\n } catch {\n return false;\n }\n};\n\nfunction PdfRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n // A new Blob remounts the preview, so changed bytes show the new file. A revision refetch\n // often returns the same bytes (the Assistant refetches on every tool step); keeping the\n // Blob then keeps the reader's page instead of reloading the viewer.\n const bytes = createMemo(() => props.content, undefined, {\n equals: (previous, next) => previous.encoding === next.encoding && previous.content === next.content,\n });\n const blob = createMemo(() => (props.previewHref || !bytes().content ? null : pdfBlob(bytes())));\n return (\n <Show\n when={props.previewHref}\n fallback={\n <Show\n keyed\n when={blob()}\n fallback={<Placeholder icon=\"ti ti-file-type-pdf\" title=\"PDF\" description={fileViewMessages().noInlinePreview} />}\n >\n {(pdf) => (\n // The host already names the file; the viewer keeps the file name as its accessible title.\n <PdfViewer\n class=\"k2b-content-file-view__pdf-viewer\"\n open\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n data={pdf}\n />\n )}\n </Show>\n }\n >\n {(href) => (\n // Keyed by the address: a new revision of the file loads the new document.\n <Show keyed when={href()}>\n {(current) => (\n // A page may fetch only its own origin's PDFs without CORS; another origin's address stays with the\n // browser's viewer, which embeds it as before. The viewer fetches a same-origin address itself and stops\n // when the preview closes or a new revision arrives.\n <Show\n when={sameOrigin(current)}\n fallback={<object data={current} type=\"application/pdf\" class=\"k2b-content-file-view__pdf\" aria-label={props.file.path} />}\n >\n <PdfViewer\n class=\"k2b-content-file-view__pdf-viewer\"\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n open={current}\n data={current}\n />\n </Show>\n )}\n </Show>\n )}\n </Show>\n );\n}\n\nfunction AudioRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"audio\">\n <audio\n crossOrigin={props.crossOrigin}\n onError={props.onPreviewError}\n controls\n preload=\"metadata\"\n src={mediaSource(props)}\n aria-label={props.file.path}\n >\n {fileViewMessages().audioUnsupported}\n </audio>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction VideoRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const name = () => props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1);\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"video\">\n <VideoPlayer\n src={mediaSource(props)}\n label={name()}\n crossOrigin={props.crossOrigin}\n onFallback={props.onPreviewError}\n fallbackAction={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download={name()}>\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n </div>\n </OverlayPanel>\n );\n}\n\nfunction BinaryRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n return (\n <Placeholder\n icon=\"ti ti-file-unknown\"\n title={fileViewMessages().noPreview}\n description={props.content.mediaType || fileViewMessages().binaryFile}\n action={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download=\"\">\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n );\n}\n\nconst BUILTIN_RENDERERS: FileViewRenderer[] = [\n { id: \"markdown\", match: isMarkdown, component: MarkdownRenderer, editable: true },\n {\n id: \"image\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"image\",\n component: ImageRenderer,\n },\n {\n id: \"pdf\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"pdf\",\n component: PdfRenderer,\n },\n {\n id: \"json\",\n match: (file, content) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"json\",\n component: JsonRenderer,\n },\n {\n id: \"delimited-text\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"delimited-text\",\n component: DelimitedTextRenderer,\n },\n {\n id: \"audio\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"audio\",\n component: AudioRenderer,\n },\n {\n id: \"video\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"video\",\n component: VideoRenderer,\n },\n { id: \"text\", match: (_file, content) => content.encoding === \"utf8\", component: TextRenderer, editable: true },\n { id: \"binary\", match: () => true, component: BinaryRenderer },\n];\n\n// ── Component ───────────────────────────────────────────────────────────────\n\nexport default function FileView(props: FileViewProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const [draft, setDraft] = createSignal(\"\");\n const [savedDraft, setSavedDraft] = createSignal(\"\");\n const [nativeRevision, setNativeRevision] = createSignal(0);\n const dirty = createMemo(() => draft() !== savedDraft());\n const instanceRenderers = () => props.renderers ?? [];\n const saveMutation = mutation.create<{ path: string; content: string }, { path: string; content: string }>({\n mutation: async (input) => {\n await props.save!(input.content);\n return input;\n },\n onSuccess: (saved) => {\n if (props.file.path === saved.path) setSavedDraft(saved.content);\n toast.success(fileViewMessages().fileSaved);\n },\n onError: (error) => toast.error(error.message),\n });\n const nativePreviewHref = createMemo(() => {\n const href = props.previewHref;\n if (!href) return null;\n const separator = href.includes(\"?\") ? \"&\" : \"?\";\n return `${href}${separator}preview-revision=${nativeRevision()}`;\n });\n const browserPreviewContent = createMemo<FileViewContent | null>(() => {\n const kind = getFileViewPreviewKind(props.file);\n if (kind !== \"image\" && kind !== \"pdf\" && kind !== \"audio\" && kind !== \"video\") return null;\n const href = nativePreviewHref();\n if (!href) return null;\n\n const candidate: FileViewContent = {\n encoding: \"base64\",\n content: \"\",\n mediaType: props.file.mediaType ?? \"application/octet-stream\",\n };\n return instanceRenderers().some((renderer) => renderer.match(props.file, candidate)) ? null : candidate;\n });\n const [content, { refetch }] = createResource(\n () => (browserPreviewContent() ? null : { path: props.file.path, revision: props.revision }),\n async () => {\n saveMutation.abort();\n // `load` is an imperative source adapter. Host signal reads inside it\n // must not turn this resource into a hidden reactive feedback loop.\n const loaded = await untrack(() => props.load());\n const loadedDraft = loaded.encoding === \"utf8\" ? loaded.content : \"\";\n setDraft(loadedDraft);\n setSavedDraft(loadedDraft);\n return loaded;\n },\n );\n createEffect(() => {\n if (!props.registerRefresh) return;\n const unregister = props.registerRefresh(async () => {\n if (browserPreviewContent()) setNativeRevision((value) => value + 1);\n else await refetch();\n });\n if (unregister) onCleanup(unregister);\n });\n // An errored resource throws when read; the error state below shows it instead.\n const resolvedContent = createMemo(() => browserPreviewContent() ?? (content.error ? undefined : content()));\n\n const renderer = createMemo(() => {\n const loaded = resolvedContent();\n if (!loaded) return null;\n return [...instanceRenderers(), ...BUILTIN_RENDERERS].find((candidate) => candidate.match(props.file, loaded)) ?? null;\n });\n\n createEffect(() => {\n props.onDirtyChange?.(dirty());\n });\n\n const save = async () => {\n if (!props.save || saveMutation.loading()) return;\n await saveMutation.mutate({ path: props.file.path, content: draft() });\n };\n\n const editor = () =>\n props.save && renderer()?.editable && resolvedContent()?.encoding === \"utf8\"\n ? {\n draft,\n setDraft,\n dirty,\n saving: saveMutation.loading,\n save,\n }\n : null;\n\n // Undefined while loading; the host keeps its own placeholder until the shown file decides.\n const documentTitle = createMemo<string | null | undefined>(() => {\n if (!props.onDocumentTitle) return undefined;\n if (content.error) return null;\n const loaded = resolvedContent();\n if (!loaded) return undefined;\n if (renderer()?.component !== MarkdownRenderer) return null;\n return leadingMarkdownTitle(stripFrontmatter(editor()?.draft() ?? loaded.content))?.title ?? null;\n });\n createEffect(() => {\n const title = documentTitle();\n if (title !== undefined) props.onDocumentTitle?.(title);\n });\n\n return (\n <div\n class={`k2b-content-file-view ${props.class ?? \"\"}`}\n data-variant={props.variant}\n data-excerpt={props.previewLines !== undefined ? \"true\" : undefined}\n >\n <FileViewHost.Provider\n value={{\n get plain() {\n return props.variant === \"plain\";\n },\n get liftTitle() {\n return Boolean(props.onDocumentTitle);\n },\n }}\n >\n <Switch>\n <Match when={content.loading && content() === undefined}>\n <Placeholder state=\"loading\" title={messages().loading} />\n </Match>\n <Match when={content.error}>\n <Placeholder state=\"error\" title={fileViewMessages().failedLoadFile} description={String(content.error?.message ?? \"\")} />\n </Match>\n <Match when={resolvedContent() && renderer()}>\n {(active) => {\n const Renderer = active().component;\n return (\n <Renderer\n previewLines={props.previewLines}\n onExpandPreview={props.onExpandPreview}\n headingScale={props.headingScale}\n previewPreferencesKey={props.previewPreferencesKey}\n file={props.file}\n content={resolvedContent()!}\n previewHref={nativePreviewHref()}\n crossOrigin={props.crossOrigin}\n onPreviewError={props.onPreviewError}\n downloadHref={props.downloadHref ?? null}\n editor={editor()}\n />\n );\n }}\n </Match>\n </Switch>\n </FileViewHost.Provider>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,yBAAyB,QAAQ,oCAAoC;AAC9E,SAAS,oBAAoB,QAAQ,uBAAuB;AAC5D,SAAS,mBAAmB,QAAQ,sBAAsB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,QAAQ,QAAQ,mBAAmB;AAC5C,SAEE,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,GAAG,EAEH,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,MAAM,EACN,OAAO,EACP,UAAU,QACL,UAAU;AACjB,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,KAAK,QAAQ,mBAAmB;AACzC,SAAS,cAAc,QAAQ,mCAAmC;AAClE,SAAS,MAAM,QAAQ,kBAAkB;AACzC,SAAS,aAAa,QAAQ,kBAAkB;AAChD,OAAO,WAAW,MAAM,yBAAyB;AACjD,OAAO,WAAW,MAAoC,eAAe;AACrE,SAAoC,sBAAsB,EAAE,wBAAwB,QAAQ,yBAAyB;AACrH,SAA4B,iBAAiB,EAAE,sBAAsB,EAAE,kBAAkB,QAAQ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AA;IAAA;EAAA;AAMb","ignoreList":[]}
@@ -10,7 +10,7 @@ const activityMessages = i18n.define({
10
10
  activityToday: "Today",
11
11
  activityYesterday: "Yesterday",
12
12
  activityOlder: "More than a week ago",
13
- activityAutomatic: "automatic",
13
+ activityAutomatic: "Automatic",
14
14
  activityAll: ({
15
15
  count
16
16
  }) => `All ${count}`,
@@ -24,7 +24,7 @@ const activityMessages = i18n.define({
24
24
  activityToday: "Heute",
25
25
  activityYesterday: "Gestern",
26
26
  activityOlder: "Vor über einer Woche",
27
- activityAutomatic: "automatisch",
27
+ activityAutomatic: "Automatisch",
28
28
  activityAll: ({
29
29
  count
30
30
  }) => `Alle ${count}`,
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/activity-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Words of `ActivityList` and `ActivityCard`; the sentences of the entries come from the application. */\nconst activityMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n activityTitle: \"History\",\n activityToday: \"Today\",\n activityYesterday: \"Yesterday\",\n activityOlder: \"More than a week ago\",\n activityAutomatic: \"automatic\",\n activityAll: ({ count }: { count: number }) => `All ${count}`,\n activityEmpty: \"Nothing has happened yet.\",\n activityError: \"The history did not load.\",\n activityReload: \"Reload\",\n activityFilter: \"Filter by kind\",\n },\n de: {\n activityTitle: \"Verlauf\",\n activityToday: \"Heute\",\n activityYesterday: \"Gestern\",\n activityOlder: \"Vor über einer Woche\",\n activityAutomatic: \"automatisch\",\n activityAll: ({ count }) => `Alle ${count}`,\n activityEmpty: \"Noch nichts passiert.\",\n activityError: \"Der Verlauf ließ sich nicht laden.\",\n activityReload: \"Neu laden\",\n activityFilter: \"Filter nach Art\",\n },\n },\n});\n\nexport type ActivityMessages = ReturnType<(typeof activityMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useActivityMessages = (): (() => ActivityMessages) => {\n const locale = useLocale();\n return () => activityMessages.resolve([locale()]).t;\n};\n\n/** Outside a component, such as when a dialog opens: the given locale, else the document's language. */\nexport const resolveActivityMessages = (locale?: string): ActivityMessages =>\n activityMessages.resolve([locale ?? (typeof document === \"undefined\" ? activityMessages.baseLocale : document.documentElement.lang)]).t;\n\nexport const checkActivityMessages = () => activityMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,SAAS;MACxB,aAAa,EAAE,OAAO;MACtB,iBAAiB,EAAE,WAAW;MAC9B,aAAa,EAAE,sBAAsB;MACrC,iBAAiB,EAAE,WAAW;MAC9B,WAAW,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,OAAO,KAAK,EAAE;MAC7D,aAAa,EAAE,2BAA2B;MAC1C,aAAa,EAAE,2BAA2B;MAC1C,cAAc,EAAE,QAAQ;MACxB,cAAc,EAAE;IAClB,CAAC;IACD,EAAE,EAAE;MACF,aAAa,EAAE,SAAS;MACxB,aAAa,EAAE,OAAO;MACtB,iBAAiB,EAAE,SAAS;MAC5B,aAAa,EAAE,sBAAsB;MACrC,iBAAiB,EAAE,aAAa;MAChC,WAAW,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,QAAQ,KAAK,EAAE;MAC3C,aAAa,EAAE,uBAAuB;MACtC,aAAa,EAAE,oCAAoC;MACnD,cAAc,EAAE,WAAW;MAC3B,cAAc,EAAE;IAClB;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;;AAED;AACA,OAAO,MAAM,uBAAuB,GAAI,MAAe,IACrD,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,OAAO,QAAQ,KAAK,WAAW,GAAG,gBAAgB,CAAC,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzI,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/activity-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Words of `ActivityList` and `ActivityCard`; the sentences of the entries come from the application. */\nconst activityMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n activityTitle: \"History\",\n activityToday: \"Today\",\n activityYesterday: \"Yesterday\",\n activityOlder: \"More than a week ago\",\n activityAutomatic: \"Automatic\",\n activityAll: ({ count }: { count: number }) => `All ${count}`,\n activityEmpty: \"Nothing has happened yet.\",\n activityError: \"The history did not load.\",\n activityReload: \"Reload\",\n activityFilter: \"Filter by kind\",\n },\n de: {\n activityTitle: \"Verlauf\",\n activityToday: \"Heute\",\n activityYesterday: \"Gestern\",\n activityOlder: \"Vor über einer Woche\",\n activityAutomatic: \"Automatisch\",\n activityAll: ({ count }) => `Alle ${count}`,\n activityEmpty: \"Noch nichts passiert.\",\n activityError: \"Der Verlauf ließ sich nicht laden.\",\n activityReload: \"Neu laden\",\n activityFilter: \"Filter nach Art\",\n },\n },\n});\n\nexport type ActivityMessages = ReturnType<(typeof activityMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useActivityMessages = (): (() => ActivityMessages) => {\n const locale = useLocale();\n return () => activityMessages.resolve([locale()]).t;\n};\n\n/** Outside a component, such as when a dialog opens: the given locale, else the document's language. */\nexport const resolveActivityMessages = (locale?: string): ActivityMessages =>\n activityMessages.resolve([locale ?? (typeof document === \"undefined\" ? activityMessages.baseLocale : document.documentElement.lang)]).t;\n\nexport const checkActivityMessages = () => activityMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,SAAS;MACxB,aAAa,EAAE,OAAO;MACtB,iBAAiB,EAAE,WAAW;MAC9B,aAAa,EAAE,sBAAsB;MACrC,iBAAiB,EAAE,WAAW;MAC9B,WAAW,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,OAAO,KAAK,EAAE;MAC7D,aAAa,EAAE,2BAA2B;MAC1C,aAAa,EAAE,2BAA2B;MAC1C,cAAc,EAAE,QAAQ;MACxB,cAAc,EAAE;IAClB,CAAC;IACD,EAAE,EAAE;MACF,aAAa,EAAE,SAAS;MACxB,aAAa,EAAE,OAAO;MACtB,iBAAiB,EAAE,SAAS;MAC5B,aAAa,EAAE,sBAAsB;MACrC,iBAAiB,EAAE,aAAa;MAChC,WAAW,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,QAAQ,KAAK,EAAE;MAC3C,aAAa,EAAE,uBAAuB;MACtC,aAAa,EAAE,oCAAoC;MACnD,cAAc,EAAE,WAAW;MAC3B,cAAc,EAAE;IAClB;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;;AAED;AACA,OAAO,MAAM,uBAAuB,GAAI,MAAe,IACrD,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,OAAO,QAAQ,KAAK,WAAW,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