@duro-app/ui 5.18.0 → 5.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/{Table-DnaoH-h5.js → Table-Cw1B14R3.js} +4 -2
  2. package/dist/Table-Cw1B14R3.js.map +1 -0
  3. package/dist/components/AppShell/AppShell.d.ts.map +1 -1
  4. package/dist/components/AppShell/AppShell.stories.d.ts +5 -0
  5. package/dist/components/AppShell/AppShell.stories.d.ts.map +1 -1
  6. package/dist/components/Menu/native.css.d.ts +1 -0
  7. package/dist/components/Menu/native.css.d.ts.map +1 -1
  8. package/dist/components/Popover/native.css.d.ts +1 -0
  9. package/dist/components/Popover/native.css.d.ts.map +1 -1
  10. package/dist/components/SideNav/SideNav.d.ts +2 -1
  11. package/dist/components/SideNav/SideNav.d.ts.map +1 -1
  12. package/dist/components/SideNav/SideNav.meta.d.ts.map +1 -1
  13. package/dist/components/TextLink/native.css.d.ts +19 -0
  14. package/dist/components/TextLink/native.css.d.ts.map +1 -0
  15. package/dist/components/Tree/Tree.d.ts +12 -22
  16. package/dist/components/Tree/Tree.d.ts.map +1 -1
  17. package/dist/components/Tree/Tree.stories.d.ts +33 -0
  18. package/dist/components/Tree/Tree.stories.d.ts.map +1 -1
  19. package/dist/components/Tree/TreeContext.d.ts +5 -5
  20. package/dist/components/Tree/TreeContext.d.ts.map +1 -1
  21. package/dist/components/Tree/TreeFocusStore.d.ts +25 -0
  22. package/dist/components/Tree/TreeFocusStore.d.ts.map +1 -0
  23. package/dist/components/Tree/TreeItemRow.d.ts +25 -0
  24. package/dist/components/Tree/TreeItemRow.d.ts.map +1 -0
  25. package/dist/components/Tree/TreeRow.d.ts +3 -0
  26. package/dist/components/Tree/TreeRow.d.ts.map +1 -0
  27. package/dist/components/Tree/TreeRowProps.d.ts +41 -0
  28. package/dist/components/Tree/TreeRowProps.d.ts.map +1 -0
  29. package/dist/components/Tree/TreeRows.d.ts +70 -0
  30. package/dist/components/Tree/TreeRows.d.ts.map +1 -0
  31. package/dist/components/Tree/TreeWindow.d.ts +21 -0
  32. package/dist/components/Tree/TreeWindow.d.ts.map +1 -0
  33. package/dist/components/Tree/styles.css.d.ts +69 -1
  34. package/dist/components/Tree/styles.css.d.ts.map +1 -1
  35. package/dist/components/Tree/useTreeKeyboard.d.ts +15 -9
  36. package/dist/components/Tree/useTreeKeyboard.d.ts.map +1 -1
  37. package/dist/index.css +1 -1
  38. package/dist/index.js +3798 -3477
  39. package/dist/index.js.map +1 -1
  40. package/dist/shared/InLandmarkContext.d.ts +7 -0
  41. package/dist/shared/InLandmarkContext.d.ts.map +1 -0
  42. package/dist/shared/navigate.d.ts.map +1 -1
  43. package/dist/table.js +1 -1
  44. package/package.json +3 -3
  45. package/src/components/AppShell/AppShell.native.tsx +17 -14
  46. package/src/components/AppShell/AppShell.stories.tsx +30 -0
  47. package/src/components/AppShell/AppShell.tsx +3 -2
  48. package/src/components/Menu/Menu.native.tsx +4 -24
  49. package/src/components/Menu/native.css.ts +4 -0
  50. package/src/components/Panel/Panel.meta.ts +1 -1
  51. package/src/components/Popover/native.css.ts +4 -0
  52. package/src/components/SideNav/SideNav.meta.ts +1 -0
  53. package/src/components/SideNav/SideNav.tsx +18 -4
  54. package/src/components/TextLink/TextLink.meta.ts +1 -1
  55. package/src/components/TextLink/TextLink.native.tsx +55 -0
  56. package/src/components/TextLink/native.css.ts +36 -0
  57. package/src/components/Tree/Tree.meta.ts +1 -1
  58. package/src/components/Tree/Tree.stories.tsx +376 -1
  59. package/src/components/Tree/Tree.tsx +88 -131
  60. package/src/components/Tree/TreeContext.ts +5 -5
  61. package/src/components/Tree/TreeFocusStore.ts +73 -0
  62. package/src/components/Tree/TreeItemRow.tsx +71 -0
  63. package/src/components/Tree/TreeRow.native.tsx +96 -0
  64. package/src/components/Tree/TreeRow.tsx +112 -0
  65. package/src/components/Tree/TreeRowProps.ts +42 -0
  66. package/src/components/Tree/TreeRows.ts +139 -0
  67. package/src/components/Tree/TreeWindow.native.tsx +19 -0
  68. package/src/components/Tree/TreeWindow.tsx +118 -0
  69. package/src/components/Tree/styles.css.ts +81 -2
  70. package/src/components/Tree/useTreeKeyboard.ts +86 -42
  71. package/src/index.native.ts +4 -0
  72. package/src/shared/InLandmarkContext.ts +8 -0
  73. package/src/shared/followLink.native.ts +33 -0
  74. package/src/shared/navigate.ts +2 -0
  75. package/dist/Table-DnaoH-h5.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SideNav.meta.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,aA2ClB,CAAA"}
