@jini-ai/ui 0.4.3 → 0.4.5

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 (169) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +20 -0
  3. package/dist/core/theme/default.d.ts +4 -0
  4. package/dist/core/theme/default.js +11 -0
  5. package/dist/core/theme/stylesheet.d.ts +8 -0
  6. package/dist/core/theme/stylesheet.js +14 -0
  7. package/dist/core/theme/types.d.ts +39 -0
  8. package/dist/core/theme/types.js +2 -0
  9. package/dist/core/theme/validation.d.ts +15 -0
  10. package/dist/core/theme/validation.js +55 -0
  11. package/dist/features/admin-widgets/components/Select/Select.d.ts +11 -3
  12. package/dist/features/admin-widgets/components/Select/Select.hooks.d.ts +8 -13
  13. package/dist/features/admin-widgets/components/Select/Select.hooks.js +37 -215
  14. package/dist/features/admin-widgets/components/Select/Select.js +4 -3
  15. package/dist/features/appearance/constants.js +1 -1
  16. package/dist/features/connectors/rules.d.ts +1 -6
  17. package/dist/features/connectors/types.d.ts +1 -6
  18. package/dist/features/connectors/types.js +1 -6
  19. package/dist/features/execution/http-adapter.d.ts +111 -0
  20. package/dist/features/execution/http-adapter.js +160 -0
  21. package/dist/features/execution/index.d.ts +4 -0
  22. package/dist/features/execution/index.js +2 -0
  23. package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +232 -0
  24. package/dist/features/execution/react/hooks/use-execution-credential.hooks.js +217 -0
  25. package/dist/features/html-editor/canvas-style.d.ts +1 -1
  26. package/dist/features/html-editor/canvas-style.js +2 -2
  27. package/dist/features/i18n/dictionaries/settings-dialog.ar.js +2 -0
  28. package/dist/features/i18n/dictionaries/settings-dialog.bn.js +2 -0
  29. package/dist/features/i18n/dictionaries/settings-dialog.de.js +2 -0
  30. package/dist/features/i18n/dictionaries/settings-dialog.en.js +2 -0
  31. package/dist/features/i18n/dictionaries/settings-dialog.es.js +2 -0
  32. package/dist/features/i18n/dictionaries/settings-dialog.fa.js +2 -0
  33. package/dist/features/i18n/dictionaries/settings-dialog.fr.js +2 -0
  34. package/dist/features/i18n/dictionaries/settings-dialog.hi.js +2 -0
  35. package/dist/features/i18n/dictionaries/settings-dialog.hu.js +2 -0
  36. package/dist/features/i18n/dictionaries/settings-dialog.id.js +2 -0
  37. package/dist/features/i18n/dictionaries/settings-dialog.it.js +2 -0
  38. package/dist/features/i18n/dictionaries/settings-dialog.ja.js +2 -0
  39. package/dist/features/i18n/dictionaries/settings-dialog.ko.js +2 -0
  40. package/dist/features/i18n/dictionaries/settings-dialog.pl.js +2 -0
  41. package/dist/features/i18n/dictionaries/settings-dialog.pt-BR.js +2 -0
  42. package/dist/features/i18n/dictionaries/settings-dialog.ru.js +2 -0
  43. package/dist/features/i18n/dictionaries/settings-dialog.th.js +2 -0
  44. package/dist/features/i18n/dictionaries/settings-dialog.tr.js +2 -0
  45. package/dist/features/i18n/dictionaries/settings-dialog.uk.js +2 -0
  46. package/dist/features/i18n/dictionaries/settings-dialog.ur.js +2 -0
  47. package/dist/features/i18n/dictionaries/settings-dialog.zh-CN.js +2 -0
  48. package/dist/features/i18n/dictionaries/settings-dialog.zh-TW.js +2 -0
  49. package/dist/features/i18n/dictionary-translator.d.ts +5 -2
  50. package/dist/features/i18n/dictionary-translator.js +1 -1
  51. package/dist/features/i18n/index.d.ts +1 -1
  52. package/dist/features/i18n/index.js +1 -1
  53. package/dist/features/i18n/template-i18n.d.ts +11 -0
  54. package/dist/features/i18n/template-i18n.js +12 -0
  55. package/dist/features/interactive-ui/interactive-ui.css +1 -1
  56. package/dist/features/interactive-ui/providers/recharts/bar-chart.js +3 -2
  57. package/dist/features/interactive-ui/providers/recharts/chart-tokens.d.ts +43 -0
  58. package/dist/features/interactive-ui/providers/recharts/chart-tokens.js +44 -0
  59. package/dist/features/interactive-ui/providers/recharts/line-chart.js +3 -2
  60. package/dist/features/interactive-ui/providers/recharts/pie-chart.js +2 -2
  61. package/dist/features/lexical-rich-text-editor/deserialize.d.ts +0 -5
  62. package/dist/features/lexical-rich-text-editor/deserialize.js +0 -5
  63. package/dist/features/lexical-rich-text-editor/mention-node.d.ts +5 -17
  64. package/dist/features/lexical-rich-text-editor/mention-node.js +5 -17
  65. package/dist/features/lexical-rich-text-editor/mention-parser.d.ts +2 -4
  66. package/dist/features/lexical-rich-text-editor/serialize.d.ts +0 -4
  67. package/dist/features/lexical-rich-text-editor/serialize.js +0 -4
  68. package/dist/features/lexical-rich-text-editor/types.d.ts +3 -13
  69. package/dist/features/lexical-rich-text-editor/types.js +3 -13
  70. package/dist/features/mcp-ui/early-message-buffer.d.ts +1 -2
  71. package/dist/features/mcp-ui/early-message-buffer.js +1 -2
  72. package/dist/features/mcp-ui/escape.d.ts +4 -0
  73. package/dist/features/mcp-ui/escape.js +2 -9
  74. package/dist/features/mcp-ui/index.d.ts +1 -0
  75. package/dist/features/mcp-ui/index.js +1 -0
  76. package/dist/features/mcp-ui/protocol.d.ts +2 -5
  77. package/dist/features/mcp-ui/protocol.js +2 -5
  78. package/dist/features/mcp-ui/resource.d.ts +47 -7
  79. package/dist/features/mcp-ui/resource.js +5 -8
  80. package/dist/features/mcp-ui/secret-card.d.ts +115 -0
  81. package/dist/features/mcp-ui/secret-card.js +137 -0
  82. package/dist/features/mcp-ui/surfaces/confirmation.js +5 -0
  83. package/dist/features/mcp-ui/surfaces/fields.d.ts +5 -2
  84. package/dist/features/mcp-ui/surfaces/fields.js +3 -1
  85. package/dist/features/mcp-ui/surfaces/form.d.ts +4 -1
  86. package/dist/features/mcp-ui/surfaces/form.js +65 -3
  87. package/dist/features/mcp-ui/surfaces/outcome.d.ts +2 -0
  88. package/dist/features/mcp-ui/surfaces/text-input.d.ts +14 -6
  89. package/dist/features/mcp-ui/surfaces/text-input.js +16 -2
  90. package/dist/features/mcp-ui/surfaces/tokens.js +1 -1
  91. package/dist/features/memory/react/components/MemoryConnectedPanel.d.ts +1 -1
  92. package/dist/features/memory/react/components/MemoryConnectedPanel.js +0 -1
  93. package/dist/features/panel-kit/helpers/format-timestamp.d.ts +5 -3
  94. package/dist/features/panel-kit/helpers/format-timestamp.js +13 -4
  95. package/dist/features/panel-kit/helpers/permissions.js +2 -0
  96. package/dist/features/panel-kit/helpers/resolve-active-tab-id.js +2 -0
  97. package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +51 -0
  98. package/dist/features/panel-kit/helpers/standing-draft-local-backup.js +77 -0
  99. package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +8 -0
  100. package/dist/features/panel-kit/helpers/standing-draft-recovery-message.js +10 -0
  101. package/dist/features/panel-kit/hooks/use-async-action.hooks.d.ts +1 -0
  102. package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.d.ts +1 -0
  103. package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.js +1 -0
  104. package/dist/features/panel-kit/hooks/use-serial-writes.hooks.d.ts +8 -0
  105. package/dist/features/panel-kit/hooks/use-serial-writes.hooks.js +3 -0
  106. package/dist/features/panel-kit/hooks/use-settings-slice.hooks.d.ts +211 -0
  107. package/dist/features/panel-kit/hooks/use-settings-slice.hooks.js +382 -0
  108. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +179 -0
  109. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.js +300 -0
  110. package/dist/features/panel-kit/index.d.ts +7 -1
  111. package/dist/features/panel-kit/index.js +5 -1
  112. package/dist/features/resource-dashboard/types.d.ts +8 -41
  113. package/dist/features/resource-dashboard/types.js +3 -26
  114. package/dist/features/tab-strip/constants.d.ts +3 -4
  115. package/dist/features/tab-strip/constants.js +3 -4
  116. package/dist/features/tab-strip/dependencies.d.ts +1 -6
  117. package/dist/features/tab-strip/dependencies.js +1 -6
  118. package/dist/features/tab-strip/react/components/TabBar.d.ts +33 -1
  119. package/dist/features/tab-strip/react/components/TabBar.hooks.d.ts +57 -5
  120. package/dist/features/tab-strip/react/components/TabBar.hooks.js +63 -5
  121. package/dist/features/tab-strip/react/components/TabBar.js +12 -1
  122. package/dist/features/tab-strip/rules.d.ts +4 -17
  123. package/dist/features/tab-strip/rules.js +4 -17
  124. package/dist/features/tab-strip/types.d.ts +2 -13
  125. package/dist/icon-name.d.ts +1 -1
  126. package/dist/icon-name.js +1 -0
  127. package/dist/index.d.ts +42 -417
  128. package/dist/index.js +42 -430
  129. package/dist/react/components/CustomSelect.d.ts +6 -2
  130. package/dist/react/components/CustomSelect.js +20 -91
  131. package/dist/react/components/Icon.d.ts +6 -0
  132. package/dist/react/components/Icon.js +12 -0
  133. package/dist/react/components/select-popover.d.ts +106 -0
  134. package/dist/react/components/select-popover.js +210 -0
  135. package/dist/renderers/sandbox-scripts.d.ts +29 -0
  136. package/dist/renderers/sandbox-scripts.js +127 -0
  137. package/dist/renderers/sandboxed-document.js +3 -86
  138. package/dist/renderers/srcdoc/build.d.ts +10 -17
  139. package/dist/renderers/srcdoc/build.js +31 -234
  140. package/dist/styles/variables.css +30 -0
  141. package/dist/theme/apply.d.ts +1 -1
  142. package/dist/theme/apply.js +2 -2
  143. package/dist/theme/color-scheme.d.ts +1 -1
  144. package/dist/theme/default.d.ts +1 -3
  145. package/dist/theme/default.js +2 -10
  146. package/dist/theme/index.d.ts +3 -3
  147. package/dist/theme/index.js +2 -2
  148. package/dist/theme/stylesheet.d.ts +1 -7
  149. package/dist/theme/stylesheet.js +2 -13
  150. package/dist/theme/types.d.ts +1 -38
  151. package/dist/theme/types.js +2 -1
  152. package/dist/theme/validation.d.ts +1 -14
  153. package/dist/theme/validation.js +2 -54
  154. package/dist/utils/endpoint-policy.d.ts +21 -39
  155. package/dist/utils/endpoint-policy.js +19 -107
  156. package/dist/utils/file-system-errors.d.ts +1 -2
  157. package/dist/utils/file-system-errors.js +1 -2
  158. package/dist/utils/ime-composing.d.ts +0 -3
  159. package/dist/utils/ime-composing.js +0 -3
  160. package/dist/utils/platform.d.ts +1 -4
  161. package/dist/utils/platform.js +1 -4
  162. package/dist/utils/smooth-scroll-to-top.d.ts +1 -3
  163. package/dist/utils/smooth-scroll-to-top.js +3 -13
  164. package/dist/utils/timezone.js +1 -5
  165. package/dist/utils/uuid.d.ts +0 -3
  166. package/dist/utils/uuid.js +0 -3
  167. package/dist/utils/visual-stability.d.ts +1 -3
  168. package/dist/utils/visual-stability.js +1 -3
  169. package/package.json +74 -15
