@ankhorage/zora 25.8.13 → 25.8.15

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 (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/features/button/utils/resolveButtonThemeRecipe.d.ts +1 -1
  4. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.d.ts.map +1 -1
  5. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.js +11 -8
  6. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.js.map +1 -1
  7. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.d.ts +1 -1
  8. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.d.ts.map +1 -1
  9. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.js +25 -5
  10. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.js.map +1 -1
  11. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.d.ts +1 -1
  12. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.d.ts.map +1 -1
  13. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.js +5 -2
  14. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.js.map +1 -1
  15. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts +4 -0
  16. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -0
  17. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +187 -0
  18. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -0
  19. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts +1 -0
  20. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts.map +1 -1
  21. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +4 -185
  22. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
  23. package/dist/features/registry/createZoraComponentRegistry.d.ts +4 -0
  24. package/dist/features/registry/createZoraComponentRegistry.d.ts.map +1 -0
  25. package/dist/features/registry/createZoraComponentRegistry.js +6 -0
  26. package/dist/features/registry/createZoraComponentRegistry.js.map +1 -0
  27. package/dist/features/registry/public.d.ts +2 -0
  28. package/dist/features/registry/public.d.ts.map +1 -1
  29. package/dist/features/registry/public.js +2 -0
  30. package/dist/features/registry/public.js.map +1 -1
  31. package/dist/features/registry/readerFreeRegistry.d.ts +3 -0
  32. package/dist/features/registry/readerFreeRegistry.d.ts.map +1 -0
  33. package/dist/features/registry/readerFreeRegistry.js +3 -0
  34. package/dist/features/registry/readerFreeRegistry.js.map +1 -0
  35. package/dist/index.d.ts +1 -126
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -77
  38. package/dist/index.js.map +1 -1
  39. package/dist/readerFree.d.ts +129 -0
  40. package/dist/readerFree.d.ts.map +1 -0
  41. package/dist/readerFree.js +79 -0
  42. package/dist/readerFree.js.map +1 -0
  43. package/dist/types/matrix-grid.d.ts +2 -0
  44. package/dist/types/matrix-grid.d.ts.map +1 -1
  45. package/dist/types/matrix-grid.js.map +1 -1
  46. package/package.json +17 -2
  47. package/src/features/layout/public.test.ts +2 -1
  48. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.protected-focus.test.tsx +252 -0
  49. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.test.tsx +79 -0
  50. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx +16 -5
  51. package/src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts +31 -4
  52. package/src/features/matrix-grid/application/resolveMatrixGridSelection.test.ts +20 -13
  53. package/src/features/matrix-grid/application/resolveMatrixGridSelection.ts +3 -0
  54. package/src/features/progress/adapters/inbound/ProgressRing.test.ts +6 -4
  55. package/src/features/reader/adapters/inbound/Reader.test.ts +1 -1
  56. package/src/features/reader/utils/resolveReaderProgress.test.ts +1 -1
  57. package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +236 -0
  58. package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +4 -233
  59. package/src/features/registry/createZoraComponentRegistry.ts +9 -0
  60. package/src/features/registry/public.ts +2 -0
  61. package/src/features/registry/readerFreeRegistry.ts +2 -0
  62. package/src/features/registry/registry.test.ts +36 -5
  63. package/src/features/uploader/public.test.ts +3 -2
  64. package/src/index.ts +1 -533
  65. package/src/interactionPolicy.test.ts +1 -1
  66. package/src/readerFree.ts +538 -0
  67. package/src/types/matrix-grid.ts +2 -0
  68. package/web-dist/components/matrix-grid/MatrixGrid.js +41 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 25.8.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 2e249fc: Add a Reader-free registry entrypoint so generated consumers can select Reader only when their manifest requires it.
8
+
9
+ ## 25.8.14
10
+
11
+ ### Patch Changes
12
+
13
+ - 2ba10d7: Prevent protected MatrixGrid cells from receiving focus or changing selection.
14
+
3
15
  ## 25.8.13
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/zora
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v25.8.13](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v25.8.15](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
9
9
 
@@ -7,5 +7,5 @@ export declare function resolveButtonThemeRecipe(input: {
7
7
  readonly variant?: ZoraButtonVariant;
8
8
  readonly size?: ZoraControlSize;
9
9
  readonly themeFields: Readonly<Record<string, ThemeRecipeOverrideValue>>;
10
- }): Pick<import("@ankhorage/surface").ButtonProps, "variant" | "size" | "color">;
10
+ }): Pick<import("@ankhorage/surface").ButtonProps, "size" | "variant" | "color">;
11
11
  //# sourceMappingURL=resolveButtonThemeRecipe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MatrixGrid.d.ts","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA4NrE,gGAAgG;AAChG,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