1
+ {"version":3,"file":"SideNav.meta.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,aA4ClB,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { css } from 'react-strict-dom';
2
+ export declare const nativeStyles: Readonly<{
3
+ readonly base: Readonly<{
4
+ readonly fontFamily: css.StyleXClassNameFor<"fontFamily", "inherit">;
5
+ readonly fontSize: css.StyleXClassNameFor<"fontSize", "inherit">;
6
+ readonly lineHeight: css.StyleXClassNameFor<"lineHeight", "inherit">;
7
+ readonly textDecorationLine: css.StyleXClassNameFor<"textDecorationLine", "underline">;
8
+ readonly textDecorationStyle: css.StyleXClassNameFor<"textDecorationStyle", "solid">;
9
+ }>;
10
+ readonly default: Readonly<{
11
+ readonly color: css.StyleXClassNameFor<"color", string>;
12
+ readonly textDecorationColor: css.StyleXClassNameFor<"textDecorationColor", string>;
13
+ }>;
14
+ readonly subtle: Readonly<{
15
+ readonly color: css.StyleXClassNameFor<"color", string>;
16
+ readonly textDecorationColor: css.StyleXClassNameFor<"textDecorationColor", string>;
17
+ }>;
18
+ }>;
19
+ //# sourceMappingURL=native.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.css.d.ts","sourceRoot":"","sources":["../../../src/components/TextLink/native.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAOpC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;EA4BvB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { OnNavigate } from '../../shared/navigate';
2
+ import { TreeItemProps } from './TreeRows';
3
+ import { Length } from '../../shared/length';
3
4
  interface RootProps {
4
5
  children: ReactNode;
5
6
  /** accessible name of the tree (or give `aria-labelledby`) */
@@ -13,32 +14,21 @@ interface RootProps {
13
14
  expanded?: ReadonlyArray<string>;
14
15
  defaultExpanded?: ReadonlyArray<string>;
15
16
  onExpandedChange?: (expanded: string[]) => void;
16
- }
17
- declare function Root({ children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, value, defaultValue, onValueChange, expanded, defaultExpanded, onExpandedChange, }: RootProps): import("react/jsx-runtime").JSX.Element;
18
- interface ItemProps {
19
- /** unique within the tree */
20
- value: string;
21
- /** what the row shows */
22
- label: ReactNode;
23
- /** plain text for typeahead when `label` isn't a string */
24
- textValue?: string;
25
- /** nested items: the branch's children (none = a leaf) */
26
- children?: ReactNode;
27
- /** trailing content on the row (a count, a status) */
28
- meta?: ReactNode;
29
17
  /**
30
- * Makes the row a link to this URL. A plain click (or Enter / Space)
31
- * selects the item and calls `onNavigate`; a modified click keeps the
32
- * browser default (new tab, new window) and does not select.
18
+ * Native: the accessible name of a branch's chevron control, from the item's
19
+ * text (its `textValue`, else a string `label`). Defaults to that text.
33
20
  */
34
- href?: string;
21
+ expandLabel?: (label: string) => string;
35
22
  /**
36
- * Client-side navigation for `href`: called for a plain primary click. Call
37
- * `event.preventDefault()`, then your router's navigate.
23
+ * Web: with more items than this (open or not) the tree mounts only the rows
24
+ * in view. At or below it, every row is mounted. Default 150.
38
25
  */
39
- onNavigate?: OnNavigate;
26
+ virtualizeThreshold?: number;
27
+ /** Web, windowed: caps the scroll viewport's height; without it, it fills its parent. */
28
+ maxHeight?: Length;
40
29
  }
41
- declare function Item({ value, label, textValue, children, meta, href, onNavigate }: ItemProps): import("react/jsx-runtime").JSX.Element;
30
+ declare function Root({ children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, value, defaultValue, onValueChange, expanded, defaultExpanded, onExpandedChange, expandLabel, virtualizeThreshold, maxHeight, }: RootProps): import("react/jsx-runtime").JSX.Element;
31
+ declare function Item({ value, label, textValue, children, meta, href, onNavigate }: TreeItemProps): import("react/jsx-runtime").JSX.Element;
42
32
  export declare const Tree: {
43
33
  Root: typeof Root;
44
34
  Item: typeof Item;
@@ -1 +1 @@
1
- {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAmD,MAAM,OAAO,CAAA;AAOhG,OAAO,EAAoC,KAAK,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAgBxF,UAAU,SAAS;IACjB,QAAQ,EAAE,SAAS,CAAA;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAChC,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,E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AC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAChC,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC/C;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAKD,iBAAS,IAAI,CAAC,EACZ,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,KAAK,EACL,YAAmB,EACnB,aAAa,EACb,QAAQ,EACR,eAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,mBAAyB,EACzB,SAAS,GACV,EAAE,SAAS,2CAyFX;AAID,iBAAS,IAAI,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAC,EAAE,aAAa,2CAmBvF;AAED,eAAO,MAAM,IAAI;;;CAGhB,CAAA"}
@@ -15,4 +15,37 @@ export declare const Controlled: Story;
15
15
  export declare const WithLinks: StoryObj<{
16
16
  onNavigate: OnNavigate;
17
17
  }>;
18
+ interface TreePerf {
19
+ mountTimes: number[];
20
+ keyTimes: number[];
21
+ eventEntries: number[];
22
+ renders: number;
23
+ resetRenders: () => void;
24
+ remount: (n: number) => Promise<number[]>;
25
+ scroll: () => Promise<{
26
+ worstFrameGap: number;
27
+ longTasks: number;
28
+ }>;
29
+ }
30
+ declare global {
31
+ interface Window {
32
+ __treeRenders?: number;
33
+ __treePerf?: TreePerf;
34
+ }
35
+ }
36
+ /**
37
+ * Measurement harness for the cost of a 300-leaf tree (20 branches of 15 links,
38
+ * Happier-shaped meta). Read `window.__treePerf` from a benchmark run; the play
39
+ * function only proves the harness works, with a generous ceiling.
40
+ */
41
+ export declare const Perf300: Story;
42
+ /** Above virtualizeThreshold only the rows in view mount, as flat treeitems. */
43
+ export declare const Windowed: Story;
44
+ /**
45
+ * Past the threshold, but one branch's rows sit inside a component: the tree
46
+ * falls back to rendering every row, so none of them vanish.
47
+ */
48
+ export declare const WindowedFallback: Story;
49
+ /** A branch with no link toggles on a click of its row (a folder); Enter too. */
50
+ export declare const BranchRowToggles: Story;
18
51
  //# sourceMappingURL=Tree.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/Tree.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAKpD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAErD,QAAA,MAAM,IAAI,EAAE,IAEX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAA;AA8BrB,eAAO,MAAM,OAAO,EAAE,KAyBrB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAwChC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAA;AAcD,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAA;AAiCD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAC,CAmDxD,CAAA"}
1
+ {"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/Tree.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AA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1
+ import { TreeFocusStore } from './TreeFocusStore';
1
2
  export interface TreeContextValue {
2
3
  /** the selected item's value (single selection), or null */
3
4
  selectedValue: string | null;
@@ -5,11 +6,10 @@ export interface TreeContextValue {
5
6
  isExpanded: (value: string) => boolean;
6
7
  toggle: (value: string) => void;
7
8
  setExpanded: (value: string, expanded: boolean) => void;
8
- /** the item holding the tree's single tab stop (roving tabindex) */
9
- focusValue: string | null;
10
- setFocusValue: (value: string) => void;
11
- /** the focus holder is focused from the keyboard (draws its ring) */
12
- keyboardFocus: boolean;
9
+ /** the tab stop and the focus ring: rows subscribe, the tree does not re-render */
10
+ focus: TreeFocusStore;
11
+ /** native: names a branch's chevron control from the item's text */
12
+ expandLabel?: (label: string) => string;
13
13
  }
14
14
  export declare const TreeContext: import('react').Context<TreeContextValue | null>;
15
15
  export declare function useTree(): TreeContextValue;
@@ -1 +1 @@
1
- {"version":3,"file":"TreeContext.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeContext.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IACvD,oEAAoE;IACpE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,WAAW,kDAA+C,CAAA;AAEvE,wBAAgB,OAAO,qBAItB;AAED,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,iCAAmB,CAAA"}
1
+ {"version":3,"file":"TreeContext.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IACvD,mFAAmF;IACnF,KAAK,EAAE,cAAc,CAAA;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CACxC;AAED,eAAO,MAAM,WAAW,kDAA+C,CAAA;AAEvE,wBAAgB,OAAO,qBAItB;AAED,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,iCAAmB,CAAA"}
@@ -0,0 +1,25 @@
1
+ /** What a row reads of the tree's focus: nothing, the tab stop, or the tab stop with the ring. */
2
+ export type RowFocus = 'none' | 'tabStop' | 'ringed';
3
+ /**
4
+ * The tree's focus, outside React state: the item holding the roving tab stop,
5
+ * whether its ring shows (keyboard focus), and a focus request an off-screen
6
+ * row waits on. A row reads only "am I the tab stop / ringed" through
7
+ * `useTreeRowFocus`, so a focus move re-renders the row that lost it and the
8
+ * row that gained it, not the tree.
9
+ */
10
+ export interface TreeFocusStore {
11
+ getValue: () => string | null;
12
+ getPending: () => string | null;
13
+ /** moves the tab stop */
14
+ setValue: (value: string | null) => void;
15
+ setRing: (ring: boolean) => void;
16
+ /** moves the tab stop and asks the window to focus the row once it mounts */
17
+ request: (value: string) => void;
18
+ clearPending: () => void;
19
+ subscribe: (listener: () => void) => () => void;
20
+ read: (value: string) => RowFocus;
21
+ }
22
+ export declare function createTreeFocusStore(initial: string | null): TreeFocusStore;
23
+ export declare function useTreeRowFocus(store: TreeFocusStore, value: string): RowFocus;
24
+ export declare function useTreePendingFocus(store: TreeFocusStore): string | null;
25
+ //# sourceMappingURL=TreeFocusStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeFocusStore.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeFocusStore.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IAC/B,yBAAyB;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAChC,6EAA6E;IAC7E,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAA;CAClC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,CAuC3E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAE9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAExE"}
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from 'react';
2
+ import { WindowedRow } from './TreeRowProps';
3
+ import { OnNavigate } from '../../shared/navigate';
4
+ interface TreeItemRowProps {
5
+ value: string;
6
+ level: number;
7
+ label: ReactNode;
8
+ meta?: ReactNode;
9
+ text: string;
10
+ href?: string;
11
+ onNavigate?: OnNavigate;
12
+ hasChildren: boolean;
13
+ open: boolean;
14
+ /** the open branch's children (nested tree), none in a windowed one */
15
+ branch: ReactNode;
16
+ windowed?: WindowedRow;
17
+ }
18
+ /**
19
+ * One row of the tree with its state: the selection from the tree, and the
20
+ * tab stop and ring from the focus store, which this row alone subscribes to.
21
+ * Shared by the nested `Tree.Item` and the windowed rows.
22
+ */
23
+ export declare function TreeItemRow({ value, level, label, meta, text, href, onNavigate, hasChildren, open, branch, windowed, }: TreeItemRowProps): import("react/jsx-runtime").JSX.Element;
24
+ export {};
25
+ //# sourceMappingURL=TreeItemRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeItemRow.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeItemRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAAQ,MAAM,OAAO,CAAA;AAI3C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAErD,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,OAAO,CAAA;IACb,uEAAuE;IACvE,MAAM,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,IAAI,EACJ,MAAM,EACN,QAAQ,GACT,EAAE,gBAAgB,2CA+BlB"}
@@ -0,0 +1,3 @@
1
+ import { TreeRowProps } from './TreeRowProps';
2
+ export declare function TreeRow({ value, level, label, meta, text, href, onNavigate, hasChildren, open, selected, tabStop, ringed, labelId, metaId, onSelect, onToggle, branch, windowed, }: TreeRowProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=TreeRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeRow.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAMhD,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,EAAE,YAAY,2CAoFd"}
@@ -0,0 +1,41 @@
1
+ import { ReactNode } from 'react';
2
+ import { OnNavigate } from '../../shared/navigate';
3
+ /** What `Tree.Item` hands its row: state is decided there, markup here. */
4
+ export interface TreeRowProps {
5
+ value: string;
6
+ level: number;
7
+ label: ReactNode;
8
+ meta?: ReactNode;
9
+ /** plain text of the item (typeahead, native names) */
10
+ text: string;
11
+ href?: string;
12
+ onNavigate?: OnNavigate;
13
+ hasChildren: boolean;
14
+ open: boolean;
15
+ selected: boolean;
16
+ /** the item holds the tree's tab stop */
17
+ tabStop: boolean;
18
+ /** draw the keyboard focus ring on the row */
19
+ ringed: boolean;
20
+ labelId: string;
21
+ metaId: string;
22
+ onSelect: () => void;
23
+ onToggle: () => void;
24
+ /** the chevron control's accessible name (native) */
25
+ expandLabel?: (label: string) => string;
26
+ /** the open branch's children, already inside their level context */
27
+ branch: ReactNode;
28
+ /** web, windowed tree: the row is flat, placed by the window, and sets its own set size */
29
+ windowed?: WindowedRow;
30
+ }
31
+ /** What a row of a windowed tree adds: the window places and measures it. */
32
+ export interface WindowedRow {
33
+ /** the row's index among the visible rows (the virtualizer's `data-index`) */
34
+ index: number;
35
+ setSize: number;
36
+ posInSet: number;
37
+ /** distance from the top of the scrolled content, in px */
38
+ top: number;
39
+ measureRef: (el: HTMLElement | null) => void;
40
+ }
41
+ //# sourceMappingURL=TreeRowProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeRowProps.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeRowProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAErD,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,qEAAqE;IACrE,MAAM,EAAE,SAAS,CAAA;IACjB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;CAC7C"}
@@ -0,0 +1,70 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { OnNavigate } from '../../shared/navigate';
3
+ /** The props of a `Tree.Item`. */
4
+ export interface TreeItemProps {
5
+ /** unique within the tree */
6
+ value: string;
7
+ /** what the row shows */
8
+ label: ReactNode;
9
+ /** plain text for typeahead when `label` isn't a string */
10
+ textValue?: string;
11
+ /** nested items: the branch's children (none = a leaf) */
12
+ children?: ReactNode;
13
+ /** trailing content on the row (a count, a status) */
14
+ meta?: ReactNode;
15
+ /**
16
+ * Makes the row a link to this URL. A plain click (or Enter / Space)
17
+ * selects the item and calls `onNavigate`; a modified click keeps the
18
+ * browser default (new tab, new window) and does not select.
19
+ */
20
+ href?: string;
21
+ /**
22
+ * Client-side navigation for `href`: called for a plain primary click. Call
23
+ * `event.preventDefault()`, then your router's navigate.
24
+ */
25
+ onNavigate?: OnNavigate;
26
+ }
27
+ /** One visible row of the tree, read from the items without rendering them. */
28
+ export interface TreeRowModel {
29
+ value: string;
30
+ level: number;
31
+ text: string;
32
+ label: ReactNode;
33
+ meta: ReactNode;
34
+ href: string | undefined;
35
+ onNavigate: OnNavigate | undefined;
36
+ hasChildren: boolean;
37
+ open: boolean;
38
+ /** the value of the parent row, null at the top level */
39
+ parent: string | null;
40
+ setSize: number;
41
+ posInSet: number;
42
+ }
43
+ export interface CollectedRows {
44
+ /** the rows in view order: an open branch is followed by its children */
45
+ rows: TreeRowModel[];
46
+ /** every item of the tree, open or not (what the threshold counts) */
47
+ total: number;
48
+ /**
49
+ * false when a branch holds something other than `Tree.Item`s (an item
50
+ * inside another component): the pass cannot see those rows, so the tree
51
+ * must not be windowed, or they would vanish
52
+ */
53
+ complete: boolean;
54
+ }
55
+ /** The plain text of an item: typeahead and names. */
56
+ export declare function itemText(label: ReactNode, textValue: string | undefined): string;
57
+ /**
58
+ * holds-until: a consumer needs to window a tree whose Items sit inside its own
59
+ * components. The pass reads JSX props only, so it cannot see an Item that a
60
+ * component renders; `complete` turns false and Tree renders unwindowed with a
61
+ * dev warning. Then: collect by rendering Items in a register-only mode.
62
+ *
63
+ * The collect pass: walks the `Tree.Item` elements of the tree and returns its
64
+ * visible rows, with each row's level and its set size and position among its
65
+ * siblings. It reads props only: no DOM, no render, no mutation of anything
66
+ * outside this call. Items must be JSX descendants of the root (through
67
+ * fragments or arrays); an item hidden inside another component is not seen.
68
+ */
69
+ export declare function collectRows(children: ReactNode, isItem: (el: ReactElement) => boolean, isOpen: (value: string) => boolean): CollectedRows;
70
+ //# sourceMappingURL=TreeRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeRows.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;AAC3F,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAErD,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC5B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,yBAAyB;IACzB,KAAK,EAAE,SAAS,C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from 'react';
2
+ import { Length } from '../../shared/length';
3
+ import { TreeRowModel } from './TreeRows';
4
+ export declare const CAN_WINDOW = true;
5
+ interface TreeWindowProps {
6
+ rows: readonly TreeRowModel[];
7
+ maxHeight?: Length;
8
+ 'aria-label'?: string;
9
+ 'aria-labelledby'?: string;
10
+ scrollRef: RefObject<HTMLDivElement | null>;
11
+ }
12
+ /**
13
+ * The windowed tree (web): a scroll container `role="tree"` that mounts only
14
+ * the rows in view, plus the tab stop, as flat treeitems carrying their level,
15
+ * set size and position. The keyboard runs in useTreeKeyboard on the row
16
+ * model; a move to a row that is not mounted asks the focus store, and this
17
+ * window scrolls to it and focuses it once it mounts.
18
+ */
19
+ export declare function TreeWindow({ rows, maxHeight, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, scrollRef, }: TreeWindowProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
21
+ //# sourceMappingURL=TreeWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeWindow.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/TreeWindow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAG/C,OAAO,EAAgB,KAAK,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAI9D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAG5C,eAAO,MAAM,UAAU,OAAO,CAAA;AAO9B,UAAU,eAAe;IACvB,IAAI,EAAE,SAAS,YAAY,EAAE,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAC5C;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,SAAS,GACV,EAAE,eAAe,2CA8EjB"}
@@ -20,6 +20,33 @@ export declare const styles: Readonly<{
20
20
  readonly outlineWidth: css.StyleXClassNameFor<"outlineWidth", 0>;
21
21
  readonly outlineStyle: css.StyleXClassNameFor<"outlineStyle", "none">;
22
22
  }>;
23
+ readonly windowScroller: Readonly<{
24
+ readonly position: css.StyleXClassNameFor<"position", "relative">;
25
+ readonly width: css.StyleXClassNameFor<"width", "100%">;
26
+ readonly height: css.StyleXClassNameFor<"height", "100%">;
27
+ readonly minHeight: css.StyleXClassNameFor<"minHeight", 0>;
28
+ readonly margin: css.StyleXClassNameFor<"margin", 0>;
29
+ readonly padding: css.StyleXClassNameFor<"padding", 0>;
30
+ readonly listStyleType: css.StyleXClassNameFor<"listStyleType", "none">;
31
+ readonly overflowY: css.StyleXClassNameFor<"overflowY", "auto">;
32
+ readonly overscrollBehavior: css.StyleXClassNameFor<"overscrollBehavior", "contain">;
33
+ }>;
34
+ readonly windowScrollerMax: (maxHeight: string | number) => readonly [Readonly<{
35
+ height: css.StyleXClassNameFor<"height", string>;
36
+ maxHeight: css.StyleXClassNameFor<"maxHeight", string | number>;
37
+ }>, css.InlineStyles];
38
+ readonly windowTotal: (height: number) => readonly [Readonly<{
39
+ position: css.StyleXClassNameFor<"position", "relative">;
40
+ width: css.StyleXClassNameFor<"width", string>;
41
+ height: css.StyleXClassNameFor<"height", number>;
42
+ }>, css.InlineStyles];
43
+ readonly windowRow: (top: number) => readonly [Readonly<{
44
+ position: css.StyleXClassNameFor<"position", "absolute">;
45
+ top: css.StyleXClassNameFor<"top", number>;
46
+ left: css.StyleXClassNameFor<"left", number>;
47
+ width: css.StyleXClassNameFor<"width", string>;
48
+ transform: css.StyleXClassNameFor<"transform", string>;
49
+ }>, css.InlineStyles];
23
50
  readonly row: Readonly<{
24
51
  readonly display: css.StyleXClassNameFor<"display", "flex">;
25
52
  readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
@@ -59,8 +86,49 @@ export declare const styles: Readonly<{
59
86
  readonly fontWeight: css.StyleXClassNameFor<"fontWeight", string>;
60
87
  readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
61
88
  }>;
62
- readonly nativeFlex: Readonly<{
89
+ readonly nativeRow: Readonly<{
90
+ readonly display: css.StyleXClassNameFor<"display", "flex">;
91
+ readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "row">;
92
+ readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
93
+ readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
94
+ readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
95
+ }>;
96
+ readonly pressTarget: Readonly<{
97
+ readonly display: css.StyleXClassNameFor<"display", "flex">;
98
+ readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "row">;
99
+ readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
100
+ readonly flexGrow: css.StyleXClassNameFor<"flexGrow", 1>;
101
+ readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 1>;
102
+ readonly gap: css.StyleXClassNameFor<"gap", string>;
103
+ readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
104
+ readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
105
+ readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
106
+ readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
107
+ }>;
108
+ readonly chevronControl: Readonly<{
109
+ readonly display: css.StyleXClassNameFor<"display", "flex">;
110
+ readonly alignItems: css.StyleXClassNameFor<"alignItems", "center">;
111
+ readonly justifyContent: css.StyleXClassNameFor<"justifyContent", "center">;
112
+ readonly minWidth: css.StyleXClassNameFor<"minWidth", string>;
113
+ readonly minHeight: css.StyleXClassNameFor<"minHeight", string>;
114
+ readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
115
+ }>;
116
+ readonly chevronGlyph: Readonly<{
117
+ readonly color: css.StyleXClassNameFor<"color", string>;
118
+ }>;
119
+ readonly chevronSpacer: Readonly<{
120
+ readonly width: css.StyleXClassNameFor<"width", string>;
121
+ readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
122
+ }>;
123
+ readonly labelBox: Readonly<{
63
124
  readonly display: css.StyleXClassNameFor<"display", "flex">;
125
+ readonly flexGrow: css.StyleXClassNameFor<"flexGrow", 1>;
126
+ readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 1>;
127
+ readonly minWidth: css.StyleXClassNameFor<"minWidth", 0>;
128
+ }>;
129
+ readonly metaBox: Readonly<{
130
+ readonly display: css.StyleXClassNameFor<"display", "flex">;
131
+ readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
64
132
  }>;
65
133
  readonly chevron: Readonly<{
66
134
  readonly display: css.StyleXClassNameFor<"display", "inline-flex">;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAQpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqGjB,CAAA"}
1
+ {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAQpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoLjB,CAAA"}
@@ -1,19 +1,25 @@
1
- import { ReactNode } from 'react';
1
+ import { RefObject } from 'react';
2
+ import { TreeFocusStore } from './TreeFocusStore';
3
+ import { TreeRowModel } from './TreeRows';
2
4
  interface TreeKeyboardInput {
3
- rootRef: React.RefObject<HTMLUListElement | null>;
4
- focusValue: string | null;
5
- setFocusValue: (value: string | null) => void;
6
- setKeyboardFocus: (on: boolean) => void;
5
+ rootRef: RefObject<HTMLElement | null>;
6
+ focus: TreeFocusStore;
7
+ /** the visible rows when the tree is windowed (most are not in the DOM), else null */
8
+ windowedRows: readonly TreeRowModel[] | null;
9
+ /** a change here re-checks the tab stop: the items or the open branches */
10
+ children: unknown;
7
11
  open: ReadonlyArray<string>;
8
- children: ReactNode;
9
12
  onSelect: (value: string) => void;
10
13
  setExpanded: (value: string, open: boolean) => void;
11
14
  }
12
15
  /**
13
16
  * Web: the tree's roving tab stop, arrow keys, Home/End, Enter and typeahead
14
- * (WAI-ARIA tree pattern), read from the rendered DOM. Native has none of
15
- * them (plan N0, Decision 6): useTreeKeyboard.native.ts.
17
+ * (WAI-ARIA tree pattern). A nested tree reads its items from the DOM; a
18
+ * windowed one from the row model, since most rows are not mounted: a move to
19
+ * a row that is not mounted goes through the focus store, and the window
20
+ * scrolls to it and focuses it. Native has none of them (plan N0, Decision 6):
21
+ * useTreeKeyboard.native.ts.
16
22
  */
17
- export declare function useTreeKeyboard({ rootRef, focusValue, setFocusValue, setKeyboardFocus, open, children, onSelect, setExpanded, }: TreeKeyboardInput): void;
23
+ export declare function useTreeKeyboard({ rootRef, focus, windowedRows, children, open, onSelect, setExpanded, }: TreeKeyboardInput): void;
18
24
  export {};
19
25
  //# sourceMappingURL=useTreeKeyboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/useTreeKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAAqC,MAAM,OAAO,CAAA;AAKxE,UAAU,iBAAiB;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,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