@solid2-aria/components 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +6 -0
  2. package/dist/NOTICE.txt +33 -11
  3. package/dist/browser/collection-dnd.js +37 -40
  4. package/dist/browser/collection-dnd.js.map +1 -1
  5. package/dist/browser/color-field.js +12 -6
  6. package/dist/browser/color-field.js.map +1 -1
  7. package/dist/browser/drop-zone.js +6 -3
  8. package/dist/browser/drop-zone.js.map +1 -1
  9. package/dist/browser/grid-list.d.ts +2 -2
  10. package/dist/browser/grid-list.js +8 -7
  11. package/dist/browser/grid-list.js.map +1 -1
  12. package/dist/browser/list-box.js +31 -37
  13. package/dist/browser/list-box.js.map +1 -1
  14. package/dist/browser/menu.js +16 -19
  15. package/dist/browser/menu.js.map +1 -1
  16. package/dist/browser/modal.js +28 -31
  17. package/dist/browser/modal.js.map +1 -1
  18. package/dist/browser/number-field.js +5 -4
  19. package/dist/browser/number-field.js.map +1 -1
  20. package/dist/browser/popover.js +26 -29
  21. package/dist/browser/popover.js.map +1 -1
  22. package/dist/browser/shared-element-transition.js +19 -22
  23. package/dist/browser/shared-element-transition.js.map +1 -1
  24. package/dist/browser/sheet.d.ts +1 -1
  25. package/dist/browser/sheet.js +82 -7
  26. package/dist/browser/sheet.js.map +1 -1
  27. package/dist/browser/table.d.ts +2 -2
  28. package/dist/browser/table.js +5 -2
  29. package/dist/browser/table.js.map +1 -1
  30. package/dist/browser/tabs.d.ts +1 -1
  31. package/dist/browser/tabs.js +65 -26
  32. package/dist/browser/tabs.js.map +1 -1
  33. package/dist/browser/toast.js +43 -46
  34. package/dist/browser/toast.js.map +1 -1
  35. package/dist/browser/token-field.js +0 -1
  36. package/dist/browser/token-field.js.map +1 -1
  37. package/dist/browser/tooltip.js +22 -25
  38. package/dist/browser/tooltip.js.map +1 -1
  39. package/dist/browser/tree.js +21 -10
  40. package/dist/browser/tree.js.map +1 -1
  41. package/dist/server/calendar.js +3 -1
  42. package/dist/server/calendar.js.map +1 -1
  43. package/dist/server/checkbox.js +3 -1
  44. package/dist/server/checkbox.js.map +1 -1
  45. package/dist/server/collection-dnd.js +8 -36
  46. package/dist/server/collection-dnd.js.map +1 -1
  47. package/dist/server/color-field.js +7 -2
  48. package/dist/server/color-field.js.map +1 -1
  49. package/dist/server/color-thumb.js +6 -2
  50. package/dist/server/color-thumb.js.map +1 -1
  51. package/dist/server/drop-zone.js +12 -5
  52. package/dist/server/drop-zone.js.map +1 -1
  53. package/dist/server/grid-list.js +16 -32
  54. package/dist/server/grid-list.js.map +1 -1
  55. package/dist/server/hidden-date-input.js +3 -1
  56. package/dist/server/hidden-date-input.js.map +1 -1
  57. package/dist/server/list-box.js +25 -69
  58. package/dist/server/list-box.js.map +1 -1
  59. package/dist/server/menu.js +10 -31
  60. package/dist/server/menu.js.map +1 -1
  61. package/dist/server/modal.js +35 -67
  62. package/dist/server/modal.js.map +1 -1
  63. package/dist/server/popover.js +71 -98
  64. package/dist/server/popover.js.map +1 -1
  65. package/dist/server/radio-group.js +3 -1
  66. package/dist/server/radio-group.js.map +1 -1
  67. package/dist/server/shared-element-transition.js +13 -42
  68. package/dist/server/shared-element-transition.js.map +1 -1
  69. package/dist/server/sheet.js +135 -60
  70. package/dist/server/sheet.js.map +1 -1
  71. package/dist/server/slider.js +3 -1
  72. package/dist/server/slider.js.map +1 -1
  73. package/dist/server/switch.js +3 -1
  74. package/dist/server/switch.js.map +1 -1
  75. package/dist/server/table.js +8 -3
  76. package/dist/server/table.js.map +1 -1
  77. package/dist/server/tabs.js +180 -169
  78. package/dist/server/tabs.js.map +1 -1
  79. package/dist/server/toast.js +68 -101
  80. package/dist/server/toast.js.map +1 -1
  81. package/dist/server/token-field.js +2 -2
  82. package/dist/server/tooltip.js +34 -61
  83. package/dist/server/tooltip.js.map +1 -1
  84. package/dist/server/tree.js +156 -130
  85. package/dist/server/tree.js.map +1 -1
  86. package/dist/server/virtualizer.js +3 -1
  87. package/dist/server/virtualizer.js.map +1 -1
  88. package/package.json +12 -11
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","names":["{dnd.dropState && <RootDropIndicator />}","<CollectionDropIndicator {...indicatorProps} ref={ref} />","ref={ref}","{values.isEmpty && props.renderEmptyState && (\n <div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>\n )}","{props.renderEmptyState(values)}","props.renderEmptyState(values)","<div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>","{dnd.preview}","state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode","<CheckboxContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <CheckboxFieldContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <ButtonContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: mergeProps(\n merge(() => aria.expandButtonProps ?? {}),\n {}\n ),\n drag: mergeProps(\n merge(() => drag?.dragButtonProps ?? {}),\n {\n style: { \"pointer-events\": \"none\" as const },\n }\n ),\n },\n }}\n >\n <TreeItemContentContext value={values}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n <TreeItemChildren state={state} itemKey={item.key} />\n </SelectionIndicatorContext>\n </TreeItemContentContext>\n </ButtonContext>\n </CheckboxFieldContext>\n </CheckboxContext>","style={{ display: \"contents\" }}","elementRef={ref}","setElementRef={(element: HTMLDivElement) => {\n setRef(element);\n }}","dom.div","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.gridProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => dnd.collectionProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n outer.setElementRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-drop-target={values.isDropTarget || undefined}\n >\n <TreeStateContext value={state}>\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, ref) => (\n <CollectionDropIndicator {...indicatorProps} ref={ref} />\n ),\n }}\n >\n {dnd.dropState && <RootDropIndicator />}\n <Root\n collection={state.collection}\n scrollRef={outer.elementRef}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </TreeStateContext>\n {values.isEmpty && props.renderEmptyState && (\n <div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>\n )}\n {dnd.preview}\n </dom.div>","{drop && !drop.isHidden && (\n <div role=\"row\" style={{ position: \"absolute\" }}>\n <div role=\"gridcell\">\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />\n {values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}\n </div>\n </div>\n )}","<div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />","{values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}","<div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />","tabindex={-1}","values.hasChildItems","<div role=\"row\" style={{ position: \"absolute\" }}>\n <div role=\"gridcell\">\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />\n {values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}\n </div>\n </div>","style={{ position: \"absolute\" }}","<dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.rowProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => within.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => drag?.dragProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-expanded={getTruthyValue(\n values.hasChildItems && values.isExpanded\n )}\n data-has-child-items={values.hasChildItems || undefined}\n data-level={values.level}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-focus-visible-within={within.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-allows-dragging={!!dnd.dragState || undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={drop?.isDropTarget ?? undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <div {...aria.gridCellProps} style={{ display: \"contents\" }}>\n <CheckboxContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <CheckboxFieldContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <ButtonContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: mergeProps(\n merge(() => aria.expandButtonProps ?? {}),\n {}\n ),\n drag: mergeProps(\n merge(() => drag?.dragButtonProps ?? {}),\n {\n style: { \"pointer-events\": \"none\" as const },\n }\n ),\n },\n }}\n >\n <TreeItemContentContext value={values}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n <TreeItemChildren state={state} itemKey={item.key} />\n </SelectionIndicatorContext>\n </TreeItemContentContext>\n </ButtonContext>\n </CheckboxFieldContext>\n </CheckboxContext>\n </div>\n </dom.div>","{props.children}","<div inert style={{ height: 0, position: \"relative\", width: 0 }}>\n <div\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>","style={{ height: 0, position: \"relative\", width: 0 }}","style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}","{props.isLoading === true && (\n <dom.div {...render} role=\"row\" ref={ref}>\n <div role=\"gridcell\">{render.children}</div>\n </dom.div>\n )}","<dom.div {...render} role=\"row\" ref={ref}>\n <div role=\"gridcell\">{render.children}</div>\n </dom.div>","role=\"row\"","{render.children}","render.children","<div role=\"gridcell\">{render.children}</div>","<dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.rowGroupProps ?? {})\n )}\n render={props.render}\n class={props.class ?? \"solid2-aria-TreeSection\"}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n >\n <GridListHeaderContext value={{ role: \"row\" }}>\n <GridListHeaderInnerContext value={aria.rowHeaderProps}>\n <Branch collection={state.collection} parent={item} />\n </GridListHeaderInnerContext>\n </GridListHeaderContext>\n </dom.div>","<GridListHeader\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"ref\")\n // oxlint-enable solid/reactivity\n }\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n class={props.class ?? \"solid2-aria-TreeHeader\"}\n />","{content()}","_$memo","_$mergeProps","_$applyRef","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrElement","_$ssrElementAttribute","_$ssrStyleProperty","_$ssrStyleProperties"],"sources":["../../src/tree.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Tree.tsx.\n * Modified for Solid Aria: preserve flattened tree traversal with Solid collection nodes, controlled expansion, and reactive accessibility primitives; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n BaseCollection,\n CollectionNode,\n LoaderNode,\n SectionNode,\n} from \"@solid2-aria/core/collections/base-collection\";\nimport {\n Collection,\n CollectionBuilder,\n createBranchComponent,\n createLeafComponent,\n} from \"@solid2-aria/core/collections/collection-builder\";\nimport { createCachedChildren } from \"@solid2-aria/core/collections/create-cached-children\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createGridListSection } from \"@solid2-aria/core/gridlist/create-grid-list-section\";\nimport { createGridListSelectionCheckbox } from \"@solid2-aria/core/gridlist/create-grid-list-selection-checkbox\";\nimport { createCollator } from \"@solid2-aria/core/i18n/create-collator\";\nimport { createLocale } from \"@solid2-aria/core/i18n/i18n-provider\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { ListKeyboardDelegate } from \"@solid2-aria/core/selection/list-keyboard-delegate\";\nimport { createTree } from \"@solid2-aria/core/tree/create-tree\";\nimport type { AriaTreeProps } from \"@solid2-aria/core/tree/create-tree\";\nimport { createTreeItem } from \"@solid2-aria/core/tree/create-tree-item\";\nimport type { AriaTreeItemOptions } from \"@solid2-aria/core/tree/create-tree-item\";\nimport { createLoadMoreSentinel } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport type { LoadMoreSentinelProps } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { isPresent } from \"@solid2-aria/core/utils/is-present\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { getTruthyValue, isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createVisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport { createTreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport type { TreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport { createControlledSignal } from \"@solid2-aria/stately/utils/create-controlled-signal\";\nimport { getNodeProps } from \"@solid2-aria/stately/utils/get-node-props\";\nimport type {\n Key,\n Node,\n LinkDOMProps,\n HoverEvents,\n PressEvents,\n MultipleSelection,\n Expandable,\n SelectionMode,\n SelectionBehavior,\n DisabledBehavior,\n} from \"@solid2-aria/types-shared\";\nimport type { GlobalDOMAttributes } from \"@solid2-aria/types-shared-web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createContext,\n useContext,\n createMemo,\n omit,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { ButtonContext } from \"./button\";\nimport { CheckboxContext, CheckboxFieldContext } from \"./checkbox\";\nimport {\n CollectionRendererContext,\n DefaultCollectionRenderer,\n} from \"./collection\";\nimport type {\n CollectionProps,\n ItemRenderProps,\n SectionProps,\n} from \"./collection\";\nimport { createCollectionItemDragAndDrop } from \"./collection-dnd\";\nimport type { DragAndDropHooks } from \"./create-drag-and-drop\";\nimport {\n DragAndDropContext,\n DropIndicatorContext,\n createDndPersistedKeys,\n createRenderDropIndicator,\n} from \"./drag-and-drop\";\nimport {\n GridListHeader,\n GridListHeaderContext,\n GridListHeaderInnerContext,\n RootDropIndicator,\n createCollectionDragAndDrop,\n CollectionDropIndicator,\n} from \"./grid-list\";\nimport type { GridListHeaderProps } from \"./grid-list\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TreeDropTargetDelegate } from \"./tree-drop-target-delegate\";\nimport {\n assignRef,\n dom,\n DEFAULT_SLOT,\n createContextProps,\n createRenderProps,\n} from \"./utils\";\nimport type {\n ChildrenOrFunction,\n ClassOrFunction,\n ContextValue,\n RenderProps,\n StyleRenderProps,\n SlotProps,\n DOMRenderProps,\n Ref,\n} from \"./utils\";\n\nclass TreeCollection<T> extends BaseCollection<T> {\n private expandedKeys = new Set<Key>();\n\n withExpandedKeys(lastExpandedKeys: Set<Key>, expandedKeys: Set<Key>) {\n const collection = this.clone();\n collection.expandedKeys = expandedKeys;\n\n // Clone ancestor section nodes so React knows to re-render since the same item won't cause a new render but a clone creating a new object with the same value will\n // Without this change, the items won't expand and collapse when virtualized inside a section\n TreeCollection.cloneAncestorSections(\n expandedKeys,\n lastExpandedKeys,\n collection\n );\n TreeCollection.cloneAncestorSections(\n lastExpandedKeys,\n expandedKeys,\n collection\n );\n\n collection.frozen = this.frozen;\n\n return collection;\n }\n\n // diff lastExpandedKeys and expandedKeys so we only clone what has changed\n private static cloneAncestorSections<T>(\n keys: Iterable<Key>,\n excludeSet: Set<Key>,\n collection: TreeCollection<T>\n ) {\n for (const key of keys) {\n if (!excludeSet.has(key)) {\n let currentKey: Key | null = key;\n\n while (isPresent(currentKey)) {\n const item: CollectionNode<T> = requireValue(\n collection.getItem(currentKey),\n \"Expected collection.getItem(currentKey)\"\n );\n\n if (item?.type === \"section\") {\n collection.keyMap.set(currentKey, item.clone());\n break;\n } else {\n currentKey = item?.parentKey ?? null;\n }\n }\n }\n }\n }\n\n override *[Symbol.iterator]() {\n const firstKey = this.getFirstKey();\n\n let node: Node<T> | null = isPresent(firstKey)\n ? this.getItem(firstKey)\n : null;\n\n while (node) {\n yield node;\n\n if (node.type === \"section\") {\n node = isPresent(node.nextKey) ? this.getItem(node.nextKey) : null;\n } else {\n // This will include both item and content nodes\n // We handle the content nodes in useCollectionRenderer and ListLayout\n const key = this.getKeyAfter(node.key);\n node = isPresent(key) ? this.getItem(key) : null;\n }\n }\n }\n\n override getLastKey() {\n // Find the deepest expanded child. We don't use collection.getLastKey() here\n // because that will return the deepest child regardless of expandedKeys.\n // Instead, start from the last top-level key and walk down.\n const key = this.lastKey;\n\n if (!isPresent(key)) {\n return null;\n }\n\n let node = requireValue(this.getItem(key), \"Expected this.getItem(key)\");\n\n while (\n isPresent(node?.lastChildKey) &&\n (node.type !== \"item\" || this.expandedKeys.has(node.key))\n ) {\n node = requireValue(\n this.getItem(node.lastChildKey),\n \"Expected this.getItem(node.lastChildKey)\"\n );\n }\n\n return node?.key;\n }\n\n override getKeyAfter(key: Key) {\n let node = requireValue(this.getItem(key), \"Expected this.getItem(key)\");\n\n if (!isTruthy(node)) {\n return null;\n }\n\n if (\n (this.expandedKeys.has(node.key) || node.type !== \"item\") &&\n isPresent(node.firstChildKey)\n ) {\n return node.firstChildKey;\n }\n\n while (isTruthy(node)) {\n if (isPresent(node.nextKey)) {\n return node.nextKey;\n }\n\n if (!isPresent(node.parentKey)) {\n return null;\n }\n\n node = requireValue(\n this.getItem(node.parentKey),\n \"Expected this.getItem(node.parentKey)\"\n );\n }\n\n return null;\n }\n\n override getKeyBefore(key: Key) {\n let node = requireValue(this.getItem(key), \"Expected this.getItem(key)\");\n\n if (!isTruthy(node)) {\n return null;\n }\n\n if (isPresent(node.prevKey)) {\n node = requireValue(\n this.getItem(node.prevKey),\n \"Expected this.getItem(node.prevKey)\"\n );\n\n // If the lastChildKey is expanded, check its lastChildKey\n while (\n Boolean(node) &&\n (node.type !== \"item\" || this.expandedKeys.has(node.key)) &&\n isPresent(node.lastChildKey)\n ) {\n node = requireValue(\n this.getItem(node.lastChildKey),\n \"Expected this.getItem(node.lastChildKey)\"\n );\n }\n\n return node?.key ?? null;\n }\n\n return node.parentKey;\n }\n\n override *getChildren(key: Key): IterableIterator<CollectionNode<T>> {\n const parent = this.getItem(key);\n\n let node = isPresent(parent?.firstChildKey)\n ? this.getItem(parent.firstChildKey)\n : null;\n\n if (parent?.type === \"section\") {\n while (node && node.key !== parent.nextKey) {\n yield node;\n const nextKey = this.getKeyAfter(node.key);\n node = isPresent(nextKey) ? this.getItem(nextKey) : null;\n }\n\n return;\n }\n\n while (node) {\n yield node;\n node = isPresent(node.nextKey) ? this.getItem(node.nextKey) : null;\n }\n }\n\n getTextValue(key: Key): string {\n const item = this.getItem(key);\n\n return item ? item.textValue : \"\";\n }\n}\n\nexport interface TreeRenderProps {\n isEmpty: boolean;\n\n isFocused: boolean;\n\n isFocusVisible: boolean;\n\n selectionMode: SelectionMode;\n\n allowsDragging: boolean;\n\n isDropTarget: boolean;\n\n state: TreeState<unknown>;\n}\n\nexport type TreeEmptyStateRenderProps = Omit<TreeRenderProps, \"isEmpty\">;\n\nexport interface TreeProps<T>\n extends\n Omit<AriaTreeProps<T>, \"children\">,\n MultipleSelection,\n CollectionProps<T>,\n StyleRenderProps<TreeRenderProps>,\n SlotProps,\n Expandable,\n GlobalDOMAttributes<HTMLDivElement> {\n class?: ClassOrFunction<TreeRenderProps>;\n\n selectionBehavior?: SelectionBehavior;\n\n renderEmptyState?: (props: TreeEmptyStateRenderProps) => JSX.Element;\n\n disabledBehavior?: DisabledBehavior;\n\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;\n}\n\nexport interface TreeItemRenderProps extends ItemRenderProps {\n isExpanded: boolean;\n\n hasChildItems: boolean;\n\n level: number;\n\n isFocusVisibleWithin: boolean;\n\n state: TreeState<unknown>;\n\n id: Key;\n}\n\nexport type TreeItemContentRenderProps = TreeItemRenderProps;\n\nexport interface TreeItemContentProps {\n children: ChildrenOrFunction<TreeItemContentRenderProps>;\n}\n\nexport interface TreeItemProps<T = object>\n extends\n StyleRenderProps<TreeItemRenderProps>,\n LinkDOMProps,\n HoverEvents,\n PressEvents,\n Pick<\n AriaTreeItemOptions,\n \"hasChildItems\" | \"focusMode\" | \"allowsArrowNavigation\"\n >,\n Omit<GlobalDOMAttributes<HTMLDivElement>, \"onClick\"> {\n class?: ClassOrFunction<TreeItemRenderProps>;\n\n id?: Key;\n\n value?: T;\n\n textValue: string;\n\n \"aria-label\"?: string;\n\n children: JSX.Element;\n\n isDisabled?: boolean;\n\n onAction?: () => void;\n}\n\nexport interface TreeLoadMoreItemRenderProps {\n level: number;\n}\n\nexport interface TreeLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, \"collection\" | \"direction\">,\n RenderProps<TreeLoadMoreItemRenderProps> {\n class?: ClassOrFunction<TreeLoadMoreItemRenderProps>;\n\n children?: ChildrenOrFunction<TreeLoadMoreItemRenderProps>;\n\n isLoading?: boolean;\n}\n\nexport interface TreeSectionProps<T>\n extends SectionProps<T>, DOMRenderProps<\"div\", undefined> {}\n\nexport type TreeHeaderProps = GridListHeaderProps;\n\nexport const TreeContext =\n // oxlint-disable-next-line typescript/no-explicit-any -- The collection owner and its descendants share one item type through this context.\n createContext<ContextValue<TreeProps<any>, HTMLDivElement>>(null);\n\n// oxlint-disable-next-line typescript/no-explicit-any -- The collection owner and its descendants share one item type through this context.\nexport const TreeStateContext = createContext<TreeState<any> | null>(null);\n\nexport const TreeItemContentContext =\n createContext<TreeItemContentRenderProps | null>(null);\n\nexport function Tree<T>(input: TreeProps<T> & { ref?: Ref<HTMLDivElement> }) {\n const [props, ref, setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n TreeContext\n );\n\n return (\n <CollectionBuilder\n createCollection={() => new TreeCollection<T>()}\n content={<Collection {...props} />}\n >\n {(collection) => (\n <TreeInner\n props={props}\n collection={collection}\n elementRef={ref}\n setElementRef={(element: HTMLDivElement) => {\n setRef(element);\n }}\n />\n )}\n </CollectionBuilder>\n );\n}\n\nfunction TreeInner<T>(outer: {\n props: TreeProps<T>;\n collection: TreeCollection<T>;\n elementRef: Accessor<HTMLDivElement | null>;\n setElementRef: (element: HTMLDivElement) => void;\n}) {\n const { props } = untrack(() => outer);\n const renderer = useContext(CollectionRendererContext);\n\n const [expanded, setExpanded] = createControlledSignal(\n () => (props.expandedKeys ? new Set(props.expandedKeys) : undefined),\n untrack(() => new Set(props.defaultExpandedKeys)),\n (keys) => {\n props.onExpandedChange?.(keys);\n }\n );\n\n const collection = createMemo(() =>\n outer.collection.withExpandedKeys(new Set(), expanded())\n );\n\n // oxlint-disable-next-line typescript/no-explicit-any -- The public collection accepts primitive items; this state adapter only reads their keyed nodes.\n const state = createTreeState<any>(\n mergeProps(props, {\n get collection() {\n return collection();\n },\n get expandedKeys() {\n return expanded();\n },\n onExpandedChange: setExpanded,\n })\n );\n\n const locale = createLocale();\n const collator = createCollator({ sensitivity: \"base\", usage: \"search\" });\n\n const delegate = createMemo(\n () =>\n new ListKeyboardDelegate({\n collator,\n get collection() {\n return state.collection;\n },\n get disabledBehavior() {\n return state.selectionManager.disabledBehavior;\n },\n get disabledKeys() {\n return state.disabledKeys;\n },\n layoutDelegate: renderer.layoutDelegate,\n ref: outer.elementRef,\n })\n );\n\n const aria = createTree(\n mergeProps(props, {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get keyboardDelegate() {\n return delegate();\n },\n }),\n state,\n untrack(() => outer.elementRef)\n );\n\n const treeDelegate = new TreeDropTargetDelegate<T>();\n\n const hooks = untrack(() => props.dragAndDropHooks);\n\n if (hooks?.createDroppableCollectionState) {\n treeDelegate.setup(\n hooks.dropTargetDelegate ??\n renderer.dropTargetDelegate ??\n new hooks.ListDropTargetDelegate(\n {\n [Symbol.iterator]() {\n return state.collection[Symbol.iterator]();\n },\n },\n untrack(() => outer.elementRef)\n ),\n state,\n locale.direction\n );\n }\n\n const dnd = createCollectionDragAndDrop({\n get collection() {\n return state.collection;\n },\n dropTargetDelegate: treeDelegate,\n get hooks() {\n return props.dragAndDropHooks;\n },\n get keyboardDelegate() {\n return delegate();\n },\n onDropActivate: (event) => {\n if (event.target.type === \"item\") {\n const { key } = event.target;\n const item = state.collection.getItem(key);\n\n const expandable =\n isTruthy(getNodeProps(item).hasChildItems) ||\n [...(state.collection.getChildren?.(key) ?? [])].some(\n (child) => child.type === \"item\"\n );\n\n if (\n expandable &&\n (!state.expandedKeys.has(key) ||\n props.dragAndDropHooks?.isVirtualDragging?.() === true)\n ) {\n state.toggleKey(key);\n }\n }\n },\n onKeyDown: (event) => {\n const target = dnd.dropState?.target;\n\n if (target?.type !== \"item\" || target.dropPosition !== \"on\") {\n return;\n }\n\n const isExpanded = state.expandedKeys.has(target.key);\n\n if (\n (event.key ===\n (locale.direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\") &&\n !isExpanded) ||\n (event.key ===\n (locale.direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\") &&\n isExpanded)\n ) {\n state.toggleKey(target.key);\n }\n },\n get ref() {\n return outer.elementRef;\n },\n get selectionManager() {\n return state.selectionManager;\n },\n });\n\n const focus = createFocusRing();\n\n const values: TreeRenderProps = {\n get allowsDragging() {\n return !!dnd.dragState;\n },\n get isDropTarget() {\n return dnd.dropState?.isDropTarget({ type: \"root\" }) === true;\n },\n get isEmpty() {\n return ![...state.collection].some((node) => node.type === \"item\");\n },\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocused() {\n return focus.isFocused;\n },\n get selectionMode() {\n return state.selectionManager.selectionMode;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-Tree\",\n values,\n })\n );\n\n const Root = renderer.CollectionRoot;\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.gridProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => dnd.collectionProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n outer.setElementRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-drop-target={values.isDropTarget || undefined}\n >\n <TreeStateContext value={state}>\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, ref) => (\n <CollectionDropIndicator {...indicatorProps} ref={ref} />\n ),\n }}\n >\n {dnd.dropState && <RootDropIndicator />}\n <Root\n collection={state.collection}\n scrollRef={outer.elementRef}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </TreeStateContext>\n {values.isEmpty && props.renderEmptyState && (\n <div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>\n )}\n {dnd.preview}\n </dom.div>\n );\n}\n\nclass TreeContentNode extends CollectionNode<unknown> {\n static override readonly type = \"content\";\n}\n\nclass TreeItemNode extends CollectionNode<unknown> {\n static override readonly type = \"item\";\n}\n\nexport const TreeItemContent = createLeafComponent(\n TreeContentNode,\n (props: TreeItemContentProps) => {\n const values = useContext(TreeItemContentContext);\n\n if (!values) {\n throw new Error(\"TreeItemContent must be rendered within TreeItem.\");\n }\n\n const render = createRenderProps(mergeProps(props, { values }));\n\n return (\n <CollectionRendererContext value={DefaultCollectionRenderer}>\n {render.children}\n </CollectionRendererContext>\n );\n }\n);\n\nexport const TreeItem = createBranchComponent(\n TreeItemNode,\n <T,>(\n props: TreeItemProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<T>\n ) => {\n const state = requireValue(\n useContext(TreeStateContext),\n \"Expected useContext(TreeStateContext)\"\n );\n\n const dnd = useContext(DragAndDropContext);\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createTreeItem(\n {\n get allowsArrowNavigation() {\n return props.allowsArrowNavigation;\n },\n get focusMode() {\n return props.focusMode;\n },\n get hasChildItems() {\n return props.hasChildItems;\n },\n node: item,\n shouldSelectOnPressUp: !!dnd.dragState,\n },\n state,\n ref\n );\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return !aria.allowsSelection && !aria.hasAction && !dnd.dragState;\n },\n })\n );\n\n const focus = createFocusRing();\n const within = createFocusRing({ within: true });\n const checkbox = createGridListSelectionCheckbox({ key: item.key }, state);\n\n const [dropRef, setDropRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [activateRef, setActivateRef] = createSignal<HTMLDivElement | null>(\n null,\n { ownedWrite: true }\n );\n\n const { drag, drop } = createCollectionItemDragAndDrop(\n dnd,\n item.key,\n dropRef,\n activateRef\n );\n\n const values: TreeItemRenderProps = {\n get allowsDragging() {\n return !!dnd.dragState;\n },\n get hasChildItems() {\n return (\n props.hasChildItems === true ||\n [...(state.collection.getChildren?.(item.key) ?? [])].some(\n (node) => node.type === \"item\"\n )\n );\n },\n id: item.key,\n get isDisabled() {\n return aria.isDisabled;\n },\n get isDragging() {\n return dnd.dragState?.isDragging(item.key) === true;\n },\n get isDropTarget() {\n return drop?.isDropTarget === true;\n },\n get isExpanded() {\n return state.expandedKeys.has(item.key);\n },\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocusVisibleWithin() {\n return within.isFocusVisible;\n },\n get isFocused() {\n return aria.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isPressed() {\n return aria.isPressed;\n },\n get isSelected() {\n return aria.isSelected;\n },\n get level() {\n return Number(aria.rowProps[\"aria-level\"] ?? 1);\n },\n get selectionBehavior() {\n return state.selectionManager.selectionBehavior;\n },\n get selectionMode() {\n return state.selectionManager.selectionMode;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-TreeItem\",\n values,\n })\n );\n\n const hidden = createVisuallyHidden();\n\n return (\n <>\n {drop && !drop.isHidden && (\n <div role=\"row\" style={{ position: \"absolute\" }}>\n <div role=\"gridcell\">\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />\n {values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}\n </div>\n </div>\n )}\n <dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.rowProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => within.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => drag?.dragProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-expanded={getTruthyValue(\n values.hasChildItems && values.isExpanded\n )}\n data-has-child-items={values.hasChildItems || undefined}\n data-level={values.level}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-focus-visible-within={within.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-allows-dragging={!!dnd.dragState || undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={drop?.isDropTarget ?? undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <div {...aria.gridCellProps} style={{ display: \"contents\" }}>\n <CheckboxContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <CheckboxFieldContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <ButtonContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: mergeProps(\n merge(() => aria.expandButtonProps ?? {}),\n {}\n ),\n drag: mergeProps(\n merge(() => drag?.dragButtonProps ?? {}),\n {\n style: { \"pointer-events\": \"none\" as const },\n }\n ),\n },\n }}\n >\n <TreeItemContentContext value={values}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n <TreeItemChildren state={state} itemKey={item.key} />\n </SelectionIndicatorContext>\n </TreeItemContentContext>\n </ButtonContext>\n </CheckboxFieldContext>\n </CheckboxContext>\n </div>\n </dom.div>\n </>\n );\n },\n (props) => <>{props.children}</>\n);\n\nexport const TreeLoadMoreItem = createLeafComponent(\n LoaderNode,\n (\n props: TreeLoadMoreItemProps,\n ref: Ref<HTMLDivElement>,\n item: Node<unknown>\n ) => {\n const state = requireValue(\n useContext(TreeStateContext),\n \"Expected useContext(TreeStateContext)\"\n );\n\n const [sentinel, setSentinel] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n createLoadMoreSentinel(\n mergeProps(props, {\n get collection() {\n return state.collection;\n },\n }),\n sentinel\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n get children() {\n return item.rendered;\n },\n defaultClass: \"solid2-aria-TreeLoadingIndicator\",\n values: { level: item.level + 1 },\n })\n );\n\n return (\n <>\n <div inert style={{ height: 0, position: \"relative\", width: 0 }}>\n <div\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>\n {props.isLoading === true && (\n <dom.div {...render} role=\"row\" ref={ref}>\n <div role=\"gridcell\">{render.children}</div>\n </dom.div>\n )}\n </>\n );\n }\n);\n\nexport const TreeSection = createBranchComponent(\n SectionNode,\n <T,>(\n props: TreeSectionProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<T>\n ) => {\n const state = requireValue(\n useContext(TreeStateContext),\n \"Expected useContext(TreeStateContext)\"\n );\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createGridListSection(props, state, ref);\n\n return (\n <dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.rowGroupProps ?? {})\n )}\n render={props.render}\n class={props.class ?? \"solid2-aria-TreeSection\"}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n >\n <GridListHeaderContext value={{ role: \"row\" }}>\n <GridListHeaderInnerContext value={aria.rowHeaderProps}>\n <Branch collection={state.collection} parent={item} />\n </GridListHeaderInnerContext>\n </GridListHeaderContext>\n </dom.div>\n );\n }\n);\n\nexport function TreeHeader(\n props: TreeHeaderProps & { ref?: Ref<HTMLDivElement> }\n) {\n return (\n <GridListHeader\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"ref\")\n // oxlint-enable solid/reactivity\n }\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n class={props.class ?? \"solid2-aria-TreeHeader\"}\n />\n );\n}\n\nfunction TreeItemChildren(props: { state: TreeState<unknown>; itemKey: Key }) {\n const content = createCachedChildren({\n children: (node: Node<unknown>) =>\n node.type === \"content\" ? (node.render?.(node) ?? node.rendered) : null,\n get items() {\n return props.state.collection.getChildren?.(props.itemKey);\n },\n });\n\n return <>{content()}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2bM,OAAA,WAAyB,KAAQ;;;;;;;;;;;;;;EAmOzB,O,SAAY,CAAM;;;;;;;EAClB,O,UAAW,CAAM;;;;;;;;;;EACjB,OAAe,uBACb,MAAM,kBACN,MAAM,kBACN,IAAI,SACN;;;;;;;;;EACA,OAAqB,0BACnB,MAAM,kBACN,IAAI,SACN;;;;;;;;;;;;;;;;;;;;;;;EAnBJ,OAMC,CACCA,WAAAA;;IAAC,OAAA,CAAA,CAAA,IAAI;GAAkC,CAAA,CAAC,CAAD,IAAA,kBAArB,CAAoB,CAAA,IAArC,IAAI;EAAkC,CAAA,GAAA,KACvC,IAAA,KACc,OACD,OAGT,OACA,GAMH,CAAA,CAbF;;;;;;;;;;;;;;;;;;;;;;EAPD,OAAA,qBAAA,IAAA,KAOG,KAAA,MAEa,OACD,OAGT,OAZG,EACL,SAAS,gBAAgB,QAAA,wBACvBC,aAA6B,gBAA7B,EAA6C,IAAA,IAAA;GAAK,IAAA,QAAA;GAAL,OAAA,UAAA,cAAA,MAAA,QAAA,KAAQ,IAARC,SAAAA,OAAAA,EAAQ,IAAR,MAAAA;EAAQ,EAAG,CAAA,CAAA,EAE5D,CAgBoB,CAAA;;;;;;;;;;;;;;;;;;;;;;EAtBxB,OAAA,mBAAA,IAAA,KAQK,KAAA,MAEa,OACD,OAGT,OAdmB,GAuBP,CAAA;;;;;;;;;;;;;;;;;EA9BtB,O,SAAM,CAAM,QAAQ,KAAA;;;;;;;EACpB,O,UAAY,CAAO,WAAW,KAAA;;;;;;;EAC9B,O,UAAc,CAAM,aAAa,KAAA;;;;;;;EACjC,O,UAAoB,CAAM,kBAAkB,KAAA;;;;;;;EAC5C,O,UAAkB,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,uCACF;CAGA,MAAM,SADW,WAAW,yBACb,CAAA,CAAS;CAExB,MAAM,CAAC,KAAK,UAAU,aAAoC,MAAM,EAC9D,YAAY,KACd,CAAC;CAED,MAAM,OAAO,sBAAsB,OAAO,OAAO,GAAG;CAEpD,OAAA,IACGlB,IAADqB,mBACE;EAAI,OAAA,WACF,KAAK,eAAe,OAAO,EAAE,QAAQ,KAAK,CAAC,GAAG,IAAI,GAClD,YAAY,KAAK,iBAAiB,CAAC,CAAC,CACtC;CAAC,GAJH,IAAA,MAKU,OAO6B,MAAA,QACb,OAA0B,OAN5C,YAA4B;EAChC,OAAO,OAAO;CAChB,CAOO,CAAA,CAAA;AAEb,CACF;AAEA,SAAgB,WACd,OACA;CACA,OAAA,eACEC,mBACE;EAEK,OAAA,KAAK,OAAO,KAAK;CAEtB,GALF,IAAA,MAYS,QAND,YAA4B;EAChC,UACE,cAAc,MAAM,GAAG,GACvB,OACF;CACF,CAED,CAAA,CAAA;AAEL;AAEA,SAAS,iBAAiB,OAAoD;CAC5E,MAAM,UAAU,qBAAqB;EACnC,WAAW,SACT,KAAK,SAAS,YAAa,KAAK,SAAS,IAAI,KAAK,KAAK,WAAY;EACrE,IAAI,QAAQ;GACV,OAAO,MAAM,MAAM,WAAW,cAAc,MAAM,OAAO;EAC3D;CACF,CAAC;CAED,OAASC,KAAC,OAAS;AACrB"}
1
+ {"version":3,"file":"tree.js","names":["{dnd.dropState && <RootDropIndicator />}","<CollectionDropIndicator {...indicatorProps} ref={ref} />","ref={ref}","{values.isEmpty && props.renderEmptyState && (\n <div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>\n )}","{props.renderEmptyState(values)}","props.renderEmptyState(values)","<div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>","{dnd.preview}","state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode","<CheckboxContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <CheckboxFieldContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <ButtonContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: mergeProps(\n merge(() => aria.expandButtonProps ?? {}),\n {}\n ),\n drag: mergeProps(\n merge(() => drag?.dragButtonProps ?? {}),\n {\n style: { \"pointer-events\": \"none\" as const },\n }\n ),\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get description() {\n return aria.descriptionProps;\n },\n },\n }}\n >\n <TreeItemContentContext value={values}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n <TreeItemChildren state={state} itemKey={item.key} />\n </SelectionIndicatorContext>\n </TreeItemContentContext>\n </TextContext>\n </ButtonContext>\n </CheckboxFieldContext>\n </CheckboxContext>","style={{ display: \"contents\" }}","elementRef={ref}","setElementRef={(element: HTMLDivElement) => {\n setRef(element);\n }}","dom.div","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.gridProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => dnd.collectionProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n outer.setElementRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-drop-target={values.isDropTarget || undefined}\n >\n <TreeStateContext value={state}>\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, ref) => (\n <CollectionDropIndicator {...indicatorProps} ref={ref} />\n ),\n }}\n >\n {dnd.dropState && <RootDropIndicator />}\n <Root\n collection={state.collection}\n scrollRef={outer.elementRef}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </TreeStateContext>\n {values.isEmpty && props.renderEmptyState && (\n <div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>\n )}\n {dnd.preview}\n </dom.div>","{drop && !drop.isHidden && (\n <div role=\"row\" style={{ position: \"absolute\" }}>\n <div role=\"gridcell\">\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />\n {values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}\n </div>\n </div>\n )}","<div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />","{values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}","<div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />","tabindex={-1}","values.hasChildItems","<div role=\"row\" style={{ position: \"absolute\" }}>\n <div role=\"gridcell\">\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />\n {values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}\n </div>\n </div>","style={{ position: \"absolute\" }}","<dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.rowProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => within.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => drag?.dragProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-expanded={getTruthyValue(\n values.hasChildItems && values.isExpanded\n )}\n data-has-child-items={values.hasChildItems || undefined}\n data-level={values.level}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-focus-visible-within={within.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-allows-dragging={!!dnd.dragState || undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={drop?.isDropTarget ?? undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <div {...aria.gridCellProps} style={{ display: \"contents\" }}>\n <CheckboxContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <CheckboxFieldContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <ButtonContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: mergeProps(\n merge(() => aria.expandButtonProps ?? {}),\n {}\n ),\n drag: mergeProps(\n merge(() => drag?.dragButtonProps ?? {}),\n {\n style: { \"pointer-events\": \"none\" as const },\n }\n ),\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get description() {\n return aria.descriptionProps;\n },\n },\n }}\n >\n <TreeItemContentContext value={values}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n <TreeItemChildren state={state} itemKey={item.key} />\n </SelectionIndicatorContext>\n </TreeItemContentContext>\n </TextContext>\n </ButtonContext>\n </CheckboxFieldContext>\n </CheckboxContext>\n </div>\n </dom.div>","{props.children}","<div inert style={{ height: 0, position: \"relative\", width: 0 }}>\n <div\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>","style={{ height: 0, position: \"relative\", width: 0 }}","style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}","{props.isLoading === true && (\n <dom.div {...render} role=\"row\" ref={ref}>\n <div role=\"gridcell\">{render.children}</div>\n </dom.div>\n )}","<dom.div {...render} role=\"row\" ref={ref}>\n <div role=\"gridcell\">{render.children}</div>\n </dom.div>","role=\"row\"","{render.children}","render.children","<div role=\"gridcell\">{render.children}</div>","<dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.rowGroupProps ?? {})\n )}\n render={props.render}\n class={props.class ?? \"solid2-aria-TreeSection\"}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n >\n <GridListHeaderContext value={{ role: \"row\" }}>\n <GridListHeaderInnerContext value={aria.rowHeaderProps}>\n <Branch collection={state.collection} parent={item} />\n </GridListHeaderInnerContext>\n </GridListHeaderContext>\n </dom.div>","<GridListHeader\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"ref\")\n // oxlint-enable solid/reactivity\n }\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n class={props.class ?? \"solid2-aria-TreeHeader\"}\n />","{content()}","_$memo","_$mergeProps","_$applyRef","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrElement","_$ssrElementAttribute","_$ssrStyleProperty","_$ssrStyleProperties"],"sources":["../../src/tree.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Tree.tsx.\n * Modified for Solid Aria: preserve flattened tree traversal with Solid collection nodes, controlled expansion, and reactive accessibility primitives; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n BaseCollection,\n CollectionNode,\n LoaderNode,\n SectionNode,\n} from \"@solid2-aria/core/collections/base-collection\";\nimport {\n Collection,\n CollectionBuilder,\n createBranchComponent,\n createLeafComponent,\n} from \"@solid2-aria/core/collections/collection-builder\";\nimport { createCachedChildren } from \"@solid2-aria/core/collections/create-cached-children\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createGridListSection } from \"@solid2-aria/core/gridlist/create-grid-list-section\";\nimport { createGridListSelectionCheckbox } from \"@solid2-aria/core/gridlist/create-grid-list-selection-checkbox\";\nimport { createCollator } from \"@solid2-aria/core/i18n/create-collator\";\nimport { createLocale } from \"@solid2-aria/core/i18n/i18n-provider\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { ListKeyboardDelegate } from \"@solid2-aria/core/selection/list-keyboard-delegate\";\nimport { createTree } from \"@solid2-aria/core/tree/create-tree\";\nimport type { AriaTreeProps } from \"@solid2-aria/core/tree/create-tree\";\nimport { createTreeItem } from \"@solid2-aria/core/tree/create-tree-item\";\nimport type { AriaTreeItemOptions } from \"@solid2-aria/core/tree/create-tree-item\";\nimport { createLoadMoreSentinel } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport type { LoadMoreSentinelProps } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { isPresent } from \"@solid2-aria/core/utils/is-present\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { getTruthyValue, isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createVisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport { createTreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport type { TreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport { createControlledSignal } from \"@solid2-aria/stately/utils/create-controlled-signal\";\nimport { getNodeProps } from \"@solid2-aria/stately/utils/get-node-props\";\nimport type {\n Key,\n Node,\n LinkDOMProps,\n HoverEvents,\n PressEvents,\n MultipleSelection,\n Expandable,\n SelectionMode,\n SelectionBehavior,\n DisabledBehavior,\n} from \"@solid2-aria/types-shared\";\nimport type { GlobalDOMAttributes } from \"@solid2-aria/types-shared-web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createContext,\n useContext,\n createMemo,\n omit,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { ButtonContext } from \"./button\";\nimport { CheckboxContext, CheckboxFieldContext } from \"./checkbox\";\nimport {\n CollectionRendererContext,\n DefaultCollectionRenderer,\n} from \"./collection\";\nimport type {\n CollectionProps,\n ItemRenderProps,\n SectionProps,\n} from \"./collection\";\nimport { createCollectionItemDragAndDrop } from \"./collection-dnd\";\nimport type { DragAndDropHooks } from \"./create-drag-and-drop\";\nimport {\n DragAndDropContext,\n DropIndicatorContext,\n createDndPersistedKeys,\n createRenderDropIndicator,\n} from \"./drag-and-drop\";\nimport {\n GridListHeader,\n GridListHeaderContext,\n GridListHeaderInnerContext,\n RootDropIndicator,\n createCollectionDragAndDrop,\n CollectionDropIndicator,\n} from \"./grid-list\";\nimport type { GridListHeaderProps } from \"./grid-list\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport { TreeDropTargetDelegate } from \"./tree-drop-target-delegate\";\nimport {\n assignRef,\n dom,\n DEFAULT_SLOT,\n createContextProps,\n createRenderProps,\n} from \"./utils\";\nimport type {\n ChildrenOrFunction,\n ClassOrFunction,\n ContextValue,\n RenderProps,\n StyleRenderProps,\n SlotProps,\n DOMRenderProps,\n Ref,\n} from \"./utils\";\n\nclass TreeCollection<T> extends BaseCollection<T> {\n private expandedKeys = new Set<Key>();\n\n withExpandedKeys(lastExpandedKeys: Set<Key>, expandedKeys: Set<Key>) {\n const collection = this.clone();\n collection.expandedKeys = expandedKeys;\n\n // Clone ancestor section nodes so React knows to re-render since the same item won't cause a new render but a clone creating a new object with the same value will\n // Without this change, the items won't expand and collapse when virtualized inside a section\n TreeCollection.cloneAncestorSections(\n expandedKeys,\n lastExpandedKeys,\n collection\n );\n TreeCollection.cloneAncestorSections(\n lastExpandedKeys,\n expandedKeys,\n collection\n );\n\n collection.frozen = this.frozen;\n\n return collection;\n }\n\n // diff lastExpandedKeys and expandedKeys so we only clone what has changed\n private static cloneAncestorSections<T>(\n keys: Iterable<Key>,\n excludeSet: Set<Key>,\n collection: TreeCollection<T>\n ) {\n for (const key of keys) {\n if (!excludeSet.has(key)) {\n let currentKey: Key | null = key;\n\n while (isPresent(currentKey)) {\n const item: CollectionNode<T> = requireValue(\n collection.getItem(currentKey),\n \"Expected collection.getItem(currentKey)\"\n );\n\n if (item?.type === \"section\") {\n collection.keyMap.set(currentKey, item.clone());\n break;\n } else {\n currentKey = item?.parentKey ?? null;\n }\n }\n }\n }\n }\n\n override *[Symbol.iterator]() {\n const firstKey = this.getFirstKey();\n\n let node: Node<T> | null = isPresent(firstKey)\n ? this.getItem(firstKey)\n : null;\n\n while (node) {\n yield node;\n\n if (node.type === \"section\") {\n node = isPresent(node.nextKey) ? this.getItem(node.nextKey) : null;\n } else {\n // This will include both item and content nodes\n // We handle the content nodes in useCollectionRenderer and ListLayout\n const key = this.getKeyAfter(node.key);\n node = isPresent(key) ? this.getItem(key) : null;\n }\n }\n }\n\n override getLastKey() {\n // Find the deepest expanded child. We don't use collection.getLastKey() here\n // because that will return the deepest child regardless of expandedKeys.\n // Instead, start from the last top-level key and walk down.\n const key = this.lastKey;\n\n if (!isPresent(key)) {\n return null;\n }\n\n let node = requireValue(this.getItem(key), \"Expected this.getItem(key)\");\n\n while (\n isPresent(node?.lastChildKey) &&\n (node.type !== \"item\" || this.expandedKeys.has(node.key))\n ) {\n node = requireValue(\n this.getItem(node.lastChildKey),\n \"Expected this.getItem(node.lastChildKey)\"\n );\n }\n\n return node?.key;\n }\n\n override getKeyAfter(key: Key) {\n let node = requireValue(this.getItem(key), \"Expected this.getItem(key)\");\n\n if (!isTruthy(node)) {\n return null;\n }\n\n if (\n (this.expandedKeys.has(node.key) || node.type !== \"item\") &&\n isPresent(node.firstChildKey)\n ) {\n return node.firstChildKey;\n }\n\n while (isTruthy(node)) {\n if (isPresent(node.nextKey)) {\n return node.nextKey;\n }\n\n if (!isPresent(node.parentKey)) {\n return null;\n }\n\n node = requireValue(\n this.getItem(node.parentKey),\n \"Expected this.getItem(node.parentKey)\"\n );\n }\n\n return null;\n }\n\n override getKeyBefore(key: Key) {\n let node = requireValue(this.getItem(key), \"Expected this.getItem(key)\");\n\n if (!isTruthy(node)) {\n return null;\n }\n\n if (isPresent(node.prevKey)) {\n node = requireValue(\n this.getItem(node.prevKey),\n \"Expected this.getItem(node.prevKey)\"\n );\n\n // If the lastChildKey is expanded, check its lastChildKey\n while (\n Boolean(node) &&\n (node.type !== \"item\" || this.expandedKeys.has(node.key)) &&\n isPresent(node.lastChildKey)\n ) {\n node = requireValue(\n this.getItem(node.lastChildKey),\n \"Expected this.getItem(node.lastChildKey)\"\n );\n }\n\n return node?.key ?? null;\n }\n\n return node.parentKey;\n }\n\n override *getChildren(key: Key): IterableIterator<CollectionNode<T>> {\n const parent = this.getItem(key);\n\n let node = isPresent(parent?.firstChildKey)\n ? this.getItem(parent.firstChildKey)\n : null;\n\n if (parent?.type === \"section\") {\n while (node && node.key !== parent.nextKey) {\n yield node;\n const nextKey = this.getKeyAfter(node.key);\n node = isPresent(nextKey) ? this.getItem(nextKey) : null;\n }\n\n return;\n }\n\n while (node) {\n yield node;\n node = isPresent(node.nextKey) ? this.getItem(node.nextKey) : null;\n }\n }\n\n getTextValue(key: Key): string {\n const item = this.getItem(key);\n\n return item ? item.textValue : \"\";\n }\n}\n\nexport interface TreeRenderProps {\n isEmpty: boolean;\n\n isFocused: boolean;\n\n isFocusVisible: boolean;\n\n selectionMode: SelectionMode;\n\n allowsDragging: boolean;\n\n isDropTarget: boolean;\n\n state: TreeState<unknown>;\n}\n\nexport type TreeEmptyStateRenderProps = Omit<TreeRenderProps, \"isEmpty\">;\n\nexport interface TreeProps<T>\n extends\n Omit<AriaTreeProps<T>, \"children\">,\n MultipleSelection,\n CollectionProps<T>,\n StyleRenderProps<TreeRenderProps>,\n SlotProps,\n Expandable,\n GlobalDOMAttributes<HTMLDivElement> {\n class?: ClassOrFunction<TreeRenderProps>;\n\n selectionBehavior?: SelectionBehavior;\n\n renderEmptyState?: (props: TreeEmptyStateRenderProps) => JSX.Element;\n\n disabledBehavior?: DisabledBehavior;\n\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;\n}\n\nexport interface TreeItemRenderProps extends ItemRenderProps {\n isExpanded: boolean;\n\n hasChildItems: boolean;\n\n level: number;\n\n isFocusVisibleWithin: boolean;\n\n state: TreeState<unknown>;\n\n id: Key;\n}\n\nexport type TreeItemContentRenderProps = TreeItemRenderProps;\n\nexport interface TreeItemContentProps {\n children: ChildrenOrFunction<TreeItemContentRenderProps>;\n}\n\nexport interface TreeItemProps<T = object>\n extends\n StyleRenderProps<TreeItemRenderProps>,\n LinkDOMProps,\n HoverEvents,\n PressEvents,\n Pick<\n AriaTreeItemOptions,\n \"hasChildItems\" | \"focusMode\" | \"allowsArrowNavigation\"\n >,\n Omit<GlobalDOMAttributes<HTMLDivElement>, \"onClick\"> {\n class?: ClassOrFunction<TreeItemRenderProps>;\n\n id?: Key;\n\n value?: T;\n\n textValue: string;\n\n \"aria-label\"?: string;\n\n children: JSX.Element;\n\n isDisabled?: boolean;\n\n onAction?: () => void;\n}\n\nexport interface TreeLoadMoreItemRenderProps {\n level: number;\n}\n\nexport interface TreeLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, \"collection\" | \"direction\">,\n RenderProps<TreeLoadMoreItemRenderProps> {\n class?: ClassOrFunction<TreeLoadMoreItemRenderProps>;\n\n children?: ChildrenOrFunction<TreeLoadMoreItemRenderProps>;\n\n isLoading?: boolean;\n}\n\nexport interface TreeSectionProps<T>\n extends SectionProps<T>, DOMRenderProps<\"div\", undefined> {}\n\nexport type TreeHeaderProps = GridListHeaderProps;\n\nexport const TreeContext =\n // oxlint-disable-next-line typescript/no-explicit-any -- The collection owner and its descendants share one item type through this context.\n createContext<ContextValue<TreeProps<any>, HTMLDivElement>>(null);\n\n// oxlint-disable-next-line typescript/no-explicit-any -- The collection owner and its descendants share one item type through this context.\nexport const TreeStateContext = createContext<TreeState<any> | null>(null);\n\nexport const TreeItemContentContext =\n createContext<TreeItemContentRenderProps | null>(null);\n\nexport function Tree<T>(input: TreeProps<T> & { ref?: Ref<HTMLDivElement> }) {\n const [props, ref, setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n TreeContext\n );\n\n return (\n <CollectionBuilder\n createCollection={() => new TreeCollection<T>()}\n content={<Collection {...props} />}\n >\n {(collection) => (\n <TreeInner\n props={props}\n collection={collection}\n elementRef={ref}\n setElementRef={(element: HTMLDivElement) => {\n setRef(element);\n }}\n />\n )}\n </CollectionBuilder>\n );\n}\n\nfunction TreeInner<T>(outer: {\n props: TreeProps<T>;\n collection: TreeCollection<T>;\n elementRef: Accessor<HTMLDivElement | null>;\n setElementRef: (element: HTMLDivElement) => void;\n}) {\n const { props } = untrack(() => outer);\n const renderer = useContext(CollectionRendererContext);\n\n const [expanded, setExpanded] = createControlledSignal(\n () => (props.expandedKeys ? new Set(props.expandedKeys) : undefined),\n untrack(() => new Set(props.defaultExpandedKeys)),\n (keys) => {\n props.onExpandedChange?.(keys);\n }\n );\n\n const collection = createMemo(() =>\n outer.collection.withExpandedKeys(new Set(), expanded())\n );\n\n // oxlint-disable-next-line typescript/no-explicit-any -- The public collection accepts primitive items; this state adapter only reads their keyed nodes.\n const state = createTreeState<any>(\n mergeProps(props, {\n get collection() {\n return collection();\n },\n get expandedKeys() {\n return expanded();\n },\n onExpandedChange: setExpanded,\n })\n );\n\n const locale = createLocale();\n const collator = createCollator({ sensitivity: \"base\", usage: \"search\" });\n\n const delegate = createMemo(\n () =>\n new ListKeyboardDelegate({\n collator,\n get collection() {\n return state.collection;\n },\n get disabledBehavior() {\n return state.selectionManager.disabledBehavior;\n },\n get disabledKeys() {\n return state.disabledKeys;\n },\n layoutDelegate: renderer.layoutDelegate,\n ref: outer.elementRef,\n })\n );\n\n const aria = createTree(\n mergeProps(props, {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get keyboardDelegate() {\n return delegate();\n },\n }),\n state,\n untrack(() => outer.elementRef)\n );\n\n const treeDelegate = new TreeDropTargetDelegate<T>();\n\n const hooks = untrack(() => props.dragAndDropHooks);\n\n if (hooks?.createDroppableCollectionState) {\n treeDelegate.setup(\n hooks.dropTargetDelegate ??\n renderer.dropTargetDelegate ??\n new hooks.ListDropTargetDelegate(\n {\n [Symbol.iterator]() {\n return state.collection[Symbol.iterator]();\n },\n },\n untrack(() => outer.elementRef)\n ),\n state,\n locale.direction\n );\n }\n\n const dnd = createCollectionDragAndDrop({\n get collection() {\n return state.collection;\n },\n dropTargetDelegate: treeDelegate,\n get hooks() {\n return props.dragAndDropHooks;\n },\n get keyboardDelegate() {\n return delegate();\n },\n onDropActivate: (event) => {\n if (event.target.type === \"item\") {\n const { key } = event.target;\n const item = state.collection.getItem(key);\n\n const expandable =\n isTruthy(getNodeProps(item).hasChildItems) ||\n [...(state.collection.getChildren?.(key) ?? [])].some(\n (child) => child.type === \"item\"\n );\n\n if (\n expandable &&\n (!state.expandedKeys.has(key) ||\n props.dragAndDropHooks?.isVirtualDragging?.() === true)\n ) {\n state.toggleKey(key);\n }\n }\n },\n onKeyDown: (event) => {\n const target = dnd.dropState?.target;\n\n if (target?.type !== \"item\" || target.dropPosition !== \"on\") {\n return;\n }\n\n const isExpanded = state.expandedKeys.has(target.key);\n\n if (\n (event.key ===\n (locale.direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\") &&\n !isExpanded) ||\n (event.key ===\n (locale.direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\") &&\n isExpanded)\n ) {\n state.toggleKey(target.key);\n }\n },\n get ref() {\n return outer.elementRef;\n },\n get selectionManager() {\n return state.selectionManager;\n },\n });\n\n const focus = createFocusRing();\n\n const values: TreeRenderProps = {\n get allowsDragging() {\n return !!dnd.dragState;\n },\n get isDropTarget() {\n return dnd.dropState?.isDropTarget({ type: \"root\" }) === true;\n },\n get isEmpty() {\n return ![...state.collection].some((node) => node.type === \"item\");\n },\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocused() {\n return focus.isFocused;\n },\n get selectionMode() {\n return state.selectionManager.selectionMode;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-Tree\",\n values,\n })\n );\n\n const Root = renderer.CollectionRoot;\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.gridProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => dnd.collectionProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n outer.setElementRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-drop-target={values.isDropTarget || undefined}\n >\n <TreeStateContext value={state}>\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, ref) => (\n <CollectionDropIndicator {...indicatorProps} ref={ref} />\n ),\n }}\n >\n {dnd.dropState && <RootDropIndicator />}\n <Root\n collection={state.collection}\n scrollRef={outer.elementRef}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </TreeStateContext>\n {values.isEmpty && props.renderEmptyState && (\n <div role=\"row\">\n <div role=\"gridcell\">{props.renderEmptyState(values)}</div>\n </div>\n )}\n {dnd.preview}\n </dom.div>\n );\n}\n\nclass TreeContentNode extends CollectionNode<unknown> {\n static override readonly type = \"content\";\n}\n\nclass TreeItemNode extends CollectionNode<unknown> {\n static override readonly type = \"item\";\n}\n\nexport const TreeItemContent = createLeafComponent(\n TreeContentNode,\n (props: TreeItemContentProps) => {\n const values = useContext(TreeItemContentContext);\n\n if (!values) {\n throw new Error(\"TreeItemContent must be rendered within TreeItem.\");\n }\n\n const render = createRenderProps(mergeProps(props, { values }));\n\n return (\n <CollectionRendererContext value={DefaultCollectionRenderer}>\n {render.children}\n </CollectionRendererContext>\n );\n }\n);\n\nexport const TreeItem = createBranchComponent(\n TreeItemNode,\n <T,>(\n props: TreeItemProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<T>\n ) => {\n const state = requireValue(\n useContext(TreeStateContext),\n \"Expected useContext(TreeStateContext)\"\n );\n\n const dnd = useContext(DragAndDropContext);\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createTreeItem(\n {\n get allowsArrowNavigation() {\n return props.allowsArrowNavigation;\n },\n get focusMode() {\n return props.focusMode;\n },\n get hasChildItems() {\n return props.hasChildItems;\n },\n node: item,\n shouldSelectOnPressUp: !!dnd.dragState,\n },\n state,\n ref\n );\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return !aria.allowsSelection && !aria.hasAction && !dnd.dragState;\n },\n })\n );\n\n const focus = createFocusRing();\n const within = createFocusRing({ within: true });\n const checkbox = createGridListSelectionCheckbox({ key: item.key }, state);\n\n const [dropRef, setDropRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [activateRef, setActivateRef] = createSignal<HTMLDivElement | null>(\n null,\n { ownedWrite: true }\n );\n\n const { drag, drop } = createCollectionItemDragAndDrop(\n dnd,\n item.key,\n dropRef,\n activateRef\n );\n\n const values: TreeItemRenderProps = {\n get allowsDragging() {\n return !!dnd.dragState;\n },\n get hasChildItems() {\n return (\n props.hasChildItems === true ||\n [...(state.collection.getChildren?.(item.key) ?? [])].some(\n (node) => node.type === \"item\"\n )\n );\n },\n id: item.key,\n get isDisabled() {\n return aria.isDisabled;\n },\n get isDragging() {\n return dnd.dragState?.isDragging(item.key) === true;\n },\n get isDropTarget() {\n return drop?.isDropTarget === true;\n },\n get isExpanded() {\n return state.expandedKeys.has(item.key);\n },\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocusVisibleWithin() {\n return within.isFocusVisible;\n },\n get isFocused() {\n return aria.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isPressed() {\n return aria.isPressed;\n },\n get isSelected() {\n return aria.isSelected;\n },\n get level() {\n return Number(aria.rowProps[\"aria-level\"] ?? 1);\n },\n get selectionBehavior() {\n return state.selectionManager.selectionBehavior;\n },\n get selectionMode() {\n return state.selectionManager.selectionMode;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-TreeItem\",\n values,\n })\n );\n\n const hidden = createVisuallyHidden();\n\n return (\n <>\n {drop && !drop.isHidden && (\n <div role=\"row\" style={{ position: \"absolute\" }}>\n <div role=\"gridcell\">\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => drop.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setDropRef(element);\n }}\n />\n {values.hasChildItems && (\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.expandButtonProps ?? {})\n )}\n role=\"button\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n setActivateRef(element);\n }}\n />\n )}\n </div>\n </div>\n )}\n <dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.rowProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => within.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => drag?.dragProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-expanded={getTruthyValue(\n values.hasChildItems && values.isExpanded\n )}\n data-has-child-items={values.hasChildItems || undefined}\n data-level={values.level}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-focus-visible-within={within.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-allows-dragging={!!dnd.dragState || undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={drop?.isDropTarget ?? undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <div {...aria.gridCellProps} style={{ display: \"contents\" }}>\n <CheckboxContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <CheckboxFieldContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get selection() {\n return checkbox.checkboxProps;\n },\n },\n }}\n >\n <ButtonContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: mergeProps(\n merge(() => aria.expandButtonProps ?? {}),\n {}\n ),\n drag: mergeProps(\n merge(() => drag?.dragButtonProps ?? {}),\n {\n style: { \"pointer-events\": \"none\" as const },\n }\n ),\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n get description() {\n return aria.descriptionProps;\n },\n },\n }}\n >\n <TreeItemContentContext value={values}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n <TreeItemChildren state={state} itemKey={item.key} />\n </SelectionIndicatorContext>\n </TreeItemContentContext>\n </TextContext>\n </ButtonContext>\n </CheckboxFieldContext>\n </CheckboxContext>\n </div>\n </dom.div>\n </>\n );\n },\n (props) => <>{props.children}</>\n);\n\nexport const TreeLoadMoreItem = createLeafComponent(\n LoaderNode,\n (\n props: TreeLoadMoreItemProps,\n ref: Ref<HTMLDivElement>,\n item: Node<unknown>\n ) => {\n const state = requireValue(\n useContext(TreeStateContext),\n \"Expected useContext(TreeStateContext)\"\n );\n\n const [sentinel, setSentinel] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n createLoadMoreSentinel(\n mergeProps(props, {\n get collection() {\n return state.collection;\n },\n }),\n sentinel\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n get children() {\n return item.rendered;\n },\n defaultClass: \"solid2-aria-TreeLoadingIndicator\",\n values: { level: item.level + 1 },\n })\n );\n\n return (\n <>\n <div inert style={{ height: 0, position: \"relative\", width: 0 }}>\n <div\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>\n {props.isLoading === true && (\n <dom.div {...render} role=\"row\" ref={ref}>\n <div role=\"gridcell\">{render.children}</div>\n </dom.div>\n )}\n </>\n );\n }\n);\n\nexport const TreeSection = createBranchComponent(\n SectionNode,\n <T,>(\n props: TreeSectionProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<T>\n ) => {\n const state = requireValue(\n useContext(TreeStateContext),\n \"Expected useContext(TreeStateContext)\"\n );\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createGridListSection(props, state, ref);\n\n return (\n <dom.div\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.rowGroupProps ?? {})\n )}\n render={props.render}\n class={props.class ?? \"solid2-aria-TreeSection\"}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n >\n <GridListHeaderContext value={{ role: \"row\" }}>\n <GridListHeaderInnerContext value={aria.rowHeaderProps}>\n <Branch collection={state.collection} parent={item} />\n </GridListHeaderInnerContext>\n </GridListHeaderContext>\n </dom.div>\n );\n }\n);\n\nexport function TreeHeader(\n props: TreeHeaderProps & { ref?: Ref<HTMLDivElement> }\n) {\n return (\n <GridListHeader\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"ref\")\n // oxlint-enable solid/reactivity\n }\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n class={props.class ?? \"solid2-aria-TreeHeader\"}\n />\n );\n}\n\nfunction TreeItemChildren(props: { state: TreeState<unknown>; itemKey: Key }) {\n const content = createCachedChildren({\n children: (node: Node<unknown>) =>\n node.type === \"content\" ? (node.render?.(node) ?? node.rendered) : null,\n get items() {\n return props.state.collection.getChildren?.(props.itemKey);\n },\n });\n\n return <>{content()}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAC3B,uCACF;CAGA,MAAM,SADW,WAAW,yBACb,CAAA,CAAS;CAExB,MAAM,CAAC,KAAK,UAAU,aAAoC,MAAM,EAC9D,YAAY,KACd,CAAC;CAED,MAAM,OAAO,sBAAsB,OAAO,OAAO,GAAG;CAEpD,OAAA,IACGlB,IAADqB,mBACE;EAAI,OAAA,WACF,KAAK,eAAe,OAAO,EAAE,QAAQ,KAAK,CAAC,GAAG,IAAI,GAClD,YAAY,KAAK,iBAAiB,CAAC,CAAC,CACtC;CAAC,GAJH,IAAA,MAKU,OAO6B,MAAA,QACb,OAA0B,OAN5C,YAA4B;EAChC,OAAO,OAAO;CAChB,CAOO,CAAA,CAAA;AAEb,CACF;AAEA,SAAgB,WACd,OACA;CACA,OAAA,eACEC,mBACE;EAEK,OAAA,KAAK,OAAO,KAAK;CAEtB,GALF,IAAA,MAYS,QAND,YAA4B;EAChC,UACE,cAAc,MAAM,GAAG,GACvB,OACF;CACF,CAED,CAAA,CAAA;AAEL;AAEA,SAAS,iBAAiB,OAAoD;CAC5E,MAAM,UAAU,qBAAqB;EACnC,WAAW,SACT,KAAK,SAAS,YAAa,KAAK,SAAS,IAAI,KAAK,KAAK,WAAY;EACrE,IAAI,QAAQ;GACV,OAAO,MAAM,MAAM,WAAW,cAAc,MAAM,OAAO;EAC3D;CACF,CAAC;CAED,OAASC,KAAC,OAAS;AACrB"}
@@ -211,7 +211,9 @@ function CollectionRoot(props) {
211
211
  onSizeChange: state.setSize,
212
212
  onVisibleRectChange: state.setVisibleRect
213
213
  }, requireValue(untrack(() => props.scrollRef), "Expected props.scrollRef"));
214
- return ssrElement("div", scroll.contentProps, () => {
214
+ return ssrElement("div", () => {
215
+ return scroll.contentProps;
216
+ }, () => {
215
217
  return escape(VirtualizerContext(new _P$4(state, props, options, state)));
216
218
  }, true);
217
219
  }
@@ -1 +1 @@
1
- {"version":3,"file":"virtualizer.js","names":["<div {...scroll.contentProps}>\n <VirtualizerContext value={state}>\n {\n <For each={state.visibleViews}>\n {(view) =>\n renderView(\n null,\n view,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n }\n </For>\n }\n </VirtualizerContext>\n </div>","<VirtualizerContext value={state}>\n {\n <For each={state.visibleViews}>\n {(view) =>\n renderView(\n null,\n view,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n }\n </For>\n }\n </VirtualizerContext>","{view()\n ? [...requireValue(view(), \"Expected view()\").children].map((child) =>\n renderView(\n requireValue(view(), \"Expected view()\"),\n child,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n )\n : null}","{renderIndicatorView(\n parent,\n view,\n { dropPosition: \"before\", key: node.key, type: \"item\" },\n renderIndicator\n )}","{renderAfterDropIndicators(view.virtualizer.collection, node, (target) =>\n renderIndicatorView(parent, view, target, renderIndicator)\n )}","_$ssrElement","_$escape","_$memo"],"sources":["../../src/virtualizer.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Virtualizer.tsx.\n * Modified for Solid Aria: collection virtualization, scroll measurement, view ownership and layout options use Solid primitives.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createScrollView } from \"@solid2-aria/core/virtualizer/scroll-view\";\nimport { VirtualizerItem } from \"@solid2-aria/core/virtualizer/virtualizer-item\";\nimport { createVirtualizerState } from \"@solid2-aria/stately/virtualizer/create-virtualizer-state\";\nimport type { VirtualizerState } from \"@solid2-aria/stately/virtualizer/create-virtualizer-state\";\nimport type { Layout } from \"@solid2-aria/stately/virtualizer/layout\";\nimport type { ReusableView } from \"@solid2-aria/stately/virtualizer/reusable-view\";\nimport type {\n DropTarget,\n Node,\n DropTargetDelegate,\n ItemDropTarget,\n} from \"@solid2-aria/types-shared\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n For,\n createContext,\n useContext,\n createMemo,\n merge,\n untrack,\n} from \"solid-js\";\n\nimport {\n CollectionRendererContext,\n renderAfterDropIndicators,\n} from \"./collection\";\nimport type {\n CollectionRootProps,\n CollectionBranchProps,\n CollectionRenderer,\n} from \"./collection\";\n\nexport interface LayoutOptionsDelegate<O> {\n createLayoutOptions?: () => O;\n}\n\ninterface ILayout<O>\n extends\n Layout<Node<unknown>, O>,\n Partial<DropTargetDelegate>,\n LayoutOptionsDelegate<O> {}\n\ntype LayoutClass<O> = new () => ILayout<O>;\n\nexport interface VirtualizerProps<O> {\n children: JSX.Element;\n layout: LayoutClass<O> | ILayout<O>;\n layoutOptions?: O;\n shouldObserveItemSize?: boolean;\n}\n\nconst VirtualizerOptionsContext = createContext<{\n layout: ILayout<unknown>;\n layoutOptions?: unknown;\n shouldObserveItemSize?: boolean;\n} | null>(null);\n\nconst VirtualizerContext = createContext<VirtualizerState<\n Node<unknown>,\n JSX.Element\n> | null>(null);\n\ntype View = ReusableView<Node<unknown>, JSX.Element>;\n\nexport function Virtualizer<O>(props: VirtualizerProps<O>) {\n const layout = createMemo(() =>\n typeof props.layout === \"function\" ? new props.layout() : props.layout\n );\n\n const renderer: CollectionRenderer = {\n CollectionBranch,\n CollectionRoot,\n get dropTargetDelegate() {\n const initialValue = layout();\n\n return initialValue.getDropTargetFromPoint\n ? {\n getDropTargetFromPoint: (\n x: number,\n y: number,\n valid: (target: DropTarget) => boolean\n ) => initialValue.getDropTargetFromPoint?.(x, y, valid) ?? null,\n }\n : undefined;\n },\n isVirtualized: true,\n get layoutDelegate() {\n return layout();\n },\n };\n\n const options = {\n get layout() {\n return layout();\n },\n get layoutOptions() {\n return props.layoutOptions;\n },\n get shouldObserveItemSize() {\n return props.shouldObserveItemSize;\n },\n };\n\n return (\n <CollectionRendererContext value={renderer}>\n <VirtualizerOptionsContext value={options}>\n {props.children}\n </VirtualizerOptionsContext>\n </CollectionRendererContext>\n );\n}\n\nfunction CollectionRoot(props: CollectionRootProps) {\n const options = requireValue(\n useContext(VirtualizerOptionsContext),\n \"Expected useContext(VirtualizerOptionsContext)\"\n );\n\n const layout = untrack(() => options.layout);\n const derivedOptions = layout.createLayoutOptions?.();\n\n const state = createVirtualizerState<Node<unknown>, JSX.Element>({\n allowsWindowScrolling: true,\n get collection() {\n return props.collection;\n },\n get layout() {\n return options.layout;\n },\n get layoutOptions() {\n return Boolean(derivedOptions) && Boolean(options.layoutOptions)\n ? // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n merge(options.layoutOptions, derivedOptions)\n : // oxlint-enable solid/reactivity\n (derivedOptions ?? options.layoutOptions);\n },\n onVisibleRectChange(rect) {\n const element = props.scrollRef?.();\n\n if (element) {\n element.scrollLeft = rect.x;\n element.scrollTop = rect.y;\n }\n },\n get persistedKeys() {\n return props.persistedKeys;\n },\n renderView: (_type, item) => item?.render?.(item) ?? item?.rendered,\n });\n\n const scroll = createScrollView(\n {\n allowsWindowScrolling: true,\n get contentSize() {\n return state.contentSize;\n },\n onScrollEnd: state.endScrolling,\n onScrollStart: state.startScrolling,\n onSizeChange: state.setSize,\n onVisibleRectChange: state.setVisibleRect,\n },\n requireValue(\n untrack(() => props.scrollRef),\n \"Expected props.scrollRef\"\n )\n );\n\n return (\n <div {...scroll.contentProps}>\n <VirtualizerContext value={state}>\n {\n <For each={state.visibleViews}>\n {(view) =>\n renderView(\n null,\n view,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n }\n </For>\n }\n </VirtualizerContext>\n </div>\n );\n}\n\nfunction CollectionBranch(props: CollectionBranchProps) {\n const state = requireValue(\n useContext(VirtualizerContext),\n \"Expected useContext(VirtualizerContext)\"\n );\n\n const options = requireValue(\n useContext(VirtualizerOptionsContext),\n \"Expected useContext(VirtualizerOptionsContext)\"\n );\n\n const view = () => state.virtualizer.getVisibleView(props.parent.key);\n\n return (\n <>\n {view()\n ? [...requireValue(view(), \"Expected view()\").children].map((child) =>\n renderView(\n requireValue(view(), \"Expected view()\"),\n child,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n )\n : null}\n </>\n );\n}\n\nfunction renderView(\n parent: View | null,\n view: View,\n renderIndicator?: (target: ItemDropTarget) => JSX.Element,\n observe?: boolean\n): JSX.Element {\n const node = view.content;\n\n const rendered = (\n <VirtualizerItem\n layoutInfo={requireValue(view.layoutInfo, \"Expected view.layoutInfo\")}\n virtualizer={view.virtualizer}\n parent={parent?.layoutInfo}\n shouldObserveItemSize={observe}\n >\n {view.rendered}\n </VirtualizerItem>\n );\n\n if (\n node?.type !== \"item\" ||\n !renderIndicator ||\n !view.virtualizer.layout.getDropTargetLayoutInfo\n ) {\n return rendered;\n }\n\n return (\n <>\n {renderIndicatorView(\n parent,\n view,\n { dropPosition: \"before\", key: node.key, type: \"item\" },\n renderIndicator\n )}\n {rendered}\n {renderAfterDropIndicators(view.virtualizer.collection, node, (target) =>\n renderIndicatorView(parent, view, target, renderIndicator)\n )}\n </>\n );\n}\n\nfunction renderIndicatorView(\n parent: View | null,\n view: View,\n target: ItemDropTarget,\n render: (target: ItemDropTarget) => JSX.Element\n): JSX.Element {\n const indicator = render(target);\n\n if (!isTruthy(indicator)) {\n return null;\n }\n\n const info = requireValue(\n view.virtualizer.layout.getDropTargetLayoutInfo?.(target),\n \"Expected a drop target layout\"\n );\n\n return (\n <VirtualizerItem\n layoutInfo={info}\n virtualizer={view.virtualizer}\n parent={parent?.layoutInfo}\n >\n {indicator}\n </VirtualizerItem>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6HQ,O,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A;AAGd;AAEA,SAAS,WACP,QACA,MACA,iBACA,SACa;CACb,MAAM,OAAO,KAAK;CAElB,MAAM,WAAA,gBACJ,IAAA,KAC2B,MAEjB,QACe,OAGR,CAAA;CAGnB,IACE,MAAM,SAAS,UACf,CAAC,mBACD,CAAC,KAAK,YAAY,OAAO,yBAEzB,OAAO;CAGT,OACE;EACEC,WAAAA;GAAC,OAAA,oBACC,QACA,MACA;IAAE,cAAc;IAAU,KAAK,KAAK;IAAK,MAAM;GAAO,GACtD,eACF;EAAC,CAAA;EACA;EACDC,WAAAA;GAAC,OAAA,0BAA0B,KAAK,YAAY,YAAY,OAAO,WAC7D,oBAAoB,QAAQ,MAAM,QAAQ,eAAe,CAC3D;EAAC,CAAA;CACD;AAEN;AAEA,SAAS,oBACP,QACA,MACA,QACA,QACa;CACb,MAAM,YAAY,OAAO,MAAM;CAE/B,IAAI,CAAC,SAAS,SAAS,GACrB,OAAO;CAGT,MAAM,OAAO,aACX,KAAK,YAAY,OAAO,0BAA0B,MAAM,GACxD,+BACF;CAEA,OAAA,gBACE,IAAA,KAEe,MACL,QAFI,MAIX,SACc,CAAA;AAErB"}
1
+ {"version":3,"file":"virtualizer.js","names":["<div {...scroll.contentProps}>\n <VirtualizerContext value={state}>\n {\n <For each={state.visibleViews}>\n {(view) =>\n renderView(\n null,\n view,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n }\n </For>\n }\n </VirtualizerContext>\n </div>","<VirtualizerContext value={state}>\n {\n <For each={state.visibleViews}>\n {(view) =>\n renderView(\n null,\n view,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n }\n </For>\n }\n </VirtualizerContext>","{view()\n ? [...requireValue(view(), \"Expected view()\").children].map((child) =>\n renderView(\n requireValue(view(), \"Expected view()\"),\n child,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n )\n : null}","{renderIndicatorView(\n parent,\n view,\n { dropPosition: \"before\", key: node.key, type: \"item\" },\n renderIndicator\n )}","{renderAfterDropIndicators(view.virtualizer.collection, node, (target) =>\n renderIndicatorView(parent, view, target, renderIndicator)\n )}","_$ssrElement","_$escape","_$memo"],"sources":["../../src/virtualizer.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Virtualizer.tsx.\n * Modified for Solid Aria: collection virtualization, scroll measurement, view ownership and layout options use Solid primitives.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createScrollView } from \"@solid2-aria/core/virtualizer/scroll-view\";\nimport { VirtualizerItem } from \"@solid2-aria/core/virtualizer/virtualizer-item\";\nimport { createVirtualizerState } from \"@solid2-aria/stately/virtualizer/create-virtualizer-state\";\nimport type { VirtualizerState } from \"@solid2-aria/stately/virtualizer/create-virtualizer-state\";\nimport type { Layout } from \"@solid2-aria/stately/virtualizer/layout\";\nimport type { ReusableView } from \"@solid2-aria/stately/virtualizer/reusable-view\";\nimport type {\n DropTarget,\n Node,\n DropTargetDelegate,\n ItemDropTarget,\n} from \"@solid2-aria/types-shared\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n For,\n createContext,\n useContext,\n createMemo,\n merge,\n untrack,\n} from \"solid-js\";\n\nimport {\n CollectionRendererContext,\n renderAfterDropIndicators,\n} from \"./collection\";\nimport type {\n CollectionRootProps,\n CollectionBranchProps,\n CollectionRenderer,\n} from \"./collection\";\n\nexport interface LayoutOptionsDelegate<O> {\n createLayoutOptions?: () => O;\n}\n\ninterface ILayout<O>\n extends\n Layout<Node<unknown>, O>,\n Partial<DropTargetDelegate>,\n LayoutOptionsDelegate<O> {}\n\ntype LayoutClass<O> = new () => ILayout<O>;\n\nexport interface VirtualizerProps<O> {\n children: JSX.Element;\n layout: LayoutClass<O> | ILayout<O>;\n layoutOptions?: O;\n shouldObserveItemSize?: boolean;\n}\n\nconst VirtualizerOptionsContext = createContext<{\n layout: ILayout<unknown>;\n layoutOptions?: unknown;\n shouldObserveItemSize?: boolean;\n} | null>(null);\n\nconst VirtualizerContext = createContext<VirtualizerState<\n Node<unknown>,\n JSX.Element\n> | null>(null);\n\ntype View = ReusableView<Node<unknown>, JSX.Element>;\n\nexport function Virtualizer<O>(props: VirtualizerProps<O>) {\n const layout = createMemo(() =>\n typeof props.layout === \"function\" ? new props.layout() : props.layout\n );\n\n const renderer: CollectionRenderer = {\n CollectionBranch,\n CollectionRoot,\n get dropTargetDelegate() {\n const initialValue = layout();\n\n return initialValue.getDropTargetFromPoint\n ? {\n getDropTargetFromPoint: (\n x: number,\n y: number,\n valid: (target: DropTarget) => boolean\n ) => initialValue.getDropTargetFromPoint?.(x, y, valid) ?? null,\n }\n : undefined;\n },\n isVirtualized: true,\n get layoutDelegate() {\n return layout();\n },\n };\n\n const options = {\n get layout() {\n return layout();\n },\n get layoutOptions() {\n return props.layoutOptions;\n },\n get shouldObserveItemSize() {\n return props.shouldObserveItemSize;\n },\n };\n\n return (\n <CollectionRendererContext value={renderer}>\n <VirtualizerOptionsContext value={options}>\n {props.children}\n </VirtualizerOptionsContext>\n </CollectionRendererContext>\n );\n}\n\nfunction CollectionRoot(props: CollectionRootProps) {\n const options = requireValue(\n useContext(VirtualizerOptionsContext),\n \"Expected useContext(VirtualizerOptionsContext)\"\n );\n\n const layout = untrack(() => options.layout);\n const derivedOptions = layout.createLayoutOptions?.();\n\n const state = createVirtualizerState<Node<unknown>, JSX.Element>({\n allowsWindowScrolling: true,\n get collection() {\n return props.collection;\n },\n get layout() {\n return options.layout;\n },\n get layoutOptions() {\n return Boolean(derivedOptions) && Boolean(options.layoutOptions)\n ? // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n merge(options.layoutOptions, derivedOptions)\n : // oxlint-enable solid/reactivity\n (derivedOptions ?? options.layoutOptions);\n },\n onVisibleRectChange(rect) {\n const element = props.scrollRef?.();\n\n if (element) {\n element.scrollLeft = rect.x;\n element.scrollTop = rect.y;\n }\n },\n get persistedKeys() {\n return props.persistedKeys;\n },\n renderView: (_type, item) => item?.render?.(item) ?? item?.rendered,\n });\n\n const scroll = createScrollView(\n {\n allowsWindowScrolling: true,\n get contentSize() {\n return state.contentSize;\n },\n onScrollEnd: state.endScrolling,\n onScrollStart: state.startScrolling,\n onSizeChange: state.setSize,\n onVisibleRectChange: state.setVisibleRect,\n },\n requireValue(\n untrack(() => props.scrollRef),\n \"Expected props.scrollRef\"\n )\n );\n\n return (\n <div {...scroll.contentProps}>\n <VirtualizerContext value={state}>\n {\n <For each={state.visibleViews}>\n {(view) =>\n renderView(\n null,\n view,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n }\n </For>\n }\n </VirtualizerContext>\n </div>\n );\n}\n\nfunction CollectionBranch(props: CollectionBranchProps) {\n const state = requireValue(\n useContext(VirtualizerContext),\n \"Expected useContext(VirtualizerContext)\"\n );\n\n const options = requireValue(\n useContext(VirtualizerOptionsContext),\n \"Expected useContext(VirtualizerOptionsContext)\"\n );\n\n const view = () => state.virtualizer.getVisibleView(props.parent.key);\n\n return (\n <>\n {view()\n ? [...requireValue(view(), \"Expected view()\").children].map((child) =>\n renderView(\n requireValue(view(), \"Expected view()\"),\n child,\n props.renderDropIndicator,\n options.shouldObserveItemSize\n )\n )\n : null}\n </>\n );\n}\n\nfunction renderView(\n parent: View | null,\n view: View,\n renderIndicator?: (target: ItemDropTarget) => JSX.Element,\n observe?: boolean\n): JSX.Element {\n const node = view.content;\n\n const rendered = (\n <VirtualizerItem\n layoutInfo={requireValue(view.layoutInfo, \"Expected view.layoutInfo\")}\n virtualizer={view.virtualizer}\n parent={parent?.layoutInfo}\n shouldObserveItemSize={observe}\n >\n {view.rendered}\n </VirtualizerItem>\n );\n\n if (\n node?.type !== \"item\" ||\n !renderIndicator ||\n !view.virtualizer.layout.getDropTargetLayoutInfo\n ) {\n return rendered;\n }\n\n return (\n <>\n {renderIndicatorView(\n parent,\n view,\n { dropPosition: \"before\", key: node.key, type: \"item\" },\n renderIndicator\n )}\n {rendered}\n {renderAfterDropIndicators(view.virtualizer.collection, node, (target) =>\n renderIndicatorView(parent, view, target, renderIndicator)\n )}\n </>\n );\n}\n\nfunction renderIndicatorView(\n parent: View | null,\n view: View,\n target: ItemDropTarget,\n render: (target: ItemDropTarget) => JSX.Element\n): JSX.Element {\n const indicator = render(target);\n\n if (!isTruthy(indicator)) {\n return null;\n }\n\n const info = requireValue(\n view.virtualizer.layout.getDropTargetLayoutInfo?.(target),\n \"Expected a drop target layout\"\n );\n\n return (\n <VirtualizerItem\n layoutInfo={info}\n virtualizer={view.virtualizer}\n parent={parent?.layoutInfo}\n >\n {indicator}\n </VirtualizerItem>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6HQ,O,SAAC,CAAM;;;;;;;;;;;;;;;EADT,OAAA,0BAAA,IAAA,IACG,OAD+B,OAEP,CAAA;;;;;;;;;;;;;;EAgElB,O,SAAM,CAAM;;;;;;;;;;;;;;;;EADnB,OAAA,IACE,IAAA,KAAW,QACP,SACA,WACE,MACA,MACA,MAAM,qBACN,QAAQ,qBACV,CAEC,CAAA;;;;;;;;;;;;;;;;EA8CT,OAAY,aAAa,KAAK,YAAY,0BAA0B;;;;;;;EACpE,O,SAAa,CAAK;;;;;;;EAClB,O,UAAQ,EAAQ;;;;;;;EAGhB,O,SAAC,CAAK;;;;;;;;;;;;;;;;;EAgDN,O,SAAa,CAAK;;;;;;;EAClB,O,UAAQ,EA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,MAAM,QAAQ,eAAe,CAC3D;EAAC,CAAA;CACD;AAEN;AAEA,SAAS,oBACP,QACA,MACA,QACA,QACa;CACb,MAAM,YAAY,OAAO,MAAM;CAE/B,IAAI,CAAC,SAAS,SAAS,GACrB,OAAO;CAGT,MAAM,OAAO,aACX,KAAK,YAAY,OAAO,0BAA0B,MAAM,GACxD,+BACF;CAEA,OAAA,gBACE,IAAA,KAEe,MACL,QAFI,MAIX,SACc,CAAA;AAErB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solid2-aria/components",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "description": "Styleable accessible components for Solid 2",
6
6
  "keywords": [
@@ -417,23 +417,24 @@
417
417
  "dependencies": {
418
418
  "@internationalized/date": "^3.12.4",
419
419
  "@internationalized/string": "^3.2.10",
420
- "@solid2-aria/core": "^0.0.1",
421
- "@solid2-aria/stately": "^0.0.1",
422
- "@solid2-aria/types-shared": "^0.0.1",
423
- "@solid2-aria/types-shared-web": "^0.0.1"
420
+ "@solid2-aria/core": "^0.1.0",
421
+ "@solid2-aria/stately": "^0.1.0",
422
+ "@solid2-aria/types-shared": "^0.1.0",
423
+ "@solid2-aria/types-shared-web": "^0.1.0"
424
424
  },
425
425
  "devDependencies": {
426
- "@solidjs/compiler": "^2.0.0-rc.17",
427
- "@solidjs/web": "^2.0.0-rc.17",
426
+ "@solidjs/compiler": "^2.0.0",
427
+ "@solidjs/web": "^2.0.0",
428
428
  "@types/bun": "^1.4.4",
429
429
  "happy-dom": "^21.0.4",
430
- "solid-js": "^2.0.0-rc.17",
430
+ "rolldown-plugin-solid-compiler": "^1.0.0",
431
+ "solid-js": "^2.0.0",
431
432
  "tsdown": "^0.23.2",
432
- "tsrs": "^0.20.0-ts7.1.0-beta",
433
+ "tsrs": "^7.1.0-beta.tsrs3",
433
434
  "typescript": "^7.1.0-beta"
434
435
  },
435
436
  "peerDependencies": {
436
- "@solidjs/web": "^2.0.0-rc.17",
437
- "solid-js": "^2.0.0-rc.17"
437
+ "@solidjs/web": "^2.0.0",
438
+ "solid-js": "^2.0.0"
438
439
  }
439
440
  }