1
+ {"version":3,"file":"MatrixGrid.d.ts","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAuOrE,gGAAgG;AAChG,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
@@ -12,7 +12,7 @@ import { resolveMatrixGridSelection } from '../../application/resolveMatrixGridS
12
12
  import { MatrixGridKeyboardProxy } from './MatrixGridKeyboardProxy';
13
13
  import { useMatrixGridKeyboardFocus } from './useMatrixGridKeyboardFocus';
14
14
  /*** Compose the canonical GridView around released sparse matrix placement and culling geometry. */
15
- function MatrixGridInner({ accessibilityLabel = 'Matrix grid', cells, height, interactionPolicy, layout, onSelectionChange, onViewportChange, overscanPixels = 160, readOnly = false, renderCell, selectedCellIds = [], selectionMode = 'single', testID, viewport: controlledViewport, width, zoomX = 1, zoomY = 1, }) {
15
+ function MatrixGridInner({ accessibilityLabel = 'Matrix grid', cells, height, interactionPolicy, layout, onSelectionChange, onViewportChange, overscanPixels = 160, protectedCellIds = [], readOnly = false, renderCell, selectedCellIds = [], selectionMode = 'single', testID, viewport: controlledViewport, width, zoomX = 1, zoomY = 1, }) {
16
16
  const { theme } = useZoraTheme();
17
17
  const contentSize = React.useMemo(() => resolveMatrixGridContentSize(layout), [layout]);
18
18
  const initialViewport = React.useMemo(() => ({ height, offsetX: 0, offsetY: 0, pixelsPerUnitX: zoomX, pixelsPerUnitY: zoomY, width }), [height, width, zoomX, zoomY]);
@@ -22,18 +22,20 @@ function MatrixGridInner({ accessibilityLabel = 'Matrix grid', cells, height, in
22
22
  const cellPlacements = React.useMemo(() => getVisibleMatrixCells(layout, cells, viewport, overscanPixels), [cells, layout, overscanPixels, viewport]);
23
23
  const [visibleIds, setVisibleIds] = React.useState([]);
24
24
  const anchorId = React.useRef(null);
25
+ const protectedCellIdSet = React.useMemo(() => new Set(protectedCellIds), [protectedCellIds]);
26
+ const isNavigable = React.useCallback((id) => !protectedCellIdSet.has(id), [protectedCellIdSet]);
25
27
  const handleViewportChange = React.useCallback((proposal) => {
26
28
  if (controlledViewport === undefined)
27
29
  setUncontrolledViewport(proposal);
28
30
  onViewportChange?.(proposal);
29
31
  }, [controlledViewport, onViewportChange]);
30
32
  const activateCell = React.useCallback((cell, event) => {
31
- if (interactionPolicy === 'passive' || readOnly)
33
+ if (interactionPolicy === 'passive' || readOnly || protectedCellIdSet.has(cell.id))
32
34
  return;
33
35
  const intent = isRangeSelectionEvent(event)
34
36
  ? 'range'
35
37
  : resolveSelectionEventIntent(event, 'pointer');
36
- onSelectionChange?.(resolveMatrixGridSelection(sparseIndex.entries, selectedCellIds, cell.id, anchorId.current, intent, selectionMode));
38
+ onSelectionChange?.(resolveMatrixGridSelection(sparseIndex.entries, selectedCellIds, cell.id, anchorId.current, intent, selectionMode, protectedCellIdSet));
37
39
  if (intent !== 'range')
38
40
  anchorId.current = cell.id;
39
41
  }, [
@@ -43,6 +45,7 @@ function MatrixGridInner({ accessibilityLabel = 'Matrix grid', cells, height, in
43
45
  selectedCellIds,
44
46
  selectionMode,
45
47
  sparseIndex.entries,
48
+ protectedCellIdSet,
46
49
  ]);
47
50
  const handleKeyboardNavigation = React.useCallback((targetId, originId, shiftKey) => {
48
51
  anchorId.current ??= originId;
@@ -52,7 +55,7 @@ function MatrixGridInner({ accessibilityLabel = 'Matrix grid', cells, height, in
52
55
  if (cell)
53
56
  activateCell(getMatrixCellPlacement(layout, cell), { shiftKey: true });
54
57
  }, [activateCell, layout, sparseIndex]);
55
- const keyboard = useMatrixGridKeyboardFocus(sparseIndex, interactionPolicy === 'passive', visibleIds, handleKeyboardNavigation);
58
+ const keyboard = useMatrixGridKeyboardFocus(sparseIndex, interactionPolicy === 'passive', visibleIds, isNavigable, handleKeyboardNavigation);
56
59
  const focusedPlacement = React.useMemo(() => {
57
60
  const focusedCell = keyboard.focusedId === null ? undefined : sparseIndex.cellById.get(keyboard.focusedId);
58
61
  return focusedCell ? getMatrixCellPlacement(layout, focusedCell) : undefined;
@@ -66,12 +69,12 @@ function MatrixGridInner({ accessibilityLabel = 'Matrix grid', cells, height, in
66
69
  const cell = cellById.get(item.id);
67
70
  if (!cell)
68
71
  return null;
69
- return renderMatrixCell(cell, selectedCellIds, theme.semantics.neutral.divider, theme.colors.primary, renderCell, activateCell, keyboard, interactionPolicy === 'passive', readOnly, testID);
72
+ return renderMatrixCell(cell, selectedCellIds, theme.semantics.neutral.divider, theme.colors.primary, renderCell, activateCell, keyboard, interactionPolicy === 'passive', protectedCellIdSet.has(cell.id), readOnly, testID);
70
73
  }} testID={testID} viewport={viewport} width={width} onViewportChange={handleViewportChange}/>
71
74
  </View>);
72
75
  }
73
76
  /*** Render one positioned sparse cell with native/web accessible selection semantics. */
74
- function renderMatrixCell(cell, selectedCellIds, dividerColor, selectedColor, renderCell, activateCell, keyboard, passive, readOnly, testID) {
77
+ function renderMatrixCell(cell, selectedCellIds, dividerColor, selectedColor, renderCell, activateCell, keyboard, passive, protectedCell, readOnly, testID) {
75
78
  const selected = selectedCellIds.includes(cell.id);
76
79
  const canInteract = keyboard.tabStopId === cell.id;
77
80
  return (<MatrixGridKeyboardProxy onKeyDown={(event) => {
@@ -79,12 +82,12 @@ function renderMatrixCell(cell, selectedCellIds, dividerColor, selectedColor, re
79
82
  return true;
80
83
  if (!['Enter', ' '].includes(event.key))
81
84
  return false;
82
- if (passive || readOnly)
85
+ if (passive || protectedCell || readOnly)
83
86
  return false;
84
87
  activateCell(cell, event);
85
88
  return true;
86
89
  }}>
87
- <NativePressable key={cell.id} accessibilityActions={[{ name: 'activate' }]} accessibilityLabel={`Cell ${cell.id}`} accessibilityRole="button" accessibilityState={{ disabled: passive, selected }} disabled={passive} focusable={Platform.OS !== 'web' || canInteract} style={[
90
+ <NativePressable key={cell.id} accessibilityActions={[{ name: 'activate' }]} accessibilityLabel={`Cell ${cell.id}`} accessibilityRole="button" accessibilityState={{ disabled: passive || protectedCell, selected }} disabled={passive || protectedCell} focusable={!protectedCell && (Platform.OS !== 'web' || canInteract)} style={[
88
91
  styles.cell,
89
92
  {
90
93
  borderColor: selected || keyboard.focusedId === cell.id ? selectedColor : dividerColor,
@@ -1 +1 @@
1
- {"version":3,"file":"MatrixGrid.js","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAGtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,IAAI,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGxF,OAAO,EAAE,Q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AAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAEpD;QAAA,CAAC,UAAU,CAAC,IAAI,CAAC,CACnB;MAAA,EAAE,eAAe,CACnB;IAAA,EAAE,uBAAuB,CAAC,CAC3B,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,SAAS,qBAAqB,CAAC,KAAc;IAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,CACL,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC;QACpE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,QAAQ,KAAK,IAAI,CAAC,CACzE,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;CAC5E,CAAC,CAAC;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import {\n getMatrixCellPlacement,\n getVisibleMatrixCells,\n type GridMatrixCellPlacement,\n type GridViewport,\n} from '@ankhorage/grid-view';\nimport { isRecord } from '@ankhorage/utility/object';\nimport React from 'react';\nimport { Platform, Pressable as NativePressable, StyleSheet, View } from 'react-native';\n\nimport type { MatrixGridProps } from '../../../../types/matrix-grid';\nimport { GridView } from '../../../grid-view/public';\nimport { resolveSelectionEventIntent } from '../../../selection/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { createMatrixGridSparseIndex } from '../../application/createMatrixGridSparseIndex';\nimport { resolveMatrixGridContentSize } from '../../application/resolveMatrixGridContentSize';\nimport { resolveMatrixGridSelection } from '../../application/resolveMatrixGridSelection';\nimport { MatrixGridKeyboardProxy } from './MatrixGridKeyboardProxy';\nimport { useMatrixGridKeyboardFocus } from './useMatrixGridKeyboardFocus';\n\n/*** Compose the canonical GridView around released sparse matrix placement and culling geometry. */\nfunction MatrixGridInner({\n accessibilityLabel = 'Matrix grid',\n cells,\n height,\n interactionPolicy,\n layout,\n onSelectionChange,\n onViewportChange,\n overscanPixels = 160,\n readOnly = false,\n renderCell,\n selectedCellIds = [],\n selectionMode = 'single',\n testID,\n viewport: controlledViewport,\n width,\n zoomX = 1,\n zoomY = 1,\n}: MatrixGridProps) {\n const { theme } = useZoraTheme();\n const contentSize = React.useMemo(() => resolveMatrixGridContentSize(layout), [layout]);\n const initialViewport = React.useMemo<GridViewport>(\n () => ({ height, offsetX: 0, offsetY: 0, pixelsPerUnitX: zoomX, pixelsPerUnitY: zoomY, width }),\n [height, width, zoomX, zoomY],\n );\n const [uncontrolledViewport, setUncontrolledViewport] = React.useState(initialViewport);\n const viewport = controlledViewport ?? uncontrolledViewport;\n const sparseIndex = React.useMemo(\n () => createMatrixGridSparseIndex(layout, cells),\n [cells, layout],\n );\n const cellPlacements = React.useMemo(\n () => getVisibleMatrixCells(layout, cells, viewport, overscanPixels),\n [cells, layout, overscanPixels, viewport],\n );\n const [visibleIds, setVisibleIds] = React.useState<readonly string[]>([]);\n const anchorId = React.useRef<string | null>(null);\n\n const handleViewportChange = React.useCallback(\n (proposal: GridViewport) => {\n if (controlledViewport === undefined) setUncontrolledViewport(proposal);\n onViewportChange?.(proposal);\n },\n [controlledViewport, onViewportChange],\n );\n\n const activateCell = React.useCallback(\n (cell: GridMatrixCellPlacement, event: unknown) => {\n if (interactionPolicy === 'passive' || readOnly) return;\n const intent = isRangeSelectionEvent(event)\n ? 'range'\n : resolveSelectionEventIntent(event, 'pointer');\n onSelectionChange?.(\n resolveMatrixGridSelection(\n sparseIndex.entries,\n selectedCellIds,\n cell.id,\n anchorId.current,\n intent,\n selectionMode,\n ),\n );\n if (intent !== 'range') anchorId.current = cell.id;\n },\n [\n interactionPolicy,\n onSelectionChange,\n readOnly,\n selectedCellIds,\n selectionMode,\n sparseIndex.entries,\n ],\n );\n const handleKeyboardNavigation = React.useCallback(\n (targetId: string, originId: string, shiftKey: boolean) => {\n anchorId.current ??= originId;\n if (!shiftKey) return;\n const cell = sparseIndex.cellById.get(targetId);\n if (cell) activateCell(getMatrixCellPlacement(layout, cell), { shiftKey: true });\n },\n [activateCell, layout, sparseIndex],\n );\n const keyboard = useMatrixGridKeyboardFocus(\n sparseIndex,\n interactionPolicy === 'passive',\n visibleIds,\n handleKeyboardNavigation,\n );\n const focusedPlacement = React.useMemo(() => {\n const focusedCell =\n keyboard.focusedId === null ? undefined : sparseIndex.cellById.get(keyboard.focusedId);\n return focusedCell ? getMatrixCellPlacement(layout, focusedCell) : undefined;\n }, [keyboard.focusedId, layout, sparseIndex.cellById]);\n const gridItems = React.useMemo(\n () =>\n focusedPlacement && !cellPlacements.some((cell) => cell.id === focusedPlacement.id)\n ? [...cellPlacements, focusedPlacement]\n : cellPlacements,\n [cellPlacements, focusedPlacement],\n );\n const cellById = React.useMemo(\n () => new Map(gridItems.map((cell) => [cell.id, cell])),\n [gridItems],\n );\n\n return (\n <View accessibilityLabel={accessibilityLabel}>\n <GridView\n contentHeight={contentSize.height}\n contentWidth={contentSize.width}\n height={height}\n interactionPolicy={interactionPolicy}\n items={gridItems}\n focusedItemId={keyboard.focusedId ?? undefined}\n overscanPixels={0}\n onVisibleItemIdsChange={setVisibleIds}\n renderItem={(item) => {\n const cell = cellById.get(item.id);\n if (!cell) return null;\n return renderMatrixCell(\n cell,\n selectedCellIds,\n theme.semantics.neutral.divider,\n theme.colors.primary,\n renderCell,\n activateCell,\n keyboard,\n interactionPolicy === 'passive',\n readOnly,\n testID,\n );\n }}\n testID={testID}\n viewport={viewport}\n width={width}\n onViewportChange={handleViewportChange}\n />\n </View>\n );\n}\n\n/*** Render one positioned sparse cell with native/web accessible selection semantics. */\nfunction renderMatrixCell(\n cell: GridMatrixCellPlacement,\n selectedCellIds: readonly string[],\n dividerColor: string,\n selectedColor: string,\n renderCell: MatrixGridProps['renderCell'],\n activateCell: (cell: GridMatrixCellPlacement, event: unknown) => void,\n keyboard: ReturnType<typeof useMatrixGridKeyboardFocus>,\n passive: boolean,\n readOnly: boolean,\n testID: string | undefined,\n) {\n const selected = selectedCellIds.includes(cell.id);\n const canInteract = keyboard.tabStopId === cell.id;\n return (\n <MatrixGridKeyboardProxy\n onKeyDown={(event) => {\n if (keyboard.onKeyDown(cell.id, event.key, event.shiftKey)) return true;\n if (!['Enter', ' '].includes(event.key)) return false;\n if (passive || readOnly) return false;\n activateCell(cell, event);\n return true;\n }}\n >\n <NativePressable\n key={cell.id}\n accessibilityActions={[{ name: 'activate' }]}\n accessibilityLabel={`Cell ${cell.id}`}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: passive, selected }}\n disabled={passive}\n focusable={Platform.OS !== 'web' || canInteract}\n style={[\n styles.cell,\n {\n borderColor: selected || keyboard.focusedId === cell.id ? selectedColor : dividerColor,\n height: '100%',\n width: '100%',\n },\n ]}\n testID={testID === undefined ? undefined : `${testID}-cell-${cell.id}`}\n onAccessibilityAction={() => activateCell(cell, {})}\n onFocus={() => keyboard.onFocus(cell.id)}\n onPress={(event) => activateCell(cell, event)}\n ref={(node) => keyboard.registerCell(cell.id, node)}\n >\n {renderCell(cell)}\n </NativePressable>\n </MatrixGridKeyboardProxy>\n );\n}\n\n/*** Recognize range intent without changing the shared replace-or-toggle selection contract. */\nfunction isRangeSelectionEvent(event: unknown): boolean {\n if (!isRecord(event)) return false;\n if (event.shiftKey === true) return true;\n return (\n (isRecord(event.nativeEvent) && event.nativeEvent.shiftKey === true) ||\n (isRecord(event.originalEvent) && event.originalEvent.shiftKey === true)\n );\n}\n\nconst styles = StyleSheet.create({\n cell: { borderWidth: 1, height: '100%', overflow: 'hidden', width: '100%' },\n});\n\n/*** A code-first generic sparse matrix grid; formulas and domain vocabulary remain external. */\nexport const MatrixGrid = withZoraThemeScope(MatrixGridInner);\n"]}
1
+ {"version":3,"file":"MatrixGrid.js","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAGtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,IAAI,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGxF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,oGAAoG;AACpG,SAAS,eAAe,CAAC,EACvB,kBAAkB,GAAG,aAAa,EAClC,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GAAG,GAAG,EACpB,gBAAgB,GAAG,EAAE,EACr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,CAAC,IAAI,CAAC,CACnB;MAAA,EAAE,eAAe,CACnB;IAAA,EAAE,uBAAuB,CAAC,CAC3B,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,SAAS,qBAAqB,CAAC,KAAc;IAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,CACL,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC;QACpE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,QAAQ,KAAK,IAAI,CAAC,CACzE,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;CAC5E,CAAC,CAAC;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import {\n getMatrixCellPlacement,\n getVisibleMatrixCells,\n type GridMatrixCellPlacement,\n type GridViewport,\n} from '@ankhorage/grid-view';\nimport { isRecord } from '@ankhorage/utility/object';\nimport React from 'react';\nimport { Platform, Pressable as NativePressable, StyleSheet, View } from 'react-native';\n\nimport type { MatrixGridProps } from '../../../../types/matrix-grid';\nimport { GridView } from '../../../grid-view/public';\nimport { resolveSelectionEventIntent } from '../../../selection/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { createMatrixGridSparseIndex } from '../../application/createMatrixGridSparseIndex';\nimport { resolveMatrixGridContentSize } from '../../application/resolveMatrixGridContentSize';\nimport { resolveMatrixGridSelection } from '../../application/resolveMatrixGridSelection';\nimport { MatrixGridKeyboardProxy } from './MatrixGridKeyboardProxy';\nimport { useMatrixGridKeyboardFocus } from './useMatrixGridKeyboardFocus';\n\n/*** Compose the canonical GridView around released sparse matrix placement and culling geometry. */\nfunction MatrixGridInner({\n accessibilityLabel = 'Matrix grid',\n cells,\n height,\n interactionPolicy,\n layout,\n onSelectionChange,\n onViewportChange,\n overscanPixels = 160,\n protectedCellIds = [],\n readOnly = false,\n renderCell,\n selectedCellIds = [],\n selectionMode = 'single',\n testID,\n viewport: controlledViewport,\n width,\n zoomX = 1,\n zoomY = 1,\n}: MatrixGridProps) {\n const { theme } = useZoraTheme();\n const contentSize = React.useMemo(() => resolveMatrixGridContentSize(layout), [layout]);\n const initialViewport = React.useMemo<GridViewport>(\n () => ({ height, offsetX: 0, offsetY: 0, pixelsPerUnitX: zoomX, pixelsPerUnitY: zoomY, width }),\n [height, width, zoomX, zoomY],\n );\n const [uncontrolledViewport, setUncontrolledViewport] = React.useState(initialViewport);\n const viewport = controlledViewport ?? uncontrolledViewport;\n const sparseIndex = React.useMemo(\n () => createMatrixGridSparseIndex(layout, cells),\n [cells, layout],\n );\n const cellPlacements = React.useMemo(\n () => getVisibleMatrixCells(layout, cells, viewport, overscanPixels),\n [cells, layout, overscanPixels, viewport],\n );\n const [visibleIds, setVisibleIds] = React.useState<readonly string[]>([]);\n const anchorId = React.useRef<string | null>(null);\n const protectedCellIdSet = React.useMemo(() => new Set(protectedCellIds), [protectedCellIds]);\n const isNavigable = React.useCallback(\n (id: string) => !protectedCellIdSet.has(id),\n [protectedCellIdSet],\n );\n\n const handleViewportChange = React.useCallback(\n (proposal: GridViewport) => {\n if (controlledViewport === undefined) setUncontrolledViewport(proposal);\n onViewportChange?.(proposal);\n },\n [controlledViewport, onViewportChange],\n );\n\n const activateCell = React.useCallback(\n (cell: GridMatrixCellPlacement, event: unknown) => {\n if (interactionPolicy === 'passive' || readOnly || protectedCellIdSet.has(cell.id)) return;\n const intent = isRangeSelectionEvent(event)\n ? 'range'\n : resolveSelectionEventIntent(event, 'pointer');\n onSelectionChange?.(\n resolveMatrixGridSelection(\n sparseIndex.entries,\n selectedCellIds,\n cell.id,\n anchorId.current,\n intent,\n selectionMode,\n protectedCellIdSet,\n ),\n );\n if (intent !== 'range') anchorId.current = cell.id;\n },\n [\n interactionPolicy,\n onSelectionChange,\n readOnly,\n selectedCellIds,\n selectionMode,\n sparseIndex.entries,\n protectedCellIdSet,\n ],\n );\n const handleKeyboardNavigation = React.useCallback(\n (targetId: string, originId: string, shiftKey: boolean) => {\n anchorId.current ??= originId;\n if (!shiftKey) return;\n const cell = sparseIndex.cellById.get(targetId);\n if (cell) activateCell(getMatrixCellPlacement(layout, cell), { shiftKey: true });\n },\n [activateCell, layout, sparseIndex],\n );\n const keyboard = useMatrixGridKeyboardFocus(\n sparseIndex,\n interactionPolicy === 'passive',\n visibleIds,\n isNavigable,\n handleKeyboardNavigation,\n );\n const focusedPlacement = React.useMemo(() => {\n const focusedCell =\n keyboard.focusedId === null ? undefined : sparseIndex.cellById.get(keyboard.focusedId);\n return focusedCell ? getMatrixCellPlacement(layout, focusedCell) : undefined;\n }, [keyboard.focusedId, layout, sparseIndex.cellById]);\n const gridItems = React.useMemo(\n () =>\n focusedPlacement && !cellPlacements.some((cell) => cell.id === focusedPlacement.id)\n ? [...cellPlacements, focusedPlacement]\n : cellPlacements,\n [cellPlacements, focusedPlacement],\n );\n const cellById = React.useMemo(\n () => new Map(gridItems.map((cell) => [cell.id, cell])),\n [gridItems],\n );\n\n return (\n <View accessibilityLabel={accessibilityLabel}>\n <GridView\n contentHeight={contentSize.height}\n contentWidth={contentSize.width}\n height={height}\n interactionPolicy={interactionPolicy}\n items={gridItems}\n focusedItemId={keyboard.focusedId ?? undefined}\n overscanPixels={0}\n onVisibleItemIdsChange={setVisibleIds}\n renderItem={(item) => {\n const cell = cellById.get(item.id);\n if (!cell) return null;\n return renderMatrixCell(\n cell,\n selectedCellIds,\n theme.semantics.neutral.divider,\n theme.colors.primary,\n renderCell,\n activateCell,\n keyboard,\n interactionPolicy === 'passive',\n protectedCellIdSet.has(cell.id),\n readOnly,\n testID,\n );\n }}\n testID={testID}\n viewport={viewport}\n width={width}\n onViewportChange={handleViewportChange}\n />\n </View>\n );\n}\n\n/*** Render one positioned sparse cell with native/web accessible selection semantics. */\nfunction renderMatrixCell(\n cell: GridMatrixCellPlacement,\n selectedCellIds: readonly string[],\n dividerColor: string,\n selectedColor: string,\n renderCell: MatrixGridProps['renderCell'],\n activateCell: (cell: GridMatrixCellPlacement, event: unknown) => void,\n keyboard: ReturnType<typeof useMatrixGridKeyboardFocus>,\n passive: boolean,\n protectedCell: boolean,\n readOnly: boolean,\n testID: string | undefined,\n) {\n const selected = selectedCellIds.includes(cell.id);\n const canInteract = keyboard.tabStopId === cell.id;\n return (\n <MatrixGridKeyboardProxy\n onKeyDown={(event) => {\n if (keyboard.onKeyDown(cell.id, event.key, event.shiftKey)) return true;\n if (!['Enter', ' '].includes(event.key)) return false;\n if (passive || protectedCell || readOnly) return false;\n activateCell(cell, event);\n return true;\n }}\n >\n <NativePressable\n key={cell.id}\n accessibilityActions={[{ name: 'activate' }]}\n accessibilityLabel={`Cell ${cell.id}`}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: passive || protectedCell, selected }}\n disabled={passive || protectedCell}\n focusable={!protectedCell && (Platform.OS !== 'web' || canInteract)}\n style={[\n styles.cell,\n {\n borderColor: selected || keyboard.focusedId === cell.id ? selectedColor : dividerColor,\n height: '100%',\n width: '100%',\n },\n ]}\n testID={testID === undefined ? undefined : `${testID}-cell-${cell.id}`}\n onAccessibilityAction={() => activateCell(cell, {})}\n onFocus={() => keyboard.onFocus(cell.id)}\n onPress={(event) => activateCell(cell, event)}\n ref={(node) => keyboard.registerCell(cell.id, node)}\n >\n {renderCell(cell)}\n </NativePressable>\n </MatrixGridKeyboardProxy>\n );\n}\n\n/*** Recognize range intent without changing the shared replace-or-toggle selection contract. */\nfunction isRangeSelectionEvent(event: unknown): boolean {\n if (!isRecord(event)) return false;\n if (event.shiftKey === true) return true;\n return (\n (isRecord(event.nativeEvent) && event.nativeEvent.shiftKey === true) ||\n (isRecord(event.originalEvent) && event.originalEvent.shiftKey === true)\n );\n}\n\nconst styles = StyleSheet.create({\n cell: { borderWidth: 1, height: '100%', overflow: 'hidden', width: '100%' },\n});\n\n/*** A code-first generic sparse matrix grid; formulas and domain vocabulary remain external. */\nexport const MatrixGrid = withZoraThemeScope(MatrixGridInner);\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { MatrixGridSparseIndex } from '../../application/createMatrixGridSparseIndex';
2
2
  /*** Keep one roving focus target and restore it after GridView virtualizes a sparse cell. */
3
- export declare function useMatrixGridKeyboardFocus(index: MatrixGridSparseIndex, disabled: boolean, visibleIds: readonly string[], onNavigate: (targetId: string, originId: string, shiftKey: boolean) => void): {
3
+ export declare function useMatrixGridKeyboardFocus(index: MatrixGridSparseIndex, disabled: boolean, visibleIds: readonly string[], isNavigable: (id: string) => boolean, onNavigate: (targetId: string, originId: string, shiftKey: boolean) => void): {
4
4
  focusedId: string | null;
5
5
  onFocus: (id: string) => void;
6
6
  onKeyDown: (id: string, key: string, shiftKey: boolean) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useMatrixGridKeyboardFocus.d.ts","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAG3F,6FAA6F;AAC7F,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,EAC5B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI;;kBAYpC,MAAM;oBAmBtC,MAAM,OAAO,MAAM,YAAY,OAAO,KAAG,OAAO;uBAbX,MAAM,QAAQ,aAAa,GAAG,IAAI;;EAqC/E;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
1
+ {"version":3,"file":"useMatrixGridKeyboardFocus.d.ts","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAG3F,6FAA6F;AAC7F,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,EAC5B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EACpC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI;;kBAsBpC,MAAM;oBAmBtC,MAAM,OAAO,MAAM,YAAY,OAAO,KAAG,OAAO;uBAbX,MAAM,QAAQ,aAAa,GAAG,IAAI;;EAqC/E;AAkBD,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
@@ -1,15 +1,24 @@
1
1
  import React from 'react';
2
2
  import { getMatrixGridNextFocusId } from '../../application/getMatrixGridNextFocusId';
3
3
  /*** Keep one roving focus target and restore it after GridView virtualizes a sparse cell. */
4
- export function useMatrixGridKeyboardFocus(index, disabled, visibleIds, onNavigate) {
4
+ export function useMatrixGridKeyboardFocus(index, disabled, visibleIds, isNavigable, onNavigate) {
5
5
  const [focusedId, setFocusedId] = React.useState(null);
6
6
  const focusedRef = React.useRef(null);
7
7
  const pendingFocusRef = React.useRef(null);
8
8
  const cellRefs = React.useRef(new Map());
9
9
  const visibleIdSet = React.useMemo(() => new Set(visibleIds), [visibleIds]);
10
- const tabStopId = focusedId !== null && visibleIdSet.has(focusedId)
10
+ const tabStopId = focusedId !== null && visibleIdSet.has(focusedId) && isNavigable(focusedId)
11
11
  ? focusedId
12
- : visibleIds.find((id) => index.positionById.has(id));
12
+ : visibleIds.find((id) => index.positionById.has(id) && isNavigable(id));
13
+ React.useEffect(() => {
14
+ if (focusedRef.current !== null && !isNavigable(focusedRef.current)) {
15
+ focusedRef.current = null;
16
+ setFocusedId(null);
17
+ }
18
+ if (pendingFocusRef.current !== null && !isNavigable(pendingFocusRef.current)) {
19
+ pendingFocusRef.current = null;
20
+ }
21
+ }, [isNavigable]);
13
22
  const onFocus = React.useCallback((id) => {
14
23
  pendingFocusRef.current = null;
15
24
  focusedRef.current = id;
@@ -31,7 +40,7 @@ export function useMatrixGridKeyboardFocus(index, disabled, visibleIds, onNaviga
31
40
  return false;
32
41
  }
33
42
  const originId = focusedRef.current ?? id;
34
- const nextId = getMatrixGridNextFocusId(index, originId, key);
43
+ const nextId = resolveNextNavigableId(index, originId, key, isNavigable);
35
44
  if (nextId === null || nextId === originId)
36
45
  return true;
37
46
  focusedRef.current = nextId;
@@ -44,7 +53,18 @@ export function useMatrixGridKeyboardFocus(index, disabled, visibleIds, onNaviga
44
53
  mounted.focus();
45
54
  }
46
55
  return true;
47
- }, [disabled, index, onNavigate]);
56
+ }, [disabled, index, isNavigable, onNavigate]);
48
57
  return { focusedId, onFocus, onKeyDown, registerCell, tabStopId };
49
58
  }
59
+ /*** Skip protected sparse cells while retaining the nearest deterministic directional navigation. */
60
+ function resolveNextNavigableId(index, originId, key, isNavigable) {
61
+ let candidate = getMatrixGridNextFocusId(index, originId, key);
62
+ while (candidate !== null && candidate !== originId && !isNavigable(candidate)) {
63
+ const nextCandidate = getMatrixGridNextFocusId(index, candidate, key);
64
+ if (nextCandidate === candidate)
65
+ return originId;
66
+ candidate = nextCandidate;
67
+ }
68
+ return candidate;
69
+ }
50
70
  //# sourceMappingURL=useMatrixGridKeyboardFocus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMatrixGridKeyboardFocus.js","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,6FAA6F;AAC7F,MAAM,UAAU,0BAA0B,CACxC,KAA4B,EAC5B,QAAiB,EACjB,UAA6B,EAC7B,UAA2E;IAE3E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACtE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IACrD,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,EAAyB,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,MAAM,SAAS,GACb,SAAS,KAAK,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;QAC/C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1D,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAC/C,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QAC/B,UAAU,CAAC,OAAO,GAAG,EAAE,CAAC;QACxB,YAAY,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC,EA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AAC;QAC7C,IAAI,OAAO,EAAE,CAAC;YACZ,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;YAC/B,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,EACD,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,CAC9B,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AACpE,CAAC","sourcesContent":["import React from 'react';\n\nimport type { MatrixGridSparseIndex } from '../../application/createMatrixGridSparseIndex';\nimport { getMatrixGridNextFocusId } from '../../application/getMatrixGridNextFocusId';\n\n/*** Keep one roving focus target and restore it after GridView virtualizes a sparse cell. */\nexport function useMatrixGridKeyboardFocus(\n index: MatrixGridSparseIndex,\n disabled: boolean,\n visibleIds: readonly string[],\n onNavigate: (targetId: string, originId: string, shiftKey: boolean) => void,\n) {\n const [focusedId, setFocusedId] = React.useState<string | null>(null);\n const focusedRef = React.useRef<string | null>(null);\n const pendingFocusRef = React.useRef<string | null>(null);\n const cellRefs = React.useRef(new Map<string, FocusableCell>());\n const visibleIdSet = React.useMemo(() => new Set(visibleIds), [visibleIds]);\n const tabStopId =\n focusedId !== null && visibleIdSet.has(focusedId)\n ? focusedId\n : visibleIds.find((id) => index.positionById.has(id));\n\n const onFocus = React.useCallback((id: string) => {\n pendingFocusRef.current = null;\n focusedRef.current = id;\n setFocusedId(id);\n }, []);\n\n const registerCell = React.useCallback((id: string, node: FocusableCell | null) => {\n if (node === null) {\n cellRefs.current.delete(id);\n return;\n }\n cellRefs.current.set(id, node);\n if (pendingFocusRef.current === id) {\n pendingFocusRef.current = null;\n node.focus();\n }\n }, []);\n\n const onKeyDown = React.useCallback(\n (id: string, key: string, shiftKey: boolean): boolean => {\n if (disabled || !['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(key)) {\n return false;\n }\n const originId = focusedRef.current ?? id;\n const nextId = getMatrixGridNextFocusId(index, originId, key);\n if (nextId === null || nextId === originId) return true;\n\n focusedRef.current = nextId;\n pendingFocusRef.current = nextId;\n setFocusedId(nextId);\n onNavigate(nextId, originId, shiftKey);\n\n const mounted = cellRefs.current.get(nextId);\n if (mounted) {\n pendingFocusRef.current = null;\n mounted.focus();\n }\n return true;\n },\n [disabled, index, onNavigate],\n );\n\n return { focusedId, onFocus, onKeyDown, registerCell, tabStopId };\n}\n\ninterface FocusableCell {\n focus: () => void;\n}\n"]}
1
+ {"version":3,"file":"useMatrixGridKeyboardFocus.js","sourceRoot":"","sources":["../../../../../src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,6FAA6F;AAC7F,MAAM,UAAU,0BAA0B,CACxC,KAA4B,EAC5B,QAAiB,EACjB,UAA6B,EAC7B,WAAoC,EACpC,UAA2E;IAE3E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACtE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IACrD,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,EAAyB,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,MAAM,SAAS,GACb,SAAS,KAAK,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC;QACzE,CAAC,CAAC,SAAS;QAC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AoC;IAEpC,IAAI,SAAS,GAAG,wBAAwB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/D,OAAO,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/E,MAAM,aAAa,GAAG,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QACtE,IAAI,aAAa,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC;QACjD,SAAS,GAAG,aAAa,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import React from 'react';\n\nimport type { MatrixGridSparseIndex } from '../../application/createMatrixGridSparseIndex';\nimport { getMatrixGridNextFocusId } from '../../application/getMatrixGridNextFocusId';\n\n/*** Keep one roving focus target and restore it after GridView virtualizes a sparse cell. */\nexport function useMatrixGridKeyboardFocus(\n index: MatrixGridSparseIndex,\n disabled: boolean,\n visibleIds: readonly string[],\n isNavigable: (id: string) => boolean,\n onNavigate: (targetId: string, originId: string, shiftKey: boolean) => void,\n) {\n const [focusedId, setFocusedId] = React.useState<string | null>(null);\n const focusedRef = React.useRef<string | null>(null);\n const pendingFocusRef = React.useRef<string | null>(null);\n const cellRefs = React.useRef(new Map<string, FocusableCell>());\n const visibleIdSet = React.useMemo(() => new Set(visibleIds), [visibleIds]);\n const tabStopId =\n focusedId !== null && visibleIdSet.has(focusedId) && isNavigable(focusedId)\n ? focusedId\n : visibleIds.find((id) => index.positionById.has(id) && isNavigable(id));\n\n React.useEffect(() => {\n if (focusedRef.current !== null && !isNavigable(focusedRef.current)) {\n focusedRef.current = null;\n setFocusedId(null);\n }\n if (pendingFocusRef.current !== null && !isNavigable(pendingFocusRef.current)) {\n pendingFocusRef.current = null;\n }\n }, [isNavigable]);\n\n const onFocus = React.useCallback((id: string) => {\n pendingFocusRef.current = null;\n focusedRef.current = id;\n setFocusedId(id);\n }, []);\n\n const registerCell = React.useCallback((id: string, node: FocusableCell | null) => {\n if (node === null) {\n cellRefs.current.delete(id);\n return;\n }\n cellRefs.current.set(id, node);\n if (pendingFocusRef.current === id) {\n pendingFocusRef.current = null;\n node.focus();\n }\n }, []);\n\n const onKeyDown = React.useCallback(\n (id: string, key: string, shiftKey: boolean): boolean => {\n if (disabled || !['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(key)) {\n return false;\n }\n const originId = focusedRef.current ?? id;\n const nextId = resolveNextNavigableId(index, originId, key, isNavigable);\n if (nextId === null || nextId === originId) return true;\n\n focusedRef.current = nextId;\n pendingFocusRef.current = nextId;\n setFocusedId(nextId);\n onNavigate(nextId, originId, shiftKey);\n\n const mounted = cellRefs.current.get(nextId);\n if (mounted) {\n pendingFocusRef.current = null;\n mounted.focus();\n }\n return true;\n },\n [disabled, index, isNavigable, onNavigate],\n );\n\n return { focusedId, onFocus, onKeyDown, registerCell, tabStopId };\n}\n\n/*** Skip protected sparse cells while retaining the nearest deterministic directional navigation. */\nfunction resolveNextNavigableId(\n index: MatrixGridSparseIndex,\n originId: string,\n key: string,\n isNavigable: (id: string) => boolean,\n): string | null {\n let candidate = getMatrixGridNextFocusId(index, originId, key);\n while (candidate !== null && candidate !== originId && !isNavigable(candidate)) {\n const nextCandidate = getMatrixGridNextFocusId(index, candidate, key);\n if (nextCandidate === candidate) return originId;\n candidate = nextCandidate;\n }\n return candidate;\n}\n\ninterface FocusableCell {\n focus: () => void;\n}\n"]}
@@ -2,7 +2,7 @@ import { type SelectionIntent } from '@ankhorage/utility/selection';
2
2
  import type { SelectionMode } from '../../../types/selection';
3
3
  type MatrixGridSelectionIntent = SelectionIntent | 'range';
4
4
  /*** Apply ZORA's canonical selection intent while retaining the configured selection mode. */
5
- export declare function resolveMatrixGridSelection(cells: readonly MatrixGridSelectionCell[], selectedIds: readonly string[], cellId: string, anchorId: string | null, intent: MatrixGridSelectionIntent, mode: SelectionMode): readonly string[];
5
+ export declare function resolveMatrixGridSelection(cells: readonly MatrixGridSelectionCell[], selectedIds: readonly string[], cellId: string, anchorId: string | null, intent: MatrixGridSelectionIntent, mode: SelectionMode, protectedCellIds: ReadonlySet<string>): readonly string[];
6
6
  type MatrixGridSelectionCell = Readonly<{
7
7
  columnIndex: number;
8
8
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"resolveMatrixGridSelection.d.ts","sourceRoot":"","sources":["../../../../src/features/matrix-grid/application/resolveMatrixGridSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,yBAAyB,GAAG,eAAe,GAAG,OAAO,CAAC;AAE3D,8FAA8F;AAC9F,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,uBAAuB,EAAE,EACzC,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE,aAAa,GAClB,SAAS,MAAM,EAAE,CAiBnB;AAED,KAAK,uBAAuB,GAAG,QAAQ,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC"}
1
+ {"version":3,"file":"resolveMatrixGridSelection.d.ts","sourceRoot":"","sources":["../../../../src/features/matrix-grid/application/resolveMatrixGridSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,yBAAyB,GAAG,eAAe,GAAG,OAAO,CAAC;AAE3D,8FAA8F;AAC9F,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,uBAAuB,EAAE,EACzC,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE,aAAa,EACnB,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,GACpC,SAAS,MAAM,EAAE,CAmBnB;AAED,KAAK,uBAAuB,GAAG,QAAQ,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { applySelectionIntent } from '@ankhorage/utility/selection';
2
2
  /*** Apply ZORA's canonical selection intent while retaining the configured selection mode. */
3
- export function resolveMatrixGridSelection(cells, selectedIds, cellId, anchorId, intent, mode) {
3
+ export function resolveMatrixGridSelection(cells, selectedIds, cellId, anchorId, intent, mode, protectedCellIds) {
4
+ if (protectedCellIds.has(cellId))
5
+ return selectedIds;
4
6
  if (mode === 'single')
5
7
  return applySelectionIntent(selectedIds, cellId, 'replace');
6
8
  if (intent !== 'range')
@@ -10,7 +12,8 @@ export function resolveMatrixGridSelection(cells, selectedIds, cellId, anchorId,
10
12
  if (!anchor || !target)
11
13
  return applySelectionIntent(selectedIds, cellId, 'replace');
12
14
  return cells
13
- .filter((cell) => cell.rowIndex >= Math.min(anchor.rowIndex, target.rowIndex) &&
15
+ .filter((cell) => !protectedCellIds.has(cell.id) &&
16
+ cell.rowIndex >= Math.min(anchor.rowIndex, target.rowIndex) &&
14
17
  cell.rowIndex <= Math.max(anchor.rowIndex, target.rowIndex) &&
15
18
  cell.columnIndex >= Math.min(anchor.columnIndex, target.columnIndex) &&
16
19
  cell.columnIndex <= Math.max(anchor.columnIndex, target.columnIndex))
@@ -1 +1 @@
1
- {"version":3,"file":"resolveMatrixGridSelection.js","sourceRoot":"","sources":["../../../../src/features/matrix-grid/application/resolveMatrixG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ACvE;SACA,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import { applySelectionIntent, type SelectionIntent } from '@ankhorage/utility/selection';\n\nimport type { SelectionMode } from '../../../types/selection';\n\ntype MatrixGridSelectionIntent = SelectionIntent | 'range';\n\n/*** Apply ZORA's canonical selection intent while retaining the configured selection mode. */\nexport function resolveMatrixGridSelection(\n cells: readonly MatrixGridSelectionCell[],\n selectedIds: readonly string[],\n cellId: string,\n anchorId: string | null,\n intent: MatrixGridSelectionIntent,\n mode: SelectionMode,\n): readonly string[] {\n if (mode === 'single') return applySelectionIntent(selectedIds, cellId, 'replace');\n if (intent !== 'range') return applySelectionIntent(selectedIds, cellId, intent);\n\n const anchor = cells.find((cell) => cell.id === anchorId);\n const target = cells.find((cell) => cell.id === cellId);\n if (!anchor || !target) return applySelectionIntent(selectedIds, cellId, 'replace');\n\n return cells\n .filter(\n (cell) =>\n cell.rowIndex >= Math.min(anchor.rowIndex, target.rowIndex) &&\n cell.rowIndex <= Math.max(anchor.rowIndex, target.rowIndex) &&\n cell.columnIndex >= Math.min(anchor.columnIndex, target.columnIndex) &&\n cell.columnIndex <= Math.max(anchor.columnIndex, target.columnIndex),\n )\n .map((cell) => cell.id);\n}\n\ntype MatrixGridSelectionCell = Readonly<{\n columnIndex: number;\n id: string;\n rowIndex: number;\n}>;\n"]}
1
+ {"version":3,"file":"resolveMatrixGridSelection.js","sourceRoot":"","sources":["../../../../src/features/matrix-grid/application/resolveMatrixGridSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,8BAA8B,CAAC;AAM1F,8FAA8F;AAC9F,MAAM,UAAU,0BAA0B,CACxC,KAAyC,EACzC,WAA8B,EAC9B,MAAc,EACd,QAAuB,EACvB,MAAiC,EACjC,IAAmB,EACnB,gBAAqC;IAErC,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC;Q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ntent, type SelectionIntent } from '@ankhorage/utility/selection';\n\nimport type { SelectionMode } from '../../../types/selection';\n\ntype MatrixGridSelectionIntent = SelectionIntent | 'range';\n\n/*** Apply ZORA's canonical selection intent while retaining the configured selection mode. */\nexport function resolveMatrixGridSelection(\n cells: readonly MatrixGridSelectionCell[],\n selectedIds: readonly string[],\n cellId: string,\n anchorId: string | null,\n intent: MatrixGridSelectionIntent,\n mode: SelectionMode,\n protectedCellIds: ReadonlySet<string>,\n): readonly string[] {\n if (protectedCellIds.has(cellId)) return selectedIds;\n if (mode === 'single') return applySelectionIntent(selectedIds, cellId, 'replace');\n if (intent !== 'range') return applySelectionIntent(selectedIds, cellId, intent);\n\n const anchor = cells.find((cell) => cell.id === anchorId);\n const target = cells.find((cell) => cell.id === cellId);\n if (!anchor || !target) return applySelectionIntent(selectedIds, cellId, 'replace');\n\n return cells\n .filter(\n (cell) =>\n !protectedCellIds.has(cell.id) &&\n cell.rowIndex >= Math.min(anchor.rowIndex, target.rowIndex) &&\n cell.rowIndex <= Math.max(anchor.rowIndex, target.rowIndex) &&\n cell.columnIndex >= Math.min(anchor.columnIndex, target.columnIndex) &&\n cell.columnIndex <= Math.max(anchor.columnIndex, target.columnIndex),\n )\n .map((cell) => cell.id);\n}\n\ntype MatrixGridSelectionCell = Readonly<{\n columnIndex: number;\n id: string;\n rowIndex: number;\n}>;\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ZoraComponentRegistry } from '../../types/registry';
2
+ /*** The core ZORA runtime component registry, excluding separately selected feature entries such as Reader. */
3
+ export declare const ZORA_BASE_COMPONENT_REGISTRY: ZoraComponentRegistry;
4
+ //# sourceMappingURL=ZORA_BASE_COMPONENT_REGISTRY.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZORA_BASE_COMPONENT_REGISTRY.d.ts","sourceRoot":"","sources":["../../../src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAuOlE,+GAA+G;AAC/G,eAAO,MAAM,4BAA4B,EAAE,qBAAqD,CAAC"}
@@ -0,0 +1,187 @@
1
+ import { Accordion, AccordionItem } from '../accordion/public';
2
+ import { ActivityIndicator } from '../activity-indicator/public';
3
+ import { AppBar } from '../app-bar/public';
4
+ import { AppHeader } from '../app-header/public';
5
+ import { AuthScreen, ForgotPasswordForm, OAuthProviderButton, OAuthProviderList, OtpForm, SignInForm, SignUpForm, } from '../auth/public';
6
+ import { Avatar, AvatarGroup } from '../avatar/public';
7
+ import { Badge } from '../badge/public';
8
+ import { BottomSheet } from '../bottom-sheet/public';
9
+ import { Breadcrumbs } from '../breadcrumbs/public';
10
+ import { Button, ButtonGroup, IconButton } from '../button/public';
11
+ import { Card, MediaCard, MetricCard, PostCard, ProductCard } from '../card/public';
12
+ import { ChatListItem, MessageBubble } from '../chat/public';
13
+ import { ChessBoard, OpeningBook } from '../chess/public';
14
+ import { Chip, ChipGroup } from '../chip/public';
15
+ import { CollectionEditor } from '../collection-editor/public';
16
+ import { ContentRail } from '../content-rail/public';
17
+ import { DataTable } from '../data-table/public';
18
+ import { DatePicker } from '../date-picker/public';
19
+ import { Dialog } from '../dialog/public';
20
+ import { EmptyState } from '../empty-state/public';
21
+ import { Explorer, FileExplorer, MediaExplorer } from '../explorer/public';
22
+ import { Checkbox, CheckboxGroup } from '../form/checkbox/public';
23
+ import { Field, Form, FormActions, FormError } from '../form/public';
24
+ import { Radio, RadioGroup } from '../form/radio/public';
25
+ import { SearchInput } from '../form/search-input/public';
26
+ import { Select } from '../form/select/public';
27
+ import { Switch } from '../form/switch/public';
28
+ import { TextInput } from '../form/text-input/public';
29
+ import { Game, GameEntity, GameField, GameInputZone, GameMeasurementProbe, GameOverlay, } from '../game/public';
30
+ import { Gradient } from '../gradient/public';
31
+ import { GridInteractions } from '../grid-interactions/public';
32
+ import { GridLineOverlay, GridRuler } from '../grid-rulers/public';
33
+ import { GridView, TileGrid } from '../grid-view/public';
34
+ import { Hero } from '../hero/public';
35
+ import { Icon } from '../icon/public';
36
+ import { Image } from '../image/public';
37
+ import { KeyboardAvoidingView } from '../keyboard-avoiding-view/public';
38
+ import { AppShell, Divider, Grid, Screen, ScrollView, View } from '../layout/public';
39
+ import { FlatList, List, ListItem, ListSection, SectionList } from '../list/public';
40
+ import { MatrixGrid } from '../matrix-grid/public';
41
+ import { MissingElement } from '../missing-element/public';
42
+ import { Pagination } from '../pagination/public';
43
+ import { PaletteItem } from '../palette-item/public';
44
+ import { PopoverMenu } from '../popover-menu/public';
45
+ import { Progress, ProgressRing } from '../progress/public';
46
+ import { Rating } from '../rating/public';
47
+ import { BarcodeScannerView, CameraPermissionView, ScanOverlay } from '../scanner/public';
48
+ import { ScreenSection, SectionHeader } from '../section/public';
49
+ import { SelectableItem } from '../selection/public';
50
+ import { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from '../skeleton/public';
51
+ import { SpatialGrid } from '../spatial-grid/public';
52
+ import { Surface } from '../surface/public';
53
+ import { CardBack, CardHand, PlayingCard, PokerTrainingTable, TabletopTable, } from '../tabletop/public';
54
+ import { Tab, TabList, TabPanel, Tabs } from '../tabs/public';
55
+ import { ThemeModeToggle } from '../theme/adapters/inbound/ThemeModeToggle';
56
+ import { TimeGrid } from '../time-grid/public';
57
+ import { TimePicker } from '../time-picker/public';
58
+ import { Timeline } from '../timeline/public';
59
+ import { Toast } from '../toast/public';
60
+ import { Toolbar } from '../toolbar/public';
61
+ import { TreeItem, TreeView } from '../tree-view/public';
62
+ import { Heading, Text } from '../typography/public';
63
+ import { Uploader } from '../uploader/public';
64
+ const _ZORA_BASE_COMPONENT_REGISTRY = {
65
+ Accordion,
66
+ AccordionItem,
67
+ ActivityIndicator,
68
+ AppBar,
69
+ AppHeader,
70
+ Avatar,
71
+ AvatarGroup,
72
+ Badge,
73
+ Breadcrumbs,
74
+ Button,
75
+ ButtonGroup,
76
+ Card,
77
+ Checkbox,
78
+ CheckboxGroup,
79
+ Chip,
80
+ ChipGroup,
81
+ DataTable,
82
+ DatePicker,
83
+ Dialog,
84
+ Form,
85
+ FormActions,
86
+ FormError,
87
+ Field,
88
+ Gradient,
89
+ Game,
90
+ GameEntity,
91
+ GameField,
92
+ GameInputZone,
93
+ GameMeasurementProbe,
94
+ GameOverlay,
95
+ Heading,
96
+ Icon,
97
+ IconButton,
98
+ Image,
99
+ KeyboardAvoidingView,
100
+ TextInput,
101
+ MediaCard,
102
+ MetricCard,
103
+ Pagination,
104
+ PopoverMenu,
105
+ Progress,
106
+ ProgressRing,
107
+ Radio,
108
+ RadioGroup,
109
+ Rating,
110
+ SearchInput,
111
+ Select,
112
+ Switch,
113
+ Skeleton,
114
+ SkeletonCard,
115
+ SkeletonList,
116
+ SkeletonText,
117
+ Tab,
118
+ TabList,
119
+ TabPanel,
120
+ Tabs,
121
+ Text,
122
+ TimePicker,
123
+ Toast,
124
+ Toolbar,
125
+ Uploader,
126
+ BottomSheet,
127
+ FlatList,
128
+ SectionList,
129
+ ScrollView,
130
+ View,
131
+ ThemeModeToggle,
132
+ Divider,
133
+ Grid,
134
+ Surface,
135
+ AppShell,
136
+ Screen,
137
+ ScreenSection,
138
+ AuthScreen,
139
+ ForgotPasswordForm,
140
+ OAuthProviderButton,
141
+ OAuthProviderList,
142
+ OtpForm,
143
+ SignInForm,
144
+ SignUpForm,
145
+ ChatListItem,
146
+ ChessBoard,
147
+ CollectionEditor,
148
+ ContentRail,
149
+ EmptyState,
150
+ Explorer,
151
+ FileExplorer,
152
+ GridLineOverlay,
153
+ GridRuler,
154
+ GridInteractions,
155
+ GridView,
156
+ TileGrid,
157
+ TimeGrid,
158
+ MatrixGrid,
159
+ MediaExplorer,
160
+ Hero,
161
+ List,
162
+ ListItem,
163
+ ListSection,
164
+ MessageBubble,
165
+ OpeningBook,
166
+ MissingElement,
167
+ PostCard,
168
+ ProductCard,
169
+ BarcodeScannerView,
170
+ CameraPermissionView,
171
+ ScanOverlay,
172
+ SectionHeader,
173
+ SelectableItem,
174
+ SpatialGrid,
175
+ PaletteItem,
176
+ CardBack,
177
+ CardHand,
178
+ PlayingCard,
179
+ TabletopTable,
180
+ PokerTrainingTable,
181
+ Timeline,
182
+ TreeItem,
183
+ TreeView,
184
+ };
185
+ /*** The core ZORA runtime component registry, excluding separately selected feature entries such as Reader. */
186
+ export const ZORA_BASE_COMPONENT_REGISTRY = _ZORA_BASE_COMPONENT_REGISTRY;
187
+ //# sourceMappingURL=ZORA_BASE_COMPONENT_REGISTRY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZORA_BASE_COMPONENT_REGISTRY.js","sourceRoot":"","sources":["../../../src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,aAAa,E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W;IACX,MAAM;IACN,MAAM;IACN,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,GAAG;IACH,OAAO;IACP,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,KAAK;IACL,OAAO;IACP,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,WAAW;IACX,UAAU;IACV,IAAI;IACJ,eAAe;IACf,OAAO;IACP,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,MAAM;IACN,aAAa;IACb,UAAU;IACV,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,OAAO;IACP,UAAU;IACV,UAAU;IACV,YAAY;IACZ,UAAU;IACV,gBAAgB;IAChB,WAAW;IACX,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,SAAS;IACT,gBAAgB;IAChB,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,aAAa;IACb,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,WAAW;IACX,aAAa;IACb,WAAW;IACX,cAAc;IACd,QAAQ;IACR,WAAW;IACX,kBAAkB;IAClB,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,cAAc;IACd,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,aAAa;IACb,kBAAkB;IAClB,QAAQ;IACR,QAAQ;IACR,QAAQ;CACgC,CAAC;AAE3C,+GAA+G;AAC/G,MAAM,CAAC,MAAM,4BAA4B,GAA0B,6BAA6B,CAAC","sourcesContent":["import type { InteractionPolicyProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraComponentRegistry } from '../../types/registry';\nimport { Accordion, AccordionItem } from '../accordion/public';\nimport { ActivityIndicator } from '../activity-indicator/public';\nimport { AppBar } from '../app-bar/public';\nimport { AppHeader } from '../app-header/public';\nimport {\n AuthScreen,\n ForgotPasswordForm,\n OAuthProviderButton,\n OAuthProviderList,\n OtpForm,\n SignInForm,\n SignUpForm,\n} from '../auth/public';\nimport { Avatar, AvatarGroup } from '../avatar/public';\nimport { Badge } from '../badge/public';\nimport { BottomSheet } from '../bottom-sheet/public';\nimport { Breadcrumbs } from '../breadcrumbs/public';\nimport { Button, ButtonGroup, IconButton } from '../button/public';\nimport { Card, MediaCard, MetricCard, PostCard, ProductCard } from '../card/public';\nimport { ChatListItem, MessageBubble } from '../chat/public';\nimport { ChessBoard, OpeningBook } from '../chess/public';\nimport { Chip, ChipGroup } from '../chip/public';\nimport { CollectionEditor } from '../collection-editor/public';\nimport { ContentRail } from '../content-rail/public';\nimport { DataTable } from '../data-table/public';\nimport { DatePicker } from '../date-picker/public';\nimport { Dialog } from '../dialog/public';\nimport { EmptyState } from '../empty-state/public';\nimport { Explorer, FileExplorer, MediaExplorer } from '../explorer/public';\nimport { Checkbox, CheckboxGroup } from '../form/checkbox/public';\nimport { Field, Form, FormActions, FormError } from '../form/public';\nimport { Radio, RadioGroup } from '../form/radio/public';\nimport { SearchInput } from '../form/search-input/public';\nimport { Select } from '../form/select/public';\nimport { Switch } from '../form/switch/public';\nimport { TextInput } from '../form/text-input/public';\nimport {\n Game,\n GameEntity,\n GameField,\n GameInputZone,\n GameMeasurementProbe,\n GameOverlay,\n} from '../game/public';\nimport { Gradient } from '../gradient/public';\nimport { GridInteractions } from '../grid-interactions/public';\nimport { GridLineOverlay, GridRuler } from '../grid-rulers/public';\nimport { GridView, TileGrid } from '../grid-view/public';\nimport { Hero } from '../hero/public';\nimport { Icon } from '../icon/public';\nimport { Image } from '../image/public';\nimport { KeyboardAvoidingView } from '../keyboard-avoiding-view/public';\nimport { AppShell, Divider, Grid, Screen, ScrollView, View } from '../layout/public';\nimport { FlatList, List, ListItem, ListSection, SectionList } from '../list/public';\nimport { MatrixGrid } from '../matrix-grid/public';\nimport { MissingElement } from '../missing-element/public';\nimport { Pagination } from '../pagination/public';\nimport { PaletteItem } from '../palette-item/public';\nimport { PopoverMenu } from '../popover-menu/public';\nimport { Progress, ProgressRing } from '../progress/public';\nimport { Rating } from '../rating/public';\nimport { BarcodeScannerView, CameraPermissionView, ScanOverlay } from '../scanner/public';\nimport { ScreenSection, SectionHeader } from '../section/public';\nimport { SelectableItem } from '../selection/public';\nimport { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from '../skeleton/public';\nimport { SpatialGrid } from '../spatial-grid/public';\nimport { Surface } from '../surface/public';\nimport {\n CardBack,\n CardHand,\n PlayingCard,\n PokerTrainingTable,\n TabletopTable,\n} from '../tabletop/public';\nimport { Tab, TabList, TabPanel, Tabs } from '../tabs/public';\nimport { ThemeModeToggle } from '../theme/adapters/inbound/ThemeModeToggle';\nimport { TimeGrid } from '../time-grid/public';\nimport { TimePicker } from '../time-picker/public';\nimport { Timeline } from '../timeline/public';\nimport { Toast } from '../toast/public';\nimport { Toolbar } from '../toolbar/public';\nimport { TreeItem, TreeView } from '../tree-view/public';\nimport { Heading, Text } from '../typography/public';\nimport { Uploader } from '../uploader/public';\n\ntype ComponentPropsFor<K extends keyof typeof _ZORA_BASE_COMPONENT_REGISTRY> = React.ComponentProps<\n (typeof _ZORA_BASE_COMPONENT_REGISTRY)[K]\n>;\n\ntype AcceptsSurfaceInteractionPolicyProps<P> = 'interactionPolicy' extends keyof P\n ? InteractionPolicyProps extends Pick<P, 'interactionPolicy'>\n ? Pick<P, 'interactionPolicy'> extends InteractionPolicyProps\n ? true\n : false\n : false\n : false;\n\ntype RegistryInteractionPolicyContract = {\n [K in keyof typeof _ZORA_BASE_COMPONENT_REGISTRY]: AcceptsSurfaceInteractionPolicyProps<\n ComponentPropsFor<K>\n >;\n};\n\ntype _AssertTrue<T extends true> = T;\ntype _RegistryInteractionPolicyCheck = _AssertTrue<\n RegistryInteractionPolicyContract[keyof typeof _ZORA_BASE_COMPONENT_REGISTRY]\n>;\n\nconst _ZORA_BASE_COMPONENT_REGISTRY = {\n Accordion,\n AccordionItem,\n ActivityIndicator,\n AppBar,\n AppHeader,\n Avatar,\n AvatarGroup,\n Badge,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n Checkbox,\n CheckboxGroup,\n Chip,\n ChipGroup,\n DataTable,\n DatePicker,\n Dialog,\n Form,\n FormActions,\n FormError,\n Field,\n Gradient,\n Game,\n GameEntity,\n GameField,\n GameInputZone,\n GameMeasurementProbe,\n GameOverlay,\n Heading,\n Icon,\n IconButton,\n Image,\n KeyboardAvoidingView,\n TextInput,\n MediaCard,\n MetricCard,\n Pagination,\n PopoverMenu,\n Progress,\n ProgressRing,\n Radio,\n RadioGroup,\n Rating,\n SearchInput,\n Select,\n Switch,\n Skeleton,\n SkeletonCard,\n SkeletonList,\n SkeletonText,\n Tab,\n TabList,\n TabPanel,\n Tabs,\n Text,\n TimePicker,\n Toast,\n Toolbar,\n Uploader,\n BottomSheet,\n FlatList,\n SectionList,\n ScrollView,\n View,\n ThemeModeToggle,\n Divider,\n Grid,\n Surface,\n AppShell,\n Screen,\n ScreenSection,\n AuthScreen,\n ForgotPasswordForm,\n OAuthProviderButton,\n OAuthProviderList,\n OtpForm,\n SignInForm,\n SignUpForm,\n ChatListItem,\n ChessBoard,\n CollectionEditor,\n ContentRail,\n EmptyState,\n Explorer,\n FileExplorer,\n GridLineOverlay,\n GridRuler,\n GridInteractions,\n GridView,\n TileGrid,\n TimeGrid,\n MatrixGrid,\n MediaExplorer,\n Hero,\n List,\n ListItem,\n ListSection,\n MessageBubble,\n OpeningBook,\n MissingElement,\n PostCard,\n ProductCard,\n BarcodeScannerView,\n CameraPermissionView,\n ScanOverlay,\n SectionHeader,\n SelectableItem,\n SpatialGrid,\n PaletteItem,\n CardBack,\n CardHand,\n PlayingCard,\n TabletopTable,\n PokerTrainingTable,\n Timeline,\n TreeItem,\n TreeView,\n} as const satisfies ZoraComponentRegistry;\n\n/*** The core ZORA runtime component registry, excluding separately selected feature entries such as Reader. */\nexport const ZORA_BASE_COMPONENT_REGISTRY: ZoraComponentRegistry = _ZORA_BASE_COMPONENT_REGISTRY;\n"]}
@@ -1,3 +1,4 @@
1
1
  import type { ZoraComponentRegistry } from '../../types/registry';
2
+ /*** The complete ZORA runtime component registry, including the public Reader component. */
2
3
  export declare const ZORA_COMPONENT_REGISTRY: ZoraComponentRegistry;
3
4
  //# sourceMappingURL=ZORA_COMPONENT_REGISTRY.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZORA_COMPONENT_REGISTRY.d.ts","sourceRoot":"","sources":["../../../src/features/registry/ZORA_COMPONENT_REGISTRY.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAyOlE,eAAO,MAAM,uBAAuB,EAAE,qBAAgD,CAAC"}
1
+ {"version":3,"file":"ZORA_COMPONENT_REGISTRY.d.ts","sourceRoot":"","sources":["../../../src/features/registry/ZORA_COMPONENT_REGISTRY.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlE,4FAA4F;AAC5F,eAAO,MAAM,uBAAuB,EAAE,qBAEpC,CAAC"}