@qwik.dev/devtools 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin/index.js +8 -5
- package/dist/ui/_virtual/index.qwik.cjs +5 -4
- package/dist/ui/_virtual/index.qwik.mjs +5 -3
- package/dist/ui/components/Tree/Tree.qwik.cjs +36 -16
- package/dist/ui/components/Tree/Tree.qwik.mjs +36 -16
- package/dist/ui/devtools.qwik.cjs +0 -20
- package/dist/ui/devtools.qwik.mjs +1 -21
- package/dist/ui/features/RenderTree/RenderTree.qwik.cjs +125 -62
- package/dist/ui/features/RenderTree/RenderTree.qwik.mjs +125 -62
- package/dist/ui/features/RenderTree/formatTreeData.qwik.cjs +3 -0
- package/dist/ui/features/RenderTree/formatTreeData.qwik.mjs +3 -0
- package/dist/ui/global.css.qwik.cjs +101 -28
- package/dist/ui/global.css.qwik.mjs +101 -28
- package/dist/ui/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.4.2_tsx@4.19.2_yaml@2.7.0__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.cjs +0 -17
- package/dist/ui/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@7.1.3_@types_node@20.14.11_jiti@2.4.2_tsx@4.19.2_yaml@2.7.0__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs +0 -17
- package/dist/ui/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.cjs +1 -1
- package/dist/ui/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.mjs +1 -1
- package/package.json +4 -1
- package/dist/ui/_virtual/client.qwik.cjs +0 -5
- package/dist/ui/_virtual/client.qwik.mjs +0 -5
- package/dist/ui/_virtual/client.qwik2.cjs +0 -4
- package/dist/ui/_virtual/client.qwik2.mjs +0 -4
- package/dist/ui/_virtual/index.qwik2.cjs +0 -8
- package/dist/ui/_virtual/index.qwik2.mjs +0 -8
- package/dist/ui/_virtual/index.qwik3.cjs +0 -4
- package/dist/ui/_virtual/index.qwik3.mjs +0 -4
- package/dist/ui/_virtual/index.qwik4.cjs +0 -4
- package/dist/ui/_virtual/index.qwik4.mjs +0 -4
- package/dist/ui/_virtual/index.qwik5.cjs +0 -6
- package/dist/ui/_virtual/index.qwik5.mjs +0 -7
- package/dist/ui/_virtual/index.qwik6.cjs +0 -4
- package/dist/ui/_virtual/index.qwik6.mjs +0 -4
- package/dist/ui/_virtual/jsx-runtime.qwik.cjs +0 -5
- package/dist/ui/_virtual/jsx-runtime.qwik.mjs +0 -5
- package/dist/ui/_virtual/jsx-runtime.qwik2.cjs +0 -4
- package/dist/ui/_virtual/jsx-runtime.qwik2.mjs +0 -4
- package/dist/ui/_virtual/react-dom-server-legacy.node.development.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-dom-server-legacy.node.development.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-dom-server-legacy.node.production.min.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-dom-server-legacy.node.production.min.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-dom-server.node.development.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-dom-server.node.development.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-dom-server.node.production.min.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-dom-server.node.production.min.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-dom.development.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-dom.development.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-dom.production.min.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-dom.production.min.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-jsx-runtime.development.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-jsx-runtime.development.qwik.mjs +0 -4
- package/dist/ui/_virtual/react-jsx-runtime.production.min.qwik.cjs +0 -4
- package/dist/ui/_virtual/react-jsx-runtime.production.min.qwik.mjs +0 -4
- package/dist/ui/_virtual/react.development.qwik.cjs +0 -4
- package/dist/ui/_virtual/react.development.qwik.mjs +0 -4
- package/dist/ui/_virtual/react.production.min.qwik.cjs +0 -4
- package/dist/ui/_virtual/react.production.min.qwik.mjs +0 -4
- package/dist/ui/_virtual/scheduler.development.qwik.cjs +0 -4
- package/dist/ui/_virtual/scheduler.development.qwik.mjs +0 -4
- package/dist/ui/_virtual/scheduler.production.min.qwik.cjs +0 -4
- package/dist/ui/_virtual/scheduler.production.min.qwik.mjs +0 -4
- package/dist/ui/_virtual/server.node.qwik.cjs +0 -5
- package/dist/ui/_virtual/server.node.qwik.mjs +0 -5
- package/dist/ui/_virtual/server.node.qwik2.cjs +0 -4
- package/dist/ui/_virtual/server.node.qwik2.mjs +0 -4
- package/dist/ui/features/Components/Components.qwik.cjs +0 -108
- package/dist/ui/features/Components/Components.qwik.mjs +0 -108
- package/dist/ui/features/Components/components/Tree.qwik.cjs +0 -60
- package/dist/ui/features/Components/components/Tree.qwik.mjs +0 -60
- package/dist/ui/features/Components/styles.css.qwik.cjs +0 -3
- package/dist/ui/features/Components/styles.css.qwik.mjs +0 -4
- package/dist/ui/lib-types/ui/src/features/Components/Components.d.ts +0 -19
- package/dist/ui/lib-types/ui/src/features/Components/components/Tree.d.ts +0 -1
- package/dist/ui/node_modules/.pnpm/@qwik.dev_react@2.0.0-beta.9_@qwik.dev_core@2.0.0-beta.9_prettier@3.3.3_vite@7.1.3_@typ_acdb3a1fab641cc17ee740fd3c684547/node_modules/@qwik.dev/react/lib/index.qwik.qwik.cjs +0 -269
- package/dist/ui/node_modules/.pnpm/@qwik.dev_react@2.0.0-beta.9_@qwik.dev_core@2.0.0-beta.9_prettier@3.3.3_vite@7.1.3_@typ_acdb3a1fab641cc17ee740fd3c684547/node_modules/@qwik.dev/react/lib/index.qwik.qwik.mjs +0 -269
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/EventEmitter.qwik.cjs +0 -162
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/EventEmitter.qwik.mjs +0 -162
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/ControlledTreeEnvironment.qwik.cjs +0 -48
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/ControlledTreeEnvironment.qwik.mjs +0 -48
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/InteractionManagerProvider.qwik.cjs +0 -29
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/InteractionManagerProvider.qwik.mjs +0 -29
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/buildInteractionMode.qwik.cjs +0 -19
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/buildInteractionMode.qwik.mjs +0 -19
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/layoutUtils.qwik.cjs +0 -17
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/layoutUtils.qwik.mjs +0 -17
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/mergeInteractionManagers.qwik.cjs +0 -22
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/mergeInteractionManagers.qwik.mjs +0 -22
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/useControlledTreeEnvironmentProps.qwik.cjs +0 -127
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/useControlledTreeEnvironmentProps.qwik.mjs +0 -127
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/useLinearItems.qwik.cjs +0 -7
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/controlledEnvironment/useLinearItems.qwik.mjs +0 -7
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/DragAndDropProvider.qwik.cjs +0 -231
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/DragAndDropProvider.qwik.mjs +0 -231
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/DraggingPositionEvaluation.qwik.cjs +0 -179
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/DraggingPositionEvaluation.qwik.mjs +0 -179
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useCanDropAt.qwik.cjs +0 -30
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useCanDropAt.qwik.mjs +0 -30
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useDraggingPosition.qwik.cjs +0 -87
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useDraggingPosition.qwik.mjs +0 -87
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useGetParentOfLinearItem.qwik.cjs +0 -21
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useGetParentOfLinearItem.qwik.mjs +0 -21
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useGetViableDragPositions.qwik.cjs +0 -90
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/drag/useGetViableDragPositions.qwik.mjs +0 -90
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/environmentActions/EnvironmentActionsProvider.qwik.cjs +0 -321
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/environmentActions/EnvironmentActionsProvider.qwik.mjs +0 -321
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/environmentActions/useCreatedEnvironmentRef.qwik.cjs +0 -24
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/environmentActions/useCreatedEnvironmentRef.qwik.mjs +0 -24
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/defaultKeyboardBindings.qwik.cjs +0 -18
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/defaultKeyboardBindings.qwik.mjs +0 -18
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/useHotkey.qwik.cjs +0 -76
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/useHotkey.qwik.mjs +0 -76
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/useKey.qwik.cjs +0 -15
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/useKey.qwik.mjs +0 -15
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/useKeyboardBindings.qwik.cjs +0 -26
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/hotkeys/useKeyboardBindings.qwik.mjs +0 -26
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/interactionMode/ClickArrowToExpandInteractionManager.qwik.cjs +0 -49
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/interactionMode/ClickArrowToExpandInteractionManager.qwik.mjs +0 -49
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/interactionMode/ClickItemToExpandInteractionManager.qwik.cjs +0 -52
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/interactionMode/ClickItemToExpandInteractionManager.qwik.mjs +0 -52
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/interactionMode/DoubleClickItemToExpandInteractionManager.qwik.cjs +0 -56
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/interactionMode/DoubleClickItemToExpandInteractionManager.qwik.mjs +0 -56
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/isControlKey.qwik.cjs +0 -6
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/isControlKey.qwik.mjs +0 -6
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/renderers/createDefaultRenderers.qwik.cjs +0 -136
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/renderers/createDefaultRenderers.qwik.mjs +0 -136
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/renderers/useRenderers.qwik.cjs +0 -42
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/renderers/useRenderers.qwik.mjs +0 -42
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/search/SearchInput.qwik.cjs +0 -69
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/search/SearchInput.qwik.mjs +0 -69
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/search/defaultMatcher.qwik.cjs +0 -6
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/search/defaultMatcher.qwik.mjs +0 -6
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/search/useSearchMatchFocus.qwik.cjs +0 -37
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/search/useSearchMatchFocus.qwik.mjs +0 -37
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/DragBetweenLine.qwik.cjs +0 -31
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/DragBetweenLine.qwik.mjs +0 -31
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/LiveDescription.qwik.cjs +0 -52
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/LiveDescription.qwik.mjs +0 -52
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/MaybeLiveDescription.qwik.cjs +0 -14
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/MaybeLiveDescription.qwik.mjs +0 -14
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/Tree.qwik.cjs +0 -87
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/Tree.qwik.mjs +0 -87
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/TreeManager.qwik.cjs +0 -62
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/TreeManager.qwik.mjs +0 -62
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/defaultLiveDescriptors.qwik.cjs +0 -10
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/defaultLiveDescriptors.qwik.mjs +0 -10
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/getItemsLinearly.qwik.cjs +0 -19
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/getItemsLinearly.qwik.mjs +0 -19
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/resolveLiveDescriptor.qwik.cjs +0 -41
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/resolveLiveDescriptor.qwik.mjs +0 -41
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/scrollIntoView.qwik.cjs +0 -19
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/scrollIntoView.qwik.mjs +0 -19
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useCreatedTreeInformation.qwik.cjs +0 -37
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useCreatedTreeInformation.qwik.mjs +0 -37
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useFocusWithin.qwik.cjs +0 -31
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useFocusWithin.qwik.mjs +0 -31
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useMoveFocusToIndex.qwik.cjs +0 -25
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useMoveFocusToIndex.qwik.mjs +0 -25
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useSelectUpTo.qwik.cjs +0 -82
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useSelectUpTo.qwik.mjs +0 -82
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useTreeKeyboardBindings.qwik.cjs +0 -164
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useTreeKeyboardBindings.qwik.mjs +0 -164
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useViewState.qwik.cjs +0 -11
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/tree/useViewState.qwik.mjs +0 -11
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeActions/TreeActionsProvider.qwik.cjs +0 -87
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeActions/TreeActionsProvider.qwik.mjs +0 -87
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeActions/useCreatedTreeRef.qwik.cjs +0 -26
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeActions/useCreatedTreeRef.qwik.mjs +0 -26
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/TreeItemChildren.qwik.cjs +0 -27
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/TreeItemChildren.qwik.mjs +0 -27
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/TreeItemElement.qwik.cjs +0 -53
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/TreeItemElement.qwik.mjs +0 -53
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/TreeItemRenamingInput.qwik.cjs +0 -78
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/TreeItemRenamingInput.qwik.mjs +0 -78
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/useTreeItemRenderContext.qwik.cjs +0 -200
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/treeItem/useTreeItemRenderContext.qwik.mjs +0 -200
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/types.qwik.cjs +0 -8
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/types.qwik.mjs +0 -9
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/uncontrolledEnvironment/CompleteTreeDataProvider.qwik.cjs +0 -145
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/uncontrolledEnvironment/CompleteTreeDataProvider.qwik.mjs +0 -145
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/uncontrolledEnvironment/StaticTreeDataProvider.qwik.cjs +0 -152
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/uncontrolledEnvironment/StaticTreeDataProvider.qwik.mjs +0 -152
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/uncontrolledEnvironment/UncontrolledTreeEnvironment.qwik.cjs +0 -320
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/uncontrolledEnvironment/UncontrolledTreeEnvironment.qwik.mjs +0 -320
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useCallSoon.qwik.cjs +0 -29
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useCallSoon.qwik.mjs +0 -29
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useGetOriginalItemOrder.qwik.cjs +0 -27
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useGetOriginalItemOrder.qwik.mjs +0 -27
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useHtmlElementEventListener.qwik.cjs +0 -18
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useHtmlElementEventListener.qwik.mjs +0 -18
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useIsMounted.qwik.cjs +0 -14
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useIsMounted.qwik.mjs +0 -14
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useRefCopy.qwik.cjs +0 -9
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useRefCopy.qwik.mjs +0 -9
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useSideEffect.qwik.cjs +0 -30
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useSideEffect.qwik.mjs +0 -30
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useStableHandler.qwik.cjs +0 -17
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/useStableHandler.qwik.mjs +0 -17
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/utils.qwik.cjs +0 -27
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/utils.qwik.mjs +0 -27
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/waitFor.qwik.cjs +0 -30
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/esm/waitFor.qwik.mjs +0 -30
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/style-modern.css.qwik.cjs +0 -3
- package/dist/ui/node_modules/.pnpm/react-complex-tree@2.4.6_react@18.2.0/node_modules/react-complex-tree/lib/style-modern.css.qwik.mjs +0 -4
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.qwik.cjs +0 -5418
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.qwik.mjs +0 -5418
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.qwik.cjs +0 -1531
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.qwik.mjs +0 -1531
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.node.development.qwik.cjs +0 -5432
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.node.development.qwik.mjs +0 -5432
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.node.production.min.qwik.cjs +0 -1595
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.node.production.min.qwik.mjs +0 -1595
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.qwik.cjs +0 -21128
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.qwik.mjs +0 -21128
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.production.min.qwik.cjs +0 -6420
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.production.min.qwik.mjs +0 -6420
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/client.qwik.cjs +0 -34
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/client.qwik.mjs +0 -34
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.qwik.cjs +0 -31
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.qwik.mjs +0 -31
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/server.node.qwik.cjs +0 -28
- package/dist/ui/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/server.node.qwik.mjs +0 -28
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.qwik.cjs +0 -875
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.qwik.mjs +0 -875
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.qwik.cjs +0 -33
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.qwik.mjs +0 -33
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.qwik.cjs +0 -1887
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.qwik.mjs +0 -1887
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.qwik.cjs +0 -265
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.qwik.mjs +0 -265
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/index.qwik.cjs +0 -17
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/index.qwik.mjs +0 -17
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.qwik.cjs +0 -17
- package/dist/ui/node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.qwik.mjs +0 -17
- package/dist/ui/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.qwik.cjs +0 -453
- package/dist/ui/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.qwik.mjs +0 -453
- package/dist/ui/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.qwik.cjs +0 -248
- package/dist/ui/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.qwik.mjs +0 -248
- package/dist/ui/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.qwik.cjs +0 -17
- package/dist/ui/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.qwik.mjs +0 -17
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../../../../../../../../_virtual/index.qwik2.cjs");
|
|
4
|
-
const ControlledTreeEnvironment = require("../controlledEnvironment/ControlledTreeEnvironment.qwik.cjs");
|
|
5
|
-
const useCanDropAt = require("./useCanDropAt.qwik.cjs");
|
|
6
|
-
const useGetViableDragPositions = require("./useGetViableDragPositions.qwik.cjs");
|
|
7
|
-
const useSideEffect = require("../useSideEffect.qwik.cjs");
|
|
8
|
-
const utils = require("../utils.qwik.cjs");
|
|
9
|
-
const useCallSoon = require("../useCallSoon.qwik.cjs");
|
|
10
|
-
const useStableHandler = require("../useStableHandler.qwik.cjs");
|
|
11
|
-
const useGetOriginalItemOrder = require("../useGetOriginalItemOrder.qwik.cjs");
|
|
12
|
-
const useDraggingPosition = require("./useDraggingPosition.qwik.cjs");
|
|
13
|
-
const layoutUtils = require("../controlledEnvironment/layoutUtils.qwik.cjs");
|
|
14
|
-
var DragAndDropContext = index.reactExports.createContext(null);
|
|
15
|
-
var useDragAndDrop = function() {
|
|
16
|
-
return index.reactExports.useContext(DragAndDropContext);
|
|
17
|
-
};
|
|
18
|
-
var DragAndDropProvider = function(_a) {
|
|
19
|
-
var children = _a.children;
|
|
20
|
-
var environment = ControlledTreeEnvironment.useTreeEnvironment();
|
|
21
|
-
var _b = index.reactExports.useState(false), isProgrammaticallyDragging = _b[0], setIsProgrammaticallyDragging = _b[1];
|
|
22
|
-
var _c = index.reactExports.useState({}), viableDragPositions = _c[0], setViableDragPositions = _c[1];
|
|
23
|
-
var _d = index.reactExports.useState(0), programmaticDragIndex = _d[0], setProgrammaticDragIndex = _d[1];
|
|
24
|
-
var _e = index.reactExports.useState(), draggingPosition = _e[0], setDraggingPosition = _e[1];
|
|
25
|
-
var getViableDragPositions = useGetViableDragPositions.useGetViableDragPositions();
|
|
26
|
-
var callSoon = useCallSoon.useCallSoon();
|
|
27
|
-
var getOriginalItemOrder = useGetOriginalItemOrder.useGetOriginalItemOrder();
|
|
28
|
-
var _f = useDraggingPosition.useDraggingPosition(), initiateDraggingPosition = _f.initiateDraggingPosition, resetDraggingPosition = _f.resetDraggingPosition, draggingItems = _f.draggingItems, getDraggingPosition = _f.getDraggingPosition, itemHeight = _f.itemHeight;
|
|
29
|
-
var resetProgrammaticDragIndexForCurrentTree = index.reactExports.useCallback(function(viableDragPositions2, draggingItems2) {
|
|
30
|
-
var _a2;
|
|
31
|
-
if (environment.activeTreeId && ((_a2 = environment.viewState[environment.activeTreeId]) === null || _a2 === void 0 ? void 0 : _a2.focusedItem) && environment.linearItems && draggingItems2) {
|
|
32
|
-
var focusItem_1 = environment.viewState[environment.activeTreeId].focusedItem;
|
|
33
|
-
var treeDragPositions = getViableDragPositions(environment.activeTreeId, draggingItems2);
|
|
34
|
-
var newPos = treeDragPositions.findIndex(function(pos) {
|
|
35
|
-
if (pos.targetType === "item") {
|
|
36
|
-
return pos.targetItem === focusItem_1;
|
|
37
|
-
}
|
|
38
|
-
if (pos.targetType === "between-items") {
|
|
39
|
-
return environment.items[pos.parentItem].children[pos.childIndex] === focusItem_1;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
});
|
|
43
|
-
if (newPos) {
|
|
44
|
-
setProgrammaticDragIndex(Math.min(newPos + 1, treeDragPositions.length - 1));
|
|
45
|
-
} else {
|
|
46
|
-
setProgrammaticDragIndex(0);
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
setProgrammaticDragIndex(0);
|
|
50
|
-
}
|
|
51
|
-
}, [
|
|
52
|
-
environment.activeTreeId,
|
|
53
|
-
environment.items,
|
|
54
|
-
environment.linearItems,
|
|
55
|
-
environment.viewState,
|
|
56
|
-
getViableDragPositions
|
|
57
|
-
]);
|
|
58
|
-
var resetState = useStableHandler.useStableHandler(function() {
|
|
59
|
-
setIsProgrammaticallyDragging(false);
|
|
60
|
-
setViableDragPositions({});
|
|
61
|
-
setProgrammaticDragIndex(0);
|
|
62
|
-
setDraggingPosition(void 0);
|
|
63
|
-
resetDraggingPosition();
|
|
64
|
-
});
|
|
65
|
-
useSideEffect.useSideEffect(function() {
|
|
66
|
-
if (environment.activeTreeId && environment.linearItems[environment.activeTreeId] && viableDragPositions[environment.activeTreeId]) {
|
|
67
|
-
resetProgrammaticDragIndexForCurrentTree(viableDragPositions[environment.activeTreeId], draggingItems);
|
|
68
|
-
}
|
|
69
|
-
}, [
|
|
70
|
-
draggingItems,
|
|
71
|
-
environment.activeTreeId,
|
|
72
|
-
environment.linearItems,
|
|
73
|
-
resetProgrammaticDragIndexForCurrentTree,
|
|
74
|
-
viableDragPositions
|
|
75
|
-
], [environment.activeTreeId]);
|
|
76
|
-
useSideEffect.useSideEffect(function() {
|
|
77
|
-
if (isProgrammaticallyDragging && environment.activeTreeId) {
|
|
78
|
-
setDraggingPosition(viableDragPositions[environment.activeTreeId][programmaticDragIndex]);
|
|
79
|
-
}
|
|
80
|
-
}, [
|
|
81
|
-
programmaticDragIndex,
|
|
82
|
-
environment.activeTreeId,
|
|
83
|
-
isProgrammaticallyDragging,
|
|
84
|
-
viableDragPositions
|
|
85
|
-
], [programmaticDragIndex, environment.activeTreeId]);
|
|
86
|
-
var canDropAt = useCanDropAt.useCanDropAt();
|
|
87
|
-
var performDrag = function(draggingPosition2) {
|
|
88
|
-
var _a2;
|
|
89
|
-
if (draggingItems && !canDropAt(draggingPosition2, draggingItems)) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
setDraggingPosition(draggingPosition2);
|
|
93
|
-
environment.setActiveTree(draggingPosition2.treeId);
|
|
94
|
-
if (draggingItems && environment.activeTreeId !== draggingPosition2.treeId) {
|
|
95
|
-
(_a2 = environment.onSelectItems) === null || _a2 === void 0 ? void 0 : _a2.call(environment, draggingItems.map(function(item) {
|
|
96
|
-
return item.index;
|
|
97
|
-
}), draggingPosition2.treeId);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
var onDragOverTreeHandler = useStableHandler.useStableHandler(function(e, treeId, containerRef) {
|
|
101
|
-
if (!draggingItems)
|
|
102
|
-
return;
|
|
103
|
-
var newDraggingPosition = getDraggingPosition(e, treeId, containerRef);
|
|
104
|
-
if (!newDraggingPosition)
|
|
105
|
-
return;
|
|
106
|
-
if (newDraggingPosition === "invalid") {
|
|
107
|
-
setDraggingPosition(void 0);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
performDrag(newDraggingPosition);
|
|
111
|
-
});
|
|
112
|
-
var onDragLeaveContainerHandler = useStableHandler.useStableHandler(function(e, containerRef) {
|
|
113
|
-
if (!containerRef.current)
|
|
114
|
-
return;
|
|
115
|
-
if (layoutUtils.isOutsideOfContainer(e, containerRef.current.getBoundingClientRect())) {
|
|
116
|
-
setDraggingPosition(void 0);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
var onDropHandler = useStableHandler.useStableHandler(function() {
|
|
120
|
-
if (!draggingItems || !draggingPosition || !environment.onDrop) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
environment.onDrop(draggingItems, draggingPosition);
|
|
124
|
-
callSoon(function() {
|
|
125
|
-
var _a2;
|
|
126
|
-
(_a2 = environment.onFocusItem) === null || _a2 === void 0 ? void 0 : _a2.call(environment, draggingItems[0], draggingPosition.treeId);
|
|
127
|
-
resetState();
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
var onStartDraggingItems = index.reactExports.useCallback(function(items, treeId) {
|
|
131
|
-
var treeViableDragPositions = utils.buildMapForTrees(environment.treeIds, function(treeId2) {
|
|
132
|
-
return getViableDragPositions(treeId2, items);
|
|
133
|
-
});
|
|
134
|
-
initiateDraggingPosition(treeId, items);
|
|
135
|
-
setViableDragPositions(treeViableDragPositions);
|
|
136
|
-
if (environment.activeTreeId) {
|
|
137
|
-
resetProgrammaticDragIndexForCurrentTree(treeViableDragPositions[environment.activeTreeId], items);
|
|
138
|
-
}
|
|
139
|
-
}, [
|
|
140
|
-
environment.activeTreeId,
|
|
141
|
-
environment.treeIds,
|
|
142
|
-
getViableDragPositions,
|
|
143
|
-
initiateDraggingPosition,
|
|
144
|
-
resetProgrammaticDragIndexForCurrentTree
|
|
145
|
-
]);
|
|
146
|
-
var startProgrammaticDrag = index.reactExports.useCallback(function() {
|
|
147
|
-
var _a2, _b2, _c2;
|
|
148
|
-
if (!environment.canDragAndDrop) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (environment.activeTreeId) {
|
|
152
|
-
var draggingItems_1 = (_b2 = (_a2 = environment.viewState[environment.activeTreeId]) === null || _a2 === void 0 ? void 0 : _a2.selectedItems) !== null && _b2 !== void 0 ? _b2 : [
|
|
153
|
-
(_c2 = environment.viewState[environment.activeTreeId]) === null || _c2 === void 0 ? void 0 : _c2.focusedItem
|
|
154
|
-
];
|
|
155
|
-
if (draggingItems_1.length === 0 || draggingItems_1[0] === void 0) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
var resolvedDraggingItems = getOriginalItemOrder(environment.activeTreeId, draggingItems_1.map(function(id) {
|
|
159
|
-
return environment.items[id];
|
|
160
|
-
}));
|
|
161
|
-
if (environment.canDrag && !environment.canDrag(resolvedDraggingItems)) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
onStartDraggingItems(resolvedDraggingItems, environment.activeTreeId);
|
|
165
|
-
setTimeout(function() {
|
|
166
|
-
setIsProgrammaticallyDragging(true);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}, [environment, getOriginalItemOrder, onStartDraggingItems]);
|
|
170
|
-
var abortProgrammaticDrag = index.reactExports.useCallback(function() {
|
|
171
|
-
resetState();
|
|
172
|
-
}, [resetState]);
|
|
173
|
-
var completeProgrammaticDrag = index.reactExports.useCallback(function() {
|
|
174
|
-
onDropHandler();
|
|
175
|
-
resetState();
|
|
176
|
-
}, [onDropHandler, resetState]);
|
|
177
|
-
var programmaticDragUp = index.reactExports.useCallback(function() {
|
|
178
|
-
setProgrammaticDragIndex(function(oldIndex) {
|
|
179
|
-
return Math.max(0, oldIndex - 1);
|
|
180
|
-
});
|
|
181
|
-
}, []);
|
|
182
|
-
var programmaticDragDown = index.reactExports.useCallback(function() {
|
|
183
|
-
if (environment.activeTreeId) {
|
|
184
|
-
setProgrammaticDragIndex(function(oldIndex) {
|
|
185
|
-
return Math.min(viableDragPositions[environment.activeTreeId].length, oldIndex + 1);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}, [environment.activeTreeId, viableDragPositions]);
|
|
189
|
-
var dnd = index.reactExports.useMemo(function() {
|
|
190
|
-
return {
|
|
191
|
-
onStartDraggingItems,
|
|
192
|
-
startProgrammaticDrag,
|
|
193
|
-
abortProgrammaticDrag,
|
|
194
|
-
completeProgrammaticDrag,
|
|
195
|
-
programmaticDragUp,
|
|
196
|
-
programmaticDragDown,
|
|
197
|
-
draggingItems,
|
|
198
|
-
draggingPosition,
|
|
199
|
-
itemHeight: itemHeight.current,
|
|
200
|
-
isProgrammaticallyDragging,
|
|
201
|
-
onDragOverTreeHandler,
|
|
202
|
-
onDragLeaveContainerHandler,
|
|
203
|
-
viableDragPositions
|
|
204
|
-
};
|
|
205
|
-
}, [
|
|
206
|
-
abortProgrammaticDrag,
|
|
207
|
-
completeProgrammaticDrag,
|
|
208
|
-
draggingItems,
|
|
209
|
-
draggingPosition,
|
|
210
|
-
isProgrammaticallyDragging,
|
|
211
|
-
itemHeight,
|
|
212
|
-
onDragOverTreeHandler,
|
|
213
|
-
onDragLeaveContainerHandler,
|
|
214
|
-
onStartDraggingItems,
|
|
215
|
-
programmaticDragDown,
|
|
216
|
-
programmaticDragUp,
|
|
217
|
-
startProgrammaticDrag,
|
|
218
|
-
viableDragPositions
|
|
219
|
-
]);
|
|
220
|
-
index.reactExports.useEffect(function() {
|
|
221
|
-
window.addEventListener("dragend", resetState);
|
|
222
|
-
window.addEventListener("drop", onDropHandler);
|
|
223
|
-
return function() {
|
|
224
|
-
window.removeEventListener("dragend", resetState);
|
|
225
|
-
window.removeEventListener("drop", onDropHandler);
|
|
226
|
-
};
|
|
227
|
-
}, [onDropHandler, resetState]);
|
|
228
|
-
return index.reactExports.createElement(DragAndDropContext.Provider, { value: dnd }, children);
|
|
229
|
-
};
|
|
230
|
-
exports.DragAndDropProvider = DragAndDropProvider;
|
|
231
|
-
exports.useDragAndDrop = useDragAndDrop;
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { r as reactExports } from "../../../../../../../../_virtual/index.qwik2.mjs";
|
|
2
|
-
import { useTreeEnvironment } from "../controlledEnvironment/ControlledTreeEnvironment.qwik.mjs";
|
|
3
|
-
import { useCanDropAt } from "./useCanDropAt.qwik.mjs";
|
|
4
|
-
import { useGetViableDragPositions } from "./useGetViableDragPositions.qwik.mjs";
|
|
5
|
-
import { useSideEffect } from "../useSideEffect.qwik.mjs";
|
|
6
|
-
import { buildMapForTrees } from "../utils.qwik.mjs";
|
|
7
|
-
import { useCallSoon } from "../useCallSoon.qwik.mjs";
|
|
8
|
-
import { useStableHandler } from "../useStableHandler.qwik.mjs";
|
|
9
|
-
import { useGetOriginalItemOrder } from "../useGetOriginalItemOrder.qwik.mjs";
|
|
10
|
-
import { useDraggingPosition } from "./useDraggingPosition.qwik.mjs";
|
|
11
|
-
import { isOutsideOfContainer } from "../controlledEnvironment/layoutUtils.qwik.mjs";
|
|
12
|
-
var DragAndDropContext = reactExports.createContext(null);
|
|
13
|
-
var useDragAndDrop = function() {
|
|
14
|
-
return reactExports.useContext(DragAndDropContext);
|
|
15
|
-
};
|
|
16
|
-
var DragAndDropProvider = function(_a) {
|
|
17
|
-
var children = _a.children;
|
|
18
|
-
var environment = useTreeEnvironment();
|
|
19
|
-
var _b = reactExports.useState(false), isProgrammaticallyDragging = _b[0], setIsProgrammaticallyDragging = _b[1];
|
|
20
|
-
var _c = reactExports.useState({}), viableDragPositions = _c[0], setViableDragPositions = _c[1];
|
|
21
|
-
var _d = reactExports.useState(0), programmaticDragIndex = _d[0], setProgrammaticDragIndex = _d[1];
|
|
22
|
-
var _e = reactExports.useState(), draggingPosition = _e[0], setDraggingPosition = _e[1];
|
|
23
|
-
var getViableDragPositions = useGetViableDragPositions();
|
|
24
|
-
var callSoon = useCallSoon();
|
|
25
|
-
var getOriginalItemOrder = useGetOriginalItemOrder();
|
|
26
|
-
var _f = useDraggingPosition(), initiateDraggingPosition = _f.initiateDraggingPosition, resetDraggingPosition = _f.resetDraggingPosition, draggingItems = _f.draggingItems, getDraggingPosition = _f.getDraggingPosition, itemHeight = _f.itemHeight;
|
|
27
|
-
var resetProgrammaticDragIndexForCurrentTree = reactExports.useCallback(function(viableDragPositions2, draggingItems2) {
|
|
28
|
-
var _a2;
|
|
29
|
-
if (environment.activeTreeId && ((_a2 = environment.viewState[environment.activeTreeId]) === null || _a2 === void 0 ? void 0 : _a2.focusedItem) && environment.linearItems && draggingItems2) {
|
|
30
|
-
var focusItem_1 = environment.viewState[environment.activeTreeId].focusedItem;
|
|
31
|
-
var treeDragPositions = getViableDragPositions(environment.activeTreeId, draggingItems2);
|
|
32
|
-
var newPos = treeDragPositions.findIndex(function(pos) {
|
|
33
|
-
if (pos.targetType === "item") {
|
|
34
|
-
return pos.targetItem === focusItem_1;
|
|
35
|
-
}
|
|
36
|
-
if (pos.targetType === "between-items") {
|
|
37
|
-
return environment.items[pos.parentItem].children[pos.childIndex] === focusItem_1;
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
});
|
|
41
|
-
if (newPos) {
|
|
42
|
-
setProgrammaticDragIndex(Math.min(newPos + 1, treeDragPositions.length - 1));
|
|
43
|
-
} else {
|
|
44
|
-
setProgrammaticDragIndex(0);
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
setProgrammaticDragIndex(0);
|
|
48
|
-
}
|
|
49
|
-
}, [
|
|
50
|
-
environment.activeTreeId,
|
|
51
|
-
environment.items,
|
|
52
|
-
environment.linearItems,
|
|
53
|
-
environment.viewState,
|
|
54
|
-
getViableDragPositions
|
|
55
|
-
]);
|
|
56
|
-
var resetState = useStableHandler(function() {
|
|
57
|
-
setIsProgrammaticallyDragging(false);
|
|
58
|
-
setViableDragPositions({});
|
|
59
|
-
setProgrammaticDragIndex(0);
|
|
60
|
-
setDraggingPosition(void 0);
|
|
61
|
-
resetDraggingPosition();
|
|
62
|
-
});
|
|
63
|
-
useSideEffect(function() {
|
|
64
|
-
if (environment.activeTreeId && environment.linearItems[environment.activeTreeId] && viableDragPositions[environment.activeTreeId]) {
|
|
65
|
-
resetProgrammaticDragIndexForCurrentTree(viableDragPositions[environment.activeTreeId], draggingItems);
|
|
66
|
-
}
|
|
67
|
-
}, [
|
|
68
|
-
draggingItems,
|
|
69
|
-
environment.activeTreeId,
|
|
70
|
-
environment.linearItems,
|
|
71
|
-
resetProgrammaticDragIndexForCurrentTree,
|
|
72
|
-
viableDragPositions
|
|
73
|
-
], [environment.activeTreeId]);
|
|
74
|
-
useSideEffect(function() {
|
|
75
|
-
if (isProgrammaticallyDragging && environment.activeTreeId) {
|
|
76
|
-
setDraggingPosition(viableDragPositions[environment.activeTreeId][programmaticDragIndex]);
|
|
77
|
-
}
|
|
78
|
-
}, [
|
|
79
|
-
programmaticDragIndex,
|
|
80
|
-
environment.activeTreeId,
|
|
81
|
-
isProgrammaticallyDragging,
|
|
82
|
-
viableDragPositions
|
|
83
|
-
], [programmaticDragIndex, environment.activeTreeId]);
|
|
84
|
-
var canDropAt = useCanDropAt();
|
|
85
|
-
var performDrag = function(draggingPosition2) {
|
|
86
|
-
var _a2;
|
|
87
|
-
if (draggingItems && !canDropAt(draggingPosition2, draggingItems)) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
setDraggingPosition(draggingPosition2);
|
|
91
|
-
environment.setActiveTree(draggingPosition2.treeId);
|
|
92
|
-
if (draggingItems && environment.activeTreeId !== draggingPosition2.treeId) {
|
|
93
|
-
(_a2 = environment.onSelectItems) === null || _a2 === void 0 ? void 0 : _a2.call(environment, draggingItems.map(function(item) {
|
|
94
|
-
return item.index;
|
|
95
|
-
}), draggingPosition2.treeId);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var onDragOverTreeHandler = useStableHandler(function(e, treeId, containerRef) {
|
|
99
|
-
if (!draggingItems)
|
|
100
|
-
return;
|
|
101
|
-
var newDraggingPosition = getDraggingPosition(e, treeId, containerRef);
|
|
102
|
-
if (!newDraggingPosition)
|
|
103
|
-
return;
|
|
104
|
-
if (newDraggingPosition === "invalid") {
|
|
105
|
-
setDraggingPosition(void 0);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
performDrag(newDraggingPosition);
|
|
109
|
-
});
|
|
110
|
-
var onDragLeaveContainerHandler = useStableHandler(function(e, containerRef) {
|
|
111
|
-
if (!containerRef.current)
|
|
112
|
-
return;
|
|
113
|
-
if (isOutsideOfContainer(e, containerRef.current.getBoundingClientRect())) {
|
|
114
|
-
setDraggingPosition(void 0);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
var onDropHandler = useStableHandler(function() {
|
|
118
|
-
if (!draggingItems || !draggingPosition || !environment.onDrop) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
environment.onDrop(draggingItems, draggingPosition);
|
|
122
|
-
callSoon(function() {
|
|
123
|
-
var _a2;
|
|
124
|
-
(_a2 = environment.onFocusItem) === null || _a2 === void 0 ? void 0 : _a2.call(environment, draggingItems[0], draggingPosition.treeId);
|
|
125
|
-
resetState();
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
var onStartDraggingItems = reactExports.useCallback(function(items, treeId) {
|
|
129
|
-
var treeViableDragPositions = buildMapForTrees(environment.treeIds, function(treeId2) {
|
|
130
|
-
return getViableDragPositions(treeId2, items);
|
|
131
|
-
});
|
|
132
|
-
initiateDraggingPosition(treeId, items);
|
|
133
|
-
setViableDragPositions(treeViableDragPositions);
|
|
134
|
-
if (environment.activeTreeId) {
|
|
135
|
-
resetProgrammaticDragIndexForCurrentTree(treeViableDragPositions[environment.activeTreeId], items);
|
|
136
|
-
}
|
|
137
|
-
}, [
|
|
138
|
-
environment.activeTreeId,
|
|
139
|
-
environment.treeIds,
|
|
140
|
-
getViableDragPositions,
|
|
141
|
-
initiateDraggingPosition,
|
|
142
|
-
resetProgrammaticDragIndexForCurrentTree
|
|
143
|
-
]);
|
|
144
|
-
var startProgrammaticDrag = reactExports.useCallback(function() {
|
|
145
|
-
var _a2, _b2, _c2;
|
|
146
|
-
if (!environment.canDragAndDrop) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (environment.activeTreeId) {
|
|
150
|
-
var draggingItems_1 = (_b2 = (_a2 = environment.viewState[environment.activeTreeId]) === null || _a2 === void 0 ? void 0 : _a2.selectedItems) !== null && _b2 !== void 0 ? _b2 : [
|
|
151
|
-
(_c2 = environment.viewState[environment.activeTreeId]) === null || _c2 === void 0 ? void 0 : _c2.focusedItem
|
|
152
|
-
];
|
|
153
|
-
if (draggingItems_1.length === 0 || draggingItems_1[0] === void 0) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
var resolvedDraggingItems = getOriginalItemOrder(environment.activeTreeId, draggingItems_1.map(function(id) {
|
|
157
|
-
return environment.items[id];
|
|
158
|
-
}));
|
|
159
|
-
if (environment.canDrag && !environment.canDrag(resolvedDraggingItems)) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
onStartDraggingItems(resolvedDraggingItems, environment.activeTreeId);
|
|
163
|
-
setTimeout(function() {
|
|
164
|
-
setIsProgrammaticallyDragging(true);
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}, [environment, getOriginalItemOrder, onStartDraggingItems]);
|
|
168
|
-
var abortProgrammaticDrag = reactExports.useCallback(function() {
|
|
169
|
-
resetState();
|
|
170
|
-
}, [resetState]);
|
|
171
|
-
var completeProgrammaticDrag = reactExports.useCallback(function() {
|
|
172
|
-
onDropHandler();
|
|
173
|
-
resetState();
|
|
174
|
-
}, [onDropHandler, resetState]);
|
|
175
|
-
var programmaticDragUp = reactExports.useCallback(function() {
|
|
176
|
-
setProgrammaticDragIndex(function(oldIndex) {
|
|
177
|
-
return Math.max(0, oldIndex - 1);
|
|
178
|
-
});
|
|
179
|
-
}, []);
|
|
180
|
-
var programmaticDragDown = reactExports.useCallback(function() {
|
|
181
|
-
if (environment.activeTreeId) {
|
|
182
|
-
setProgrammaticDragIndex(function(oldIndex) {
|
|
183
|
-
return Math.min(viableDragPositions[environment.activeTreeId].length, oldIndex + 1);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
}, [environment.activeTreeId, viableDragPositions]);
|
|
187
|
-
var dnd = reactExports.useMemo(function() {
|
|
188
|
-
return {
|
|
189
|
-
onStartDraggingItems,
|
|
190
|
-
startProgrammaticDrag,
|
|
191
|
-
abortProgrammaticDrag,
|
|
192
|
-
completeProgrammaticDrag,
|
|
193
|
-
programmaticDragUp,
|
|
194
|
-
programmaticDragDown,
|
|
195
|
-
draggingItems,
|
|
196
|
-
draggingPosition,
|
|
197
|
-
itemHeight: itemHeight.current,
|
|
198
|
-
isProgrammaticallyDragging,
|
|
199
|
-
onDragOverTreeHandler,
|
|
200
|
-
onDragLeaveContainerHandler,
|
|
201
|
-
viableDragPositions
|
|
202
|
-
};
|
|
203
|
-
}, [
|
|
204
|
-
abortProgrammaticDrag,
|
|
205
|
-
completeProgrammaticDrag,
|
|
206
|
-
draggingItems,
|
|
207
|
-
draggingPosition,
|
|
208
|
-
isProgrammaticallyDragging,
|
|
209
|
-
itemHeight,
|
|
210
|
-
onDragOverTreeHandler,
|
|
211
|
-
onDragLeaveContainerHandler,
|
|
212
|
-
onStartDraggingItems,
|
|
213
|
-
programmaticDragDown,
|
|
214
|
-
programmaticDragUp,
|
|
215
|
-
startProgrammaticDrag,
|
|
216
|
-
viableDragPositions
|
|
217
|
-
]);
|
|
218
|
-
reactExports.useEffect(function() {
|
|
219
|
-
window.addEventListener("dragend", resetState);
|
|
220
|
-
window.addEventListener("drop", onDropHandler);
|
|
221
|
-
return function() {
|
|
222
|
-
window.removeEventListener("dragend", resetState);
|
|
223
|
-
window.removeEventListener("drop", onDropHandler);
|
|
224
|
-
};
|
|
225
|
-
}, [onDropHandler, resetState]);
|
|
226
|
-
return reactExports.createElement(DragAndDropContext.Provider, { value: dnd }, children);
|
|
227
|
-
};
|
|
228
|
-
export {
|
|
229
|
-
DragAndDropProvider,
|
|
230
|
-
useDragAndDrop
|
|
231
|
-
};
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
var DraggingPositionEvaluation = (
|
|
4
|
-
/** @class */
|
|
5
|
-
function() {
|
|
6
|
-
function DraggingPositionEvaluation2(env, e, treeId, hoveringPosition, draggingItems, getParentOfLinearItem) {
|
|
7
|
-
this.env = env;
|
|
8
|
-
this.e = e;
|
|
9
|
-
this.treeId = treeId;
|
|
10
|
-
this.linearIndex = hoveringPosition.linearIndex;
|
|
11
|
-
this.offset = hoveringPosition.offset;
|
|
12
|
-
this.indentation = hoveringPosition.indentation;
|
|
13
|
-
this.targetItem = this.env.linearItems[this.treeId][this.linearIndex];
|
|
14
|
-
this.getParentOfLinearItem = getParentOfLinearItem;
|
|
15
|
-
this.draggingItems = draggingItems;
|
|
16
|
-
}
|
|
17
|
-
DraggingPositionEvaluation2.prototype.getEmptyTreeDragPosition = function() {
|
|
18
|
-
return {
|
|
19
|
-
targetType: "root",
|
|
20
|
-
treeId: this.treeId,
|
|
21
|
-
depth: 0,
|
|
22
|
-
linearIndex: 0,
|
|
23
|
-
targetItem: this.env.trees[this.treeId].rootItem
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
DraggingPositionEvaluation2.prototype.maybeRedirectToParent = function() {
|
|
27
|
-
var redirectTargetToParent = !this.env.canReorderItems && !this.env.canDropOnNonFolder && !this.env.items[this.targetItem.item].isFolder;
|
|
28
|
-
if (redirectTargetToParent) {
|
|
29
|
-
var _a = this.getParentOfLinearItem(this.linearIndex, this.treeId), parentLinearIndex = _a.parentLinearIndex, parent_1 = _a.parent;
|
|
30
|
-
this.targetItem = parent_1;
|
|
31
|
-
this.linearIndex = parentLinearIndex;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
DraggingPositionEvaluation2.prototype.maybeReparentUpwards = function() {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
if (this.indentation === void 0) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
var treeLinearItems = this.env.linearItems[this.treeId];
|
|
40
|
-
var deepestDepth = treeLinearItems[this.linearIndex].depth;
|
|
41
|
-
var legalDropDepthCount = (
|
|
42
|
-
// itemDepthDifferenceToNextItem/isLastInGroup
|
|
43
|
-
deepestDepth - ((_b = (_a = treeLinearItems[this.linearIndex + 1]) === null || _a === void 0 ? void 0 : _a.depth) !== null && _b !== void 0 ? _b : 0)
|
|
44
|
-
);
|
|
45
|
-
var canReparentUpwards = this.offset === "bottom" && legalDropDepthCount > 0;
|
|
46
|
-
if (!canReparentUpwards) {
|
|
47
|
-
return void 0;
|
|
48
|
-
}
|
|
49
|
-
var droppingIndent = Math.max(deepestDepth - legalDropDepthCount, this.indentation);
|
|
50
|
-
var newParent = {
|
|
51
|
-
parentLinearIndex: this.linearIndex,
|
|
52
|
-
parent: this.targetItem
|
|
53
|
-
};
|
|
54
|
-
var insertionItemAbove;
|
|
55
|
-
for (var i = deepestDepth; i >= droppingIndent; i -= 1) {
|
|
56
|
-
insertionItemAbove = newParent;
|
|
57
|
-
newParent = this.getParentOfLinearItem(newParent.parentLinearIndex, this.treeId);
|
|
58
|
-
}
|
|
59
|
-
if (this.indentation === treeLinearItems[this.linearIndex].depth) {
|
|
60
|
-
return void 0;
|
|
61
|
-
}
|
|
62
|
-
if (!insertionItemAbove) {
|
|
63
|
-
return void 0;
|
|
64
|
-
}
|
|
65
|
-
var reparentedChildIndex = this.env.items[newParent.parent.item].children.indexOf(insertionItemAbove.parent.item) + 1;
|
|
66
|
-
if (this.draggingItems && this.isDescendant(this.treeId, newParent.parentLinearIndex + 1, this.draggingItems)) {
|
|
67
|
-
return void 0;
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
targetType: "between-items",
|
|
71
|
-
treeId: this.treeId,
|
|
72
|
-
parentItem: newParent.parent.item,
|
|
73
|
-
depth: droppingIndent,
|
|
74
|
-
linearIndex: this.linearIndex + 1,
|
|
75
|
-
childIndex: reparentedChildIndex,
|
|
76
|
-
linePosition: "bottom"
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
DraggingPositionEvaluation2.prototype.maybeRedirectInsideOpenFolder = function() {
|
|
80
|
-
var nextItem = this.env.linearItems[this.treeId][this.linearIndex + 1];
|
|
81
|
-
var redirectInsideOpenFolder = !this.env.canDropBelowOpenFolders && nextItem && this.targetItem.depth === nextItem.depth - 1 && this.offset === "bottom";
|
|
82
|
-
if (redirectInsideOpenFolder) {
|
|
83
|
-
this.targetItem = nextItem;
|
|
84
|
-
this.linearIndex += 1;
|
|
85
|
-
this.offset = "top";
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
DraggingPositionEvaluation2.prototype.maybeMapToBottomOffset = function() {
|
|
89
|
-
var priorItem = this.env.linearItems[this.treeId][this.linearIndex - 1];
|
|
90
|
-
if (!priorItem || (priorItem === null || priorItem === void 0 ? void 0 : priorItem.depth) === void 0)
|
|
91
|
-
return;
|
|
92
|
-
var depthDistanceToPrior = priorItem.depth - this.targetItem.depth;
|
|
93
|
-
if (this.offset === "top" && (depthDistanceToPrior === 0 || depthDistanceToPrior > 0 && this.indentation !== void 0)) {
|
|
94
|
-
this.offset = "bottom";
|
|
95
|
-
this.linearIndex -= 1;
|
|
96
|
-
this.targetItem = this.env.linearItems[this.treeId][this.linearIndex];
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
DraggingPositionEvaluation2.prototype.canDropAtCurrentTarget = function() {
|
|
100
|
-
var _this = this;
|
|
101
|
-
var _a;
|
|
102
|
-
var targetItemData = this.env.items[this.targetItem.item];
|
|
103
|
-
if (!this.offset && !this.env.canDropOnNonFolder && !targetItemData.isFolder) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
if (!this.offset && !this.env.canDropOnFolder && targetItemData.isFolder) {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
if (this.offset && !this.env.canReorderItems) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
if ((_a = this.draggingItems) === null || _a === void 0 ? void 0 : _a.some(function(draggingItem) {
|
|
113
|
-
return draggingItem.index === _this.targetItem.item;
|
|
114
|
-
})) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
return true;
|
|
118
|
-
};
|
|
119
|
-
DraggingPositionEvaluation2.prototype.getDraggingPosition = function() {
|
|
120
|
-
if (this.env.linearItems[this.treeId].length === 0) {
|
|
121
|
-
return this.getEmptyTreeDragPosition();
|
|
122
|
-
}
|
|
123
|
-
if (!this.draggingItems || this.linearIndex < 0 || this.linearIndex >= this.env.linearItems[this.treeId].length) {
|
|
124
|
-
return void 0;
|
|
125
|
-
}
|
|
126
|
-
this.maybeRedirectToParent();
|
|
127
|
-
this.maybeRedirectInsideOpenFolder();
|
|
128
|
-
this.maybeMapToBottomOffset();
|
|
129
|
-
var reparented = this.maybeReparentUpwards();
|
|
130
|
-
if (reparented) {
|
|
131
|
-
return reparented;
|
|
132
|
-
}
|
|
133
|
-
if (this.areDraggingItemsDescendantOfTarget()) {
|
|
134
|
-
return "invalid";
|
|
135
|
-
}
|
|
136
|
-
if (!this.canDropAtCurrentTarget()) {
|
|
137
|
-
return "invalid";
|
|
138
|
-
}
|
|
139
|
-
var parent = this.getParentOfLinearItem(this.linearIndex, this.treeId).parent;
|
|
140
|
-
var newChildIndex = this.env.items[parent.item].children.indexOf(this.targetItem.item) + (this.offset === "top" ? 0 : 1);
|
|
141
|
-
if (this.offset) {
|
|
142
|
-
return {
|
|
143
|
-
targetType: "between-items",
|
|
144
|
-
treeId: this.treeId,
|
|
145
|
-
parentItem: parent.item,
|
|
146
|
-
depth: this.targetItem.depth,
|
|
147
|
-
linearIndex: this.linearIndex + (this.offset === "top" ? 0 : 1),
|
|
148
|
-
childIndex: newChildIndex,
|
|
149
|
-
linePosition: this.offset
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
return {
|
|
153
|
-
targetType: "item",
|
|
154
|
-
treeId: this.treeId,
|
|
155
|
-
parentItem: parent.item,
|
|
156
|
-
targetItem: this.targetItem.item,
|
|
157
|
-
depth: this.targetItem.depth,
|
|
158
|
-
linearIndex: this.linearIndex
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
DraggingPositionEvaluation2.prototype.isDescendant = function(treeId, itemLinearIndex, potentialParents) {
|
|
162
|
-
var _a = this.getParentOfLinearItem(itemLinearIndex, treeId), parentLinearIndex = _a.parentLinearIndex, parent = _a.parent;
|
|
163
|
-
if (potentialParents.some(function(p) {
|
|
164
|
-
return p.index === parent.item;
|
|
165
|
-
})) {
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
if (parent.depth === 0) {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
return this.isDescendant(treeId, parentLinearIndex, potentialParents);
|
|
172
|
-
};
|
|
173
|
-
DraggingPositionEvaluation2.prototype.areDraggingItemsDescendantOfTarget = function() {
|
|
174
|
-
return this.draggingItems && this.isDescendant(this.treeId, this.linearIndex, this.draggingItems);
|
|
175
|
-
};
|
|
176
|
-
return DraggingPositionEvaluation2;
|
|
177
|
-
}()
|
|
178
|
-
);
|
|
179
|
-
exports.DraggingPositionEvaluation = DraggingPositionEvaluation;
|