@k2b/ui 0.55.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/actions/SplitButton.js +5 -7
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +16 -7
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +6 -5
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +28 -27
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/content/Lightbox.js +917 -283
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/PdfPages.js +8 -3
- package/dist/browser/content/PdfPages.js.map +1 -1
- package/dist/browser/content/PdfThumbnails.js +271 -0
- package/dist/browser/content/PdfThumbnails.js.map +1 -0
- package/dist/browser/content/PdfViewer.js +11 -3
- package/dist/browser/content/PdfViewer.js.map +1 -1
- package/dist/browser/content/Timeline.js +116 -117
- package/dist/browser/content/Timeline.js.map +1 -1
- package/dist/browser/content/code-highlight.js +24 -11
- package/dist/browser/content/code-highlight.js.map +1 -1
- package/dist/browser/content/index.js +5 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/lightbox-messages.js +64 -18
- package/dist/browser/content/lightbox-messages.js.map +1 -1
- package/dist/browser/content/lightbox-renderers.js +6 -0
- package/dist/browser/content/lightbox-renderers.js.map +1 -0
- package/dist/browser/content/map-view-worker.js +3 -3
- package/dist/browser/content/pdf-messages.js +16 -2
- package/dist/browser/content/pdf-messages.js.map +1 -1
- package/dist/browser/content/pdf-viewer-engine.js +15 -15
- package/dist/browser/content/pdf-viewer-worker.js +4 -5
- package/dist/browser/feedback/prompt-confirm.js +2 -0
- package/dist/browser/feedback/prompt-confirm.js.map +1 -1
- package/dist/browser/internal/truncated-title.js +9 -0
- package/dist/browser/internal/truncated-title.js.map +1 -0
- package/dist/browser/intl/messages.js +1 -1
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +3 -5
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/FloatingWindow.js +416 -122
- package/dist/browser/layout/FloatingWindow.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +3 -1
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/PersonPopover.js +406 -0
- package/dist/browser/layout/PersonPopover.js.map +1 -0
- package/dist/browser/layout/floating-window-geometry.js +58 -2
- package/dist/browser/layout/floating-window-geometry.js.map +1 -1
- package/dist/browser/layout/floating-window-messages.js +12 -0
- package/dist/browser/layout/floating-window-messages.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/ssr/actions/CommandMenu.js +2 -2
- package/dist/ssr/actions/CommandMenu.js.map +1 -1
- package/dist/ssr/actions/SplitButton.js +5 -7
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +16 -7
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +6 -5
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +31 -30
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +659 -150
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/PdfPages.js +8 -3
- package/dist/ssr/content/PdfPages.js.map +1 -1
- package/dist/ssr/content/PdfThumbnails.js +189 -0
- package/dist/ssr/content/PdfThumbnails.js.map +1 -0
- package/dist/ssr/content/PdfViewer.js +11 -3
- package/dist/ssr/content/PdfViewer.js.map +1 -1
- package/dist/ssr/content/Timeline.js +2 -5
- package/dist/ssr/content/Timeline.js.map +1 -1
- package/dist/ssr/content/code-highlight.js +24 -11
- package/dist/ssr/content/code-highlight.js.map +1 -1
- package/dist/ssr/content/index.js +5 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/lightbox-messages.js +64 -18
- package/dist/ssr/content/lightbox-messages.js.map +1 -1
- package/dist/ssr/content/lightbox-renderers.js +6 -0
- package/dist/ssr/content/lightbox-renderers.js.map +1 -0
- package/dist/ssr/content/pdf-messages.js +16 -2
- package/dist/ssr/content/pdf-messages.js.map +1 -1
- package/dist/ssr/feedback/prompt-confirm.js +1 -0
- package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
- package/dist/ssr/inputs/ChoiceInputs.js +2 -2
- package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
- package/dist/ssr/inputs/SignatureInput.js +2 -2
- package/dist/ssr/inputs/SignatureInput.js.map +1 -1
- package/dist/ssr/inputs/markdown/SlashCommands.js +2 -2
- package/dist/ssr/inputs/markdown/SlashCommands.js.map +1 -1
- package/dist/ssr/internal/truncated-title.js +9 -0
- package/dist/ssr/internal/truncated-title.js.map +1 -0
- package/dist/ssr/intl/messages.js +1 -1
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +1 -4
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/FloatingWindow.js +286 -73
- package/dist/ssr/layout/FloatingWindow.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +1 -0
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/PersonPopover.js +248 -0
- package/dist/ssr/layout/PersonPopover.js.map +1 -0
- package/dist/ssr/layout/floating-window-geometry.js +58 -2
- package/dist/ssr/layout/floating-window-geometry.js.map +1 -1
- package/dist/ssr/layout/floating-window-messages.js +12 -0
- package/dist/ssr/layout/floating-window-messages.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/SplitButton.d.ts +2 -0
- package/dist/types/actions/Toolbar.d.ts +6 -0
- package/dist/types/chat/ChatComposer.d.ts +1 -0
- package/dist/types/content/Lightbox.d.ts +54 -14
- package/dist/types/content/PdfPages.d.ts +7 -1
- package/dist/types/content/PdfThumbnails.d.ts +26 -0
- package/dist/types/content/PdfViewer.d.ts +12 -3
- package/dist/types/content/index.d.ts +4 -2
- package/dist/types/content/lightbox-messages.d.ts +31 -8
- package/dist/types/content/lightbox-renderers.d.ts +3 -0
- package/dist/types/content/pdf-messages.d.ts +7 -0
- package/dist/types/internal/truncated-title.d.ts +7 -0
- package/dist/types/layout/FloatingWindow.d.ts +29 -1
- package/dist/types/layout/PersonPopover.d.ts +70 -0
- package/dist/types/layout/floating-window-geometry.d.ts +20 -3
- package/dist/types/layout/floating-window-messages.d.ts +6 -0
- package/dist/types/layout/index.d.ts +3 -2
- package/package.json +20 -20
|
@@ -12,7 +12,9 @@ export function SplitButton(props) {
|
|
|
12
12
|
const [local, buttonProps] = splitProps(props, ["children", "primaryItems", "primaryMenuLabel", "menuIcon", "class", "disabled", "items", "loading", "menuLabel", "menuPosition", "menuWidth", "menuNote", "phone", "size", "variant"]);
|
|
13
13
|
const disabled = () => Boolean(local.disabled || local.loading);
|
|
14
14
|
return _$createComponent(Dropdown.Root, {
|
|
15
|
-
"class"
|
|
15
|
+
get ["class"]() {
|
|
16
|
+
return `k2b-split-button ${local.class ?? ""}`;
|
|
17
|
+
},
|
|
16
18
|
get disabled() {
|
|
17
19
|
return disabled();
|
|
18
20
|
},
|
|
@@ -41,9 +43,7 @@ export function SplitButton(props) {
|
|
|
41
43
|
},
|
|
42
44
|
get fallback() {
|
|
43
45
|
return _$createComponent(Button, _$mergeProps(buttonProps, {
|
|
44
|
-
|
|
45
|
-
return `k2b-split-button__primary ${local.class ?? ""}`;
|
|
46
|
-
},
|
|
46
|
+
"class": "k2b-split-button__primary",
|
|
47
47
|
get disabled() {
|
|
48
48
|
return local.disabled;
|
|
49
49
|
},
|
|
@@ -95,9 +95,7 @@ export function SplitButton(props) {
|
|
|
95
95
|
get label() {
|
|
96
96
|
return local.primaryMenuLabel;
|
|
97
97
|
},
|
|
98
|
-
|
|
99
|
-
return `k2b-split-button__primary ${local.class ?? ""}`;
|
|
100
|
-
},
|
|
98
|
+
"class": "k2b-split-button__primary",
|
|
101
99
|
get children() {
|
|
102
100
|
return local.children;
|
|
103
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/SplitButton.tsx"],"sourcesContent":["import { type JSX, Show, splitProps } from \"solid-js\";\nimport { Button, type ButtonProps } from \"./Button\";\nimport { Dropdown, type DropdownItem, type DropdownPosition, type DropdownProps } from \"./Dropdown\";\n\nexport type SplitButtonProps = Omit<ButtonProps, \"align\"> & {\n /** Actions shown from the secondary menu trigger. */\n items: readonly DropdownItem[];\n /** Optional selection menu in place of the primary immediate action. */\n primaryItems?: readonly DropdownItem[];\n /** Accessible name for the primary selection menu. */\n primaryMenuLabel?: string;\n /** Secondary menu glyph; defaults to a chevron. */\n menuIcon?: JSX.Element;\n /** Accessible name and title for the icon-only menu trigger. */\n menuLabel: string;\n menuPosition?: DropdownPosition | (() => DropdownPosition);\n /** Exact width of both menus as a CSS length. Without it the menus size to their entries. */\n menuWidth?: string;\n /** `sheet` opens both menus as a bottom sheet on phones, as `Dropdown` does. Defaults to `menu`. */\n phone?: DropdownProps[\"phone\"];\n /** One quiet sentence below the secondary menu's entries that explains them all, as `Dropdown`'s `note`. */\n menuNote?: string;\n};\n\n/** One primary button action with a separate menu of related alternatives. */\nexport function SplitButton(props: SplitButtonProps): JSX.Element {\n const [local, buttonProps] = splitProps(props, [\n \"children\",\n \"primaryItems\",\n \"primaryMenuLabel\",\n \"menuIcon\",\n \"class\",\n \"disabled\",\n \"items\",\n \"loading\",\n \"menuLabel\",\n \"menuPosition\",\n \"menuWidth\",\n \"menuNote\",\n \"phone\",\n \"size\",\n \"variant\",\n ]);\n const disabled = () => Boolean(local.disabled || local.loading);\n\n return (\n <Dropdown.Root\n class
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/SplitButton.tsx"],"sourcesContent":["import { type JSX, Show, splitProps } from \"solid-js\";\nimport { Button, type ButtonProps } from \"./Button\";\nimport { Dropdown, type DropdownItem, type DropdownPosition, type DropdownProps } from \"./Dropdown\";\n\nexport type SplitButtonProps = Omit<ButtonProps, \"align\"> & {\n /** Classes for the whole control, so host tone tokens such as `--k2b-action-solid` reach both segments. */\n class?: string;\n /** Actions shown from the secondary menu trigger. */\n items: readonly DropdownItem[];\n /** Optional selection menu in place of the primary immediate action. */\n primaryItems?: readonly DropdownItem[];\n /** Accessible name for the primary selection menu. */\n primaryMenuLabel?: string;\n /** Secondary menu glyph; defaults to a chevron. */\n menuIcon?: JSX.Element;\n /** Accessible name and title for the icon-only menu trigger. */\n menuLabel: string;\n menuPosition?: DropdownPosition | (() => DropdownPosition);\n /** Exact width of both menus as a CSS length. Without it the menus size to their entries. */\n menuWidth?: string;\n /** `sheet` opens both menus as a bottom sheet on phones, as `Dropdown` does. Defaults to `menu`. */\n phone?: DropdownProps[\"phone\"];\n /** One quiet sentence below the secondary menu's entries that explains them all, as `Dropdown`'s `note`. */\n menuNote?: string;\n};\n\n/** One primary button action with a separate menu of related alternatives. */\nexport function SplitButton(props: SplitButtonProps): JSX.Element {\n const [local, buttonProps] = splitProps(props, [\n \"children\",\n \"primaryItems\",\n \"primaryMenuLabel\",\n \"menuIcon\",\n \"class\",\n \"disabled\",\n \"items\",\n \"loading\",\n \"menuLabel\",\n \"menuPosition\",\n \"menuWidth\",\n \"menuNote\",\n \"phone\",\n \"size\",\n \"variant\",\n ]);\n const disabled = () => Boolean(local.disabled || local.loading);\n\n return (\n <Dropdown.Root\n class={`k2b-split-button ${local.class ?? \"\"}`}\n disabled={disabled()}\n items={local.items}\n label={local.menuLabel}\n note={local.menuNote}\n phone={local.phone}\n position={local.menuPosition ?? \"bottom-left\"}\n width={local.menuWidth}\n >\n <Show\n when={local.primaryItems}\n fallback={\n <Button\n {...buttonProps}\n class=\"k2b-split-button__primary\"\n disabled={local.disabled}\n loading={local.loading}\n size={local.size}\n variant={local.variant ?? \"primary\"}\n >\n {local.children}\n </Button>\n }\n >\n {(items) => (\n <Dropdown.Root\n items={items()}\n disabled={disabled()}\n class=\"k2b-split-button__primary-menu\"\n phone={local.phone}\n position={local.menuPosition ?? \"bottom-left\"}\n width={local.menuWidth}\n >\n <Dropdown.Trigger\n wrap={buttonProps.wrap}\n disabled={disabled()}\n size={local.size}\n variant={local.variant ?? \"primary\"}\n label={local.primaryMenuLabel}\n class=\"k2b-split-button__primary\"\n >\n {local.children}\n </Dropdown.Trigger>\n </Dropdown.Root>\n )}\n </Show>\n <Dropdown.Trigger\n class=\"k2b-split-button__menu-trigger\"\n disabled={disabled()}\n iconOnly\n label={local.menuLabel}\n size={local.size}\n variant={local.variant ?? \"primary\"}\n >\n {local.menuIcon ?? <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />}\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAmB,IAAI,EAAE,UAAU,QAAQ,UAAU;AACrD,SAAS,MAAM,QAA0B,UAAU;AACnD,SAAS,QAAQ,QAAsE,YAAY;AAwBnG;AACA,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAe;EAChE,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAC7C,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,OAAO,EACP,MAAM,EACN,SAAS,CACV,CAAC;EACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC;EAE/D,yBACG,QAAQ,CAAC,IAAI;IAAA;MAAA,OACL,oBAAoB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;IAAA;IAAA,IAC9C,QAAQ;MAAA,OAAE,QAAQ,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AA,OAAE,QAAQ,CAAC,CAAC;cAAA;cAAA,IACpB,IAAI;gBAAA,OAAE,KAAK,CAAC,IAAI;cAAA;cAAA,IAChB,OAAO;gBAAA,OAAE,KAAK,CAAC,OAAO,IAAI,SAAS;cAAA;cAAA,IACnC,KAAK;gBAAA,OAAE,KAAK,CAAC,gBAAgB;cAAA;cAAA;cAAA;gBAAA,OAG5B,KAAK,CAAC,QAAQ;cAAA;YAAA;UAAA;QAAA;MAGpB,sBAEF,QAAQ,CAAC,OAAO;QAAA;QAAA,IAEf,QAAQ;UAAA,OAAE,QAAQ,CAAC,CAAC;QAAA;QACpB,QAAQ;QAAA,IACR,KAAK;UAAA,OAAE,KAAK,CAAC,SAAS;QAAA;QAAA,IACtB,IAAI;UAAA,OAAE,KAAK,CAAC,IAAI;QAAA;QAAA,IAChB,OAAO;UAAA,OAAE,KAAK,CAAC,OAAO,IAAI,SAAS;QAAA;QAAA;UAAA,OAElC,KAAK,CAAC,QAAQ,4BAAuD;QAAA;MAAA;IAAA;EAAA;AAI9E","ignoreList":[]}
|
|
@@ -340,7 +340,7 @@ const rovingFocus = (root, orientation) => {
|
|
|
340
340
|
* measuring: hiding it, even for a moment, can make the browser drop focus from it or from its open menu. An idle More
|
|
341
341
|
* stays out of the flow but keeps its box, so its width is always known.
|
|
342
342
|
*/
|
|
343
|
-
const measureOverflow = (root, more, actions, available) => {
|
|
343
|
+
const measureOverflow = (root, more, actions, available, pinned = false) => {
|
|
344
344
|
for (const element of root.querySelectorAll(`[${overflowAttribute}]`)) if (element !== more) reveal(element);
|
|
345
345
|
root.removeAttribute(compactAttribute);
|
|
346
346
|
const children = Array.from(root.children).filter(element => element instanceof HTMLElement && element !== more);
|
|
@@ -393,10 +393,11 @@ const measureOverflow = (root, more, actions, available) => {
|
|
|
393
393
|
const candidates = actions
|
|
394
394
|
// An action its application hides, even with `visibility: hidden`, must not reappear as a More row.
|
|
395
395
|
.filter(action => action.props.priority !== undefined && visible(action.element) && getComputedStyle(action.element).visibility !== "hidden").reverse().sort((a, b) => b.props.priority - a.props.priority);
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
// With rarer commands of its own, More always shows and always takes its room.
|
|
397
|
+
let movedAny = pinned;
|
|
398
|
+
tidy(pinned);
|
|
398
399
|
// Labels go before actions: a toolbar that does not fit with its labels drops them first.
|
|
399
|
-
if (used(
|
|
400
|
+
if (used(pinned) > available && root.querySelector(".k2b-toolbar__action[data-text]")) root.setAttribute(compactAttribute, "");
|
|
400
401
|
for (const action of candidates) {
|
|
401
402
|
if (used(movedAny) <= available) break;
|
|
402
403
|
hide(action.element);
|
|
@@ -433,7 +434,7 @@ export const Toolbar = Object.assign(props => {
|
|
|
433
434
|
// Cleared before measuring so the pending `visibility: hidden` does not hide every action from the check
|
|
434
435
|
// below; the whole measurement still runs before the next paint.
|
|
435
436
|
root.removeAttribute("data-overflow-pending");
|
|
436
|
-
const next = measureOverflow(root, more, ordered, available);
|
|
437
|
+
const next = measureOverflow(root, more, ordered, available, (props.moreItems?.length ?? 0) > 0);
|
|
437
438
|
setMoved(previous => previous.length === next.length && previous.every((action, index) => action === next[index]) ? previous : next);
|
|
438
439
|
navigation?.sync();
|
|
439
440
|
// Focus on an action that moved, on a menu row whose action came back, or on a More that disappeared goes to
|
|
@@ -492,7 +493,15 @@ export const Toolbar = Object.assign(props => {
|
|
|
492
493
|
mutations.disconnect();
|
|
493
494
|
});
|
|
494
495
|
});
|
|
495
|
-
|
|
496
|
+
// Actions that moved come first, in their order and in a group of their own; the host's rarer commands follow.
|
|
497
|
+
const menuItems = () => {
|
|
498
|
+
const movedItems = moved().map(action => action.item);
|
|
499
|
+
const pinnedItems = props.moreItems ?? [];
|
|
500
|
+
if (!pinnedItems.length) return movedItems;
|
|
501
|
+
return movedItems.length ? [{
|
|
502
|
+
items: movedItems
|
|
503
|
+
}, ...pinnedItems] : [...pinnedItems];
|
|
504
|
+
};
|
|
496
505
|
const content = _$createComponent(ToolbarOrientationContext.Provider, {
|
|
497
506
|
value: orientation,
|
|
498
507
|
get children() {
|
|
@@ -530,7 +539,7 @@ export const Toolbar = Object.assign(props => {
|
|
|
530
539
|
return messages().moreActions;
|
|
531
540
|
},
|
|
532
541
|
get disabled() {
|
|
533
|
-
return moved().length === 0;
|
|
542
|
+
return _$memo(() => moved().length === 0)() && !props.moreItems?.length;
|
|
534
543
|
},
|
|
535
544
|
get children() {
|
|
536
545
|
return _$createComponent(Dropdown.Trigger, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/Toolbar.tsx"],"sourcesContent":["import { createContext, createEffect, createSignal, type JSX, onCleanup, onMount, Show, sharedConfig, useContext } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { Kbd } from \"../content/Kbd\";\nimport { announce } from \"../feedback/announce\";\nimport { useLocale } from \"../intl/locale\";\nimport { formatShortcut, type KeyboardPlatform, keyboardPlatform } from \"../intl/shortcut\";\nimport { IconButton } from \"./Button\";\nimport { Dropdown, type DropdownAction } from \"./Dropdown\";\nimport { useToolbarMessages } from \"./toolbar-messages\";\n\nexport type ToolbarProps = {\n children: JSX.Element;\n label: string;\n orientation?: \"horizontal\" | \"vertical\";\n wrap?: boolean;\n /** `floating` floats the toolbar at an edge of its column. Defaults to `inline`. */\n variant?: \"inline\" | \"floating\";\n /** The edge a floating toolbar sticks to while its column scrolls. Defaults to `bottom`. */\n edge?: \"top\" | \"bottom\";\n /**\n * `danger` makes a floating toolbar the one red pill of a stopped state, such as an editor that can no longer save.\n * It spans its row in place of the usual pills, and screen readers announce its labels at once. Inline toolbars\n * ignore it.\n */\n tone?: \"danger\";\n class?: string;\n};\n\nexport type ToolbarActionProps = {\n /** Accessible name, tooltip text, and the row label in the More menu. */\n label: string;\n /** Icon class, such as \"ti ti-archive\". */\n icon: string;\n /**\n * Shortcut hint below the icon, tooltip suffix, and aria-keyshortcuts; does not register a shortcut handler.\n * SelectionToolbar's compact actions keep only the tooltip suffix and aria-keyshortcuts.\n */\n keys?: string;\n /** 1 is most important. Larger numbers move first; ties move later DOM actions first. Omit to keep fixed. */\n priority?: number;\n /**\n * Shows the label beside the icon while a floating toolbar has room. When it gets narrow, these labels go first,\n * every action keeps its icon, and only then do actions move into More.\n */\n text?: boolean;\n disabled?: boolean;\n /** Makes the action a toggle and exposes its state as `aria-pressed`, such as Bold over bold text. */\n pressed?: boolean;\n onClick?: () => void;\n};\nexport type ToolbarLabelProps = {\n children: JSX.Element;\n /**\n * Follows the label while it fits, such as the reason after \"Not saved\". A narrow toolbar hides it whole before\n * actions give up their labels; screen readers always read it.\n */\n detail?: JSX.Element;\n class?: string;\n};\n\nexport type ToolbarGroupProps = { children: JSX.Element; label?: string; class?: string };\nexport type ToolbarSeparatorProps = { class?: string };\n\ntype ToolbarComponent = ((props: ToolbarProps) => JSX.Element) & {\n Action: (props: ToolbarActionProps) => JSX.Element;\n Label: (props: ToolbarLabelProps) => JSX.Element;\n Group: (props: ToolbarGroupProps) => JSX.Element;\n Separator: (props: ToolbarSeparatorProps) => JSX.Element;\n Spacer: () => JSX.Element;\n};\n\ntype ToolbarOrientation = NonNullable<ToolbarProps[\"orientation\"]>;\n\nconst defaultToolbarOrientation: () => ToolbarOrientation = () => \"horizontal\";\nconst ToolbarOrientationContext = createContext(defaultToolbarOrientation);\n/** True inside a floating `tone=\"danger\"` toolbar, whose labels announce themselves. */\nconst ToolbarDangerContext = createContext(false);\n/** False where actions are icon-sized, such as SelectionToolbar: no room below the icon for a hint. Package-internal. */\nexport const ToolbarHintsContext = createContext(true);\n\n// `item` is created once per action: the More menu keys its rows by identity, so a remeasure keeps a focused row.\ntype RegisteredAction = { element: HTMLButtonElement; props: ToolbarActionProps; item: DropdownAction };\nconst ToolbarActionsContext = createContext<(action: RegisteredAction) => () => void>();\nconst overflowAttribute = \"data-overflow\";\n/** Set on a floating toolbar whose action labels gave way to icons for lack of room. */\nconst compactAttribute = \"data-compact\";\nconst hide = (element: Element) => element.setAttribute(overflowAttribute, \"hidden\");\nconst reveal = (element: Element) => element.removeAttribute(overflowAttribute);\n\n// ARIA uses language-independent key names, unlike the translated tooltip and caps.\nconst ariaShortcut = (keys: string | undefined, platform: KeyboardPlatform): string | undefined => {\n if (!keys || !formatShortcut(keys, { platform, locale: \"en\" }).keys.length) return undefined;\n const input = keys.trim().toLowerCase();\n const plus = input === \"+\" || input.endsWith(\"++\");\n const parts = (plus ? input.slice(0, -1) : input).split(\"+\");\n // ARIA separates keys with \"+\", so the plus key itself is named \"plus\".\n const key = plus ? \"plus\" : parts.pop() || \"space\";\n if (plus) parts.pop();\n const names: Record<string, string> = {\n mod: platform === \"apple\" ? \"Meta\" : \"Control\",\n ctrl: \"Control\",\n alt: \"Alt\",\n shift: \"Shift\",\n meta: \"Meta\",\n arrowup: \"ArrowUp\",\n arrowdown: \"ArrowDown\",\n arrowleft: \"ArrowLeft\",\n arrowright: \"ArrowRight\",\n escape: \"Escape\",\n esc: \"Escape\",\n backspace: \"Backspace\",\n enter: \"Enter\",\n delete: \"Delete\",\n space: \"Space\",\n tab: \"Tab\",\n home: \"Home\",\n end: \"End\",\n pageup: \"PageUp\",\n pagedown: \"PageDown\",\n plus: \"plus\",\n };\n const final = key.length === 1 || /^f(?:[1-9]|1[0-2])$/.test(key) ? key.toUpperCase() : names[key];\n return final ? [...new Set(parts.map((part) => names[part])), final].join(\"+\") : undefined;\n};\n\nconst ToolbarAction = (props: ToolbarActionProps): JSX.Element => {\n const register = useContext(ToolbarActionsContext);\n const hints = useContext(ToolbarHintsContext);\n const locale = useLocale();\n const [platform, setPlatform] = createSignal<KeyboardPlatform>(isServer || sharedConfig.context ? \"other\" : keyboardPlatform());\n onMount(() => setPlatform(keyboardPlatform()));\n const tooltip = () => {\n const shortcut = props.keys ? formatShortcut(props.keys, { platform: platform(), locale: locale() }).label : \"\";\n return shortcut ? `${props.label} (${shortcut})` : props.label;\n };\n return (\n <IconButton\n ref={(element) => {\n const item: DropdownAction = {\n get label() {\n return props.label;\n },\n get icon() {\n return props.icon;\n },\n get disabled() {\n return props.disabled;\n },\n action: () => props.onClick?.(),\n };\n const unregister = register?.({ element, props, item });\n if (unregister) onCleanup(unregister);\n }}\n class=\"k2b-toolbar__action\"\n label={props.label}\n variant=\"ghost\"\n tooltip={tooltip()}\n aria-keyshortcuts={ariaShortcut(props.keys, platform())}\n aria-pressed={props.pressed === undefined ? undefined : props.pressed ? \"true\" : \"false\"}\n data-priority={props.priority}\n data-text={props.text ? \"\" : undefined}\n disabled={props.disabled}\n onClick={() => props.onClick?.()}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n <Show when={props.text}>\n <span class=\"k2b-toolbar__text\" aria-hidden=\"true\">\n {props.label}\n </span>\n </Show>\n <Show when={hints && props.keys}>{(keys) => <Kbd keys={keys()} class=\"k2b-kbd-hint k2b-toolbar__hint\" />}</Show>\n </IconButton>\n );\n};\n\nconst ToolbarLabel = (props: ToolbarLabelProps): JSX.Element => {\n const danger = useContext(ToolbarDangerContext);\n let label!: HTMLSpanElement;\n // The shared assertive live region exists before the text arrives, so the message is read reliably, also when the\n // pill appears with it or its text changes later.\n onMount(() => {\n if (!danger) return;\n let spoken = \"\";\n const speak = () => {\n const text = label.textContent?.replace(/\\s+/g, \" \").trim() ?? \"\";\n if (text === spoken) return;\n spoken = text;\n announce(text, { politeness: \"assertive\" });\n };\n speak();\n const observer = new MutationObserver(speak);\n observer.observe(label, { childList: true, subtree: true, characterData: true });\n onCleanup(() => observer.disconnect());\n });\n return (\n <span ref={label} class={`k2b-toolbar__label ${props.class ?? \"\"}`} data-detail={props.detail ? \"\" : undefined}>\n <Show when={props.detail} fallback={props.children}>\n <span class=\"k2b-toolbar__label-main\">{props.children}</span>\n <span class=\"k2b-toolbar__label-detail\">{props.detail}</span>\n </Show>\n </span>\n );\n};\n\nconst ToolbarGroup = (props: ToolbarGroupProps): JSX.Element => (\n <div class={`k2b-toolbar__group ${props.class ?? \"\"}`} role=\"group\" aria-label={props.label}>\n {props.children}\n </div>\n);\n\nconst ToolbarSeparator = (props: ToolbarSeparatorProps): JSX.Element => {\n const toolbarOrientation = useContext(ToolbarOrientationContext);\n const separatorOrientation = () => (toolbarOrientation() === \"horizontal\" ? \"vertical\" : \"horizontal\");\n\n return (\n <span\n class={`k2b-toolbar__separator ${props.class ?? \"\"}`}\n role=\"separator\"\n aria-orientation={separatorOrientation()}\n data-orientation={separatorOrientation()}\n />\n );\n};\n\nconst ToolbarSpacer = (): JSX.Element => <span class=\"k2b-toolbar__spacer\" aria-hidden=\"true\" />;\n\nconst rovingFocus = (root: HTMLDivElement, orientation: () => ToolbarOrientation) => {\n let last: HTMLElement | undefined;\n const setLast = (item: HTMLElement | undefined) => {\n if (item === last) return;\n if (last) resizeObserver.unobserve(last);\n last = item;\n if (last) resizeObserver.observe(last);\n };\n const controls = () =>\n Array.from(root.querySelectorAll<HTMLElement>(\"button, a[href], input, select, textarea, [tabindex]\")).filter((item) => {\n if (\n item.matches(\"textarea, select\") ||\n item.isContentEditable ||\n (item.matches(\"input\") && !/^(button|checkbox|reset|submit|image|color|file)$/i.test(item.getAttribute(\"type\") ?? \"text\"))\n )\n return false;\n const nested = item.closest('[role=\"menu\"], [role=\"listbox\"], [role=\"dialog\"], [popover]');\n return !nested || !root.contains(nested);\n });\n const items = () =>\n controls().filter(\n (item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]') && item.getClientRects().length > 0,\n );\n const sync = () => {\n // A toolbar that is still hidden, such as a SelectionToolbar about to show, keeps one stop: otherwise Tab right\n // after it shows would pass it before the next measure.\n const shown = items();\n const available = shown.length\n ? shown\n : controls().filter((item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]'));\n if (!last || !available.includes(last)) setLast(available[0]);\n for (const item of controls()) item.tabIndex = item === last ? 0 : -1;\n };\n const focusin = (event: FocusEvent) => {\n if (event.target instanceof HTMLElement && items().includes(event.target)) {\n setLast(event.target);\n sync();\n }\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const available = items();\n const target = event.target;\n if (!(target instanceof HTMLElement) || !available.includes(target)) return;\n const forward = orientation() === \"vertical\" ? \"ArrowDown\" : getComputedStyle(root).direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backward = orientation() === \"vertical\" ? \"ArrowUp\" : forward === \"ArrowRight\" ? \"ArrowLeft\" : \"ArrowRight\";\n const index = available.indexOf(target);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? available.length - 1\n : event.key === forward\n ? (index + 1) % available.length\n : event.key === backward\n ? (index + available.length - 1) % available.length\n : -1;\n if (next < 0) return;\n event.preventDefault();\n setLast(available[next]);\n sync();\n last?.focus();\n };\n const observer = new MutationObserver(sync);\n observer.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"disabled\", \"hidden\", \"class\", \"style\", overflowAttribute],\n });\n const resizeObserver = new ResizeObserver(sync);\n resizeObserver.observe(root);\n root.addEventListener(\"focusin\", focusin);\n sync();\n return {\n keydown,\n sync,\n cleanup: () => {\n observer.disconnect();\n resizeObserver.disconnect();\n root.removeEventListener(\"focusin\", focusin);\n },\n };\n};\n\n/**\n * All measurement writes are DOM attributes: reactive writes do not flush during onMount. More is never toggled while\n * measuring: hiding it, even for a moment, can make the browser drop focus from it or from its open menu. An idle More\n * stays out of the flow but keeps its box, so its width is always known.\n */\nconst measureOverflow = (\n root: HTMLDivElement,\n more: HTMLDivElement,\n actions: RegisteredAction[],\n available: number,\n): RegisteredAction[] => {\n for (const element of root.querySelectorAll(`[${overflowAttribute}]`)) if (element !== more) reveal(element);\n root.removeAttribute(compactAttribute);\n const children = Array.from(root.children).filter(\n (element): element is HTMLElement => element instanceof HTMLElement && element !== more,\n );\n const visible = (element: Element) => !element.matches(\"[popover]\") && element.getClientRects().length > 0;\n const separator = (element: Element) => element.classList.contains(\"k2b-toolbar__separator\");\n const item = (element: Element) => !separator(element) && !element.classList.contains(\"k2b-toolbar__spacer\");\n // Separators are tidied in DOM order with More, the last control, counted as shown when `withMore` is set.\n const all = Array.from(root.children).filter((element): element is HTMLElement => element instanceof HTMLElement);\n const tidy = (withMore: boolean) => {\n for (const group of root.querySelectorAll(\".k2b-toolbar__group\")) {\n reveal(group);\n if (!Array.from(group.children).some(visible)) hide(group);\n }\n for (const child of children) if (separator(child)) reveal(child);\n const shown = (element: HTMLElement) => (element === more ? withMore : visible(element));\n let preceding = false;\n for (let index = 0; index < all.length; index++) {\n const child = all[index]!;\n if (!shown(child)) continue;\n if (separator(child)) {\n const following = all.slice(index + 1).some((next) => item(next) && shown(next));\n if (!preceding || !following) hide(child);\n else preceding = false;\n } else if (item(child)) preceding = true;\n }\n };\n const style = getComputedStyle(root);\n const edges = [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce(\n (sum, value) => sum + (Number.parseFloat(value) || 0),\n 0,\n );\n const gap = Number.parseFloat(style.columnGap) || 0;\n // A label may shrink in an overfull pill; measure its untruncated width (up to its cap) so actions move before the\n // count or title truncates.\n const width = (child: HTMLElement) => {\n // Separators carry inline margins, which bounding boxes leave out.\n const childStyle = getComputedStyle(child);\n // A spacer takes whatever room is left, so it needs only its minimum.\n if (child.classList.contains(\"k2b-toolbar__spacer\")) return Number.parseFloat(childStyle.minWidth) || 0;\n const box =\n child.getBoundingClientRect().width +\n (Number.parseFloat(childStyle.marginLeft) || 0) +\n (Number.parseFloat(childStyle.marginRight) || 0);\n if (!child.classList.contains(\"k2b-toolbar__label\")) return box;\n // A detail only takes leftover room: the label needs its main text and padding.\n const main = child.querySelector<HTMLElement>(\":scope > .k2b-toolbar__label-main\");\n if (main)\n return (\n main.scrollWidth +\n (Number.parseFloat(childStyle.paddingLeft) || 0) +\n (Number.parseFloat(childStyle.paddingRight) || 0) +\n (Number.parseFloat(childStyle.marginLeft) || 0) +\n (Number.parseFloat(childStyle.marginRight) || 0)\n );\n const cap = Number.parseFloat(childStyle.maxWidth);\n return Math.max(box, Math.min(child.scrollWidth, Number.isNaN(cap) ? Number.POSITIVE_INFINITY : cap));\n };\n const moreWidth = width(more) + gap;\n const used = (withMore: boolean) => {\n const shown = children.filter(visible);\n return shown.reduce((sum, child) => sum + width(child), edges) + gap * Math.max(0, shown.length - 1) + (withMore ? moreWidth : 0);\n };\n // Stable sort retains DOM order for the menu, but removes later actions first on a priority tie.\n const candidates = actions\n // An action its application hides, even with `visibility: hidden`, must not reappear as a More row.\n .filter(\n (action) =>\n action.props.priority !== undefined && visible(action.element) && getComputedStyle(action.element).visibility !== \"hidden\",\n )\n .reverse()\n .sort((a, b) => b.props.priority! - a.props.priority!);\n let movedAny = false;\n tidy(false);\n // Labels go before actions: a toolbar that does not fit with its labels drops them first.\n if (used(false) > available && root.querySelector(\".k2b-toolbar__action[data-text]\")) root.setAttribute(compactAttribute, \"\");\n for (const action of candidates) {\n if (used(movedAny) <= available) break;\n hide(action.element);\n movedAny = true;\n tidy(true);\n }\n // More changes only here, and only when its state changes.\n if (movedAny) reveal(more);\n else if (!more.hasAttribute(overflowAttribute)) hide(more);\n return actions.filter((action) => action.element.hasAttribute(overflowAttribute));\n};\n\nexport const Toolbar = Object.assign(\n (props: ToolbarProps): JSX.Element => {\n // The variant decides the DOM shape, so it is read once.\n const floating = props.variant === \"floating\";\n const danger = () => (floating && props.tone === \"danger\" ? \"danger\" : undefined);\n const orientation = () => (floating ? \"horizontal\" : (props.orientation ?? \"horizontal\"));\n const messages = useToolbarMessages();\n const actions = new Set<RegisteredAction>();\n const [revision, setRevision] = createSignal(0);\n const [moved, setMoved] = createSignal<RegisteredAction[]>([]);\n let root!: HTMLDivElement;\n let strip: HTMLDivElement | undefined;\n let more: HTMLDivElement | undefined;\n let trigger: HTMLButtonElement | undefined;\n let mounted = false;\n let navigation: ReturnType<typeof rovingFocus> | undefined;\n // Only the floating variant moves actions into More; inline toolbars keep every action in place.\n const measure = () => {\n if (!mounted || !strip || !more) return;\n const style = getComputedStyle(strip);\n const available = strip.clientWidth - Number.parseFloat(style.paddingLeft) - Number.parseFloat(style.paddingRight);\n if (available <= 0) return;\n const ordered = [...actions].sort((a, b) =>\n a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n );\n const focused = document.activeElement;\n // Cleared before measuring so the pending `visibility: hidden` does not hide every action from the check\n // below; the whole measurement still runs before the next paint.\n root.removeAttribute(\"data-overflow-pending\");\n const next = measureOverflow(root, more, ordered, available);\n setMoved((previous) =>\n previous.length === next.length && previous.every((action, index) => action === next[index]) ? previous : next,\n );\n navigation?.sync();\n // Focus on an action that moved, on a menu row whose action came back, or on a More that disappeared goes to\n // More, or to the toolbar's tab stop when nothing is left in More. Inside an effect the menu rows update after\n // this function returns, so the check waits for that flush; a microtask still runs before the next paint.\n queueMicrotask(() => {\n // A toolbar unmounted meanwhile, as its view closes, owns no focus any more.\n if (!mounted) return;\n const lost =\n next.some((action) => action.element === focused) ||\n (focused instanceof HTMLElement && !focused.isConnected) ||\n (focused === trigger && !next.length);\n if (lost) (next.length ? trigger : root.querySelector<HTMLElement>('[tabindex=\"0\"]'))?.focus();\n });\n };\n const register = (action: RegisteredAction) => {\n actions.add(action);\n setRevision((value) => value + 1);\n return () => {\n actions.delete(action);\n setRevision((value) => value + 1);\n };\n };\n if (floating)\n createEffect(() => {\n revision();\n for (const action of actions) {\n // Content and priority changes can affect intrinsic widths as well as menu rows.\n void action.props.priority;\n void action.props.label;\n void action.props.icon;\n void action.props.keys;\n void action.props.text;\n }\n measure();\n });\n onMount(() => {\n mounted = true;\n navigation = rovingFocus(root, orientation);\n onCleanup(() => {\n mounted = false;\n navigation?.cleanup();\n });\n if (!strip) return;\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(strip);\n observer.observe(root);\n const mutations = new MutationObserver(measure);\n // Visibility an application sets also counts. Measurement writes only data attributes, which stay unobserved.\n mutations.observe(root, {\n childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: [\"hidden\", \"class\", \"style\"],\n });\n onCleanup(() => {\n observer.disconnect();\n mutations.disconnect();\n });\n });\n const menuItems = (): DropdownAction[] => moved().map((action) => action.item);\n const content = (\n <ToolbarOrientationContext.Provider value={orientation}>\n <ToolbarDangerContext.Provider value={!!danger()}>\n <ToolbarActionsContext.Provider value={floating ? register : undefined}>\n <div\n ref={root}\n onKeyDown={(event) => navigation?.keydown(event)}\n class={`k2b-toolbar ${props.class ?? \"\"}`}\n role=\"toolbar\"\n aria-label={props.label}\n aria-orientation={orientation()}\n data-orientation={orientation()}\n data-variant={floating ? \"floating\" : undefined}\n data-tone={danger()}\n data-wrap={!floating && props.wrap ? \"true\" : undefined}\n data-overflow-pending={floating ? \"\" : undefined}\n >\n {props.children}\n <Show when={floating}>\n <div ref={more} class=\"k2b-toolbar__more\" data-overflow=\"hidden\">\n <Dropdown.Root\n items={menuItems()}\n position=\"top-left\"\n label={messages().moreActions}\n // An open menu closes when its last row returns to the toolbar.\n disabled={moved().length === 0}\n >\n <Dropdown.Trigger ref={trigger} iconOnly label={messages().moreActions}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </div>\n </Show>\n </div>\n </ToolbarActionsContext.Provider>\n </ToolbarDangerContext.Provider>\n </ToolbarOrientationContext.Provider>\n );\n return floating ? (\n <div ref={strip} class=\"k2b-toolbar-float\" data-edge={props.edge === \"top\" ? \"top\" : undefined} data-tone={danger()}>\n {content}\n </div>\n ) : (\n content\n );\n },\n { Action: ToolbarAction, Label: ToolbarLabel, Group: ToolbarGroup, Separator: ToolbarSeparator, Spacer: ToolbarSpacer },\n) as ToolbarComponent;\n\nexport type ToolbarDockProps = { children: JSX.Element; class?: string };\n\n/**\n * One floating row at the bottom of a column for several floating toolbars: the first sits at the start edge, the last\n * at the end edge, and each moves its own actions into More when the row gets narrow. Content scrolls beneath the row\n * and still ends above it.\n */\nexport const ToolbarDock = (props: ToolbarDockProps): JSX.Element => (\n <div class={props.class ? `k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,CAAC;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,OAInH,OACD;AACH,CAAC,EACD;EAAE,MAAM,EAAE,aAAa;EAAE,KAAK,EAAE,YAAY;EAAE,KAAK,EAAE,YAAY;EAAE,SAAS,EAAE,gBAAgB;EAAE,MAAM,EAAE;AAAc,CACxH,CAAqB;AAIrB;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,WAAW,GAAI,KAAuB;EAAA;EAAA,uBACkC,KAAK,CAAC,QAAQ;EAAA,mCAArF,KAAK,CAAC,KAAK,GAAG,oBAAoB,KAAK,CAAC,KAAK,EAAE,GAAG,kBAAkB;EAAA;AAAA,IACjF;AAED,eAAe,OAAO;AAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/Toolbar.tsx"],"sourcesContent":["import { createContext, createEffect, createSignal, type JSX, onCleanup, onMount, Show, sharedConfig, useContext } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { Kbd } from \"../content/Kbd\";\nimport { announce } from \"../feedback/announce\";\nimport { useLocale } from \"../intl/locale\";\nimport { formatShortcut, type KeyboardPlatform, keyboardPlatform } from \"../intl/shortcut\";\nimport { IconButton } from \"./Button\";\nimport { Dropdown, type DropdownAction, type DropdownItem } from \"./Dropdown\";\nimport { useToolbarMessages } from \"./toolbar-messages\";\n\nexport type ToolbarProps = {\n children: JSX.Element;\n label: string;\n orientation?: \"horizontal\" | \"vertical\";\n wrap?: boolean;\n /** `floating` floats the toolbar at an edge of its column. Defaults to `inline`. */\n variant?: \"inline\" | \"floating\";\n /** The edge a floating toolbar sticks to while its column scrolls. Defaults to `bottom`. */\n edge?: \"top\" | \"bottom\";\n /**\n * `danger` makes a floating toolbar the one red pill of a stopped state, such as an editor that can no longer save.\n * It spans its row in place of the usual pills, and screen readers announce its labels at once. Inline toolbars\n * ignore it.\n */\n tone?: \"danger\";\n /**\n * Rarer commands of a floating toolbar that always live in More, such as Copy to or Move to trash for a selection.\n * More then always shows; actions that move there on a narrow row come first, these follow in their own group.\n */\n moreItems?: readonly DropdownItem[];\n class?: string;\n};\n\nexport type ToolbarActionProps = {\n /** Accessible name, tooltip text, and the row label in the More menu. */\n label: string;\n /** Icon class, such as \"ti ti-archive\". */\n icon: string;\n /**\n * Shortcut hint below the icon, tooltip suffix, and aria-keyshortcuts; does not register a shortcut handler.\n * SelectionToolbar's compact actions keep only the tooltip suffix and aria-keyshortcuts.\n */\n keys?: string;\n /** 1 is most important. Larger numbers move first; ties move later DOM actions first. Omit to keep fixed. */\n priority?: number;\n /**\n * Shows the label beside the icon while a floating toolbar has room. When it gets narrow, these labels go first,\n * every action keeps its icon, and only then do actions move into More.\n */\n text?: boolean;\n disabled?: boolean;\n /** Makes the action a toggle and exposes its state as `aria-pressed`, such as Bold over bold text. */\n pressed?: boolean;\n onClick?: () => void;\n};\nexport type ToolbarLabelProps = {\n children: JSX.Element;\n /**\n * Follows the label while it fits, such as the reason after \"Not saved\". A narrow toolbar hides it whole before\n * actions give up their labels; screen readers always read it.\n */\n detail?: JSX.Element;\n class?: string;\n};\n\nexport type ToolbarGroupProps = { children: JSX.Element; label?: string; class?: string };\nexport type ToolbarSeparatorProps = { class?: string };\n\ntype ToolbarComponent = ((props: ToolbarProps) => JSX.Element) & {\n Action: (props: ToolbarActionProps) => JSX.Element;\n Label: (props: ToolbarLabelProps) => JSX.Element;\n Group: (props: ToolbarGroupProps) => JSX.Element;\n Separator: (props: ToolbarSeparatorProps) => JSX.Element;\n Spacer: () => JSX.Element;\n};\n\ntype ToolbarOrientation = NonNullable<ToolbarProps[\"orientation\"]>;\n\nconst defaultToolbarOrientation: () => ToolbarOrientation = () => \"horizontal\";\nconst ToolbarOrientationContext = createContext(defaultToolbarOrientation);\n/** True inside a floating `tone=\"danger\"` toolbar, whose labels announce themselves. */\nconst ToolbarDangerContext = createContext(false);\n/** False where actions are icon-sized, such as SelectionToolbar: no room below the icon for a hint. Package-internal. */\nexport const ToolbarHintsContext = createContext(true);\n\n// `item` is created once per action: the More menu keys its rows by identity, so a remeasure keeps a focused row.\ntype RegisteredAction = { element: HTMLButtonElement; props: ToolbarActionProps; item: DropdownAction };\nconst ToolbarActionsContext = createContext<(action: RegisteredAction) => () => void>();\nconst overflowAttribute = \"data-overflow\";\n/** Set on a floating toolbar whose action labels gave way to icons for lack of room. */\nconst compactAttribute = \"data-compact\";\nconst hide = (element: Element) => element.setAttribute(overflowAttribute, \"hidden\");\nconst reveal = (element: Element) => element.removeAttribute(overflowAttribute);\n\n// ARIA uses language-independent key names, unlike the translated tooltip and caps.\nconst ariaShortcut = (keys: string | undefined, platform: KeyboardPlatform): string | undefined => {\n if (!keys || !formatShortcut(keys, { platform, locale: \"en\" }).keys.length) return undefined;\n const input = keys.trim().toLowerCase();\n const plus = input === \"+\" || input.endsWith(\"++\");\n const parts = (plus ? input.slice(0, -1) : input).split(\"+\");\n // ARIA separates keys with \"+\", so the plus key itself is named \"plus\".\n const key = plus ? \"plus\" : parts.pop() || \"space\";\n if (plus) parts.pop();\n const names: Record<string, string> = {\n mod: platform === \"apple\" ? \"Meta\" : \"Control\",\n ctrl: \"Control\",\n alt: \"Alt\",\n shift: \"Shift\",\n meta: \"Meta\",\n arrowup: \"ArrowUp\",\n arrowdown: \"ArrowDown\",\n arrowleft: \"ArrowLeft\",\n arrowright: \"ArrowRight\",\n escape: \"Escape\",\n esc: \"Escape\",\n backspace: \"Backspace\",\n enter: \"Enter\",\n delete: \"Delete\",\n space: \"Space\",\n tab: \"Tab\",\n home: \"Home\",\n end: \"End\",\n pageup: \"PageUp\",\n pagedown: \"PageDown\",\n plus: \"plus\",\n };\n const final = key.length === 1 || /^f(?:[1-9]|1[0-2])$/.test(key) ? key.toUpperCase() : names[key];\n return final ? [...new Set(parts.map((part) => names[part])), final].join(\"+\") : undefined;\n};\n\nconst ToolbarAction = (props: ToolbarActionProps): JSX.Element => {\n const register = useContext(ToolbarActionsContext);\n const hints = useContext(ToolbarHintsContext);\n const locale = useLocale();\n const [platform, setPlatform] = createSignal<KeyboardPlatform>(isServer || sharedConfig.context ? \"other\" : keyboardPlatform());\n onMount(() => setPlatform(keyboardPlatform()));\n const tooltip = () => {\n const shortcut = props.keys ? formatShortcut(props.keys, { platform: platform(), locale: locale() }).label : \"\";\n return shortcut ? `${props.label} (${shortcut})` : props.label;\n };\n return (\n <IconButton\n ref={(element) => {\n const item: DropdownAction = {\n get label() {\n return props.label;\n },\n get icon() {\n return props.icon;\n },\n get disabled() {\n return props.disabled;\n },\n action: () => props.onClick?.(),\n };\n const unregister = register?.({ element, props, item });\n if (unregister) onCleanup(unregister);\n }}\n class=\"k2b-toolbar__action\"\n label={props.label}\n variant=\"ghost\"\n tooltip={tooltip()}\n aria-keyshortcuts={ariaShortcut(props.keys, platform())}\n aria-pressed={props.pressed === undefined ? undefined : props.pressed ? \"true\" : \"false\"}\n data-priority={props.priority}\n data-text={props.text ? \"\" : undefined}\n disabled={props.disabled}\n onClick={() => props.onClick?.()}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n <Show when={props.text}>\n <span class=\"k2b-toolbar__text\" aria-hidden=\"true\">\n {props.label}\n </span>\n </Show>\n <Show when={hints && props.keys}>{(keys) => <Kbd keys={keys()} class=\"k2b-kbd-hint k2b-toolbar__hint\" />}</Show>\n </IconButton>\n );\n};\n\nconst ToolbarLabel = (props: ToolbarLabelProps): JSX.Element => {\n const danger = useContext(ToolbarDangerContext);\n let label!: HTMLSpanElement;\n // The shared assertive live region exists before the text arrives, so the message is read reliably, also when the\n // pill appears with it or its text changes later.\n onMount(() => {\n if (!danger) return;\n let spoken = \"\";\n const speak = () => {\n const text = label.textContent?.replace(/\\s+/g, \" \").trim() ?? \"\";\n if (text === spoken) return;\n spoken = text;\n announce(text, { politeness: \"assertive\" });\n };\n speak();\n const observer = new MutationObserver(speak);\n observer.observe(label, { childList: true, subtree: true, characterData: true });\n onCleanup(() => observer.disconnect());\n });\n return (\n <span ref={label} class={`k2b-toolbar__label ${props.class ?? \"\"}`} data-detail={props.detail ? \"\" : undefined}>\n <Show when={props.detail} fallback={props.children}>\n <span class=\"k2b-toolbar__label-main\">{props.children}</span>\n <span class=\"k2b-toolbar__label-detail\">{props.detail}</span>\n </Show>\n </span>\n );\n};\n\nconst ToolbarGroup = (props: ToolbarGroupProps): JSX.Element => (\n <div class={`k2b-toolbar__group ${props.class ?? \"\"}`} role=\"group\" aria-label={props.label}>\n {props.children}\n </div>\n);\n\nconst ToolbarSeparator = (props: ToolbarSeparatorProps): JSX.Element => {\n const toolbarOrientation = useContext(ToolbarOrientationContext);\n const separatorOrientation = () => (toolbarOrientation() === \"horizontal\" ? \"vertical\" : \"horizontal\");\n\n return (\n <span\n class={`k2b-toolbar__separator ${props.class ?? \"\"}`}\n role=\"separator\"\n aria-orientation={separatorOrientation()}\n data-orientation={separatorOrientation()}\n />\n );\n};\n\nconst ToolbarSpacer = (): JSX.Element => <span class=\"k2b-toolbar__spacer\" aria-hidden=\"true\" />;\n\nconst rovingFocus = (root: HTMLDivElement, orientation: () => ToolbarOrientation) => {\n let last: HTMLElement | undefined;\n const setLast = (item: HTMLElement | undefined) => {\n if (item === last) return;\n if (last) resizeObserver.unobserve(last);\n last = item;\n if (last) resizeObserver.observe(last);\n };\n const controls = () =>\n Array.from(root.querySelectorAll<HTMLElement>(\"button, a[href], input, select, textarea, [tabindex]\")).filter((item) => {\n if (\n item.matches(\"textarea, select\") ||\n item.isContentEditable ||\n (item.matches(\"input\") && !/^(button|checkbox|reset|submit|image|color|file)$/i.test(item.getAttribute(\"type\") ?? \"text\"))\n )\n return false;\n const nested = item.closest('[role=\"menu\"], [role=\"listbox\"], [role=\"dialog\"], [popover]');\n return !nested || !root.contains(nested);\n });\n const items = () =>\n controls().filter(\n (item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]') && item.getClientRects().length > 0,\n );\n const sync = () => {\n // A toolbar that is still hidden, such as a SelectionToolbar about to show, keeps one stop: otherwise Tab right\n // after it shows would pass it before the next measure.\n const shown = items();\n const available = shown.length\n ? shown\n : controls().filter((item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]'));\n if (!last || !available.includes(last)) setLast(available[0]);\n for (const item of controls()) item.tabIndex = item === last ? 0 : -1;\n };\n const focusin = (event: FocusEvent) => {\n if (event.target instanceof HTMLElement && items().includes(event.target)) {\n setLast(event.target);\n sync();\n }\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const available = items();\n const target = event.target;\n if (!(target instanceof HTMLElement) || !available.includes(target)) return;\n const forward = orientation() === \"vertical\" ? \"ArrowDown\" : getComputedStyle(root).direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backward = orientation() === \"vertical\" ? \"ArrowUp\" : forward === \"ArrowRight\" ? \"ArrowLeft\" : \"ArrowRight\";\n const index = available.indexOf(target);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? available.length - 1\n : event.key === forward\n ? (index + 1) % available.length\n : event.key === backward\n ? (index + available.length - 1) % available.length\n : -1;\n if (next < 0) return;\n event.preventDefault();\n setLast(available[next]);\n sync();\n last?.focus();\n };\n const observer = new MutationObserver(sync);\n observer.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"disabled\", \"hidden\", \"class\", \"style\", overflowAttribute],\n });\n const resizeObserver = new ResizeObserver(sync);\n resizeObserver.observe(root);\n root.addEventListener(\"focusin\", focusin);\n sync();\n return {\n keydown,\n sync,\n cleanup: () => {\n observer.disconnect();\n resizeObserver.disconnect();\n root.removeEventListener(\"focusin\", focusin);\n },\n };\n};\n\n/**\n * All measurement writes are DOM attributes: reactive writes do not flush during onMount. More is never toggled while\n * measuring: hiding it, even for a moment, can make the browser drop focus from it or from its open menu. An idle More\n * stays out of the flow but keeps its box, so its width is always known.\n */\nconst measureOverflow = (\n root: HTMLDivElement,\n more: HTMLDivElement,\n actions: RegisteredAction[],\n available: number,\n pinned = false,\n): RegisteredAction[] => {\n for (const element of root.querySelectorAll(`[${overflowAttribute}]`)) if (element !== more) reveal(element);\n root.removeAttribute(compactAttribute);\n const children = Array.from(root.children).filter(\n (element): element is HTMLElement => element instanceof HTMLElement && element !== more,\n );\n const visible = (element: Element) => !element.matches(\"[popover]\") && element.getClientRects().length > 0;\n const separator = (element: Element) => element.classList.contains(\"k2b-toolbar__separator\");\n const item = (element: Element) => !separator(element) && !element.classList.contains(\"k2b-toolbar__spacer\");\n // Separators are tidied in DOM order with More, the last control, counted as shown when `withMore` is set.\n const all = Array.from(root.children).filter((element): element is HTMLElement => element instanceof HTMLElement);\n const tidy = (withMore: boolean) => {\n for (const group of root.querySelectorAll(\".k2b-toolbar__group\")) {\n reveal(group);\n if (!Array.from(group.children).some(visible)) hide(group);\n }\n for (const child of children) if (separator(child)) reveal(child);\n const shown = (element: HTMLElement) => (element === more ? withMore : visible(element));\n let preceding = false;\n for (let index = 0; index < all.length; index++) {\n const child = all[index]!;\n if (!shown(child)) continue;\n if (separator(child)) {\n const following = all.slice(index + 1).some((next) => item(next) && shown(next));\n if (!preceding || !following) hide(child);\n else preceding = false;\n } else if (item(child)) preceding = true;\n }\n };\n const style = getComputedStyle(root);\n const edges = [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce(\n (sum, value) => sum + (Number.parseFloat(value) || 0),\n 0,\n );\n const gap = Number.parseFloat(style.columnGap) || 0;\n // A label may shrink in an overfull pill; measure its untruncated width (up to its cap) so actions move before the\n // count or title truncates.\n const width = (child: HTMLElement) => {\n // Separators carry inline margins, which bounding boxes leave out.\n const childStyle = getComputedStyle(child);\n // A spacer takes whatever room is left, so it needs only its minimum.\n if (child.classList.contains(\"k2b-toolbar__spacer\")) return Number.parseFloat(childStyle.minWidth) || 0;\n const box =\n child.getBoundingClientRect().width +\n (Number.parseFloat(childStyle.marginLeft) || 0) +\n (Number.parseFloat(childStyle.marginRight) || 0);\n if (!child.classList.contains(\"k2b-toolbar__label\")) return box;\n // A detail only takes leftover room: the label needs its main text and padding.\n const main = child.querySelector<HTMLElement>(\":scope > .k2b-toolbar__label-main\");\n if (main)\n return (\n main.scrollWidth +\n (Number.parseFloat(childStyle.paddingLeft) || 0) +\n (Number.parseFloat(childStyle.paddingRight) || 0) +\n (Number.parseFloat(childStyle.marginLeft) || 0) +\n (Number.parseFloat(childStyle.marginRight) || 0)\n );\n const cap = Number.parseFloat(childStyle.maxWidth);\n return Math.max(box, Math.min(child.scrollWidth, Number.isNaN(cap) ? Number.POSITIVE_INFINITY : cap));\n };\n const moreWidth = width(more) + gap;\n const used = (withMore: boolean) => {\n const shown = children.filter(visible);\n return shown.reduce((sum, child) => sum + width(child), edges) + gap * Math.max(0, shown.length - 1) + (withMore ? moreWidth : 0);\n };\n // Stable sort retains DOM order for the menu, but removes later actions first on a priority tie.\n const candidates = actions\n // An action its application hides, even with `visibility: hidden`, must not reappear as a More row.\n .filter(\n (action) =>\n action.props.priority !== undefined && visible(action.element) && getComputedStyle(action.element).visibility !== \"hidden\",\n )\n .reverse()\n .sort((a, b) => b.props.priority! - a.props.priority!);\n // With rarer commands of its own, More always shows and always takes its room.\n let movedAny = pinned;\n tidy(pinned);\n // Labels go before actions: a toolbar that does not fit with its labels drops them first.\n if (used(pinned) > available && root.querySelector(\".k2b-toolbar__action[data-text]\")) root.setAttribute(compactAttribute, \"\");\n for (const action of candidates) {\n if (used(movedAny) <= available) break;\n hide(action.element);\n movedAny = true;\n tidy(true);\n }\n // More changes only here, and only when its state changes.\n if (movedAny) reveal(more);\n else if (!more.hasAttribute(overflowAttribute)) hide(more);\n return actions.filter((action) => action.element.hasAttribute(overflowAttribute));\n};\n\nexport const Toolbar = Object.assign(\n (props: ToolbarProps): JSX.Element => {\n // The variant decides the DOM shape, so it is read once.\n const floating = props.variant === \"floating\";\n const danger = () => (floating && props.tone === \"danger\" ? \"danger\" : undefined);\n const orientation = () => (floating ? \"horizontal\" : (props.orientation ?? \"horizontal\"));\n const messages = useToolbarMessages();\n const actions = new Set<RegisteredAction>();\n const [revision, setRevision] = createSignal(0);\n const [moved, setMoved] = createSignal<RegisteredAction[]>([]);\n let root!: HTMLDivElement;\n let strip: HTMLDivElement | undefined;\n let more: HTMLDivElement | undefined;\n let trigger: HTMLButtonElement | undefined;\n let mounted = false;\n let navigation: ReturnType<typeof rovingFocus> | undefined;\n // Only the floating variant moves actions into More; inline toolbars keep every action in place.\n const measure = () => {\n if (!mounted || !strip || !more) return;\n const style = getComputedStyle(strip);\n const available = strip.clientWidth - Number.parseFloat(style.paddingLeft) - Number.parseFloat(style.paddingRight);\n if (available <= 0) return;\n const ordered = [...actions].sort((a, b) =>\n a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n );\n const focused = document.activeElement;\n // Cleared before measuring so the pending `visibility: hidden` does not hide every action from the check\n // below; the whole measurement still runs before the next paint.\n root.removeAttribute(\"data-overflow-pending\");\n const next = measureOverflow(root, more, ordered, available, (props.moreItems?.length ?? 0) > 0);\n setMoved((previous) =>\n previous.length === next.length && previous.every((action, index) => action === next[index]) ? previous : next,\n );\n navigation?.sync();\n // Focus on an action that moved, on a menu row whose action came back, or on a More that disappeared goes to\n // More, or to the toolbar's tab stop when nothing is left in More. Inside an effect the menu rows update after\n // this function returns, so the check waits for that flush; a microtask still runs before the next paint.\n queueMicrotask(() => {\n // A toolbar unmounted meanwhile, as its view closes, owns no focus any more.\n if (!mounted) return;\n const lost =\n next.some((action) => action.element === focused) ||\n (focused instanceof HTMLElement && !focused.isConnected) ||\n (focused === trigger && !next.length);\n if (lost) (next.length ? trigger : root.querySelector<HTMLElement>('[tabindex=\"0\"]'))?.focus();\n });\n };\n const register = (action: RegisteredAction) => {\n actions.add(action);\n setRevision((value) => value + 1);\n return () => {\n actions.delete(action);\n setRevision((value) => value + 1);\n };\n };\n if (floating)\n createEffect(() => {\n revision();\n for (const action of actions) {\n // Content and priority changes can affect intrinsic widths as well as menu rows.\n void action.props.priority;\n void action.props.label;\n void action.props.icon;\n void action.props.keys;\n void action.props.text;\n }\n measure();\n });\n onMount(() => {\n mounted = true;\n navigation = rovingFocus(root, orientation);\n onCleanup(() => {\n mounted = false;\n navigation?.cleanup();\n });\n if (!strip) return;\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(strip);\n observer.observe(root);\n const mutations = new MutationObserver(measure);\n // Visibility an application sets also counts. Measurement writes only data attributes, which stay unobserved.\n mutations.observe(root, {\n childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: [\"hidden\", \"class\", \"style\"],\n });\n onCleanup(() => {\n observer.disconnect();\n mutations.disconnect();\n });\n });\n // Actions that moved come first, in their order and in a group of their own; the host's rarer commands follow.\n const menuItems = (): DropdownItem[] => {\n const movedItems = moved().map((action) => action.item);\n const pinnedItems = props.moreItems ?? [];\n if (!pinnedItems.length) return movedItems;\n return movedItems.length ? [{ items: movedItems }, ...pinnedItems] : [...pinnedItems];\n };\n const content = (\n <ToolbarOrientationContext.Provider value={orientation}>\n <ToolbarDangerContext.Provider value={!!danger()}>\n <ToolbarActionsContext.Provider value={floating ? register : undefined}>\n <div\n ref={root}\n onKeyDown={(event) => navigation?.keydown(event)}\n class={`k2b-toolbar ${props.class ?? \"\"}`}\n role=\"toolbar\"\n aria-label={props.label}\n aria-orientation={orientation()}\n data-orientation={orientation()}\n data-variant={floating ? \"floating\" : undefined}\n data-tone={danger()}\n data-wrap={!floating && props.wrap ? \"true\" : undefined}\n data-overflow-pending={floating ? \"\" : undefined}\n >\n {props.children}\n <Show when={floating}>\n <div ref={more} class=\"k2b-toolbar__more\" data-overflow=\"hidden\">\n <Dropdown.Root\n items={menuItems()}\n position=\"top-left\"\n label={messages().moreActions}\n // An open menu closes when its last row returns to the toolbar.\n disabled={moved().length === 0 && !props.moreItems?.length}\n >\n <Dropdown.Trigger ref={trigger} iconOnly label={messages().moreActions}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </div>\n </Show>\n </div>\n </ToolbarActionsContext.Provider>\n </ToolbarDangerContext.Provider>\n </ToolbarOrientationContext.Provider>\n );\n return floating ? (\n <div ref={strip} class=\"k2b-toolbar-float\" data-edge={props.edge === \"top\" ? \"top\" : undefined} data-tone={danger()}>\n {content}\n </div>\n ) : (\n content\n );\n },\n { Action: ToolbarAction, Label: ToolbarLabel, Group: ToolbarGroup, Separator: ToolbarSeparator, Spacer: ToolbarSpacer },\n) as ToolbarComponent;\n\nexport type ToolbarDockProps = { children: JSX.Element; class?: string };\n\n/**\n * One floating row at the bottom of a column for several floating toolbars: the first sits at the start edge, the last\n * at the end edge, and each moves its own actions into More when the row gets narrow. Content scrolls beneath the row\n * and still ends above it.\n */\nexport const ToolbarDock = (props: ToolbarDockProps): JSX.Element => (\n <div class={props.class ? `k2b-toolbar-dock ${props.class}` : \"k2b-toolbar-dock\"}>{props.children}</div>\n);\n\nexport default Toolbar;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa,EAAE,YAAY,EAAE,YAAY,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,QAAQ,UAAU;AAClI,SAAS,QAAQ,QAAQ,cAAc;AACvC,SAAS,GAAG,QAAQ,gBAAgB;AACpC,SAAS,QAAQ,QAAQ,sBAAsB;AAC/C,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,cAAc,EAAyB,gBAAgB,QAAQ,kBAAkB;AAC1F,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,QAAQ,QAAgD,YAAY;AAC7E,SAAS,kBAAkB,QAAQ,oBAAoB;AAsEvD,MAAM,yBAAmD,GAAG,MAAM,YAAY;AAC9E,MAAM,yBAAyB,GAAG,aAAa,CAAC,yBAAyB,CAAC;AAC1E;AACA,MAAM,oBAAoB,GAAG,aAAa,CAAC,KAAK,CAAC;AACjD;AACA,OAAO,MAAM,mBAAmB,GAAG,a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AAA,uBACkC,KAAK,CAAC,QAAQ;EAAA,mCAArF,KAAK,CAAC,KAAK,GAAG,oBAAoB,KAAK,CAAC,KAAK,EAAE,GAAG,kBAAkB;EAAA;AAAA,IACjF;AAED,eAAe,OAAO;AAAC","ignoreList":[]}
|
|
@@ -116,15 +116,16 @@ function settleViewTabs(list, edges, focused) {
|
|
|
116
116
|
* Also embedded, so it must not close over module state.
|
|
117
117
|
*
|
|
118
118
|
* A fitting strip converges by construction. It fits again only when the strip renders, web fonts finish loading, or
|
|
119
|
-
* a notification finds another width of
|
|
120
|
-
*
|
|
121
|
-
* its own width (`flex: none`), so the
|
|
119
|
+
* a notification finds another width of its room or of an entry that the last fit left shown. The room is the head
|
|
120
|
+
* lead, or outside a workspace head the strip's own root, which takes its width from its row. A fit only shows and
|
|
121
|
+
* hides entries: neither room takes width from the entries, and every entry keeps its own width (`flex: none`), so the
|
|
122
|
+
* notifications a fit causes find the widths it ended with and stop there.
|
|
122
123
|
*/
|
|
123
124
|
function watchViewTabs(list, settle, edges) {
|
|
124
125
|
if (!(list instanceof HTMLElement)) return;
|
|
125
126
|
const fits = list.hasAttribute("data-fit-room");
|
|
126
|
-
const roomOf = () => list.closest(".k2b-app-workspace__head-lead");
|
|
127
|
-
// What a fit depends on: the
|
|
127
|
+
const roomOf = () => list.closest(".k2b-app-workspace__head-lead") ?? list.closest(".k2b-view-tabs");
|
|
128
|
+
// What a fit depends on: the room's width and each shown entry's width, which fonts, icons and labels change.
|
|
128
129
|
const measured = () => [roomOf()?.clientWidth ?? -1, ...Array.from(list.children, child => child.getBoundingClientRect().width)].join(" ");
|
|
129
130
|
// A DOM property survives hydration: one observer and focus listener per reused list.
|
|
130
131
|
let watch = list.__k2bViewTabsWatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/ViewTabs.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { createScrollFade, scrollFadeEdges } from \"../layout/scroll-fade\";\nimport Dropdown, { type DropdownItem } from \"./Dropdown\";\n\nexport type ViewTab = {\n id: string;\n label: string;\n href: string;\n icon?: string;\n count?: number | string;\n /** A short quiet label after the count, such as \"New\" for a view people have not opened yet. */\n badge?: string;\n /** Stays in the strip after More at every width, for a view of another kind than the ones that overflow. */\n pinned?: boolean;\n};\nexport type ViewTabsProps = {\n /** Accessible name of the navigation landmark, e.g. \"Views\". */\n label: string;\n items: readonly ViewTab[];\n /** Id of the open view; the server reads it from `?view=`. Unknown ids select nothing. */\n current: string | undefined;\n /** At most this many views before More (default 5). */\n max?: number;\n /**\n * The strip shows only the views that fit its room and counts the rest in More, instead of scrolling them. The open\n * view and pinned views stay. Pair it with a larger `max` so a wide head shows more views.\n */\n fit?: boolean;\n class?: string;\n};\n\n/** Two deterministic strip levels; only opening the menu reads CSS visibility. */\nexport function viewTabsLayout(items: readonly ViewTab[], current: string | undefined, max = 5) {\n // At least one slot keeps the current view visible, including for an invalid limit.\n const limit = Number.isFinite(max) ? Math.max(1, Math.floor(max)) : 5;\n // Pinned views never overflow, so they take no slot.\n const flowing = items.flatMap((item, index) => (item.pinned ? [] : [index]));\n const pinned = items.flatMap((item, index) => (item.pinned ? [index] : []));\n const currentIndex = items.findIndex((item) => item.id === current);\n const currentPosition = flowing.indexOf(currentIndex);\n const visible = (size: number) => {\n const indices = flowing.slice(0, size);\n if (currentPosition >= size) indices[indices.length - 1] = currentIndex;\n return indices;\n };\n const wide = visible(limit);\n const compact = visible(Math.min(limit, 3));\n return { wide, compact, pinned, wideHidden: flowing.length - wide.length, compactHidden: flowing.length - compact.length };\n}\n\n/**\n * Self-contained: the server script embeds this before hydration. A fitting strip first keeps only the views that fit\n * its room and counts the rest in More; then the open or focused view scrolls into the strip.\n */\nfunction settleViewTabs(list: Element | null, edges: (element: HTMLElement) => string | undefined, focused?: HTMLElement) {\n if (!(list instanceof HTMLElement)) return;\n const more = list.querySelector<HTMLElement>(\":scope > .k2b-view-tabs__more\");\n const fitCount = more?.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"fit\"]');\n const flowing = Array.from(list.querySelectorAll<HTMLElement>(\":scope > .k2b-view-tabs__item:not([data-pinned])\"));\n\n for (const item of flowing) item.removeAttribute(\"data-fit-hidden\");\n more?.removeAttribute(\"data-fit\");\n // The shown entries against the strip's inner room, whatever its scroll and padding.\n const overflows = () => {\n const boxes = Array.from(list.children)\n .filter((child) => child instanceof HTMLElement && child.tagName === \"LI\" && child.getClientRects().length > 0)\n .map((child) => child.getBoundingClientRect());\n if (boxes.length === 0) return false;\n const style = getComputedStyle(list);\n const room = list.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);\n return Math.max(...boxes.map((box) => box.right)) - Math.min(...boxes.map((box) => box.left)) > room + 0.5;\n };\n // The phone head row keeps its scrolling strip: its CSS turns fitting off.\n const fits = list.hasAttribute(\"data-fit-room\") && getComputedStyle(list).getPropertyValue(\"--k2b-view-tabs-fit\").trim() !== \"none\";\n if (fits && more && fitCount && overflows()) {\n // Count from the level on screen: the compact strip already keeps fewer views than the wide one.\n const compact = more.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"compact\"]');\n const compactShown = Boolean(compact && getComputedStyle(compact).display !== \"none\");\n const behind = Number(compactShown ? more.dataset.behindCompact : more.dataset.behindWide) || 0;\n // The last views on screen leave first; the open view stays.\n const candidates = flowing.filter((item) => item.getClientRects().length > 0 && !item.querySelector(\"[aria-current=page]\")).reverse();\n more.setAttribute(\"data-fit\", \"\");\n let hidden = 0;\n for (const item of candidates) {\n item.setAttribute(\"data-fit-hidden\", \"\");\n hidden += 1;\n fitCount.textContent = `+${behind + hidden}`;\n if (!overflows()) break;\n }\n if (hidden === 0) more.removeAttribute(\"data-fit\");\n }\n const current = focused ?? list.querySelector(\".k2b-view-tabs__tab[aria-current=page]\");\n if (current && current.getClientRects().length > 0 && list.scrollWidth - list.clientWidth > 1) {\n const bounds = list.getBoundingClientRect();\n const item = current.getBoundingClientRect();\n const fade = edges(list);\n const style = getComputedStyle(list);\n const left = fade === \"top\" || fade === \"both\" ? parseFloat(style.scrollPaddingLeft) || 0 : 0;\n const right = fade === \"bottom\" || fade === \"both\" ? parseFloat(style.scrollPaddingRight) || 0 : 0;\n if (item.left < bounds.left + left || item.right > bounds.right - right) {\n let offset = item.left - bounds.left - (bounds.width - item.width) / 2;\n if (focused) {\n // Reserve padding at the destination edge; native clamping drops it when that end is reached.\n offset =\n item.left < bounds.left + left\n ? item.left - bounds.left - (parseFloat(style.scrollPaddingLeft) || 0)\n : item.right - bounds.right + (parseFloat(style.scrollPaddingRight) || 0);\n }\n // Only the strip moves: scrollIntoView would also scroll the page. Instant keeps the first frame free of animation.\n list.scrollTo({ left: list.scrollLeft + offset, behavior: \"instant\" });\n }\n }\n const fade = edges(list);\n if (fade) list.setAttribute(\"data-scroll-fade\", fade);\n else list.removeAttribute(\"data-scroll-fade\");\n}\n\ntype WatchedViewTabs = HTMLElement & {\n __k2bViewTabsWatch?: {\n resize: ResizeObserver;\n focus: (event: FocusEvent) => void;\n preferCurrent: boolean;\n connect: () => void;\n /** Runs one fit in the next frame; calls before it runs share it. */\n schedule: () => void;\n frame: number;\n /** The head lead's width and the widths of the shown entries when the last fit ended. */\n room: string;\n /** Fits again once web fonts finish loading: their metrics change every view's width, not the lead's. */\n fonts: () => void;\n };\n};\n\n/**\n * Also embedded, so it must not close over module state.\n *\n * A fitting strip converges by construction. It fits again only when the strip renders, web fonts finish loading, or\n * a notification finds another width of the head lead or of an entry that the last fit left shown. A fit only shows\n * and hides entries: the lead is an inline-size container that takes no width from the strip, and every entry keeps\n * its own width (`flex: none`), so the notifications a fit causes find the widths it ended with and stop there.\n */\nfunction watchViewTabs(list: WatchedViewTabs | null, settle: typeof settleViewTabs, edges: (element: HTMLElement) => string | undefined) {\n if (!(list instanceof HTMLElement)) return;\n const fits = list.hasAttribute(\"data-fit-room\");\n const roomOf = () => list.closest<HTMLElement>(\".k2b-app-workspace__head-lead\");\n // What a fit depends on: the lead's width and each shown entry's width, which fonts, icons and labels change.\n const measured = () =>\n [roomOf()?.clientWidth ?? -1, ...Array.from(list.children, (child) => child.getBoundingClientRect().width)].join(\" \");\n // A DOM property survives hydration: one observer and focus listener per reused list.\n let watch = list.__k2bViewTabsWatch;\n if (!watch) {\n const focus = (event: FocusEvent) => {\n // Pointer focus must not move the target under the pointer.\n if (watch && event.target instanceof HTMLElement && event.target.matches(\".k2b-view-tabs__tab:focus-visible\")) {\n watch.preferCurrent = false;\n settle(list, edges, event.target);\n }\n };\n const settleNow = () => {\n const focused = document.activeElement;\n if (\n watch?.preferCurrent === false &&\n focused instanceof HTMLElement &&\n list.contains(focused) &&\n focused.matches(\".k2b-view-tabs__tab:focus-visible\")\n )\n settle(list, edges, focused);\n else settle(list, edges);\n };\n // Head actions parse after the views; settle again after their layout, before paint, and on later resizes.\n const connect = () => {\n if (!watch) return;\n watch.resize.disconnect();\n watch.resize.observe(list);\n for (const child of Array.from(list.children)) watch.resize.observe(child);\n const room = roomOf();\n if (fits && room) watch.resize.observe(room);\n };\n // Fitting resizes the strip and possibly the head, which other observers may watch. Inside a ResizeObserver\n // callback that would leave their notifications undelivered, so a fit runs in the next frame, still before it paints.\n const schedule = () => {\n if (!watch || watch.frame) return;\n watch.frame = requestAnimationFrame(() => {\n if (!watch) return;\n watch.frame = 0;\n if (!list.isConnected) return;\n settleNow();\n watch.room = measured();\n });\n };\n watch = {\n resize: new ResizeObserver(() => {\n // A scrolling strip only scrolls and settles at once.\n if (!fits) return settleNow();\n // Heights follow the fit, and hidden entries measure 0 by its own doing: only another measure counts.\n if (watch && measured() !== watch.room) watch.schedule();\n }),\n focus,\n preferCurrent: true,\n connect,\n schedule,\n frame: 0,\n room: \"\",\n fonts: () => watch?.schedule(),\n };\n Object.defineProperty(list, \"__k2bViewTabsWatch\", { value: watch, configurable: true });\n list.addEventListener(\"focusin\", focus);\n // A first visit can paint before the web fonts load; the server frame and the client then fit the same metrics.\n if (fits && document.fonts) {\n document.fonts.addEventListener(\"loadingdone\", watch.fonts);\n void document.fonts.ready.then(watch.fonts);\n }\n }\n watch.preferCurrent = true;\n watch.connect();\n settle(list, edges);\n if (fits) {\n watch.room = measured();\n // The head's actions parse after the views. A frame's animation callbacks run before its first layout and\n // paint, so this fit also counts their room in the first frame.\n watch.schedule();\n }\n return watch;\n}\nconst VIEW_TABS_SCRIPT = `(${watchViewTabs})(document.currentScript&&document.currentScript.previousElementSibling,${settleViewTabs},${scrollFadeEdges})`;\n\n/**\n * URL-backed object views. Every view is an ordinary document link, in the strip and under More, so reload, back,\n * and forward keep the view the URL names.\n */\nexport function ViewTabs(props: ViewTabsProps): JSX.Element {\n const messages = useUiMessages();\n const layout = createMemo(() => viewTabsLayout(props.items, props.current, props.max));\n const stripItems = new Map<number, HTMLLIElement>();\n let list: HTMLUListElement | undefined;\n createScrollFade(\n () => list,\n () => true,\n );\n onMount(() => {\n const watch = watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges);\n let disposed = false;\n // Later mount effects can invalidate WebKit's scroll layout after this\n // initial settle. Finish once the mount task is complete, before its first\n // frame; ResizeObserver alone runs too late for that frame.\n queueMicrotask(() => {\n if (!disposed && watch?.preferCurrent) settleViewTabs(list ?? null, scrollFadeEdges);\n });\n onCleanup(() => {\n disposed = true;\n watch?.resize.disconnect();\n if (watch?.frame) cancelAnimationFrame(watch.frame);\n if (watch) document.fonts?.removeEventListener(\"loadingdone\", watch.fonts);\n if (list && watch) {\n list.removeEventListener(\"focusin\", watch.focus);\n Reflect.deleteProperty(list, \"__k2bViewTabsWatch\");\n }\n });\n });\n // User effects run after Solid's render effects, including For and aria-current, in the same task.\n // What the strip shows: another open view, view, label, count or badge can change what fits. Equal content in a new\n // array settles nothing again.\n const shown = createMemo(() =>\n [\n props.current ?? \"\",\n layout().wide.join(\",\"),\n ...props.items.map((item) => `${item.id}\\u0000${item.label}\\u0000${item.count ?? \"\"}\\u0000${item.badge ?? \"\"}`),\n ].join(\"\\u0001\"),\n );\n createEffect(on(shown, () => watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges), { defer: true }));\n const [open, setOpen] = createSignal(false);\n const [menuItems, setMenuItems] = createSignal<DropdownItem[]>([]);\n const onOpenChange = (next: boolean) => {\n if (next) {\n setMenuItems(\n props.items\n .filter(\n (item, index) =>\n !item.pinned &&\n item.id !== props.current &&\n (!layout().wide.includes(index) || stripItems.get(index)?.getClientRects().length === 0),\n )\n .map((item) => ({\n href: item.href,\n label: item.label,\n icon: item.icon,\n trailing: item.count !== undefined ? <span class=\"k2b-view-tabs__count\">{item.count}</span> : undefined,\n })),\n );\n }\n setOpen(next);\n };\n const tabContent = (item: ViewTab) => (\n <>\n <Show when={item.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span class=\"k2b-view-tabs__label k2b-truncate-fade\">{item.label}</span>\n <Show when={item.count !== undefined}>\n <span class=\"k2b-view-tabs__count\">{item.count}</span>\n </Show>\n <Show when={item.badge}>{(badge) => <span class=\"k2b-view-tabs__badge\">{badge()}</span>}</Show>\n </>\n );\n const stripItem = (index: number) => {\n const item = () => props.items[index]!;\n onCleanup(() => stripItems.delete(index));\n return (\n <li\n ref={(element) => stripItems.set(index, element)}\n class=\"k2b-view-tabs__item\"\n data-view-tab={item().id}\n data-pinned={item().pinned ? \"\" : undefined}\n data-compact-hidden={!item().pinned && !layout().compact.includes(index) ? \"\" : undefined}\n >\n <a class=\"k2b-view-tabs__tab\" href={item().href} aria-current={item().id === props.current ? \"page\" : undefined}>\n {tabContent(item())}\n </a>\n </li>\n );\n };\n return (\n <nav class={`k2b-view-tabs ${props.class ?? \"\"}`} aria-label={props.label}>\n <ul\n ref={list}\n class=\"k2b-view-tabs__list\"\n data-scroll-fade-mode=\"both\"\n data-scroll-fade-axis=\"horizontal\"\n data-fit-room={props.fit ? \"\" : undefined}\n >\n <For each={layout().wide}>{stripItem}</For>\n {/* A fitting strip keeps More ready, hidden until a view leaves the strip. */}\n <Show when={layout().compactHidden + layout().wideHidden > 0 || (props.fit && layout().wide.length > 1)}>\n <li\n class=\"k2b-view-tabs__more\"\n data-wide={layout().wideHidden > 0 ? \"\" : undefined}\n data-behind-wide={layout().wideHidden}\n data-behind-compact={layout().compactHidden}\n >\n <Dropdown.Root items={menuItems()} open={open()} onOpenChange={onOpenChange} label={messages().moreViews}>\n <Dropdown.Trigger appearance=\"plain\" class=\"k2b-view-tabs__tab k2b-view-tabs__more-trigger\" label={messages().moreViews}>\n <span class=\"k2b-view-tabs__label\">{messages().more}</span>\n <Show when={layout().wideHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"wide\">\n +{layout().wideHidden}\n </span>\n </Show>\n <Show when={layout().compactHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"compact\">\n +{layout().compactHidden}\n </span>\n </Show>\n {/* Written by the strip's fit, never by the render, so a rerender keeps the count it measured. */}\n <span class=\"k2b-view-tabs__more-count\" data-level=\"fit\" />\n <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </li>\n </Show>\n <For each={layout().pinned}>{stripItem}</For>\n </ul>\n <script innerHTML={VIEW_TABS_SCRIPT} />\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC9G,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,gBAAgB,EAAE,eAAe,QAAQ,uBAAuB;AACzE,OAAO,QAAQ,MAA6B,YAAY;AA6BxD;AACA,OAAO,SAAS,cAAc,CAAC,KAAyB,EAAE,OAA2B,EAAE,GAAG,GAAG,CAAC,EAAE;EAC9F;EACA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ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,GAAG,CAAC,GAAG,EAAE,GAAG,SAAS;YAAA,OACjC,MAAM,CAAC,CAAC,CAAC,UAAU;YAAA,OAChB,MAAM,CAAC,CAAC,CAAC,aAAa;UAAA;UAAA;UAAA;UAAA;QAAA;UAAA;UAAA;UAAA;QAAA;QAAA;MAAA;IAAA;IAAA,kCAsB9C,GAAG;MAAA,IAAC,IAAI;QAAA,OAAE,MAAM,CAAC,CAAC,CAAC,MAAM;MAAA;MAAA,UAAG;IAAS;IAAA,mCAErB,gBAAgB;IAAA;MAAA,WAvCzB,iBAAiB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;QAAA,OAAc,KAAK,CAAC,KAAK;QAAA,OAMtD,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS;MAAA;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;MAAA;IAAA;IAAA;EAAA;AAoCjD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/ViewTabs.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { createScrollFade, scrollFadeEdges } from \"../layout/scroll-fade\";\nimport Dropdown, { type DropdownItem } from \"./Dropdown\";\n\nexport type ViewTab = {\n id: string;\n label: string;\n href: string;\n icon?: string;\n count?: number | string;\n /** A short quiet label after the count, such as \"New\" for a view people have not opened yet. */\n badge?: string;\n /** Stays in the strip after More at every width, for a view of another kind than the ones that overflow. */\n pinned?: boolean;\n};\nexport type ViewTabsProps = {\n /** Accessible name of the navigation landmark, e.g. \"Views\". */\n label: string;\n items: readonly ViewTab[];\n /** Id of the open view; the server reads it from `?view=`. Unknown ids select nothing. */\n current: string | undefined;\n /** At most this many views before More (default 5). */\n max?: number;\n /**\n * The strip shows only the views that fit its room and counts the rest in More, instead of scrolling them. The open\n * view and pinned views stay. Pair it with a larger `max` so a wide head shows more views.\n */\n fit?: boolean;\n class?: string;\n};\n\n/** Two deterministic strip levels; only opening the menu reads CSS visibility. */\nexport function viewTabsLayout(items: readonly ViewTab[], current: string | undefined, max = 5) {\n // At least one slot keeps the current view visible, including for an invalid limit.\n const limit = Number.isFinite(max) ? Math.max(1, Math.floor(max)) : 5;\n // Pinned views never overflow, so they take no slot.\n const flowing = items.flatMap((item, index) => (item.pinned ? [] : [index]));\n const pinned = items.flatMap((item, index) => (item.pinned ? [index] : []));\n const currentIndex = items.findIndex((item) => item.id === current);\n const currentPosition = flowing.indexOf(currentIndex);\n const visible = (size: number) => {\n const indices = flowing.slice(0, size);\n if (currentPosition >= size) indices[indices.length - 1] = currentIndex;\n return indices;\n };\n const wide = visible(limit);\n const compact = visible(Math.min(limit, 3));\n return { wide, compact, pinned, wideHidden: flowing.length - wide.length, compactHidden: flowing.length - compact.length };\n}\n\n/**\n * Self-contained: the server script embeds this before hydration. A fitting strip first keeps only the views that fit\n * its room and counts the rest in More; then the open or focused view scrolls into the strip.\n */\nfunction settleViewTabs(list: Element | null, edges: (element: HTMLElement) => string | undefined, focused?: HTMLElement) {\n if (!(list instanceof HTMLElement)) return;\n const more = list.querySelector<HTMLElement>(\":scope > .k2b-view-tabs__more\");\n const fitCount = more?.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"fit\"]');\n const flowing = Array.from(list.querySelectorAll<HTMLElement>(\":scope > .k2b-view-tabs__item:not([data-pinned])\"));\n\n for (const item of flowing) item.removeAttribute(\"data-fit-hidden\");\n more?.removeAttribute(\"data-fit\");\n // The shown entries against the strip's inner room, whatever its scroll and padding.\n const overflows = () => {\n const boxes = Array.from(list.children)\n .filter((child) => child instanceof HTMLElement && child.tagName === \"LI\" && child.getClientRects().length > 0)\n .map((child) => child.getBoundingClientRect());\n if (boxes.length === 0) return false;\n const style = getComputedStyle(list);\n const room = list.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);\n return Math.max(...boxes.map((box) => box.right)) - Math.min(...boxes.map((box) => box.left)) > room + 0.5;\n };\n // The phone head row keeps its scrolling strip: its CSS turns fitting off.\n const fits = list.hasAttribute(\"data-fit-room\") && getComputedStyle(list).getPropertyValue(\"--k2b-view-tabs-fit\").trim() !== \"none\";\n if (fits && more && fitCount && overflows()) {\n // Count from the level on screen: the compact strip already keeps fewer views than the wide one.\n const compact = more.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"compact\"]');\n const compactShown = Boolean(compact && getComputedStyle(compact).display !== \"none\");\n const behind = Number(compactShown ? more.dataset.behindCompact : more.dataset.behindWide) || 0;\n // The last views on screen leave first; the open view stays.\n const candidates = flowing.filter((item) => item.getClientRects().length > 0 && !item.querySelector(\"[aria-current=page]\")).reverse();\n more.setAttribute(\"data-fit\", \"\");\n let hidden = 0;\n for (const item of candidates) {\n item.setAttribute(\"data-fit-hidden\", \"\");\n hidden += 1;\n fitCount.textContent = `+${behind + hidden}`;\n if (!overflows()) break;\n }\n if (hidden === 0) more.removeAttribute(\"data-fit\");\n }\n const current = focused ?? list.querySelector(\".k2b-view-tabs__tab[aria-current=page]\");\n if (current && current.getClientRects().length > 0 && list.scrollWidth - list.clientWidth > 1) {\n const bounds = list.getBoundingClientRect();\n const item = current.getBoundingClientRect();\n const fade = edges(list);\n const style = getComputedStyle(list);\n const left = fade === \"top\" || fade === \"both\" ? parseFloat(style.scrollPaddingLeft) || 0 : 0;\n const right = fade === \"bottom\" || fade === \"both\" ? parseFloat(style.scrollPaddingRight) || 0 : 0;\n if (item.left < bounds.left + left || item.right > bounds.right - right) {\n let offset = item.left - bounds.left - (bounds.width - item.width) / 2;\n if (focused) {\n // Reserve padding at the destination edge; native clamping drops it when that end is reached.\n offset =\n item.left < bounds.left + left\n ? item.left - bounds.left - (parseFloat(style.scrollPaddingLeft) || 0)\n : item.right - bounds.right + (parseFloat(style.scrollPaddingRight) || 0);\n }\n // Only the strip moves: scrollIntoView would also scroll the page. Instant keeps the first frame free of animation.\n list.scrollTo({ left: list.scrollLeft + offset, behavior: \"instant\" });\n }\n }\n const fade = edges(list);\n if (fade) list.setAttribute(\"data-scroll-fade\", fade);\n else list.removeAttribute(\"data-scroll-fade\");\n}\n\ntype WatchedViewTabs = HTMLElement & {\n __k2bViewTabsWatch?: {\n resize: ResizeObserver;\n focus: (event: FocusEvent) => void;\n preferCurrent: boolean;\n connect: () => void;\n /** Runs one fit in the next frame; calls before it runs share it. */\n schedule: () => void;\n frame: number;\n /** The room's width and the widths of the shown entries when the last fit ended. */\n room: string;\n /** Fits again once web fonts finish loading: their metrics change every view's width, not the lead's. */\n fonts: () => void;\n };\n};\n\n/**\n * Also embedded, so it must not close over module state.\n *\n * A fitting strip converges by construction. It fits again only when the strip renders, web fonts finish loading, or\n * a notification finds another width of its room or of an entry that the last fit left shown. The room is the head\n * lead, or outside a workspace head the strip's own root, which takes its width from its row. A fit only shows and\n * hides entries: neither room takes width from the entries, and every entry keeps its own width (`flex: none`), so the\n * notifications a fit causes find the widths it ended with and stop there.\n */\nfunction watchViewTabs(list: WatchedViewTabs | null, settle: typeof settleViewTabs, edges: (element: HTMLElement) => string | undefined) {\n if (!(list instanceof HTMLElement)) return;\n const fits = list.hasAttribute(\"data-fit-room\");\n const roomOf = () => list.closest<HTMLElement>(\".k2b-app-workspace__head-lead\") ?? list.closest<HTMLElement>(\".k2b-view-tabs\");\n // What a fit depends on: the room's width and each shown entry's width, which fonts, icons and labels change.\n const measured = () =>\n [roomOf()?.clientWidth ?? -1, ...Array.from(list.children, (child) => child.getBoundingClientRect().width)].join(\" \");\n // A DOM property survives hydration: one observer and focus listener per reused list.\n let watch = list.__k2bViewTabsWatch;\n if (!watch) {\n const focus = (event: FocusEvent) => {\n // Pointer focus must not move the target under the pointer.\n if (watch && event.target instanceof HTMLElement && event.target.matches(\".k2b-view-tabs__tab:focus-visible\")) {\n watch.preferCurrent = false;\n settle(list, edges, event.target);\n }\n };\n const settleNow = () => {\n const focused = document.activeElement;\n if (\n watch?.preferCurrent === false &&\n focused instanceof HTMLElement &&\n list.contains(focused) &&\n focused.matches(\".k2b-view-tabs__tab:focus-visible\")\n )\n settle(list, edges, focused);\n else settle(list, edges);\n };\n // Head actions parse after the views; settle again after their layout, before paint, and on later resizes.\n const connect = () => {\n if (!watch) return;\n watch.resize.disconnect();\n watch.resize.observe(list);\n for (const child of Array.from(list.children)) watch.resize.observe(child);\n const room = roomOf();\n if (fits && room) watch.resize.observe(room);\n };\n // Fitting resizes the strip and possibly the head, which other observers may watch. Inside a ResizeObserver\n // callback that would leave their notifications undelivered, so a fit runs in the next frame, still before it paints.\n const schedule = () => {\n if (!watch || watch.frame) return;\n watch.frame = requestAnimationFrame(() => {\n if (!watch) return;\n watch.frame = 0;\n if (!list.isConnected) return;\n settleNow();\n watch.room = measured();\n });\n };\n watch = {\n resize: new ResizeObserver(() => {\n // A scrolling strip only scrolls and settles at once.\n if (!fits) return settleNow();\n // Heights follow the fit, and hidden entries measure 0 by its own doing: only another measure counts.\n if (watch && measured() !== watch.room) watch.schedule();\n }),\n focus,\n preferCurrent: true,\n connect,\n schedule,\n frame: 0,\n room: \"\",\n fonts: () => watch?.schedule(),\n };\n Object.defineProperty(list, \"__k2bViewTabsWatch\", { value: watch, configurable: true });\n list.addEventListener(\"focusin\", focus);\n // A first visit can paint before the web fonts load; the server frame and the client then fit the same metrics.\n if (fits && document.fonts) {\n document.fonts.addEventListener(\"loadingdone\", watch.fonts);\n void document.fonts.ready.then(watch.fonts);\n }\n }\n watch.preferCurrent = true;\n watch.connect();\n settle(list, edges);\n if (fits) {\n watch.room = measured();\n // The head's actions parse after the views. A frame's animation callbacks run before its first layout and\n // paint, so this fit also counts their room in the first frame.\n watch.schedule();\n }\n return watch;\n}\nconst VIEW_TABS_SCRIPT = `(${watchViewTabs})(document.currentScript&&document.currentScript.previousElementSibling,${settleViewTabs},${scrollFadeEdges})`;\n\n/**\n * URL-backed object views. Every view is an ordinary document link, in the strip and under More, so reload, back,\n * and forward keep the view the URL names.\n */\nexport function ViewTabs(props: ViewTabsProps): JSX.Element {\n const messages = useUiMessages();\n const layout = createMemo(() => viewTabsLayout(props.items, props.current, props.max));\n const stripItems = new Map<number, HTMLLIElement>();\n let list: HTMLUListElement | undefined;\n createScrollFade(\n () => list,\n () => true,\n );\n onMount(() => {\n const watch = watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges);\n let disposed = false;\n // Later mount effects can invalidate WebKit's scroll layout after this\n // initial settle. Finish once the mount task is complete, before its first\n // frame; ResizeObserver alone runs too late for that frame.\n queueMicrotask(() => {\n if (!disposed && watch?.preferCurrent) settleViewTabs(list ?? null, scrollFadeEdges);\n });\n onCleanup(() => {\n disposed = true;\n watch?.resize.disconnect();\n if (watch?.frame) cancelAnimationFrame(watch.frame);\n if (watch) document.fonts?.removeEventListener(\"loadingdone\", watch.fonts);\n if (list && watch) {\n list.removeEventListener(\"focusin\", watch.focus);\n Reflect.deleteProperty(list, \"__k2bViewTabsWatch\");\n }\n });\n });\n // User effects run after Solid's render effects, including For and aria-current, in the same task.\n // What the strip shows: another open view, view, label, count or badge can change what fits. Equal content in a new\n // array settles nothing again.\n const shown = createMemo(() =>\n [\n props.current ?? \"\",\n layout().wide.join(\",\"),\n ...props.items.map((item) => `${item.id}\\u0000${item.label}\\u0000${item.count ?? \"\"}\\u0000${item.badge ?? \"\"}`),\n ].join(\"\\u0001\"),\n );\n createEffect(on(shown, () => watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges), { defer: true }));\n const [open, setOpen] = createSignal(false);\n const [menuItems, setMenuItems] = createSignal<DropdownItem[]>([]);\n const onOpenChange = (next: boolean) => {\n if (next) {\n setMenuItems(\n props.items\n .filter(\n (item, index) =>\n !item.pinned &&\n item.id !== props.current &&\n (!layout().wide.includes(index) || stripItems.get(index)?.getClientRects().length === 0),\n )\n .map((item) => ({\n href: item.href,\n label: item.label,\n icon: item.icon,\n trailing: item.count !== undefined ? <span class=\"k2b-view-tabs__count\">{item.count}</span> : undefined,\n })),\n );\n }\n setOpen(next);\n };\n const tabContent = (item: ViewTab) => (\n <>\n <Show when={item.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span class=\"k2b-view-tabs__label k2b-truncate-fade\">{item.label}</span>\n <Show when={item.count !== undefined}>\n <span class=\"k2b-view-tabs__count\">{item.count}</span>\n </Show>\n <Show when={item.badge}>{(badge) => <span class=\"k2b-view-tabs__badge\">{badge()}</span>}</Show>\n </>\n );\n const stripItem = (index: number) => {\n const item = () => props.items[index]!;\n onCleanup(() => stripItems.delete(index));\n return (\n <li\n ref={(element) => stripItems.set(index, element)}\n class=\"k2b-view-tabs__item\"\n data-view-tab={item().id}\n data-pinned={item().pinned ? \"\" : undefined}\n data-compact-hidden={!item().pinned && !layout().compact.includes(index) ? \"\" : undefined}\n >\n <a class=\"k2b-view-tabs__tab\" href={item().href} aria-current={item().id === props.current ? \"page\" : undefined}>\n {tabContent(item())}\n </a>\n </li>\n );\n };\n return (\n <nav class={`k2b-view-tabs ${props.class ?? \"\"}`} aria-label={props.label}>\n <ul\n ref={list}\n class=\"k2b-view-tabs__list\"\n data-scroll-fade-mode=\"both\"\n data-scroll-fade-axis=\"horizontal\"\n data-fit-room={props.fit ? \"\" : undefined}\n >\n <For each={layout().wide}>{stripItem}</For>\n {/* A fitting strip keeps More ready, hidden until a view leaves the strip. */}\n <Show when={layout().compactHidden + layout().wideHidden > 0 || (props.fit && layout().wide.length > 1)}>\n <li\n class=\"k2b-view-tabs__more\"\n data-wide={layout().wideHidden > 0 ? \"\" : undefined}\n data-behind-wide={layout().wideHidden}\n data-behind-compact={layout().compactHidden}\n >\n <Dropdown.Root items={menuItems()} open={open()} onOpenChange={onOpenChange} label={messages().moreViews}>\n <Dropdown.Trigger appearance=\"plain\" class=\"k2b-view-tabs__tab k2b-view-tabs__more-trigger\" label={messages().moreViews}>\n <span class=\"k2b-view-tabs__label\">{messages().more}</span>\n <Show when={layout().wideHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"wide\">\n +{layout().wideHidden}\n </span>\n </Show>\n <Show when={layout().compactHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"compact\">\n +{layout().compactHidden}\n </span>\n </Show>\n {/* Written by the strip's fit, never by the render, so a rerender keeps the count it measured. */}\n <span class=\"k2b-view-tabs__more-count\" data-level=\"fit\" />\n <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </li>\n </Show>\n <For each={layout().pinned}>{stripItem}</For>\n </ul>\n <script innerHTML={VIEW_TABS_SCRIPT} />\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC9G,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,gBAAgB,EAAE,eAAe,QAAQ,uBAAuB;AACzE,OAAO,QAAQ,MAA6B,YAAY;AA6BxD;AACA,OAAO,SAAS,cAAc,CAAC,KAAyB,EAAE,OAA2B,EAAE,GAAG,GAAG,CAAC,EAAE;EAC9F;EACA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;EACrE;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAM,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,KAAK,CAAE,CAAC;EAC5E,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAM,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,EAAG,CAAC;EAC3E,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,CAAE,IAAI,IAAK,IAAI,CAAC,EAAE,K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