@@ -1,16 +1,43 @@
1
1
  import { agentHandle } from "@jini-ai/agentic";
2
- export function tabHandleProps({ tab }) {
2
+ /**
3
+ * @file TabBar's derived props and WAI-ARIA automatic-activation keyboard behavior.
4
+ * Data and event logic live here; TabBar.tsx keeps the JSX render helpers. Arrow keys activate
5
+ * immediately and move focus, while disabled tabs are skipped and non-tab controls keep their keys.
6
+ */
7
+ /** The `TabBarButton` component's own `agentHandle()` spread, as a plain function rather than an
8
+ * inline ternary in its JSX — one more small piece pulled out of `TabBar.tsx` for the same
9
+ * complexity-gate reason that component's own doc comment gives.
10
+ * @example tabHandleProps({ tab: { id: "a", label: "A", handle: "tab-a" } });
11
+ */
12
+ export function tabHandleProps({ tab }, _optional = {}) {
3
13
  return tab.handle ? agentHandle({ handle: tab.handle }, { role: "button", label: tab.handleLabel ?? tab.label }) : {};
4
14
  }
5
15
  const TAB_BAR_NAV_KEYS = ["ArrowRight", "ArrowLeft", "Home", "End"];
6
16
  function isTabBarNavKey(key) {
7
17
  return TAB_BAR_NAV_KEYS.includes(key);
8
18
  }
19
+ /** Indices of every non-disabled tab, in `tabs` order — the only positions a key can land on. */
9
20
  function enabledTabIndices(tabs) {
10
21
  return tabs.reduce((acc, tab, i) => (tab.disabled ? acc : [...acc, i]), []);
11
22
  }
12
- /** Resolve arrow/Home/End navigation in enabled-tab order; null means no navigation. */
13
- export function resolveTabBarKeyTarget({ tabs, activeId, key }) {
23
+ /**
24
+ * Resolve arrow/Home/End navigation in enabled-tab order; null means no navigation.
25
+ *
26
+ * Resolves which tab a keydown on the tablist should move to, for the WAI-ARIA "automatic
27
+ * activation" tabs pattern (arrow keys change the selection immediately, not just focus).
28
+ *
29
+ * @param input.tabs - The tab row in DOM order.
30
+ * @param input.activeId - The currently active tab's id.
31
+ * @param input.key - `KeyboardEvent.key` from the tablist's own `onKeyDown`.
32
+ * @returns The target tab's index into `tabs`, or `null` when `key` isn't a nav key or every tab
33
+ * is disabled. Disabled tabs are never a target. Home/End always resolve to the first/last
34
+ * enabled tab. When `activeId` matches no enabled tab (unset, unknown id, or a disabled tab),
35
+ * ArrowRight/Home resolve to the first enabled tab and ArrowLeft/End resolve to the last —
36
+ * the same "nothing to move from" case Home/End already answer explicitly.
37
+ * @complexity O(n²) time, O(n) space (the enabled-index reducer copies its accumulator) in `tabs.length`.
38
+ * @example resolveTabBarKeyTarget({ tabs, activeId: "a", key: "ArrowRight" });
39
+ */
40
+ export function resolveTabBarKeyTarget({ tabs, activeId, key }, _optional = {}) {
14
41
  if (!isTabBarNavKey(key))
15
42
  return null;
16
43
  const enabled = enabledTabIndices(tabs);
@@ -32,7 +59,20 @@ export function resolveTabBarKeyTarget({ tabs, activeId, key }) {
32
59
  return enabled[enabled.length - 1];
33
60
  return enabled[(activePos - 1 + enabled.length) % enabled.length];
34
61
  }
35
- export function resolveTabBarTabIndex({ tabs, activeId, tab }) {
62
+ /**
63
+ * Resolves one tab's roving-tabindex value — exactly one tab in a `TabBar` is ever in the native
64
+ * Tab order at a time (WAI-ARIA APG roving tabindex), so arrowing between tabs never lets a plain
65
+ * Tab keypress land on more than one of them.
66
+ *
67
+ * @param input.tabs - The tab row in DOM order.
68
+ * @param input.activeId - The currently active tab's id.
69
+ * @param input.tab - The tab being rendered.
70
+ * @returns `0` for the enabled active tab, or for the first enabled tab when `activeId` matches
71
+ * no enabled tab; `-1` otherwise, including every disabled tab.
72
+ * @complexity O(n) in `tabs.length`.
73
+ * @example resolveTabBarTabIndex({ tabs, activeId: "a", tab: tabs[0]! });
74
+ */
75
+ export function resolveTabBarTabIndex({ tabs, activeId, tab }, _optional = {}) {
36
76
  if (tab.disabled)
37
77
  return -1;
38
78
  if (tabs.some((t) => t.id === activeId && !t.disabled))
@@ -40,8 +80,26 @@ export function resolveTabBarTabIndex({ tabs, activeId, tab }) {
40
80
  const firstEnabled = tabs.find((t) => !t.disabled);
41
81
  return firstEnabled?.id === tab.id ? 0 : -1;
42
82
  }
43
- export function useTabBarKeyboard({ tabs, activeId, onChange }) {
83
+ /**
84
+ * Wires {@link resolveTabBarKeyTarget} into a tablist's `onKeyDown`: on a nav key, changes the
85
+ * active tab and moves DOM focus to the new tab button, so focus and selection never drift apart.
86
+ * Keydowns that did not originate inside a `[role="tab"]` are ignored, so a non-tab control hosted
87
+ * in the same tablist keeps its own arrow/Home/End keys.
88
+ *
89
+ * @param input.tabs - The tab row in DOM order.
90
+ * @param input.activeId - The currently active tab's id.
91
+ * @param input.onChange - `TabBarProps.onChange`, called with the target tab's id.
92
+ * @returns `onKeyDown`, for the tablist container's own React event prop.
93
+ * @complexity O(n²) time, O(n) space (the enabled-index reducer copies its accumulator) in `tabs.length` per keydown (bounded by the on-screen tab count).
94
+ * @example useTabBarKeyboard({ tabs, activeId, onChange });
95
+ */
96
+ export function useTabBarKeyboard({ tabs, activeId, onChange }, _optional = {}) {
44
97
  function onKeyDown(e) {
98
+ // A tablist may legitimately hold a control that is NOT a tab — `AccessTokensTab.tsx`'s
99
+ // "+ Add custom provider" button sits inside its `role="tablist"` div and is Tab-reachable.
100
+ // React's onKeyDown here fires for keydowns anywhere in the subtree, so without this origin
101
+ // check an arrow press on that button would change the selection and pull focus onto a tab,
102
+ // silently moving the operator off the control they were standing on.
45
103
  // Controls inside the strip that are not tabs keep their own navigation keys.
46
104
  if (!(e.target instanceof Element) || !e.target.closest('[role="tab"]'))
47
105
  return;
@@ -2,16 +2,27 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TabStripFrame } from "./TabStripFrame.js";
3
3
  import { agentHandle } from "@jini-ai/agentic";
4
4
  import { resolveTabBarTabIndex, tabHandleProps, useTabBarKeyboard } from "./TabBar.hooks.js";
5
+ /** The visually-hidden accessible-name SUFFIX {@link TabBarTab.dot} adds — e.g. "GitHub Pages,
6
+ * Connected", never "Connected GitHub Pages". Deliberately its own function rather than folded into
7
+ * the visual dot span rendered before the label (`TabBarButton` below): the visual dot is
8
+ * `aria-hidden` and belongs immediately before the label, where a leading bullet reads naturally,
9
+ * but the ACCESSIBLE text has to come AFTER the label text in DOM order for the tab's accessible
10
+ * name (label + this suffix, concatenated in DOM order) to read as a sentence rather than a
11
+ * fragment stitched on backwards. Split out for the same complexity-gate reason {@link
12
+ * TabBarButton}'s own doc gives. */
5
13
  function tabDotAccessibleSuffix(tab) {
6
14
  if (!tab.dot || !tab.dotLabel)
7
15
  return null;
8
16
  return _jsxs("span", { className: "visually-hidden", children: [", ", tab.dotLabel] });
9
17
  }
18
+ /** One tab button. A named top-level component avoids the nesting penalty for branches inside
19
+ * an inline map callback under the cyclomatic/cognitive complexity gate. Derived props live in
20
+ * TabBar.hooks.tsx; tabDotAccessibleSuffix stays here because it renders JSX. */
10
21
  function TabBarButton({ tab, active, tabIndex, onChange, }) {
11
22
  return (_jsxs("button", { type: "button", role: "tab", className: "tab-bar-item", "aria-selected": active, "aria-label": tab.dot && tab.dotLabel ? [tab.label + ", " + tab.dotLabel, tab.tag, tab.count].filter((part) => part !== undefined).join(" ") : undefined, "aria-disabled": tab.disabled || undefined, disabled: tab.disabled, tabIndex: tabIndex, onClick: tab.disabled ? undefined : () => onChange(tab.id), ...tabHandleProps({ tab: tab }), children: [tab.dot ? _jsx("span", { className: "tab-bar-dot", "aria-hidden": "true" }) : null, tab.icon ? (_jsx("span", { className: "tab-bar-icon", "aria-hidden": "true", children: tab.icon })) : null, tab.label, tabDotAccessibleSuffix(tab), tab.tag ? _jsx("span", { className: "tab-bar-tag", children: tab.tag }) : null, tab.count !== undefined ? _jsx("span", { className: "tab-bar-count", children: tab.count }) : null] }));
12
23
  }
13
24
  /** Controlled button-based selection strip, including roving focus and optional agent handles. */
14
- export function TabBar({ tabs, activeId, onChange, ariaLabel, containerHandle }) {
25
+ export function TabBar({ tabs, activeId, onChange, ariaLabel, containerHandle }, _optional = {}) {
15
26
  const { onKeyDown } = useTabBarKeyboard({ tabs: tabs, activeId: activeId, onChange: onChange });
16
27
  return (_jsx(TabStripFrame, { className: "tab-bar", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, ...(containerHandle ? agentHandle({ handle: containerHandle }, { role: "region", label: ariaLabel }) : {}), children: tabs.map((tab) => (_jsx(TabBarButton, { tab: tab, active: activeId === tab.id, tabIndex: resolveTabBarTabIndex({ tabs: tabs, activeId: activeId, tab: tab }), onChange: onChange }, tab.id))) }));
17
28
  }
@@ -1,21 +1,9 @@
1
1
  import type { TabStripDragTarget, TabStripDropEdge, TabStripElementRect, TabStripTab } from './types.js';
2
- /**
3
- * Which edge of `rect` a pointer at `pointerX` lands on. Ported from
4
- * `WorkspaceTabsBar.tsx`'s `tabDropEdgeFromElement` and
5
- * `FileWorkspace.tsx`'s `tabDropEdgeFromEvent` — both compute this exact
6
- * "left half vs right half of the target's bounding rect" split, just
7
- * against a `DragEvent` directly rather than a plain `clientX` number. The
8
- * pure form here takes the already-extracted `clientX`/rect so it needs no
9
- * DOM/event types.
10
- */
2
+ /** Compare the pointer with the target rectangle's midpoint. Plain coordinates keep this rule
3
+ * independent of DOM/event types. */
11
4
  export declare function dropEdgeFromPointerX(pointerX: number, rect: Pick<TabStripElementRect, 'left' | 'width'>): TabStripDropEdge;
12
- /**
13
- * Coerces a drop target that would place a tab before a pinned tab into
14
- * landing after it instead — pinned tabs always stay leftmost. Generalizes
15
- * `WorkspaceTabsBar.tsx`'s `findTabDropTarget`'s `resolveTarget` closure
16
- * (there hardcoded to the single entry tab; here driven by the host-
17
- * supplied `pinned` field on any number of tabs).
18
- */
5
+ /** Land after a pinned target even when its left half was hit; pinned tabs must stay leftmost.
6
+ * Hosts supply the pinned ids, so the rule does not assume one special entry tab. */
19
7
  export declare function coercePinnedDropTarget(target: TabStripDragTarget, pinnedTabIds: ReadonlySet<string>): TabStripDragTarget;
20
8
  /**
21
9
  * Moves `sourceId` to just before/after `targetId` in `tabIds`, preserving
@@ -28,7 +16,6 @@ export declare function coercePinnedDropTarget(target: TabStripDragTarget, pinne
28
16
  * back in at index (+1 for 'after')" algorithm in both files.
29
17
  */
30
18
  export declare function reorderTabIds(tabIds: readonly string[], sourceId: string, targetId: string, edge: TabStripDropEdge): string[];
31
- /** Ported verbatim (both files have an identical helper under this name). */
32
19
  export declare function arraysEqual(a: readonly string[], b: readonly string[]): boolean;
33
20
  /** A stable string key for a drag target, used to detect "did the hovered
34
21
  * target actually change" without a deep-equal check (ported from
@@ -1,22 +1,10 @@
1
- /**
2
- * Which edge of `rect` a pointer at `pointerX` lands on. Ported from
3
- * `WorkspaceTabsBar.tsx`'s `tabDropEdgeFromElement` and
4
- * `FileWorkspace.tsx`'s `tabDropEdgeFromEvent` — both compute this exact
5
- * "left half vs right half of the target's bounding rect" split, just
6
- * against a `DragEvent` directly rather than a plain `clientX` number. The
7
- * pure form here takes the already-extracted `clientX`/rect so it needs no
8
- * DOM/event types.
9
- */
1
+ /** Compare the pointer with the target rectangle's midpoint. Plain coordinates keep this rule
2
+ * independent of DOM/event types. */
10
3
  export function dropEdgeFromPointerX(pointerX, rect) {
11
4
  return pointerX > rect.left + rect.width / 2 ? 'after' : 'before';
12
5
  }
13
- /**
14
- * Coerces a drop target that would place a tab before a pinned tab into
15
- * landing after it instead — pinned tabs always stay leftmost. Generalizes
16
- * `WorkspaceTabsBar.tsx`'s `findTabDropTarget`'s `resolveTarget` closure
17
- * (there hardcoded to the single entry tab; here driven by the host-
18
- * supplied `pinned` field on any number of tabs).
19
- */
6
+ /** Land after a pinned target even when its left half was hit; pinned tabs must stay leftmost.
7
+ * Hosts supply the pinned ids, so the rule does not assume one special entry tab. */
20
8
  export function coercePinnedDropTarget(target, pinnedTabIds) {
21
9
  if (target.edge === 'before' && pinnedTabIds.has(target.tabId)) {
22
10
  return { tabId: target.tabId, edge: 'after' };
@@ -46,7 +34,6 @@ export function reorderTabIds(tabIds, sourceId, targetId, edge) {
46
34
  nextIds.splice(edge === 'after' ? targetIndex + 1 : targetIndex, 0, sourceId);
47
35
  return arraysEqual(nextIds, tabIds) ? original : nextIds;
48
36
  }
49
- /** Ported verbatim (both files have an identical helper under this name). */
50
37
  export function arraysEqual(a, b) {
51
38
  if (a.length !== b.length)
52
39
  return false;
@@ -1,22 +1,11 @@
1
1
  import type { ReactNode } from 'react';
2
- /**
3
- * Which side of the drop-target tab the dragged tab lands on. Shared
4
- * concept across both source shapes this feature consolidates
5
- * (`WorkspaceTabsBar.tsx`'s `TabDropEdge`, `FileWorkspace.tsx`'s
6
- * `TabDropEdge`) — identical meaning in both.
7
- */
2
+ /** Which side of the target tab receives the dragged item. */
8
3
  export type TabStripDropEdge = 'before' | 'after';
9
4
  export interface TabStripDragTarget {
10
5
  tabId: string;
11
6
  edge: TabStripDropEdge;
12
7
  }
13
- /**
14
- * One tab-strip item. `content` is host-injected — the primitive never
15
- * renders an icon or label itself, it just lays out whatever the host gives
16
- * it (see `ADS-memory/reports/jini-port/god-components-extraction-plan.md`'s consolidation
17
- * map: "the specific parts become host-injected config, not part of the
18
- * primitive").
19
- */
8
+ /** One tab item. The host owns icon/label/meta content; this primitive only lays it out. */
20
9
  export interface TabStripTab {
21
10
  id: string;
22
11
  /** Icon + label + meta + badges — anything the host wants inside the tab. */
@@ -7,7 +7,7 @@
7
7
  * that must not drag a React import across the boundary. `Icon.tsx` re-exports
8
8
  * this type, so existing importers are unchanged.
9
9
  */
10
- export type IconName = 'alert-triangle' | 'arrow-left' | 'arrow-up' | 'attach' | 'bell' | 'blocks' | 'check' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'close' | 'copy' | 'comment' | 'message-circle' | 'discord' | 'download' | 'draw' | 'edit' | 'external-link' | 'eye' | 'eye-off' | 'file' | 'file-code' | 'file-text' | 'folder' | 'folder-filled' | 'fork' | 'github' | 'github-filled' | 'grip-vertical' | 'grid' | 'globe' | 'hammer' | 'help-circle' | 'history' | 'home' | 'home-filled' | 'image' | 'import' | 'info' | 'kanban' | 'layers-filled' | 'languages' | 'layout' | 'lightbulb' | 'link' | 'lock' | 'log-out' | 'integrations-filled' | 'maximize' | 'mic' | 'minimize' | 'minus' | 'more-horizontal' | 'orbit' | 'paint-bucket' | 'panel-left' | 'palette' | 'palette-filled' | 'pencil' | 'plus' | 'plus-filled' | 'puzzle' | 'slides' | 'star' | 'swatchbook' | 'play' | 'present' | 'refresh' | 'reload' | 'search' | 'send' | 'settings' | 'share' | 'sliders' | 'smartphone' | 'spinner' | 'sparkles' | 'stop' | 'sun' | 'moon' | 'sun-moon' | 'terminal' | 'thumbs-down' | 'thumbs-up' | 'tweaks' | 'upload' | 'trash' | 'volume' | 'zoom-in' | 'zoom-out';
10
+ export type IconName = 'package-check' | 'storefront' | 'package-outline' | 'trash-compact' | 'chevron-right-wide' | 'check-long' | 'alert-triangle' | 'arrow-left' | 'arrow-up' | 'attach' | 'bell' | 'blocks' | 'check' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'close' | 'copy' | 'comment' | 'message-circle' | 'discord' | 'download' | 'draw' | 'edit' | 'external-link' | 'eye' | 'eye-off' | 'file' | 'file-code' | 'file-text' | 'folder' | 'folder-filled' | 'fork' | 'github' | 'github-filled' | 'grip-vertical' | 'grid' | 'globe' | 'hammer' | 'help-circle' | 'history' | 'home' | 'home-filled' | 'image' | 'import' | 'info' | 'kanban' | 'layers-filled' | 'languages' | 'layout' | 'lightbulb' | 'link' | 'lock' | 'log-out' | 'integrations-filled' | 'maximize' | 'mic' | 'minimize' | 'minus' | 'more-horizontal' | 'orbit' | 'paint-bucket' | 'panel-left' | 'palette' | 'palette-filled' | 'pencil' | 'plus' | 'plus-filled' | 'puzzle' | 'slides' | 'star' | 'swatchbook' | 'play' | 'present' | 'refresh' | 'reload' | 'search' | 'send' | 'settings' | 'share' | 'sliders' | 'smartphone' | 'spinner' | 'sparkles' | 'stop' | 'sun' | 'moon' | 'sun-moon' | 'terminal' | 'thumbs-down' | 'thumbs-up' | 'tweaks' | 'upload' | 'trash' | 'volume' | 'zoom-in' | 'zoom-out';
11
11
  /**
12
12
  * Runtime enumeration of every {@link IconName}. A string union has no
13
13
  * runtime representation of its own, so this exists as the one place a
package/dist/icon-name.js CHANGED
@@ -8,6 +8,7 @@
8
8
  * compile-time one, since TS can't derive a value from a type.
9
9
  */
10
10
  export const ICON_NAMES = [
11
+ 'package-check', 'storefront', 'package-outline', 'trash-compact', 'chevron-right-wide', 'check-long',
11
12
  'alert-triangle', 'arrow-left', 'arrow-up', 'attach', 'bell', 'blocks', 'check',
12
13
  'chevron-down', 'chevron-left', 'chevron-right', 'close', 'copy', 'comment',
13
14
  'message-circle', 'discord', 'download', 'draw', 'edit', 'external-link', 'eye',