@cp949/mui-react19 2.2.0 → 2.3.1
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/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/components/Center.cjs.map +1 -1
- package/dist/components/Center.d.cts +4 -7
- package/dist/components/Center.d.ts +4 -7
- package/dist/components/Center.js.map +1 -1
- package/dist/components/CooldownButton.cjs.map +1 -1
- package/dist/components/CooldownButton.d.cts +4 -7
- package/dist/components/CooldownButton.d.ts +4 -7
- package/dist/components/CooldownButton.js.map +1 -1
- package/dist/components/CooldownButtonBase.cjs.map +1 -1
- package/dist/components/CooldownButtonBase.d.cts +4 -7
- package/dist/components/CooldownButtonBase.d.ts +4 -7
- package/dist/components/CooldownButtonBase.js.map +1 -1
- package/dist/components/CooldownIconButton.cjs.map +1 -1
- package/dist/components/CooldownIconButton.d.cts +4 -7
- package/dist/components/CooldownIconButton.d.ts +4 -7
- package/dist/components/CooldownIconButton.js.map +1 -1
- package/dist/components/CopyButtonWrapper.cjs +1 -1
- package/dist/components/CopyButtonWrapper.cjs.map +1 -1
- package/dist/components/CopyButtonWrapper.d.cts +25 -9
- package/dist/components/CopyButtonWrapper.d.ts +25 -9
- package/dist/components/CopyButtonWrapper.js +1 -1
- package/dist/components/CopyButtonWrapper.js.map +1 -1
- package/dist/components/CustomTableBody.cjs.map +1 -1
- package/dist/components/CustomTableBody.d.cts +1 -4
- package/dist/components/CustomTableBody.d.ts +1 -4
- package/dist/components/CustomTableBody.js.map +1 -1
- package/dist/components/DebouncedButton.cjs.map +1 -1
- package/dist/components/DebouncedButton.d.cts +1 -4
- package/dist/components/DebouncedButton.d.ts +1 -4
- package/dist/components/DebouncedButton.js.map +1 -1
- package/dist/components/DebouncedButtonBase.cjs.map +1 -1
- package/dist/components/DebouncedButtonBase.d.cts +1 -4
- package/dist/components/DebouncedButtonBase.d.ts +1 -4
- package/dist/components/DebouncedButtonBase.js.map +1 -1
- package/dist/components/DebouncedIconButton.cjs.map +1 -1
- package/dist/components/DebouncedIconButton.d.cts +1 -4
- package/dist/components/DebouncedIconButton.d.ts +1 -4
- package/dist/components/DebouncedIconButton.js.map +1 -1
- package/dist/components/DebouncedRender.cjs.map +1 -1
- package/dist/components/DebouncedRender.d.cts +1 -4
- package/dist/components/DebouncedRender.d.ts +1 -4
- package/dist/components/DebouncedRender.js.map +1 -1
- package/dist/components/DelayedRender.cjs.map +1 -1
- package/dist/components/DelayedRender.d.cts +1 -4
- package/dist/components/DelayedRender.d.ts +1 -4
- package/dist/components/DelayedRender.js.map +1 -1
- package/dist/components/FileButton.cjs.map +1 -1
- package/dist/components/FileButton.d.cts +1 -3
- package/dist/components/FileButton.d.ts +1 -3
- package/dist/components/FileButton.js.map +1 -1
- package/dist/components/FlexItemsContainer.cjs.map +1 -1
- package/dist/components/FlexItemsContainer.d.cts +1 -4
- package/dist/components/FlexItemsContainer.d.ts +1 -4
- package/dist/components/FlexItemsContainer.js.map +1 -1
- package/dist/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
- package/dist/components/FloatingIndicator/FloatingIndicator.d.cts +1 -4
- package/dist/components/FloatingIndicator/FloatingIndicator.d.ts +1 -4
- package/dist/components/FloatingIndicator/FloatingIndicator.js.map +1 -1
- package/dist/components/FloatingIndicator/index.cjs.map +1 -1
- package/dist/components/FloatingIndicator/index.js.map +1 -1
- package/dist/components/FloatingIndicator/useFloatingIndicator.cjs +1 -1
- package/dist/components/FloatingIndicator/useFloatingIndicator.cjs.map +1 -1
- package/dist/components/FloatingIndicator/useFloatingIndicator.js +1 -1
- package/dist/components/FloatingIndicator/useFloatingIndicator.js.map +1 -1
- package/dist/components/Hide.cjs.map +1 -1
- package/dist/components/Hide.d.cts +1 -4
- package/dist/components/Hide.d.ts +1 -4
- package/dist/components/Hide.js.map +1 -1
- package/dist/components/Highlight/Highlight.cjs.map +1 -1
- package/dist/components/Highlight/Highlight.d.cts +5 -29
- package/dist/components/Highlight/Highlight.d.ts +4 -28
- package/dist/components/Highlight/Highlight.js.map +1 -1
- package/dist/components/Highlight/highlighter/highlighter.cjs.map +1 -1
- package/dist/components/Highlight/highlighter/highlighter.js.map +1 -1
- package/dist/components/LengthLimitHelperText.cjs.map +1 -1
- package/dist/components/LengthLimitHelperText.d.cts +2 -4
- package/dist/components/LengthLimitHelperText.d.ts +1 -3
- package/dist/components/LengthLimitHelperText.js.map +1 -1
- package/dist/components/LgOrUp.cjs.map +1 -1
- package/dist/components/LgOrUp.d.cts +1 -4
- package/dist/components/LgOrUp.d.ts +1 -4
- package/dist/components/LgOrUp.js.map +1 -1
- package/dist/components/ListPagination.cjs.map +1 -1
- package/dist/components/ListPagination.d.cts +4 -24
- package/dist/components/ListPagination.d.ts +4 -24
- package/dist/components/ListPagination.js.map +1 -1
- package/dist/components/Mark.cjs.map +1 -1
- package/dist/components/Mark.d.cts +5 -8
- package/dist/components/Mark.d.ts +4 -7
- package/dist/components/Mark.js.map +1 -1
- package/dist/components/MdOrDown.cjs.map +1 -1
- package/dist/components/MdOrDown.d.cts +1 -4
- package/dist/components/MdOrDown.d.ts +1 -4
- package/dist/components/MdOrDown.js.map +1 -1
- package/dist/components/MdOrUp.cjs.map +1 -1
- package/dist/components/MdOrUp.d.cts +1 -4
- package/dist/components/MdOrUp.d.ts +1 -4
- package/dist/components/MdOrUp.js.map +1 -1
- package/dist/components/Paper.cjs.map +1 -1
- package/dist/components/Paper.d.cts +3 -7
- package/dist/components/Paper.d.ts +3 -7
- package/dist/components/Paper.js.map +1 -1
- package/dist/components/PasswordTextField.cjs.map +1 -1
- package/dist/components/PasswordTextField.d.cts +1 -4
- package/dist/components/PasswordTextField.d.ts +1 -4
- package/dist/components/PasswordTextField.js.map +1 -1
- package/dist/components/SearchBoxDebouncer.cjs.map +1 -1
- package/dist/components/SearchBoxDebouncer.d.cts +1 -4
- package/dist/components/SearchBoxDebouncer.d.ts +1 -4
- package/dist/components/SearchBoxDebouncer.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.cts +2 -5
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -4
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/components.cjs.map +1 -1
- package/dist/components/SegmentedControl/components.js.map +1 -1
- package/dist/components/Show.cjs.map +1 -1
- package/dist/components/Show.d.cts +1 -4
- package/dist/components/Show.d.ts +1 -4
- package/dist/components/Show.js.map +1 -1
- package/dist/components/SmOrDown.cjs.map +1 -1
- package/dist/components/SmOrDown.d.cts +1 -4
- package/dist/components/SmOrDown.d.ts +1 -4
- package/dist/components/SmOrDown.js.map +1 -1
- package/dist/components/SmOrUp.cjs.map +1 -1
- package/dist/components/SmOrUp.d.cts +1 -4
- package/dist/components/SmOrUp.d.ts +1 -4
- package/dist/components/SmOrUp.js.map +1 -1
- package/dist/components/Space.cjs.map +1 -1
- package/dist/components/Space.d.cts +4 -7
- package/dist/components/Space.d.ts +4 -7
- package/dist/components/Space.js.map +1 -1
- package/dist/components/Spoiler.cjs +1 -1
- package/dist/components/Spoiler.cjs.map +1 -1
- package/dist/components/Spoiler.d.cts +5 -8
- package/dist/components/Spoiler.d.ts +4 -7
- package/dist/components/Spoiler.js +1 -1
- package/dist/components/Spoiler.js.map +1 -1
- package/dist/components/XsOrDown.cjs.map +1 -1
- package/dist/components/XsOrDown.d.cts +1 -4
- package/dist/components/XsOrDown.d.ts +1 -4
- package/dist/components/XsOrDown.js.map +1 -1
- package/dist/components/YmTypography.cjs.map +1 -1
- package/dist/components/YmTypography.d.cts +1 -4
- package/dist/components/YmTypography.d.ts +1 -4
- package/dist/components/YmTypography.js.map +1 -1
- package/dist/components/YmdTextField.cjs.map +1 -1
- package/dist/components/YmdTextField.d.cts +1 -4
- package/dist/components/YmdTextField.d.ts +1 -4
- package/dist/components/YmdTextField.js.map +1 -1
- package/dist/components/YmdTypography.cjs.map +1 -1
- package/dist/components/YmdTypography.d.cts +1 -4
- package/dist/components/YmdTypography.d.ts +1 -4
- package/dist/components/YmdTypography.js.map +1 -1
- package/dist/components/absolute-box/create-absolute-box.cjs.map +1 -1
- package/dist/components/absolute-box/create-absolute-box.js.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsolute.cjs.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsolute.d.cts +2 -5
- package/dist/components/bottom-absolute/BottomAbsolute.d.ts +1 -4
- package/dist/components/bottom-absolute/BottomAbsolute.js.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.cjs.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.d.cts +2 -5
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.d.ts +1 -4
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.js.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.cjs.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.d.cts +2 -5
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.d.ts +1 -4
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.js.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsoluteRight.cjs.map +1 -1
- package/dist/components/bottom-absolute/BottomAbsoluteRight.d.cts +2 -5
- package/dist/components/bottom-absolute/BottomAbsoluteRight.d.ts +1 -4
- package/dist/components/bottom-absolute/BottomAbsoluteRight.js.map +1 -1
- package/dist/components/center-absolute/CenterAbsolute.cjs.map +1 -1
- package/dist/components/center-absolute/CenterAbsolute.d.cts +2 -5
- package/dist/components/center-absolute/CenterAbsolute.d.ts +1 -4
- package/dist/components/center-absolute/CenterAbsolute.js.map +1 -1
- package/dist/components/center-absolute/CenterAbsoluteCenter.cjs.map +1 -1
- package/dist/components/center-absolute/CenterAbsoluteCenter.d.cts +2 -5
- package/dist/components/center-absolute/CenterAbsoluteCenter.d.ts +1 -4
- package/dist/components/center-absolute/CenterAbsoluteCenter.js.map +1 -1
- package/dist/components/center-absolute/CenterAbsoluteLeft.cjs.map +1 -1
- package/dist/components/center-absolute/CenterAbsoluteLeft.d.cts +2 -5
- package/dist/components/center-absolute/CenterAbsoluteLeft.d.ts +1 -4
- package/dist/components/center-absolute/CenterAbsoluteLeft.js.map +1 -1
- package/dist/components/center-absolute/CenterAbsoluteRight.cjs.map +1 -1
- package/dist/components/center-absolute/CenterAbsoluteRight.d.cts +2 -5
- package/dist/components/center-absolute/CenterAbsoluteRight.d.ts +1 -4
- package/dist/components/center-absolute/CenterAbsoluteRight.js.map +1 -1
- package/dist/components/flex/FlexColumn.cjs.map +1 -1
- package/dist/components/flex/FlexColumn.d.cts +1 -3
- package/dist/components/flex/FlexColumn.d.ts +1 -3
- package/dist/components/flex/FlexColumn.js.map +1 -1
- package/dist/components/flex/FlexRow.cjs.map +1 -1
- package/dist/components/flex/FlexRow.d.cts +1 -3
- package/dist/components/flex/FlexRow.d.ts +1 -3
- package/dist/components/flex/FlexRow.js.map +1 -1
- package/dist/components/flex/index.d.cts +1 -1
- package/dist/components/flex/index.d.ts +1 -1
- package/dist/components/flex/types.d.cts +2 -5
- package/dist/components/flex/types.d.ts +1 -4
- package/dist/components/layout/create-layout-component.cjs.map +1 -1
- package/dist/components/layout/create-layout-component.js.map +1 -1
- package/dist/components/portlet/Portlet.cjs.map +1 -1
- package/dist/components/portlet/Portlet.d.cts +1 -4
- package/dist/components/portlet/Portlet.d.ts +1 -4
- package/dist/components/portlet/Portlet.js.map +1 -1
- package/dist/components/portlet/PortletContent.cjs.map +1 -1
- package/dist/components/portlet/PortletContent.d.cts +4 -17
- package/dist/components/portlet/PortletContent.d.ts +4 -17
- package/dist/components/portlet/PortletContent.js.map +1 -1
- package/dist/components/portlet/PortletFooter.cjs.map +1 -1
- package/dist/components/portlet/PortletFooter.d.cts +4 -17
- package/dist/components/portlet/PortletFooter.d.ts +4 -17
- package/dist/components/portlet/PortletFooter.js.map +1 -1
- package/dist/components/portlet/PortletHeader.cjs.map +1 -1
- package/dist/components/portlet/PortletHeader.d.cts +4 -20
- package/dist/components/portlet/PortletHeader.d.ts +4 -20
- package/dist/components/portlet/PortletHeader.js.map +1 -1
- package/dist/components/portlet/PortletLabel.cjs.map +1 -1
- package/dist/components/portlet/PortletLabel.d.cts +5 -18
- package/dist/components/portlet/PortletLabel.d.ts +4 -17
- package/dist/components/portlet/PortletLabel.js.map +1 -1
- package/dist/components/portlet/PortletTitle.cjs.map +1 -1
- package/dist/components/portlet/PortletTitle.d.cts +4 -27
- package/dist/components/portlet/PortletTitle.d.ts +4 -27
- package/dist/components/portlet/PortletTitle.js.map +1 -1
- package/dist/components/portlet/PortletToolbar.cjs.map +1 -1
- package/dist/components/portlet/PortletToolbar.d.cts +4 -17
- package/dist/components/portlet/PortletToolbar.d.ts +4 -17
- package/dist/components/portlet/PortletToolbar.js.map +1 -1
- package/dist/components/portlet/index.d.cts +1 -1
- package/dist/components/portlet/index.d.ts +1 -1
- package/dist/components/stack/StackColumn.cjs.map +1 -1
- package/dist/components/stack/StackColumn.d.cts +1 -3
- package/dist/components/stack/StackColumn.d.ts +1 -3
- package/dist/components/stack/StackColumn.js.map +1 -1
- package/dist/components/stack/StackRow.cjs.map +1 -1
- package/dist/components/stack/StackRow.d.cts +1 -3
- package/dist/components/stack/StackRow.d.ts +1 -3
- package/dist/components/stack/StackRow.js.map +1 -1
- package/dist/components/top-absolute/TopAbsolute.cjs.map +1 -1
- package/dist/components/top-absolute/TopAbsolute.d.cts +2 -5
- package/dist/components/top-absolute/TopAbsolute.d.ts +1 -4
- package/dist/components/top-absolute/TopAbsolute.js.map +1 -1
- package/dist/components/top-absolute/TopAbsoluteCenter.cjs.map +1 -1
- package/dist/components/top-absolute/TopAbsoluteCenter.d.cts +2 -5
- package/dist/components/top-absolute/TopAbsoluteCenter.d.ts +1 -4
- package/dist/components/top-absolute/TopAbsoluteCenter.js.map +1 -1
- package/dist/components/top-absolute/TopAbsoluteLeft.cjs.map +1 -1
- package/dist/components/top-absolute/TopAbsoluteLeft.d.cts +2 -5
- package/dist/components/top-absolute/TopAbsoluteLeft.d.ts +1 -4
- package/dist/components/top-absolute/TopAbsoluteLeft.js.map +1 -1
- package/dist/components/top-absolute/TopAbsoluteRight.cjs.map +1 -1
- package/dist/components/top-absolute/TopAbsoluteRight.d.cts +2 -5
- package/dist/components/top-absolute/TopAbsoluteRight.d.ts +1 -4
- package/dist/components/top-absolute/TopAbsoluteRight.js.map +1 -1
- package/dist/eventemitter/eventemitter3.cjs +1 -1
- package/dist/eventemitter/eventemitter3.cjs.map +1 -1
- package/dist/eventemitter/eventemitter3.d.cts +1 -4
- package/dist/eventemitter/eventemitter3.d.ts +1 -4
- package/dist/eventemitter/eventemitter3.js +1 -1
- package/dist/eventemitter/eventemitter3.js.map +1 -1
- package/dist/eventemitter/types.d.cts +1 -4
- package/dist/eventemitter/types.d.ts +1 -4
- package/dist/file-drop/handle-file-tree-drop.cjs.map +1 -1
- package/dist/file-drop/handle-file-tree-drop.d.cts +1 -4
- package/dist/file-drop/handle-file-tree-drop.d.ts +1 -4
- package/dist/file-drop/handle-file-tree-drop.js.map +1 -1
- package/dist/file-drop/index.cjs +1 -1
- package/dist/file-drop/index.d.cts +1 -1
- package/dist/file-drop/index.d.ts +1 -1
- package/dist/file-drop/index.js +1 -1
- package/dist/file-drop/internal/debug-logger.cjs.map +1 -1
- package/dist/file-drop/internal/debug-logger.js.map +1 -1
- package/dist/file-drop/internal/path-util.cjs.map +1 -1
- package/dist/file-drop/internal/path-util.d.cts +1 -4
- package/dist/file-drop/internal/path-util.d.ts +1 -4
- package/dist/file-drop/internal/path-util.js.map +1 -1
- package/dist/file-drop/internal/traverse-tree.cjs.map +1 -1
- package/dist/file-drop/internal/traverse-tree.js.map +1 -1
- package/dist/file-drop/internal/util.cjs.map +1 -1
- package/dist/file-drop/internal/util.js.map +1 -1
- package/dist/file-drop/internal/visit-file-system/visit-file-system-entry.cjs.map +1 -1
- package/dist/file-drop/internal/visit-file-system/visit-file-system-entry.js.map +1 -1
- package/dist/file-drop/internal/visit-file-system/visit-file-system-handle.cjs.map +1 -1
- package/dist/file-drop/internal/visit-file-system/visit-file-system-handle.js.map +1 -1
- package/dist/file-drop/process-file-drop.cjs +1 -1
- package/dist/file-drop/process-file-drop.cjs.map +1 -1
- package/dist/file-drop/process-file-drop.d.cts +1 -4
- package/dist/file-drop/process-file-drop.d.ts +1 -4
- package/dist/file-drop/process-file-drop.js +1 -1
- package/dist/file-drop/process-file-drop.js.map +1 -1
- package/dist/file-drop/types.cjs.map +1 -1
- package/dist/file-drop/types.d.cts +1 -4
- package/dist/file-drop/types.d.ts +1 -4
- package/dist/file-drop/types.js.map +1 -1
- package/dist/file-drop/utils/file-utils.cjs +1 -1
- package/dist/file-drop/utils/file-utils.cjs.map +1 -1
- package/dist/file-drop/utils/file-utils.d.cts +1 -4
- package/dist/file-drop/utils/file-utils.d.ts +1 -4
- package/dist/file-drop/utils/file-utils.js +1 -1
- package/dist/file-drop/utils/file-utils.js.map +1 -1
- package/dist/file-drop/utils/filter.cjs.map +1 -1
- package/dist/file-drop/utils/filter.d.cts +1 -4
- package/dist/file-drop/utils/filter.d.ts +1 -4
- package/dist/file-drop/utils/filter.js.map +1 -1
- package/dist/file-drop/utils/parallel-map.cjs.map +1 -1
- package/dist/file-drop/utils/parallel-map.js.map +1 -1
- package/dist/file-drop/utils/progress-tracker.cjs.map +1 -1
- package/dist/file-drop/utils/progress-tracker.js.map +1 -1
- package/dist/helper/mui-css-vars.cjs.map +1 -1
- package/dist/helper/mui-css-vars.d.cts +1 -3
- package/dist/helper/mui-css-vars.d.ts +1 -3
- package/dist/helper/mui-css-vars.js.map +1 -1
- package/dist/helper/mui-media-queries.cjs.map +1 -1
- package/dist/helper/mui-media-queries.d.cts +1 -3
- package/dist/helper/mui-media-queries.d.ts +1 -3
- package/dist/helper/mui-media-queries.js.map +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.cts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/types.d.cts +1 -4
- package/dist/hooks/types.d.ts +1 -4
- package/dist/hooks/useAbsolutePosition.cjs.map +1 -1
- package/dist/hooks/useAbsolutePosition.d.cts +1 -4
- package/dist/hooks/useAbsolutePosition.d.ts +1 -4
- package/dist/hooks/useAbsolutePosition.js.map +1 -1
- package/dist/hooks/useAudioUnlocked.cjs.map +1 -1
- package/dist/hooks/useAudioUnlocked.d.cts +1 -4
- package/dist/hooks/useAudioUnlocked.d.ts +1 -4
- package/dist/hooks/useAudioUnlocked.js.map +1 -1
- package/dist/hooks/useBehaviorSubject.cjs.map +1 -1
- package/dist/hooks/useBehaviorSubject.d.cts +1 -3
- package/dist/hooks/useBehaviorSubject.d.ts +1 -3
- package/dist/hooks/useBehaviorSubject.js.map +1 -1
- package/dist/hooks/useCallbackRef.cjs.map +1 -1
- package/dist/hooks/useCallbackRef.d.cts +1 -4
- package/dist/hooks/useCallbackRef.d.ts +1 -4
- package/dist/hooks/useCallbackRef.js.map +1 -1
- package/dist/hooks/useCenterInView.cjs.map +1 -1
- package/dist/hooks/useCenterInView.d.cts +1 -4
- package/dist/hooks/useCenterInView.d.ts +1 -4
- package/dist/hooks/useCenterInView.js.map +1 -1
- package/dist/hooks/useClipboard.cjs +1 -1
- package/dist/hooks/useClipboard.cjs.map +1 -1
- package/dist/hooks/useClipboard.d.cts +32 -12
- package/dist/hooks/useClipboard.d.ts +32 -12
- package/dist/hooks/useClipboard.js +1 -1
- package/dist/hooks/useClipboard.js.map +1 -1
- package/dist/hooks/useClosableEffect.cjs +1 -1
- package/dist/hooks/useClosableEffect.cjs.map +1 -1
- package/dist/hooks/useClosableEffect.d.cts +1 -3
- package/dist/hooks/useClosableEffect.d.ts +1 -3
- package/dist/hooks/useClosableEffect.js +1 -1
- package/dist/hooks/useClosableEffect.js.map +1 -1
- package/dist/hooks/useComposedRefs.cjs.map +1 -1
- package/dist/hooks/useComposedRefs.d.cts +1 -4
- package/dist/hooks/useComposedRefs.d.ts +1 -4
- package/dist/hooks/useComposedRefs.js.map +1 -1
- package/dist/hooks/useConstant.cjs.map +1 -1
- package/dist/hooks/useConstant.d.cts +1 -4
- package/dist/hooks/useConstant.d.ts +1 -4
- package/dist/hooks/useConstant.js.map +1 -1
- package/dist/hooks/useCooldown.cjs.map +1 -1
- package/dist/hooks/useCooldown.d.cts +1 -4
- package/dist/hooks/useCooldown.d.ts +1 -4
- package/dist/hooks/useCooldown.js.map +1 -1
- package/dist/hooks/useCustomCompareEffect.cjs +1 -1
- package/dist/hooks/useCustomCompareEffect.cjs.map +1 -1
- package/dist/hooks/useCustomCompareEffect.d.cts +1 -3
- package/dist/hooks/useCustomCompareEffect.d.ts +1 -3
- package/dist/hooks/useCustomCompareEffect.js +1 -1
- package/dist/hooks/useCustomCompareEffect.js.map +1 -1
- package/dist/hooks/useCustomCompareMemo.cjs +1 -1
- package/dist/hooks/useCustomCompareMemo.cjs.map +1 -1
- package/dist/hooks/useCustomCompareMemo.d.cts +1 -4
- package/dist/hooks/useCustomCompareMemo.d.ts +1 -4
- package/dist/hooks/useCustomCompareMemo.js +1 -1
- package/dist/hooks/useCustomCompareMemo.js.map +1 -1
- package/dist/hooks/useDebounceEffect.cjs.map +1 -1
- package/dist/hooks/useDebounceEffect.d.cts +1 -3
- package/dist/hooks/useDebounceEffect.d.ts +1 -3
- package/dist/hooks/useDebounceEffect.js.map +1 -1
- package/dist/hooks/useDebounceFn.cjs.map +1 -1
- package/dist/hooks/useDebounceFn.d.cts +1 -3
- package/dist/hooks/useDebounceFn.d.ts +1 -3
- package/dist/hooks/useDebounceFn.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.map +1 -1
- package/dist/hooks/useDebouncedCallback.d.cts +1 -3
- package/dist/hooks/useDebouncedCallback.d.ts +1 -3
- package/dist/hooks/useDebouncedCallback.js.map +1 -1
- package/dist/hooks/useDebouncedParams.cjs +1 -1
- package/dist/hooks/useDebouncedParams.cjs.map +1 -1
- package/dist/hooks/useDebouncedParams.d.cts +1 -4
- package/dist/hooks/useDebouncedParams.d.ts +1 -4
- package/dist/hooks/useDebouncedParams.js +1 -1
- package/dist/hooks/useDebouncedParams.js.map +1 -1
- package/dist/hooks/useDebouncedState.cjs.map +1 -1
- package/dist/hooks/useDebouncedState.d.cts +5 -8
- package/dist/hooks/useDebouncedState.d.ts +5 -8
- package/dist/hooks/useDebouncedState.js.map +1 -1
- package/dist/hooks/useDebouncedValue.cjs +1 -1
- package/dist/hooks/useDebouncedValue.cjs.map +1 -1
- package/dist/hooks/useDebouncedValue.d.cts +1 -4
- package/dist/hooks/useDebouncedValue.d.ts +1 -4
- package/dist/hooks/useDebouncedValue.js +1 -1
- package/dist/hooks/useDebouncedValue.js.map +1 -1
- package/dist/hooks/useDeepCompareEffect.cjs +1 -1
- package/dist/hooks/useDeepCompareEffect.cjs.map +1 -1
- package/dist/hooks/useDeepCompareEffect.d.cts +1 -4
- package/dist/hooks/useDeepCompareEffect.d.ts +1 -4
- package/dist/hooks/useDeepCompareEffect.js +1 -1
- package/dist/hooks/useDeepCompareEffect.js.map +1 -1
- package/dist/hooks/useDeepCompareMemo.cjs.map +1 -1
- package/dist/hooks/useDeepCompareMemo.d.cts +1 -4
- package/dist/hooks/useDeepCompareMemo.d.ts +1 -4
- package/dist/hooks/useDeepCompareMemo.js.map +1 -1
- package/dist/hooks/useDidUpdate.cjs.map +1 -1
- package/dist/hooks/useDidUpdate.d.cts +1 -4
- package/dist/hooks/useDidUpdate.d.ts +1 -4
- package/dist/hooks/useDidUpdate.js.map +1 -1
- package/dist/hooks/useEffectOnce.cjs.map +1 -1
- package/dist/hooks/useEffectOnce.d.cts +1 -4
- package/dist/hooks/useEffectOnce.d.ts +1 -4
- package/dist/hooks/useEffectOnce.js.map +1 -1
- package/dist/hooks/useElementSize.cjs.map +1 -1
- package/dist/hooks/useElementSize.d.cts +1 -4
- package/dist/hooks/useElementSize.d.ts +1 -4
- package/dist/hooks/useElementSize.js.map +1 -1
- package/dist/hooks/useEventListener.cjs.map +1 -1
- package/dist/hooks/useEventListener.d.cts +1 -4
- package/dist/hooks/useEventListener.d.ts +1 -4
- package/dist/hooks/useEventListener.js.map +1 -1
- package/dist/hooks/useId.cjs.map +1 -1
- package/dist/hooks/useId.d.cts +1 -4
- package/dist/hooks/useId.d.ts +1 -4
- package/dist/hooks/useId.js.map +1 -1
- package/dist/hooks/useIdle.cjs.map +1 -1
- package/dist/hooks/useIdle.d.cts +1 -4
- package/dist/hooks/useIdle.d.ts +1 -4
- package/dist/hooks/useIdle.js.map +1 -1
- package/dist/hooks/useImageLoadCallback.cjs.map +1 -1
- package/dist/hooks/useImageLoadCallback.d.cts +1 -4
- package/dist/hooks/useImageLoadCallback.d.ts +1 -4
- package/dist/hooks/useImageLoadCallback.js.map +1 -1
- package/dist/hooks/useImageUpload.cjs +1 -1
- package/dist/hooks/useImageUpload.cjs.map +1 -1
- package/dist/hooks/useImageUpload.d.cts +1 -4
- package/dist/hooks/useImageUpload.d.ts +1 -4
- package/dist/hooks/useImageUpload.js +1 -1
- package/dist/hooks/useImageUpload.js.map +1 -1
- package/dist/hooks/useInterval.cjs.map +1 -1
- package/dist/hooks/useInterval.d.cts +1 -3
- package/dist/hooks/useInterval.d.ts +1 -3
- package/dist/hooks/useInterval.js.map +1 -1
- package/dist/hooks/useIsomorphicEffect.cjs.map +1 -1
- package/dist/hooks/useIsomorphicEffect.d.cts +2 -5
- package/dist/hooks/useIsomorphicEffect.d.ts +2 -5
- package/dist/hooks/useIsomorphicEffect.js.map +1 -1
- package/dist/hooks/useLatest.cjs.map +1 -1
- package/dist/hooks/useLatest.d.cts +1 -4
- package/dist/hooks/useLatest.d.ts +1 -4
- package/dist/hooks/useLatest.js.map +1 -1
- package/dist/hooks/useLgOrUp.cjs.map +1 -1
- package/dist/hooks/useLgOrUp.d.cts +1 -4
- package/dist/hooks/useLgOrUp.d.ts +1 -4
- package/dist/hooks/useLgOrUp.js.map +1 -1
- package/dist/hooks/useLifecycleLogger.cjs.map +1 -1
- package/dist/hooks/useLifecycleLogger.d.cts +1 -4
- package/dist/hooks/useLifecycleLogger.d.ts +1 -4
- package/dist/hooks/useLifecycleLogger.js.map +1 -1
- package/dist/hooks/useLoadingVisible.cjs +1 -1
- package/dist/hooks/useLoadingVisible.cjs.map +1 -1
- package/dist/hooks/useLoadingVisible.d.cts +1 -3
- package/dist/hooks/useLoadingVisible.d.ts +1 -3
- package/dist/hooks/useLoadingVisible.js +1 -1
- package/dist/hooks/useLoadingVisible.js.map +1 -1
- package/dist/hooks/useLocalStorage.cjs +1 -1
- package/dist/hooks/useLocalStorage.cjs.map +1 -1
- package/dist/hooks/useLocalStorage.d.cts +1 -3
- package/dist/hooks/useLocalStorage.d.ts +1 -3
- package/dist/hooks/useLocalStorage.js +1 -1
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useLocalStorageState.cjs.map +1 -1
- package/dist/hooks/useLocalStorageState.d.cts +1 -4
- package/dist/hooks/useLocalStorageState.d.ts +1 -4
- package/dist/hooks/useLocalStorageState.js.map +1 -1
- package/dist/hooks/useMdOrDown.cjs.map +1 -1
- package/dist/hooks/useMdOrDown.d.cts +1 -4
- package/dist/hooks/useMdOrDown.d.ts +1 -4
- package/dist/hooks/useMdOrDown.js.map +1 -1
- package/dist/hooks/useMdOrUp.cjs.map +1 -1
- package/dist/hooks/useMdOrUp.d.cts +1 -4
- package/dist/hooks/useMdOrUp.d.ts +1 -4
- package/dist/hooks/useMdOrUp.js.map +1 -1
- package/dist/hooks/useMount.cjs.map +1 -1
- package/dist/hooks/useMount.d.cts +1 -4
- package/dist/hooks/useMount.d.ts +1 -4
- package/dist/hooks/useMount.js.map +1 -1
- package/dist/hooks/useMounted.cjs.map +1 -1
- package/dist/hooks/useMounted.d.cts +1 -4
- package/dist/hooks/useMounted.d.ts +1 -4
- package/dist/hooks/useMounted.js.map +1 -1
- package/dist/hooks/useMountedState.cjs.map +1 -1
- package/dist/hooks/useMountedState.d.cts +1 -4
- package/dist/hooks/useMountedState.d.ts +1 -4
- package/dist/hooks/useMountedState.js.map +1 -1
- package/dist/hooks/useMutationObserver.cjs +1 -1
- package/dist/hooks/useMutationObserver.cjs.map +1 -1
- package/dist/hooks/useMutationObserver.d.cts +1 -4
- package/dist/hooks/useMutationObserver.d.ts +1 -4
- package/dist/hooks/useMutationObserver.js +1 -1
- package/dist/hooks/useMutationObserver.js.map +1 -1
- package/dist/hooks/useObservable.cjs.map +1 -1
- package/dist/hooks/useObservable.d.cts +1 -3
- package/dist/hooks/useObservable.d.ts +1 -4
- package/dist/hooks/useObservable.js.map +1 -1
- package/dist/hooks/useObservableLocalStorage.cjs.map +1 -1
- package/dist/hooks/useObservableLocalStorage.d.cts +1 -3
- package/dist/hooks/useObservableLocalStorage.d.ts +1 -3
- package/dist/hooks/useObservableLocalStorage.js.map +1 -1
- package/dist/hooks/useObservableSessionStorage.cjs.map +1 -1
- package/dist/hooks/useObservableSessionStorage.d.cts +1 -3
- package/dist/hooks/useObservableSessionStorage.d.ts +1 -3
- package/dist/hooks/useObservableSessionStorage.js.map +1 -1
- package/dist/hooks/useOs.cjs.map +1 -1
- package/dist/hooks/useOs.d.cts +1 -3
- package/dist/hooks/useOs.d.ts +1 -3
- package/dist/hooks/useOs.js.map +1 -1
- package/dist/hooks/useRafState.cjs.map +1 -1
- package/dist/hooks/useRafState.d.cts +1 -4
- package/dist/hooks/useRafState.d.ts +1 -4
- package/dist/hooks/useRafState.js.map +1 -1
- package/dist/hooks/useRefEffect.cjs.map +1 -1
- package/dist/hooks/useRefEffect.d.cts +1 -4
- package/dist/hooks/useRefEffect.d.ts +1 -4
- package/dist/hooks/useRefEffect.js.map +1 -1
- package/dist/hooks/useResizeObserver.cjs.map +1 -1
- package/dist/hooks/useResizeObserver.d.cts +1 -3
- package/dist/hooks/useResizeObserver.d.ts +1 -3
- package/dist/hooks/useResizeObserver.js.map +1 -1
- package/dist/hooks/useScript.cjs.map +1 -1
- package/dist/hooks/useScript.d.cts +1 -3
- package/dist/hooks/useScript.d.ts +1 -3
- package/dist/hooks/useScript.js.map +1 -1
- package/dist/hooks/useSessionStorage.cjs +1 -1
- package/dist/hooks/useSessionStorage.cjs.map +1 -1
- package/dist/hooks/useSessionStorage.d.cts +1 -3
- package/dist/hooks/useSessionStorage.d.ts +1 -3
- package/dist/hooks/useSessionStorage.js +1 -1
- package/dist/hooks/useSessionStorage.js.map +1 -1
- package/dist/hooks/useSessionStorageState.cjs.map +1 -1
- package/dist/hooks/useSessionStorageState.d.cts +1 -4
- package/dist/hooks/useSessionStorageState.d.ts +1 -4
- package/dist/hooks/useSessionStorageState.js.map +1 -1
- package/dist/hooks/useSmOrDown.cjs.map +1 -1
- package/dist/hooks/useSmOrDown.d.cts +1 -4
- package/dist/hooks/useSmOrDown.d.ts +1 -4
- package/dist/hooks/useSmOrDown.js.map +1 -1
- package/dist/hooks/useSmOrUp.cjs.map +1 -1
- package/dist/hooks/useSmOrUp.d.cts +1 -4
- package/dist/hooks/useSmOrUp.d.ts +1 -4
- package/dist/hooks/useSmOrUp.js.map +1 -1
- package/dist/hooks/useThrottledCallback.cjs.map +1 -1
- package/dist/hooks/useThrottledCallback.d.cts +2 -5
- package/dist/hooks/useThrottledCallback.d.ts +2 -5
- package/dist/hooks/useThrottledCallback.js.map +1 -1
- package/dist/hooks/useThrottledCallbackWithClearTimeout.cjs.map +1 -1
- package/dist/hooks/useThrottledCallbackWithClearTimeout.d.cts +2 -5
- package/dist/hooks/useThrottledCallbackWithClearTimeout.d.ts +2 -5
- package/dist/hooks/useThrottledCallbackWithClearTimeout.js.map +1 -1
- package/dist/hooks/useThrottledState.cjs.map +1 -1
- package/dist/hooks/useThrottledState.d.cts +2 -5
- package/dist/hooks/useThrottledState.d.ts +2 -5
- package/dist/hooks/useThrottledState.js.map +1 -1
- package/dist/hooks/useThrottledValue.cjs.map +1 -1
- package/dist/hooks/useThrottledValue.d.cts +1 -4
- package/dist/hooks/useThrottledValue.d.ts +1 -4
- package/dist/hooks/useThrottledValue.js.map +1 -1
- package/dist/hooks/useTimeout.cjs.map +1 -1
- package/dist/hooks/useTimeout.d.cts +6 -9
- package/dist/hooks/useTimeout.d.ts +6 -9
- package/dist/hooks/useTimeout.js.map +1 -1
- package/dist/hooks/useTimeoutData.cjs.map +1 -1
- package/dist/hooks/useTimeoutData.d.cts +1 -4
- package/dist/hooks/useTimeoutData.d.ts +1 -4
- package/dist/hooks/useTimeoutData.js.map +1 -1
- package/dist/hooks/useUncontrolled.cjs.map +1 -1
- package/dist/hooks/useUncontrolled.d.cts +1 -3
- package/dist/hooks/useUncontrolled.d.ts +1 -3
- package/dist/hooks/useUncontrolled.js.map +1 -1
- package/dist/hooks/useUnmount.cjs.map +1 -1
- package/dist/hooks/useUnmount.d.cts +1 -4
- package/dist/hooks/useUnmount.d.ts +1 -4
- package/dist/hooks/useUnmount.js.map +1 -1
- package/dist/hooks/useUpdate.cjs.map +1 -1
- package/dist/hooks/useUpdate.d.cts +1 -4
- package/dist/hooks/useUpdate.d.ts +1 -4
- package/dist/hooks/useUpdate.js.map +1 -1
- package/dist/hooks/useUpdateEffect.cjs.map +1 -1
- package/dist/hooks/useUpdateEffect.d.cts +1 -4
- package/dist/hooks/useUpdateEffect.d.ts +1 -4
- package/dist/hooks/useUpdateEffect.js.map +1 -1
- package/dist/hooks/useUpdateLayoutEffect.cjs.map +1 -1
- package/dist/hooks/useUpdateLayoutEffect.d.cts +1 -4
- package/dist/hooks/useUpdateLayoutEffect.d.ts +1 -4
- package/dist/hooks/useUpdateLayoutEffect.js.map +1 -1
- package/dist/hooks/useWindowEvent.cjs.map +1 -1
- package/dist/hooks/useWindowEvent.d.cts +3 -6
- package/dist/hooks/useWindowEvent.d.ts +3 -6
- package/dist/hooks/useWindowEvent.js.map +1 -1
- package/dist/hooks/useWindowSize.cjs.map +1 -1
- package/dist/hooks/useWindowSize.d.cts +1 -3
- package/dist/hooks/useWindowSize.d.ts +1 -3
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/hooks/useXsOrDown.cjs.map +1 -1
- package/dist/hooks/useXsOrDown.d.cts +1 -4
- package/dist/hooks/useXsOrDown.d.ts +1 -4
- package/dist/hooks/useXsOrDown.js.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/misc/debounce.cjs.map +1 -1
- package/dist/misc/debounce.js.map +1 -1
- package/dist/misc/deepEq.cjs.map +1 -1
- package/dist/misc/deepEq.js.map +1 -1
- package/dist/persistence/codec.cjs.map +1 -1
- package/dist/persistence/codec.d.cts +1 -4
- package/dist/persistence/codec.d.ts +1 -4
- package/dist/persistence/codec.js.map +1 -1
- package/dist/persistence/useStorageState.cjs.map +1 -1
- package/dist/persistence/useStorageState.d.cts +1 -4
- package/dist/persistence/useStorageState.d.ts +1 -4
- package/dist/persistence/useStorageState.js.map +1 -1
- package/dist/util/closables.cjs.map +1 -1
- package/dist/util/closables.d.cts +1 -3
- package/dist/util/closables.d.ts +1 -3
- package/dist/util/closables.js.map +1 -1
- package/dist/util/event-utils.cjs.map +1 -1
- package/dist/util/event-utils.d.cts +1 -4
- package/dist/util/event-utils.d.ts +1 -4
- package/dist/util/event-utils.js.map +1 -1
- package/dist/util/internal-util.cjs.map +1 -1
- package/dist/util/internal-util.js.map +1 -1
- package/dist/util/misc-utils.cjs +1 -1
- package/dist/util/misc-utils.cjs.map +1 -1
- package/dist/util/misc-utils.d.cts +1 -4
- package/dist/util/misc-utils.d.ts +1 -4
- package/dist/util/misc-utils.js +1 -1
- package/dist/util/misc-utils.js.map +1 -1
- package/dist/util/override-props.cjs.map +1 -1
- package/dist/util/override-props.js.map +1 -1
- package/dist/util/sx-props.cjs.map +1 -1
- package/dist/util/sx-props.d.cts +2 -5
- package/dist/util/sx-props.d.ts +2 -5
- package/dist/util/sx-props.js.map +1 -1
- package/dist/util/ymd-date.cjs.map +1 -1
- package/dist/util/ymd-date.js.map +1 -1
- package/llm.txt +5 -4
- package/package.json +10 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-util.cjs","names":["split_","args","it","PathUtils","arr","item","p1","p2","arr1","arr2","nm","i","PathHolder","path","segments","fileName","otherPath"],"sources":["../../../src/file-drop/internal/path-util.ts"],"sourcesContent":["function split_(...args: (string | undefined | null)[]): string[] {\n return args\n .filter((it) => it && it.length > 0 && it !== '.')\n .flatMap((it) => it!.split('/'))\n .filter((it) => it.length > 0 && it !== '.');\n}\n\n/**\n * Path utils\n * not support relative path\n */\nexport class PathUtils {\n static join(...args: (string[] | string | undefined | null)[]): string {\n return PathUtils.split(...args).join('/');\n }\n\n static split = (...args: (string[] | string | undefined | null)[]): string[] => {\n const arr = [] as string[];\n args.forEach((item) => {\n if (Array.isArray(item)) {\n item.forEach((it) => {\n if (typeof it === 'string' && it.length > 0) {\n arr.push(...split_(it));\n }\n });\n } else if (typeof item === 'string' && item.length > 0) {\n arr.push(...split_(item));\n }\n });\n\n return arr.filter((it) => typeof it === 'string' && it.length > 0 && it !== '.');\n };\n\n /**\n * check startsWith for path segments\n * pathStartsWith('a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','/a/b') = true\n * pathStartsWith('/a/b/c','/a/b/') = true\n * pathStartsWith('/a//b//c//','//a//b//') = true\n */\n static pathStartsWith(p1: string, p2: string): boolean {\n return PathUtils.segmentsStartsWith(PathUtils.split(p1), PathUtils.split(p2));\n }\n\n /**\n * check startsWith for path segments\n * segmentsStartsWith([1,2,3], [1,2]) = true\n */\n static segmentsStartsWith(p1: string[], p2: string[]): boolean {\n const arr1 = p1;\n const arr2 = p2;\n if (arr2.length > arr1.length) return false;\n return arr2.every((nm, i) => nm === arr1[i]);\n }\n}\n\nexport class PathHolder {\n readonly segments: string[];\n\n readonly path: string;\n\n constructor(path: string | string[]) {\n if (Array.isArray(path)) {\n this.segments = path;\n } else {\n this.segments = PathUtils.split(path);\n }\n this.path = this.segments.join('/');\n }\n\n static EMPTY = new PathHolder([]);\n\n static from = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n return new PathHolder(PathUtils.split(...args));\n };\n\n join = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n const segments = PathUtils.split(...this.segments, ...args);\n return new PathHolder(segments);\n };\n\n changeLast = (fileName: string): PathHolder => {\n if (this.segments.length === 0) {\n return new PathHolder(fileName);\n }\n const segments = this.segments.slice();\n segments[segments.length - 1] = fileName;\n return new PathHolder(segments);\n };\n\n parentOrNull = (): PathHolder | null => {\n if (this.segments.length === 0) {\n return null;\n }\n const segments = this.segments.slice(0, this.segments.length - 1);\n return new PathHolder(segments);\n };\n\n lastSegmentOrNull = (): string | null => {\n if (this.segments.length === 0) {\n return null;\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n lastSegment = (): string => {\n if (this.segments.length === 0) {\n return '';\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n startsWith = (otherPath: string | string[] | PathHolder): boolean => {\n if (typeof otherPath === 'string') {\n return PathUtils.segmentsStartsWith(this.segments, PathUtils.split(otherPath));\n } else if (Array.isArray(otherPath)) {\n return PathUtils.segmentsStartsWith(this.segments, otherPath);\n }\n return PathUtils.segmentsStartsWith(this.segments, otherPath.segments);\n };\n\n toString() {\n return this.path;\n }\n}\n"],"mappings":"AAAA,SAASA,EAAO,GAAGC,EAA+C,CAChE,OAAOA,EACJ,
|
|
1
|
+
{"version":3,"file":"path-util.cjs","names":["split_","args","it","PathUtils","arr","item","p1","p2","arr1","arr2","nm","i","PathHolder","path","segments","fileName","otherPath"],"sources":["../../../src/file-drop/internal/path-util.ts"],"sourcesContent":["function split_(...args: (string | undefined | null)[]): string[] {\n return args\n .filter((it) => it && it.length > 0 && it !== '.')\n .flatMap((it) => it!.split('/'))\n .filter((it) => it.length > 0 && it !== '.');\n}\n\n/**\n * Path utils\n * not support relative path\n */\nexport class PathUtils {\n static join(...args: (string[] | string | undefined | null)[]): string {\n return PathUtils.split(...args).join('/');\n }\n\n static split = (...args: (string[] | string | undefined | null)[]): string[] => {\n const arr = [] as string[];\n args.forEach((item) => {\n if (Array.isArray(item)) {\n item.forEach((it) => {\n if (typeof it === 'string' && it.length > 0) {\n arr.push(...split_(it));\n }\n });\n } else if (typeof item === 'string' && item.length > 0) {\n arr.push(...split_(item));\n }\n });\n\n return arr.filter((it) => typeof it === 'string' && it.length > 0 && it !== '.');\n };\n\n /**\n * check startsWith for path segments\n * pathStartsWith('a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','/a/b') = true\n * pathStartsWith('/a/b/c','/a/b/') = true\n * pathStartsWith('/a//b//c//','//a//b//') = true\n */\n static pathStartsWith(p1: string, p2: string): boolean {\n return PathUtils.segmentsStartsWith(PathUtils.split(p1), PathUtils.split(p2));\n }\n\n /**\n * check startsWith for path segments\n * segmentsStartsWith([1,2,3], [1,2]) = true\n */\n static segmentsStartsWith(p1: string[], p2: string[]): boolean {\n const arr1 = p1;\n const arr2 = p2;\n if (arr2.length > arr1.length) return false;\n return arr2.every((nm, i) => nm === arr1[i]);\n }\n}\n\nexport class PathHolder {\n readonly segments: string[];\n\n readonly path: string;\n\n constructor(path: string | string[]) {\n if (Array.isArray(path)) {\n this.segments = path;\n } else {\n this.segments = PathUtils.split(path);\n }\n this.path = this.segments.join('/');\n }\n\n static EMPTY = new PathHolder([]);\n\n static from = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n return new PathHolder(PathUtils.split(...args));\n };\n\n join = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n const segments = PathUtils.split(...this.segments, ...args);\n return new PathHolder(segments);\n };\n\n changeLast = (fileName: string): PathHolder => {\n if (this.segments.length === 0) {\n return new PathHolder(fileName);\n }\n const segments = this.segments.slice();\n segments[segments.length - 1] = fileName;\n return new PathHolder(segments);\n };\n\n parentOrNull = (): PathHolder | null => {\n if (this.segments.length === 0) {\n return null;\n }\n const segments = this.segments.slice(0, this.segments.length - 1);\n return new PathHolder(segments);\n };\n\n lastSegmentOrNull = (): string | null => {\n if (this.segments.length === 0) {\n return null;\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n lastSegment = (): string => {\n if (this.segments.length === 0) {\n return '';\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n startsWith = (otherPath: string | string[] | PathHolder): boolean => {\n if (typeof otherPath === 'string') {\n return PathUtils.segmentsStartsWith(this.segments, PathUtils.split(otherPath));\n } else if (Array.isArray(otherPath)) {\n return PathUtils.segmentsStartsWith(this.segments, otherPath);\n }\n return PathUtils.segmentsStartsWith(this.segments, otherPath.segments);\n };\n\n toString() {\n return this.path;\n }\n}\n"],"mappings":"AAAA,SAASA,EAAO,GAAGC,EAA+C,CAChE,OAAOA,EACJ,OAAQC,GAAOA,GAAMA,EAAG,OAAS,GAAKA,IAAO,GAAG,CAAC,CACjD,QAASA,GAAOA,EAAI,MAAM,GAAG,CAAC,CAAC,CAC/B,OAAQA,GAAOA,EAAG,OAAS,GAAKA,IAAO,GAAG,CAC/C,CAMA,IAAaC,EAAb,MAAaA,CAAU,CACrB,OAAO,KAAK,GAAGF,EAAwD,CACrE,OAAOE,EAAU,MAAM,GAAGF,CAAI,CAAC,CAAC,KAAK,GAAG,CAC1C,CAEA,OAAO,OAAS,GAAGA,IAA6D,CAC9E,IAAMG,EAAM,CAAC,EAab,OAZAH,EAAK,QAASI,GAAS,CACjB,MAAM,QAAQA,CAAI,EACpBA,EAAK,QAASH,GAAO,CACf,OAAOA,GAAO,UAAYA,EAAG,OAAS,GACxCE,EAAI,KAAK,GAAGJ,EAAOE,CAAE,CAAC,CAE1B,CAAC,EACQ,OAAOG,GAAS,UAAYA,EAAK,OAAS,GACnDD,EAAI,KAAK,GAAGJ,EAAOK,CAAI,CAAC,CAE5B,CAAC,EAEMD,EAAI,OAAQF,GAAO,OAAOA,GAAO,UAAYA,EAAG,OA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F,KAAK,SAAS,KAAK,SAAS,OAAS,GAG9C,WAAcE,GACR,OAAOA,GAAc,SAChBb,EAAU,mBAAmB,KAAK,SAAUA,EAAU,MAAMa,CAAS,CAAC,EACpE,MAAM,QAAQA,CAAS,EACzBb,EAAU,mBAAmB,KAAK,SAAUa,CAAS,EAEvDb,EAAU,mBAAmB,KAAK,SAAUa,EAAU,QAAQ,EAGvE,UAAW,CACT,OAAO,KAAK,IACd,CACF,E"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/file-drop/internal/path-util.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Path utils
|
|
4
3
|
* not support relative path
|
|
@@ -34,6 +33,4 @@ export declare class PathHolder {
|
|
|
34
33
|
lastSegment: () => string;
|
|
35
34
|
startsWith: (otherPath: string | string[] | PathHolder) => boolean;
|
|
36
35
|
toString(): string;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//# sourceMappingURL=path-util.d.cts.map
|
|
36
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/file-drop/internal/path-util.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Path utils
|
|
4
3
|
* not support relative path
|
|
@@ -34,6 +33,4 @@ export declare class PathHolder {
|
|
|
34
33
|
lastSegment: () => string;
|
|
35
34
|
startsWith: (otherPath: string | string[] | PathHolder) => boolean;
|
|
36
35
|
toString(): string;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//# sourceMappingURL=path-util.d.ts.map
|
|
36
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-util.js","names":["split_","args","it","PathUtils","arr","item","p1","p2","arr1","arr2","nm","i","PathHolder","path","segments","fileName","otherPath"],"sources":["../../../src/file-drop/internal/path-util.ts"],"sourcesContent":["function split_(...args: (string | undefined | null)[]): string[] {\n return args\n .filter((it) => it && it.length > 0 && it !== '.')\n .flatMap((it) => it!.split('/'))\n .filter((it) => it.length > 0 && it !== '.');\n}\n\n/**\n * Path utils\n * not support relative path\n */\nexport class PathUtils {\n static join(...args: (string[] | string | undefined | null)[]): string {\n return PathUtils.split(...args).join('/');\n }\n\n static split = (...args: (string[] | string | undefined | null)[]): string[] => {\n const arr = [] as string[];\n args.forEach((item) => {\n if (Array.isArray(item)) {\n item.forEach((it) => {\n if (typeof it === 'string' && it.length > 0) {\n arr.push(...split_(it));\n }\n });\n } else if (typeof item === 'string' && item.length > 0) {\n arr.push(...split_(item));\n }\n });\n\n return arr.filter((it) => typeof it === 'string' && it.length > 0 && it !== '.');\n };\n\n /**\n * check startsWith for path segments\n * pathStartsWith('a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','/a/b') = true\n * pathStartsWith('/a/b/c','/a/b/') = true\n * pathStartsWith('/a//b//c//','//a//b//') = true\n */\n static pathStartsWith(p1: string, p2: string): boolean {\n return PathUtils.segmentsStartsWith(PathUtils.split(p1), PathUtils.split(p2));\n }\n\n /**\n * check startsWith for path segments\n * segmentsStartsWith([1,2,3], [1,2]) = true\n */\n static segmentsStartsWith(p1: string[], p2: string[]): boolean {\n const arr1 = p1;\n const arr2 = p2;\n if (arr2.length > arr1.length) return false;\n return arr2.every((nm, i) => nm === arr1[i]);\n }\n}\n\nexport class PathHolder {\n readonly segments: string[];\n\n readonly path: string;\n\n constructor(path: string | string[]) {\n if (Array.isArray(path)) {\n this.segments = path;\n } else {\n this.segments = PathUtils.split(path);\n }\n this.path = this.segments.join('/');\n }\n\n static EMPTY = new PathHolder([]);\n\n static from = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n return new PathHolder(PathUtils.split(...args));\n };\n\n join = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n const segments = PathUtils.split(...this.segments, ...args);\n return new PathHolder(segments);\n };\n\n changeLast = (fileName: string): PathHolder => {\n if (this.segments.length === 0) {\n return new PathHolder(fileName);\n }\n const segments = this.segments.slice();\n segments[segments.length - 1] = fileName;\n return new PathHolder(segments);\n };\n\n parentOrNull = (): PathHolder | null => {\n if (this.segments.length === 0) {\n return null;\n }\n const segments = this.segments.slice(0, this.segments.length - 1);\n return new PathHolder(segments);\n };\n\n lastSegmentOrNull = (): string | null => {\n if (this.segments.length === 0) {\n return null;\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n lastSegment = (): string => {\n if (this.segments.length === 0) {\n return '';\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n startsWith = (otherPath: string | string[] | PathHolder): boolean => {\n if (typeof otherPath === 'string') {\n return PathUtils.segmentsStartsWith(this.segments, PathUtils.split(otherPath));\n } else if (Array.isArray(otherPath)) {\n return PathUtils.segmentsStartsWith(this.segments, otherPath);\n }\n return PathUtils.segmentsStartsWith(this.segments, otherPath.segments);\n };\n\n toString() {\n return this.path;\n }\n}\n"],"mappings":"AAAA,SAASA,EAAO,GAAGC,EAA+C,CAChE,OAAOA,EACJ,
|
|
1
|
+
{"version":3,"file":"path-util.js","names":["split_","args","it","PathUtils","arr","item","p1","p2","arr1","arr2","nm","i","PathHolder","path","segments","fileName","otherPath"],"sources":["../../../src/file-drop/internal/path-util.ts"],"sourcesContent":["function split_(...args: (string | undefined | null)[]): string[] {\n return args\n .filter((it) => it && it.length > 0 && it !== '.')\n .flatMap((it) => it!.split('/'))\n .filter((it) => it.length > 0 && it !== '.');\n}\n\n/**\n * Path utils\n * not support relative path\n */\nexport class PathUtils {\n static join(...args: (string[] | string | undefined | null)[]): string {\n return PathUtils.split(...args).join('/');\n }\n\n static split = (...args: (string[] | string | undefined | null)[]): string[] => {\n const arr = [] as string[];\n args.forEach((item) => {\n if (Array.isArray(item)) {\n item.forEach((it) => {\n if (typeof it === 'string' && it.length > 0) {\n arr.push(...split_(it));\n }\n });\n } else if (typeof item === 'string' && item.length > 0) {\n arr.push(...split_(item));\n }\n });\n\n return arr.filter((it) => typeof it === 'string' && it.length > 0 && it !== '.');\n };\n\n /**\n * check startsWith for path segments\n * pathStartsWith('a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','a/b') = true\n * pathStartsWith('/a/b/c','/a/b') = true\n * pathStartsWith('/a/b/c','/a/b/') = true\n * pathStartsWith('/a//b//c//','//a//b//') = true\n */\n static pathStartsWith(p1: string, p2: string): boolean {\n return PathUtils.segmentsStartsWith(PathUtils.split(p1), PathUtils.split(p2));\n }\n\n /**\n * check startsWith for path segments\n * segmentsStartsWith([1,2,3], [1,2]) = true\n */\n static segmentsStartsWith(p1: string[], p2: string[]): boolean {\n const arr1 = p1;\n const arr2 = p2;\n if (arr2.length > arr1.length) return false;\n return arr2.every((nm, i) => nm === arr1[i]);\n }\n}\n\nexport class PathHolder {\n readonly segments: string[];\n\n readonly path: string;\n\n constructor(path: string | string[]) {\n if (Array.isArray(path)) {\n this.segments = path;\n } else {\n this.segments = PathUtils.split(path);\n }\n this.path = this.segments.join('/');\n }\n\n static EMPTY = new PathHolder([]);\n\n static from = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n return new PathHolder(PathUtils.split(...args));\n };\n\n join = (...args: (string[] | string | undefined | null)[]): PathHolder => {\n const segments = PathUtils.split(...this.segments, ...args);\n return new PathHolder(segments);\n };\n\n changeLast = (fileName: string): PathHolder => {\n if (this.segments.length === 0) {\n return new PathHolder(fileName);\n }\n const segments = this.segments.slice();\n segments[segments.length - 1] = fileName;\n return new PathHolder(segments);\n };\n\n parentOrNull = (): PathHolder | null => {\n if (this.segments.length === 0) {\n return null;\n }\n const segments = this.segments.slice(0, this.segments.length - 1);\n return new PathHolder(segments);\n };\n\n lastSegmentOrNull = (): string | null => {\n if (this.segments.length === 0) {\n return null;\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n lastSegment = (): string => {\n if (this.segments.length === 0) {\n return '';\n }\n return this.segments[this.segments.length - 1]!;\n };\n\n startsWith = (otherPath: string | string[] | PathHolder): boolean => {\n if (typeof otherPath === 'string') {\n return PathUtils.segmentsStartsWith(this.segments, PathUtils.split(otherPath));\n } else if (Array.isArray(otherPath)) {\n return PathUtils.segmentsStartsWith(this.segments, otherPath);\n }\n return PathUtils.segmentsStartsWith(this.segments, otherPath.segments);\n };\n\n toString() {\n return this.path;\n }\n}\n"],"mappings":"AAAA,SAASA,EAAO,GAAGC,EAA+C,CAChE,OAAOA,EACJ,OAAQC,GAAOA,GAAMA,EAAG,OAAS,GAAKA,IAAO,GAAG,CAAC,CACjD,QAASA,GAAOA,EAAI,MAAM,GAAG,CAAC,CAAC,CAC/B,OAAQA,GAAOA,EAAG,OAAS,GAAKA,IAAO,GAAG,CAC/C,CAMA,IAAaC,EAAb,MAAaA,CAAU,CACrB,OAAO,KAAK,GAAGF,EAAwD,CACrE,OAAOE,EAAU,MAAM,GAAGF,CAAI,CAAC,CAAC,KAAK,GAAG,CAC1C,CAEA,OAAO,OAAS,GAAGA,IAA6D,CAC9E,IAAMG,EAAM,CAAC,EAab,OAZAH,EAAK,QAASI,GAAS,CACjB,MAAM,QAAQA,CAAI,EACpBA,EAAK,QAASH,GAAO,CACf,OAAOA,GAAO,UAAYA,EAAG,OAAS,GACxCE,EAAI,KAAK,GAAGJ,EAAOE,CAAE,CAAC,CAE1B,CAAC,EACQ,OAAOG,GAAS,UAAYA,EAAK,OAAS,GACnDD,EAAI,KAAK,GAAGJ,EAAOK,CAAI,CAAC,CAE5B,CAAC,EAEMD,EAAI,OAAQF,GAAO,OAAOA,GAAO,UAAYA,EAAG,OAAS,GAAKA,IAAO,GAAG,CACjF,EAUA,OAAO,eAAeI,EAAYC,EAAqB,CACrD,OAAOJ,EAAU,mBAAmBA,EAAU,MAAMG,CAAE,EAAGH,EAAU,MAAMI,CAAE,CAAC,CAC9E,CAMA,OAAO,mBAAmBD,EAAcC,EAAuB,CAC7D,IAAMC,EAAOF,EACPG,EAAOF,EAEb,OADIE,EAAK,OAASD,EAAK,OAAe,GAC/BC,EAAK,OAAOC,EAAIC,IAAMD,IAAOF,EAAKG,EAAE,CAC7C,CACF,EAEaC,EAAb,MAAaA,CAAW,CACb,SAEA,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ByFileSystemHandle","require_visit_file_system_entry","require_visit_file_system_handle","hasProps","
|
|
1
|
+
{"version":3,"file":"traverse-tree.cjs","names":["visitByFileSystemEntry","visitByFileSystemHandle","require_visit_file_system_entry","require_visit_file_system_handle","hasProps","target","keys","it","traverseTree","parent","handle","output","callbackAccept","debugLevel","parallel","concurrency","file"],"sources":["../../../src/file-drop/internal/traverse-tree.ts"],"sourcesContent":["import type { DebugLevel } from '../types.js';\nimport type { PathHolder } from './path-util.js';\nimport type { PathAndEntry } from './visit-file-system/internal-types.js';\nimport { visitByFileSystemEntry } from './visit-file-system/visit-file-system-entry.js';\nimport { visitByFileSystemHandle } from './visit-file-system/visit-file-system-handle.js';\n\nconst hasProps = (target: object, ...keys: string[]): boolean => {\n return keys.every((it) => it in target);\n};\n\nexport async function traverseTree(\n parent: PathHolder,\n handle: FileSystemHandle | FileSystemEntry | File,\n output: PathAndEntry[],\n callbackAccept: (file: File) => boolean,\n debugLevel: DebugLevel = 'none',\n parallel = true,\n concurrency = 4,\n) {\n if (hasProps(handle, 'filesystem', 'fullPath', 'isDirectory', 'isFile')) {\n await visitByFileSystemEntry(\n parent,\n handle as FileSystemEntry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n concurrency,\n );\n return;\n }\n\n if (hasProps(handle, 'kind', 'isSameEntry')) {\n await visitByFileSystemHandle(\n parent,\n handle as FileSystemHandle,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n concurrency,\n );\n return;\n }\n\n // file은 디렉토리인지 알 수 없음\n const file = handle as File;\n if (callbackAccept(file)) {\n output.push({\n type: 'file',\n file,\n path: parent.join(file.name),\n });\n }\n}\n"],"mappings":"A,iIAMMI,GAAYC,EAAgB,GAAGC,IAC5BA,EAAK,MAAOC,GAAOA,KAAMF,CAAM,EAGxC,eAAsBG,EACpBC,EACAC,EACAC,EACAC,EACAC,EAAyB,OACzBC,EAAW,GACXC,EAAc,EACd,CACA,GAAIX,EAASM,EAAQ,aAAc,WAAY,cAAe,QAAQ,EAAG,CACvE,MAAMV,EAAAA,uBACJS,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,EACA,MACF,CAEA,GAAIX,EAASM,EAAQ,OAAQ,aAAa,EAAG,CAC3C,MAAMT,EAAAA,wBACJQ,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,EACA,MACF,CAGA,IAAMC,EAAON,EACTE,EAAeI,CAAI,GACrBL,EAAO,KAAK,CACV,KAAM,OACNK,OACA,KAAMP,EAAO,KAAKO,EAAK,IAAI,CAC7B,CAAC,CAEL,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-tree.js","names":["
|
|
1
|
+
{"version":3,"file":"traverse-tree.js","names":["visitByFileSystemEntry","visitByFileSystemHandle","hasProps","target","keys","it","traverseTree","parent","handle","output","callbackAccept","debugLevel","parallel","concurrency","file"],"sources":["../../../src/file-drop/internal/traverse-tree.ts"],"sourcesContent":["import type { DebugLevel } from '../types.js';\nimport type { PathHolder } from './path-util.js';\nimport type { PathAndEntry } from './visit-file-system/internal-types.js';\nimport { visitByFileSystemEntry } from './visit-file-system/visit-file-system-entry.js';\nimport { visitByFileSystemHandle } from './visit-file-system/visit-file-system-handle.js';\n\nconst hasProps = (target: object, ...keys: string[]): boolean => {\n return keys.every((it) => it in target);\n};\n\nexport async function traverseTree(\n parent: PathHolder,\n handle: FileSystemHandle | FileSystemEntry | File,\n output: PathAndEntry[],\n callbackAccept: (file: File) => boolean,\n debugLevel: DebugLevel = 'none',\n parallel = true,\n concurrency = 4,\n) {\n if (hasProps(handle, 'filesystem', 'fullPath', 'isDirectory', 'isFile')) {\n await visitByFileSystemEntry(\n parent,\n handle as FileSystemEntry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n concurrency,\n );\n return;\n }\n\n if (hasProps(handle, 'kind', 'isSameEntry')) {\n await visitByFileSystemHandle(\n parent,\n handle as FileSystemHandle,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n concurrency,\n );\n return;\n }\n\n // file은 디렉토리인지 알 수 없음\n const file = handle as File;\n if (callbackAccept(file)) {\n output.push({\n type: 'file',\n file,\n path: parent.join(file.name),\n });\n }\n}\n"],"mappings":"A,kLAMA,MAAME,GAAYC,EAAgB,GAAGC,IAC5BA,EAAK,MAAOC,GAAOA,KAAMF,CAAM,EAGxC,eAAsBG,EACpBC,EACAC,EACAC,EACAC,EACAC,EAAyB,OACzBC,EAAW,GACXC,EAAc,EACd,CACA,GAAIX,EAASM,EAAQ,aAAc,WAAY,cAAe,QAAQ,EAAG,CACvE,MAAMR,EACJO,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,EACA,MACF,CAEA,GAAIX,EAASM,EAAQ,OAAQ,aAAa,EAAG,CAC3C,MAAMP,EACJM,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,EACA,MACF,CAGA,IAAMC,EAAON,EACTE,EAAeI,CAAI,GACrBL,EAAO,KAAK,CACV,KAAM,OACNK,OACA,KAAMP,EAAO,KAAKO,EAAK,IAAI,CAC7B,CAAC,CAEL,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.cjs","names":["errmsg","err"],"sources":["../../../src/file-drop/internal/util.ts"],"sourcesContent":["export function errmsg(err: unknown): string {\n if (typeof err === 'undefined' || err === null) return 'unknown';\n if (typeof err === 'string') return err;\n if (typeof err === 'object' && 'message' in err && typeof err.message === 'string') {\n return err.message;\n }\n return String(err);\n}\n"],"mappings":"AAAA,SAAgBA,
|
|
1
|
+
{"version":3,"file":"util.cjs","names":["errmsg","err"],"sources":["../../../src/file-drop/internal/util.ts"],"sourcesContent":["export function errmsg(err: unknown): string {\n if (typeof err === 'undefined' || err === null) return 'unknown';\n if (typeof err === 'string') return err;\n if (typeof err === 'object' && 'message' in err && typeof err.message === 'string') {\n return err.message;\n }\n return String(err);\n}\n"],"mappings":"AAAA,SAAgBA,EAAOC,EAAsB,CAM3C,OALWA,GAA+B,KAAa,UACnD,OAAOA,GAAQ,SAAiBA,EAChC,OAAOA,GAAQ,UAAY,YAAaA,GAAO,OAAOA,EAAI,SAAY,SACjEA,EAAI,QAEN,OAAOA,CAAG,CACnB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","names":["errmsg","err"],"sources":["../../../src/file-drop/internal/util.ts"],"sourcesContent":["export function errmsg(err: unknown): string {\n if (typeof err === 'undefined' || err === null) return 'unknown';\n if (typeof err === 'string') return err;\n if (typeof err === 'object' && 'message' in err && typeof err.message === 'string') {\n return err.message;\n }\n return String(err);\n}\n"],"mappings":"AAAA,SAAgBA,
|
|
1
|
+
{"version":3,"file":"util.js","names":["errmsg","err"],"sources":["../../../src/file-drop/internal/util.ts"],"sourcesContent":["export function errmsg(err: unknown): string {\n if (typeof err === 'undefined' || err === null) return 'unknown';\n if (typeof err === 'string') return err;\n if (typeof err === 'object' && 'message' in err && typeof err.message === 'string') {\n return err.message;\n }\n return String(err);\n}\n"],"mappings":"AAAA,SAAgBA,EAAOC,EAAsB,CAM3C,OALWA,GAA+B,KAAa,UACnD,OAAOA,GAAQ,SAAiBA,EAChC,OAAOA,GAAQ,UAAY,YAAaA,GAAO,OAAOA,EAAI,SAAY,SACjEA,EAAI,QAEN,OAAOA,CAAG,CACnB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit-file-system-entry.cjs","names":["createFileDropLogger","errmsg","require_debug_logger","require_util","visitByFileSystemEntry","
|
|
1
|
+
{"version":3,"file":"visit-file-system-entry.cjs","names":["createFileDropLogger","errmsg","require_debug_logger","require_util","visitByFileSystemEntry","parent","item","output","callbackAccept","debugLevel","parallel","concurrency","logger","file","getFile","newParent","children","readEntries","child","index","simpleParallelMap","normalizedConcurrency","entry","fileEntry","resolve","reject","f","err","readAllEntries","dirReader","allEntries","readEntriesRecursively","entries"],"sources":["../../../../src/file-drop/internal/visit-file-system/visit-file-system-entry.ts"],"sourcesContent":["import type { DebugLevel } from '../../types.js';\nimport { createFileDropLogger } from '../debug-logger.js';\nimport type { PathHolder } from '../path-util.js';\nimport { errmsg } from '../util.js';\nimport type { PathAndEntry } from './internal-types.js';\n\n/**\n * visitByFileSystemEntry\n */\nexport async function visitByFileSystemEntry(\n parent: PathHolder,\n item: FileSystemEntry,\n output: PathAndEntry[],\n callbackAccept: (file: File) => boolean,\n debugLevel: DebugLevel = 'none',\n parallel = true,\n concurrency = 4,\n) {\n const logger = createFileDropLogger(debugLevel);\n\n if (item.isFile) {\n const file = await getFile(item as FileSystemFileEntry);\n if (!file) {\n logger.debug('FileSystemEntry.getFile() error', item);\n return;\n }\n if (callbackAccept(file)) {\n output.push({\n type: 'file',\n file,\n path: parent.join(file.name),\n });\n }\n return;\n }\n\n if (!item.isDirectory) {\n // ignore\n return;\n }\n\n output.push({\n type: 'dir',\n path: parent.join(item.name),\n });\n\n const newParent = parent.join(item.name);\n logger.info(`🔍 Traversing directory (Entry API): ${item.name} at path: ${newParent.toString()}`);\n\n // 디렉터리 내부의 모든 엔트리를 재귀적으로 읽는다.\n const children = await readEntries(item as FileSystemDirectoryEntry, debugLevel);\n logger.verbose(` 📊 Total children found: ${children.length}`);\n\n children.forEach((child, index) => {\n logger.verbose(` 📄 Found [${index}]: ${child.name} (${child.isFile ? 'file' : 'directory'})`);\n });\n\n // 자체 구현한 parallelMap을 사용하여 성능 최적화\n const { simpleParallelMap } = await import('../../utils/parallel-map.js');\n\n const normalizedConcurrency = Math.max(1, concurrency);\n const shouldParallel = parallel && normalizedConcurrency > 1 && children.length > 1;\n\n if (shouldParallel) {\n // 여러 파일/디렉터리가 있으면 병렬 처리로 순회 시간을 줄인다.\n logger.info(\n ` ⚡ Processing ${children.length} items in parallel (custom implementation, concurrency=${normalizedConcurrency})`,\n );\n await simpleParallelMap(\n children,\n async (entry: FileSystemEntry) => {\n if (entry.isFile || entry.isDirectory) {\n await visitByFileSystemEntry(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n },\n normalizedConcurrency,\n ); // 최대 4개씩 동시 처리\n } else {\n // 단일 항목은 직접 처리 (오버헤드 방지)\n logger.info(` 📝 Processing ${children.length} item directly`);\n for (const entry of children) {\n if (entry.isFile || entry.isDirectory) {\n await visitByFileSystemEntry(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n }\n }\n}\n\nasync function getFile(fileEntry: FileSystemFileEntry): Promise<File | null> {\n try {\n return await new Promise((resolve, reject) => {\n fileEntry.file(\n (f) => {\n resolve(f);\n },\n (err) => {\n reject(err);\n },\n );\n });\n } catch {\n return null;\n }\n}\n\nasync function readEntries(\n item: FileSystemDirectoryEntry,\n debugLevel: DebugLevel = 'none',\n): Promise<FileSystemEntry[]> {\n const logger = createFileDropLogger(debugLevel);\n\n try {\n return await readAllEntries(item, debugLevel);\n } catch (err) {\n logger.debug(errmsg(err));\n return [];\n }\n}\nasync function readAllEntries(\n item: FileSystemDirectoryEntry,\n debugLevel: DebugLevel = 'none',\n): Promise<FileSystemEntry[]> {\n const logger = createFileDropLogger(debugLevel);\n const dirReader = item.createReader();\n let allEntries: FileSystemEntry[] = [];\n\n async function readEntriesRecursively() {\n return new Promise<FileSystemEntry[]>((resolve, reject) => {\n dirReader.readEntries(\n (entries) => {\n if (entries.length > 0) {\n allEntries = allEntries.concat(entries);\n // 아직 더 읽을 파일이 남아 있을 수 있으므로 재귀적으로 호출\n resolve(readEntriesRecursively());\n } else {\n // 더 이상 읽을 엔트리가 없으면 전체 리스트 반환\n resolve(allEntries);\n }\n },\n (err) => {\n logger.warn('readEntries() error', err);\n reject(err);\n },\n );\n });\n }\n\n await readEntriesRecursively();\n return allEntries;\n}\n"],"mappings":"A,gEASA,eAAsBI,EACpBC,EACAC,EACAC,EACAC,EACAC,EAAyB,OACzBC,EAAW,GACXC,EAAc,EACd,CACA,IAAMC,EAASZ,EAAAA,qBAAqBS,CAAU,EAE9C,GAAIH,EAAK,OAAQ,CACf,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EA,eAAeP,EAAQS,EAAsD,CAC3E,GAAI,CACF,OAAO,MAAM,IAAI,SAASC,EAASC,IAAW,CAC5CF,EAAU,KACPG,GAAM,CACLF,EAAQE,CAAC,CACX,EACCC,GAAQ,CACPF,EAAOE,CAAG,CACZ,CACF,CACF,CAAC,CACH,MAAQ,CACN,OAAO,IACT,CACF,CAEA,eAAeV,EACbX,EACAG,EAAyB,OACG,CAC5B,IAAMG,EAASZ,EAAAA,qBAAqBS,CAAU,EAE9C,GAAI,CACF,OAAO,MAAMmB,EAAetB,EAAMG,CAAU,CAC9C,OAASkB,EAAK,CAEZ,OADAf,EAAO,MAAMX,EAAAA,OAAO0B,CAAG,CAAC,EACjB,CAAC,CACV,CACF,CACA,eAAeC,EACbtB,EACAG,EAAyB,OACG,CAC5B,IAAMG,EAASZ,EAAAA,qBAAqBS,CAAU,EACxCoB,EAAYvB,EAAK,aAAa,EAChCwB,EAAgC,CAAC,EAErC,eAAeC,GAAyB,CACtC,OAAO,IAAI,SAA4BP,EAASC,IAAW,CACzDI,EAAU,YACPG,GAAY,CACPA,EAAQ,OAAS,GACnBF,EAAaA,EAAW,OAAOE,CAAO,EAEtCR,EAAQO,EAAuB,CAAC,GAGhCP,EAAQM,CAAU,CAEtB,EACCH,GAAQ,CACPf,EAAO,KAAK,sBAAuBe,CAAG,EACtCF,EAAOE,CAAG,CACZ,CACF,CACF,CAAC,CACH,CAGA,OADA,MAAMI,EAAuB,EACtBD,CACT,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit-file-system-entry.js","names":["
|
|
1
|
+
{"version":3,"file":"visit-file-system-entry.js","names":["createFileDropLogger","errmsg","visitByFileSystemEntry","parent","item","output","callbackAccept","debugLevel","parallel","concurrency","logger","file","getFile","newParent","children","readEntries","child","index","simpleParallelMap","normalizedConcurrency","entry","fileEntry","resolve","reject","f","err","readAllEntries","dirReader","allEntries","readEntriesRecursively","entries"],"sources":["../../../../src/file-drop/internal/visit-file-system/visit-file-system-entry.ts"],"sourcesContent":["import type { DebugLevel } from '../../types.js';\nimport { createFileDropLogger } from '../debug-logger.js';\nimport type { PathHolder } from '../path-util.js';\nimport { errmsg } from '../util.js';\nimport type { PathAndEntry } from './internal-types.js';\n\n/**\n * visitByFileSystemEntry\n */\nexport async function visitByFileSystemEntry(\n parent: PathHolder,\n item: FileSystemEntry,\n output: PathAndEntry[],\n callbackAccept: (file: File) => boolean,\n debugLevel: DebugLevel = 'none',\n parallel = true,\n concurrency = 4,\n) {\n const logger = createFileDropLogger(debugLevel);\n\n if (item.isFile) {\n const file = await getFile(item as FileSystemFileEntry);\n if (!file) {\n logger.debug('FileSystemEntry.getFile() error', item);\n return;\n }\n if (callbackAccept(file)) {\n output.push({\n type: 'file',\n file,\n path: parent.join(file.name),\n });\n }\n return;\n }\n\n if (!item.isDirectory) {\n // ignore\n return;\n }\n\n output.push({\n type: 'dir',\n path: parent.join(item.name),\n });\n\n const newParent = parent.join(item.name);\n logger.info(`🔍 Traversing directory (Entry API): ${item.name} at path: ${newParent.toString()}`);\n\n // 디렉터리 내부의 모든 엔트리를 재귀적으로 읽는다.\n const children = await readEntries(item as FileSystemDirectoryEntry, debugLevel);\n logger.verbose(` 📊 Total children found: ${children.length}`);\n\n children.forEach((child, index) => {\n logger.verbose(` 📄 Found [${index}]: ${child.name} (${child.isFile ? 'file' : 'directory'})`);\n });\n\n // 자체 구현한 parallelMap을 사용하여 성능 최적화\n const { simpleParallelMap } = await import('../../utils/parallel-map.js');\n\n const normalizedConcurrency = Math.max(1, concurrency);\n const shouldParallel = parallel && normalizedConcurrency > 1 && children.length > 1;\n\n if (shouldParallel) {\n // 여러 파일/디렉터리가 있으면 병렬 처리로 순회 시간을 줄인다.\n logger.info(\n ` ⚡ Processing ${children.length} items in parallel (custom implementation, concurrency=${normalizedConcurrency})`,\n );\n await simpleParallelMap(\n children,\n async (entry: FileSystemEntry) => {\n if (entry.isFile || entry.isDirectory) {\n await visitByFileSystemEntry(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n },\n normalizedConcurrency,\n ); // 최대 4개씩 동시 처리\n } else {\n // 단일 항목은 직접 처리 (오버헤드 방지)\n logger.info(` 📝 Processing ${children.length} item directly`);\n for (const entry of children) {\n if (entry.isFile || entry.isDirectory) {\n await visitByFileSystemEntry(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n }\n }\n}\n\nasync function getFile(fileEntry: FileSystemFileEntry): Promise<File | null> {\n try {\n return await new Promise((resolve, reject) => {\n fileEntry.file(\n (f) => {\n resolve(f);\n },\n (err) => {\n reject(err);\n },\n );\n });\n } catch {\n return null;\n }\n}\n\nasync function readEntries(\n item: FileSystemDirectoryEntry,\n debugLevel: DebugLevel = 'none',\n): Promise<FileSystemEntry[]> {\n const logger = createFileDropLogger(debugLevel);\n\n try {\n return await readAllEntries(item, debugLevel);\n } catch (err) {\n logger.debug(errmsg(err));\n return [];\n }\n}\nasync function readAllEntries(\n item: FileSystemDirectoryEntry,\n debugLevel: DebugLevel = 'none',\n): Promise<FileSystemEntry[]> {\n const logger = createFileDropLogger(debugLevel);\n const dirReader = item.createReader();\n let allEntries: FileSystemEntry[] = [];\n\n async function readEntriesRecursively() {\n return new Promise<FileSystemEntry[]>((resolve, reject) => {\n dirReader.readEntries(\n (entries) => {\n if (entries.length > 0) {\n allEntries = allEntries.concat(entries);\n // 아직 더 읽을 파일이 남아 있을 수 있으므로 재귀적으로 호출\n resolve(readEntriesRecursively());\n } else {\n // 더 이상 읽을 엔트리가 없으면 전체 리스트 반환\n resolve(allEntries);\n }\n },\n (err) => {\n logger.warn('readEntries() error', err);\n reject(err);\n },\n );\n });\n }\n\n await readEntriesRecursively();\n return allEntries;\n}\n"],"mappings":"A,8FASA,eAAsBE,EACpBC,EACAC,EACAC,EACAC,EACAC,EAAyB,OACzBC,EAAW,GACXC,EAAc,EACd,CACA,IAAMC,EAASV,EA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AEA,eAAeP,EAAQS,EAAsD,CAC3E,GAAI,CACF,OAAO,MAAM,IAAI,SAASC,EAASC,IAAW,CAC5CF,EAAU,KACPG,GAAM,CACLF,EAAQE,CAAC,CACX,EACCC,GAAQ,CACPF,EAAOE,CAAG,CACZ,CACF,CACF,CAAC,CACH,MAAQ,CACN,OAAO,IACT,CACF,CAEA,eAAeV,EACbX,EACAG,EAAyB,OACG,CAC5B,IAAMG,EAASV,EAAqBO,CAAU,EAE9C,GAAI,CACF,OAAO,MAAMmB,EAAetB,EAAMG,CAAU,CAC9C,OAASkB,EAAK,CAEZ,OADAf,EAAO,MAAMT,EAAOwB,CAAG,CAAC,EACjB,CAAC,CACV,CACF,CACA,eAAeC,EACbtB,EACAG,EAAyB,OACG,CAC5B,IAAMG,EAASV,EAAqBO,CAAU,EACxCoB,EAAYvB,EAAK,aAAa,EAChCwB,EAAgC,CAAC,EAErC,eAAeC,GAAyB,CACtC,OAAO,IAAI,SAA4BP,EAASC,IAAW,CACzDI,EAAU,YACPG,GAAY,CACPA,EAAQ,OAAS,GACnBF,EAAaA,EAAW,OAAOE,CAAO,EAEtCR,EAAQO,EAAuB,CAAC,GAGhCP,EAAQM,CAAU,CAEtB,EACCH,GAAQ,CACPf,EAAO,KAAK,sBAAuBe,CAAG,EACtCF,EAAOE,CAAG,CACZ,CACF,CACF,CAAC,CACH,CAGA,OADA,MAAMI,EAAuB,EACtBD,CACT,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit-file-system-handle.cjs","names":["createFileDropLogger","directoryHandle","require_debug_logger","visitByFileSystemHandle","
|
|
1
|
+
{"version":3,"file":"visit-file-system-handle.cjs","names":["createFileDropLogger","directoryHandle","require_debug_logger","visitByFileSystemHandle","parent","handle","output","callbackAccept","debugLevel","parallel","concurrency","logger","file","newParent","children","iterator","entry","simpleParallelMap","normalizedConcurrency","err"],"sources":["../../../../src/file-drop/internal/visit-file-system/visit-file-system-handle.ts"],"sourcesContent":["import type { DebugLevel } from '../../types.js';\nimport { createFileDropLogger } from '../debug-logger.js';\nimport type { PathHolder } from '../path-util.js';\nimport type { PathAndEntry } from './internal-types.js';\n\nexport async function visitByFileSystemHandle(\n parent: PathHolder,\n handle: FileSystemHandle,\n output: PathAndEntry[],\n callbackAccept: (file: File) => boolean,\n debugLevel: DebugLevel = 'none',\n parallel = true,\n concurrency = 4,\n) {\n const logger = createFileDropLogger(debugLevel);\n\n if (handle.kind === 'file') {\n const file = (await (handle as FileSystemFileHandle).getFile()) as File | null;\n if (!file) {\n return;\n }\n if (callbackAccept(file)) {\n output.push({\n type: 'file',\n file,\n path: parent.join(file.name),\n });\n }\n return;\n }\n\n if (handle.kind !== 'directory') {\n // 파일이나 디렉터리가 아닌 핸들은 순회 대상에서 제외한다.\n return;\n }\n\n output.push({\n type: 'dir',\n path: parent.join(handle.name),\n });\n\n const newParent = parent.join(handle.name);\n try {\n // FileSystemDirectoryHandle의 values()는 async iterator를 반환\n const children: FileSystemHandle[] = [];\n // FileSystemDirectoryHandle.values()는 일부 환경의 표준 타입에 없을 수 있으므로 인터페이스 확장 사용\n const directoryHandle = handle as FileSystemDirectoryHandle & {\n values(): AsyncIterableIterator<FileSystemHandle>;\n };\n const iterator = directoryHandle.values();\n\n logger.info(`🔍 Traversing directory: ${handle.name} at path: ${newParent.toString()}`);\n\n // async iterator를 배열로 변환\n for await (const entry of iterator) {\n if (entry) {\n children.push(entry);\n logger.verbose(` 📄 Found: ${entry.name} (${entry.kind})`);\n }\n }\n\n logger.verbose(` 📊 Total children found: ${children.length}`);\n\n // 자체 구현한 parallelMap 사용\n const { simpleParallelMap } = await import('../../utils/parallel-map.js');\n\n const normalizedConcurrency = Math.max(1, concurrency);\n const shouldParallel = parallel && normalizedConcurrency > 1 && children.length > 1;\n\n if (shouldParallel) {\n // 병렬 처리\n logger.info(\n ` ⚡ Processing ${children.length} items in parallel (custom implementation, concurrency=${normalizedConcurrency})`,\n );\n await simpleParallelMap(\n children,\n async (entry: FileSystemHandle) => {\n if (entry.kind === 'file' || entry.kind === 'directory') {\n await visitByFileSystemHandle(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n },\n normalizedConcurrency,\n );\n } else {\n // 단일 항목은 직접 처리\n logger.info(` 📝 Processing ${children.length} item directly`);\n for (const entry of children) {\n if (entry.kind === 'file' || entry.kind === 'directory') {\n await visitByFileSystemHandle(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n }\n }\n } catch (err) {\n logger.warn(`Directory traversal warning for ${handle.name}:`, err);\n }\n}\n"],"mappings":"A,uCAKA,eAAsBG,EACpBC,EACAC,EACAC,EACAC,EACAC,EAAyB,OACzBC,EAAW,GACXC,EAAc,EACd,CACA,IAAMC,EAASX,EAAAA,qBAAqBQ,CAAU,EAE9C,GAAIH,EAAO,OAAS,OAAQ,CAC1B,IAAMO,EAAQ,MAAOP,EAAgC,QAAQ,EAC7D,GAAI,CAACO,EACH,OAEEL,EAAeK,CAAI,GACrBN,EAAO,KAAK,CACV,KAAM,OACNM,OACA,KAAMR,EAAO,KAAKQ,EAAK,IAAI,CAC7B,CAAC,EAEH,MACF,CAEA,GAAIP,EAAO,OAAS,YAElB,OAGFC,EAAO,KAAK,CACV,KAAM,MACN,KAAMF,EAAO,KAAKC,EAAO,IAAI,CAC/B,CAAC,EAED,IAAMQ,EAAYT,EAAO,KAAKC,EAAO,IAAI,EACzC,GAAI,CAEF,IAAMS,EAA+B,CAAC,EAKhCC,EAAWd,EAAgB,OAAO,EAExCU,EAAO,KAAK,4BAA4BN,EAAO,KAAK,YAAYQ,EAAU,SAAS,GAAG,EAGtF,UAAW,IAAMG,KAASD,EACpBC,IACFF,EAAS,KAAKE,CAAK,EACnBL,EAAO,QAAQ,eAAeK,EAAM,KAAK,IAAIA,EAAM,KAAK,EAAE,GAI9DL,EAAO,QAAQ,8BAA8BG,EAAS,QAAQ,EAG9D,GAAM,CAAEG,qBAAsB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,QAAM,8BAAA,CAAA,EAE9BC,EAAwB,KAAK,IAAI,EAAGR,CAAW,EAGrD,GAFuBD,GAAYS,EAAwB,GAAKJ,EAAS,OAAS,EAIhFH,EAAO,KACL,kBAAkBG,EAAS,OAAO,yDAAyDI,EAAsB,EACnH,EACA,MAAMD,EACJH,EACA,KAAOE,IAA4B,EAC7BA,EAAM,OAAS,QAAUA,EAAM,OAAS,cAC1C,MAAMb,EACJU,EACAG,EACAV,EACAC,EACAC,EACAC,EACAS,CACF,CAEJ,EACAA,CACF,MACK,CAELP,EAAO,KAAK,mBAAmBG,EAAS,OAAO,eAAe,EAC9D,IAAK,IAAME,KAASF,GACdE,EAAM,OAAS,QAAUA,EAAM,OAAS,cAC1C,MAAMb,EACJU,EACAG,EACAV,EACAC,EACAC,EACAC,EACAS,CACF,CAGN,CACF,OAASC,EAAK,CACZR,EAAO,KAAK,mCAAmCN,EAAO,KAAK,GAAIc,CAAG,CACpE,CACF,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit-file-system-handle.js","names":["directoryHandle","
|
|
1
|
+
{"version":3,"file":"visit-file-system-handle.js","names":["directoryHandle","createFileDropLogger","visitByFileSystemHandle","parent","handle","output","callbackAccept","debugLevel","parallel","concurrency","logger","file","newParent","children","iterator","entry","simpleParallelMap","normalizedConcurrency","err"],"sources":["../../../../src/file-drop/internal/visit-file-system/visit-file-system-handle.ts"],"sourcesContent":["import type { DebugLevel } from '../../types.js';\nimport { createFileDropLogger } from '../debug-logger.js';\nimport type { PathHolder } from '../path-util.js';\nimport type { PathAndEntry } from './internal-types.js';\n\nexport async function visitByFileSystemHandle(\n parent: PathHolder,\n handle: FileSystemHandle,\n output: PathAndEntry[],\n callbackAccept: (file: File) => boolean,\n debugLevel: DebugLevel = 'none',\n parallel = true,\n concurrency = 4,\n) {\n const logger = createFileDropLogger(debugLevel);\n\n if (handle.kind === 'file') {\n const file = (await (handle as FileSystemFileHandle).getFile()) as File | null;\n if (!file) {\n return;\n }\n if (callbackAccept(file)) {\n output.push({\n type: 'file',\n file,\n path: parent.join(file.name),\n });\n }\n return;\n }\n\n if (handle.kind !== 'directory') {\n // 파일이나 디렉터리가 아닌 핸들은 순회 대상에서 제외한다.\n return;\n }\n\n output.push({\n type: 'dir',\n path: parent.join(handle.name),\n });\n\n const newParent = parent.join(handle.name);\n try {\n // FileSystemDirectoryHandle의 values()는 async iterator를 반환\n const children: FileSystemHandle[] = [];\n // FileSystemDirectoryHandle.values()는 일부 환경의 표준 타입에 없을 수 있으므로 인터페이스 확장 사용\n const directoryHandle = handle as FileSystemDirectoryHandle & {\n values(): AsyncIterableIterator<FileSystemHandle>;\n };\n const iterator = directoryHandle.values();\n\n logger.info(`🔍 Traversing directory: ${handle.name} at path: ${newParent.toString()}`);\n\n // async iterator를 배열로 변환\n for await (const entry of iterator) {\n if (entry) {\n children.push(entry);\n logger.verbose(` 📄 Found: ${entry.name} (${entry.kind})`);\n }\n }\n\n logger.verbose(` 📊 Total children found: ${children.length}`);\n\n // 자체 구현한 parallelMap 사용\n const { simpleParallelMap } = await import('../../utils/parallel-map.js');\n\n const normalizedConcurrency = Math.max(1, concurrency);\n const shouldParallel = parallel && normalizedConcurrency > 1 && children.length > 1;\n\n if (shouldParallel) {\n // 병렬 처리\n logger.info(\n ` ⚡ Processing ${children.length} items in parallel (custom implementation, concurrency=${normalizedConcurrency})`,\n );\n await simpleParallelMap(\n children,\n async (entry: FileSystemHandle) => {\n if (entry.kind === 'file' || entry.kind === 'directory') {\n await visitByFileSystemHandle(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n },\n normalizedConcurrency,\n );\n } else {\n // 단일 항목은 직접 처리\n logger.info(` 📝 Processing ${children.length} item directly`);\n for (const entry of children) {\n if (entry.kind === 'file' || entry.kind === 'directory') {\n await visitByFileSystemHandle(\n newParent,\n entry,\n output,\n callbackAccept,\n debugLevel,\n parallel,\n normalizedConcurrency,\n );\n }\n }\n }\n } catch (err) {\n logger.warn(`Directory traversal warning for ${handle.name}:`, err);\n }\n}\n"],"mappings":"A,0DAKA,eAAsBE,EACpBC,EACAC,EACAC,EACAC,EACAC,EAAyB,OACzBC,EAAW,GACXC,EAAc,EACd,CACA,IAAMC,EAAST,EAAqBM,CAAU,EAE9C,GAAIH,EAAO,OAAS,OAAQ,CAC1B,IAAMO,EAAQ,MAAOP,EAAgC,QAAQ,EAC7D,GAAI,CAACO,EACH,OAEEL,EAAeK,CAAI,GACrBN,EAAO,KAAK,CACV,KAAM,OACNM,OACA,KAAMR,EAAO,KAAKQ,EAAK,IAAI,CAC7B,CAAC,EAEH,MACF,CAEA,GAAIP,EAAO,OAAS,YAElB,OAGFC,EAAO,KAAK,CACV,KAAM,MACN,KAAMF,EAAO,KAAKC,EAAO,IAAI,CAC/B,CAAC,EAED,IAAMQ,EAAYT,EAAO,KAAKC,EAAO,IAAI,EACzC,GAAI,CAEF,IAAMS,EAA+B,CAAC,EAKhCC,EAAWd,EAAgB,OAAO,EAExCU,EAAO,KAAK,4BAA4BN,EAAO,KAAK,YAAYQ,EAAU,SAAS,GAAG,EAGtF,UAAW,IAAMG,KAASD,EACpBC,IACFF,EAAS,KAAKE,CAAK,EACnBL,EAAO,QAAQ,eAAeK,EAAM,KAAK,IAAIA,EAAM,KAAK,EAAE,GAI9DL,EAAO,QAAQ,8BAA8BG,EAAS,QAAQ,EAG9D,GAAM,CAAEG,qBAAsB,MAAM,OAAO,+BAErCC,EAAwB,KAAK,IAAI,EAAGR,CAAW,EAGrD,GAFuBD,GAAYS,EAAwB,GAAKJ,EAAS,OAAS,EAIhFH,EAAO,KACL,kBAAkBG,EAAS,OAAO,yDAAyDI,EAAsB,EACnH,EACA,MAAMD,EACJH,EACA,KAAOE,IAA4B,EAC7BA,EAAM,OAAS,QAAUA,EAAM,OAAS,cAC1C,MAAMb,EACJU,EACAG,EACAV,EACAC,EACAC,EACAC,EACAS,CACF,CAEJ,EACAA,CACF,MACK,CAELP,EAAO,KAAK,mBAAmBG,EAAS,OAAO,eAAe,EAC9D,IAAK,IAAME,KAASF,GACdE,EAAM,OAAS,QAAUA,EAAM,OAAS,cAC1C,MAAMb,EACJU,EACAG,EACAV,EACAC,EACAC,EACAC,EACAS,CACF,CAGN,CACF,OAASC,EAAK,CACZR,EAAO,KAAK,mCAAmCN,EAAO,KAAK,GAAIc,CAAG,CACpE,CACF,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./internal/
|
|
1
|
+
const e=require("./internal/debug-logger.cjs"),t=require("./internal/path-util.cjs"),n=require("./internal/traverse-tree.cjs"),r=require("./types.cjs"),i=require("./utils/file-utils.cjs"),a=require("./utils/filter.cjs"),o=require("./utils/progress-tracker.cjs");async function s(e){if(`dataTransfer`in e){let t=`getAsFileSystemHandle`in DataTransferItem.prototype,n=`webkitGetAsEntry`in DataTransferItem.prototype;if(!t&&!n)return Array.from(e.dataTransfer.files);let r=Array.from(e.dataTransfer.items).filter(e=>e.kind===`file`).map(e=>n?e.webkitGetAsEntry():t?e.getAsFileSystemHandle():e.getAsFile()).filter(Boolean);return(await Promise.all(r.map(e=>e&&e instanceof Promise?e:Promise.resolve(e)))).filter(Boolean)}return`length`in e?Array.from(e):Array.isArray(e)?e:null}async function c(a,o,s,c={},l,u=`warn`,d){let f=[],p=[],m=0,{simpleParallelMap:h}=await Promise.resolve().then(()=>require("./utils/parallel-map.cjs")),g=Math.max(1,d?.concurrency??4),_=d?.parallel??!0,v=e.createFileDropLogger(u),y=async e=>{if(l?.aborted)throw new r.FileDropError(`UNKNOWN`,void 0,`Operation aborted`);try{await n.traverseTree(t.PathHolder.EMPTY,e,f,e=>{m++,s.updateTotalItems(m);let t=i.createFileItem(e,e.name);s.setCurrentItem(t);let n=o.filter(t);return n.error&&(p.push(n.error),c.onError?.(n.error,t)),n.accepted||s.completeItem(),n.accepted},u,_,g)}catch(e){let t=e instanceof r.FileDropError?e:new r.FileDropError(`UNKNOWN`,void 0,String(e));p.push(t),c.onError?.(t)}};if(_&&g>1&&a.length>1)v.info(`🚀 Processing ${a.length} handles in parallel (custom implementation, concurrency=${g})`),await h(a,y,g);else{v.info(`📝 Processing ${a.length} handle directly`);for(let e of a)await y(e)}let b=[],x=[];s.updateTotalItems(m),v.info(`🔄 Processing ${f.length} total items from traversal`);for(let e of f)if(e.type===`file`){let t=i.createFileItem(e.file,e.path.toString(),e.path.toString());b.push(t),c.onFile?.(t),s.completeItem(),v.verbose(` ✅ File: ${e.path.toString()}`)}else{let t={type:`directory`,name:e.path.lastSegment(),path:e.path.toString(),pathSegments:e.path.segments,relativePath:e.path.toString()};x.push(t),v.verbose(` 📁 Directory: ${e.path.toString()}`)}return v.info(`📊 Final results: ${b.length} files, ${x.length} directories`),{items:b,directories:x,errors:p}}async function l(e,t={}){let n=Date.now(),l=d(t.debug);try{if(t.signal?.aborted)throw new r.FileDropError(`UNKNOWN`,void 0,`Operation aborted`);let u=await s(e);if(!u)throw new r.FileDropError(`UNSUPPORTED_API`,void 0,`Unsupported file drop source`);let d=u.length,f=new o.ProgressTracker(d,t.callbacks),p=new a.FileFilter(t.filter);if(u.length>0&&u[0]instanceof File){let e=u,a=[],o=[];for(let n of e){if(t.signal?.aborted)throw new r.FileDropError(`UNKNOWN`,void 0,`Operation aborted`);let e=i.createFileItem(n,n.name);f.setCurrentItem(e);let s=p.filter(e);s.accepted?(a.push(e),t.callbacks?.onFile?.(e)):s.error&&(o.push(s.error),t.callbacks?.onError?.(s.error,e)),f.completeItem()}return{files:a,directories:[],tree:i.buildFileTree(a),metadata:{totalFiles:a.length,totalDirectories:0,totalSize:a.reduce((e,t)=>e+(t.size||0),0),processingTime:Date.now()-n},errors:o}}let{items:m,directories:h,errors:g}=await c(u,p,f,t.callbacks,t.signal,l,t.processing),_=[...m,...h];return{files:m,directories:h,tree:i.buildFileTree(_),metadata:{totalFiles:m.length,totalDirectories:h.length,totalSize:m.reduce((e,t)=>e+(t.size||0),0),processingTime:Date.now()-n},errors:g}}catch(e){throw e instanceof r.FileDropError?e:new r.FileDropError(`UNKNOWN`,void 0,String(e))}}async function u(e,t={}){try{return await l(e,t)}catch(e){return{success:!1,error:e instanceof r.FileDropError?e:new r.FileDropError(`UNKNOWN`,void 0,String(e))}}}function d(e){return e===!0?`verbose`:e===!1?`none`:e===void 0?`warn`:e}exports.processFileTreeDrop=l,exports.processFileTreeDropSafe=u;
|
|
2
2
|
//# sourceMappingURL=process-file-drop.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-file-drop.cjs","names":["createFileDropLogger","FileDropError","traverseTree","PathHolder","createFileItem","ProgressTracker","FileFilter","buildFileTree","require_path_util","require_debug_logger","require_traverse_tree","require_types","require_file_utils","require_filter","require_progress_tracker","normalizeSource","source","supportsFileSystemAccessAPI","supportsWebkitGetAsEntry","handles","item","handle","processFileTree","output","errors","totalFilesEncountered","normalizedConcurrency","processing","enableParallel","logger","debugLevel","processHandle","signal","tracker","file","filterResult","filter","callbacks","error","fileError","simpleParallelMap","items","directories","entry","processedFile","directory","processFileTreeDrop","startTime","normalizeDebugLevel","options","normalized","estimatedCount","files","sum","allItems","processFileTreeDropSafe","debug"],"sources":["../../src/file-drop/process-file-drop.ts"],"sourcesContent":["import { createFileDropLogger } from './internal/debug-logger.js';\nimport { PathHolder } from './internal/path-util.js';\nimport { traverseTree } from './internal/traverse-tree.js';\nimport type { PathAndEntry } from './internal/visit-file-system/internal-types.js';\nimport type {\n DebugLevel,\n FileDropOptions,\n FileDropSource,\n FileItem,\n ProcessedDirectory,\n ProcessedFile,\n ProcessingOptions,\n ProcessResult,\n SafeProcessResult,\n} from './types.js';\nimport { FileDropError } from './types.js';\nimport { buildFileTree, createFileItem } from './utils/file-utils.js';\nimport { FileFilter } from './utils/filter.js';\nimport { ProgressTracker } from './utils/progress-tracker.js';\n\n/**\n * 다양한 파일 드롭 소스를 내부적으로 처리 가능한 형태로 정규화\n * React DragEvent, FileList, FileSystemHandle[] 등을 통합 처리\n *\n * @internal\n * @param source - 정규화할 파일 드롭 소스\n * @returns 정규화된 File[] 또는 FileSystemHandle[] 배열, 실패시 null\n */\nasync function normalizeSource(\n source: FileDropSource,\n): Promise<File[] | FileSystemHandle[] | null> {\n if ('dataTransfer' in source) {\n // React DragEvent - 드래그앤드롭 이벤트 처리\n const supportsFileSystemAccessAPI = 'getAsFileSystemHandle' in DataTransferItem.prototype;\n const supportsWebkitGetAsEntry = 'webkitGetAsEntry' in DataTransferItem.prototype;\n\n // 브라우저가 고급 파일 API를 지원하지 않으면 기본 파일 리스트만 반환\n if (!supportsFileSystemAccessAPI && !supportsWebkitGetAsEntry) {\n return Array.from(source.dataTransfer.files);\n }\n\n // 브라우저 능력에 따라 적절한 API 사용\n // Chrome: getAsFileSystemHandle (최신)\n // Firefox/Safari: webkitGetAsEntry (레거시)\n const handles = Array.from(source.dataTransfer.items)\n .filter((item) => item.kind === 'file') // 파일 아이템만 필터링\n .map((item) => {\n if (supportsWebkitGetAsEntry) {\n return item.webkitGetAsEntry(); // 레거시 웹킷 API 사용\n } else if (supportsFileSystemAccessAPI) {\n // File System Access API - getAsFileSystemHandle은 표준 타입에 없음\n return (\n item as DataTransferItem & { getAsFileSystemHandle(): Promise<FileSystemHandle> }\n ).getAsFileSystemHandle();\n }\n return item.getAsFile(); // fallback\n })\n .filter(Boolean); // null/undefined 제거\n\n const resolvedHandles = await Promise.all(\n handles.map((handle) => {\n if (handle && handle instanceof Promise) {\n return handle;\n }\n return Promise.resolve(handle);\n }),\n );\n\n return resolvedHandles.filter(Boolean) as FileSystemHandle[];\n }\n\n if ('length' in source) {\n // FileList 또는 File[]\n return Array.from(source as FileList);\n }\n\n if (Array.isArray(source)) {\n // FileSystemHandle[]\n return source;\n }\n\n return null;\n}\n\n/**\n * 파일 핸들들을 순회하며 파일 트리를 처리\n * FileSystemHandle, FileSystemEntry, File 객체들을 병렬로 처리하여 성능 최적화\n *\n * @internal\n * @param handles - 처리할 파일/디렉토리 핸들 배열\n * @param filter - 파일 필터링 객체\n * @param tracker - 진행상황 추적 객체\n * @param callbacks - 콜백 함수들\n * @param signal - 중단 신호 (optional)\n * @returns 처리된 파일, 디렉토리, 에러 정보\n */\nasync function processFileTree(\n handles: (FileSystemHandle | FileSystemEntry | File)[],\n filter: FileFilter,\n tracker: ProgressTracker,\n callbacks: FileDropOptions['callbacks'] = {},\n signal?: AbortSignal,\n debugLevel: DebugLevel = 'warn',\n processing?: ProcessingOptions,\n): Promise<{ items: ProcessedFile[]; directories: ProcessedDirectory[]; errors: FileDropError[] }> {\n const output: PathAndEntry[] = [];\n const errors: FileDropError[] = [];\n let totalFilesEncountered = 0;\n\n // 자체 구현한 parallelMap 사용\n const { simpleParallelMap } = await import('./utils/parallel-map.js');\n\n const normalizedConcurrency = Math.max(1, processing?.concurrency ?? 4);\n const enableParallel = processing?.parallel ?? true;\n const logger = createFileDropLogger(debugLevel);\n\n const processHandle = async (handle: FileSystemHandle | FileSystemEntry | File) => {\n if (signal?.aborted) {\n throw new FileDropError('UNKNOWN', undefined, 'Operation aborted');\n }\n\n try {\n await traverseTree(\n PathHolder.EMPTY,\n handle,\n output,\n (file: File) => {\n totalFilesEncountered++;\n tracker.updateTotalItems(totalFilesEncountered);\n const item = createFileItem(file, file.name);\n tracker.setCurrentItem(item);\n\n const filterResult = filter.filter(item);\n if (filterResult.error) {\n errors.push(filterResult.error);\n callbacks.onError?.(filterResult.error, item);\n }\n\n if (!filterResult.accepted) {\n tracker.completeItem();\n }\n\n return filterResult.accepted;\n },\n debugLevel,\n enableParallel,\n normalizedConcurrency,\n );\n } catch (error) {\n const fileError =\n error instanceof FileDropError\n ? error\n : new FileDropError('UNKNOWN', undefined, String(error));\n errors.push(fileError);\n callbacks.onError?.(fileError);\n }\n };\n\n // 병렬 또는 순차 처리\n const shouldProcessInParallel = enableParallel && normalizedConcurrency > 1 && handles.length > 1;\n\n if (shouldProcessInParallel) {\n logger.info(\n `🚀 Processing ${handles.length} handles in parallel (custom implementation, concurrency=${normalizedConcurrency})`,\n );\n await simpleParallelMap(handles, processHandle, normalizedConcurrency);\n } else {\n logger.info(`📝 Processing ${handles.length} handle directly`);\n for (const handle of handles) {\n await processHandle(handle);\n }\n }\n\n // 결과 변환\n const items: ProcessedFile[] = [];\n const directories: ProcessedDirectory[] = [];\n\n tracker.updateTotalItems(totalFilesEncountered);\n\n logger.info(`🔄 Processing ${output.length} total items from traversal`);\n\n for (const entry of output) {\n if (entry.type === 'file') {\n const processedFile = createFileItem(\n entry.file,\n entry.path.toString(),\n entry.path.toString(),\n );\n items.push(processedFile);\n callbacks.onFile?.(processedFile);\n tracker.completeItem();\n logger.verbose(` ✅ File: ${entry.path.toString()}`);\n } else {\n const directory: ProcessedDirectory = {\n type: 'directory',\n name: entry.path.lastSegment(),\n path: entry.path.toString(),\n pathSegments: entry.path.segments,\n relativePath: entry.path.toString(),\n };\n directories.push(directory);\n logger.verbose(` 📁 Directory: ${entry.path.toString()}`);\n }\n }\n\n logger.info(`📊 Final results: ${items.length} files, ${directories.length} directories`);\n\n return { items, directories, errors };\n}\n\n/**\n * 파일 드래그앤드롭 이벤트를 처리하여 파일 트리를 순회하는 메인 API 함수\n *\n * React 드래그 이벤트, FileList, FileSystemHandle 배열 등 다양한 소스를 지원하며,\n * 깊은 디렉토리 구조도 완전히 순회합니다. 병렬 처리로 성능을 최적화하고,\n * 부분 실패시에도 처리 가능한 파일들은 계속 처리합니다.\n *\n * @example\n * ```tsx\n * // 기본 사용법\n * const handleDrop = async (event: React.DragEvent<HTMLDivElement>) => {\n * event.preventDefault();\n *\n * try {\n * const result = await processFileTreeDrop(event);\n * console.log(`처리된 파일: ${result.files.length}개`);\n * console.log(`처리 시간: ${result.metadata.processingTime}ms`);\n * } catch (error) {\n * console.error('파일 처리 중 오류:', error);\n * }\n * };\n * ```\n *\n * @example\n * ```tsx\n * // 고급 옵션 사용\n * const result = await processFileTreeDrop(event, {\n * filter: {\n * maxSize: 10 * 1024 * 1024, // 10MB 제한\n * maxFiles: 50, // 최대 50개 파일\n * allowedExtensions: ['.jpg', '.png', '.gif']\n * },\n * callbacks: {\n * onProgress: (progress) => {\n * console.log(`진행률: ${progress.percentage}%`);\n * },\n * onError: (error, item) => {\n * console.error(`${item?.name} 처리 실패:`, error.message);\n * }\n * },\n * signal: abortController.signal // 취소 가능\n * });\n * ```\n *\n * @param source - 파일 드롭 소스 (React DragEvent, FileList, FileSystemHandle[], File[])\n * @param options - 처리 옵션 (필터링, 콜백, 중단 신호 등)\n *\n * @returns Promise<ProcessResult> - 처리된 파일들, 디렉토리 구조, 메타데이터, 에러 정보\n *\n * @throws {FileDropError} 전체 처리가 실패한 경우\n * - 'UNSUPPORTED_API': 브라우저가 File API를 지원하지 않음\n * - 'ACCESS_DENIED': 파일 접근 권한이 거부됨\n * - 'UNKNOWN': 기타 알 수 없는 오류\n *\n * @see {@link processFileTreeDropSafe} 에러를 예외로 던지지 않는 안전한 버전\n * @see {@link FileDropOptions} 사용 가능한 모든 옵션\n * @see {@link ProcessResult} 반환 데이터 구조\n *\n * @since 1.0.0\n */\nexport async function processFileTreeDrop(\n source: FileDropSource,\n options: FileDropOptions = {},\n): Promise<ProcessResult> {\n const startTime = Date.now();\n const debugLevel = normalizeDebugLevel(options.debug);\n\n try {\n // 중단 신호 확인\n if (options.signal?.aborted) {\n throw new FileDropError('UNKNOWN', undefined, 'Operation aborted');\n }\n\n // 소스 정규화\n const normalized = await normalizeSource(source);\n if (!normalized) {\n throw new FileDropError('UNSUPPORTED_API', undefined, 'Unsupported file drop source');\n }\n\n // 초기 파일 개수 추정\n const estimatedCount = normalized.length;\n const tracker = new ProgressTracker(estimatedCount, options.callbacks);\n const filter = new FileFilter(options.filter);\n\n // 단순 파일 리스트인 경우\n if (normalized.length > 0 && normalized[0] instanceof File) {\n const files = normalized as File[];\n const items: ProcessedFile[] = [];\n const errors: FileDropError[] = [];\n\n for (const file of files) {\n if (options.signal?.aborted) {\n throw new FileDropError('UNKNOWN', undefined, 'Operation aborted');\n }\n\n const item = createFileItem(file, file.name);\n tracker.setCurrentItem(item);\n\n const filterResult = filter.filter(item);\n if (filterResult.accepted) {\n items.push(item);\n options.callbacks?.onFile?.(item);\n } else if (filterResult.error) {\n errors.push(filterResult.error);\n options.callbacks?.onError?.(filterResult.error, item);\n }\n\n tracker.completeItem();\n }\n\n // 트리 빌드\n const tree = buildFileTree(items);\n\n return {\n files: items,\n directories: [],\n tree,\n metadata: {\n totalFiles: items.length,\n totalDirectories: 0,\n totalSize: items.reduce((sum, item) => sum + (item.size || 0), 0),\n processingTime: Date.now() - startTime,\n },\n errors,\n };\n }\n\n // FileSystemHandle 처리\n const { items, directories, errors } = await processFileTree(\n normalized as FileSystemHandle[],\n filter,\n tracker,\n options.callbacks,\n options.signal,\n debugLevel,\n options.processing,\n );\n\n // 트리 빌드\n const allItems: FileItem[] = [...items, ...directories];\n const tree = buildFileTree(allItems);\n\n const result: ProcessResult = {\n files: items,\n directories,\n tree,\n metadata: {\n totalFiles: items.length,\n totalDirectories: directories.length,\n totalSize: items.reduce((sum, item) => sum + (item.size || 0), 0),\n processingTime: Date.now() - startTime,\n },\n errors,\n };\n\n return result;\n } catch (error) {\n const fileError =\n error instanceof FileDropError\n ? error\n : new FileDropError('UNKNOWN', undefined, String(error));\n\n throw fileError;\n }\n}\n\n/**\n * 안전한 버전의 파일 트리 처리 함수\n *\n * processFileTreeDrop과 동일한 기능을 제공하지만, 에러를 예외로 던지지 않고\n * 결과 객체에 포함시켜 반환합니다. 에러 처리가 복잡한 상황이나\n * 부분 실패를 허용해야 하는 경우에 유용합니다.\n *\n * @example\n * ```tsx\n * // 에러를 안전하게 처리\n * const result = await processFileTreeDropSafe(event, options);\n *\n * if ('error' in result) {\n * // 실패한 경우\n * console.error('처리 실패:', result.error.message);\n * console.log('에러 코드:', result.error.code);\n *\n * // 부분적으로 처리된 결과가 있다면 활용\n * if (result.partialResult) {\n * console.log('부분 결과:', result.partialResult.files.length, '개 파일');\n * }\n * } else {\n * // 성공한 경우\n * console.log('처리 성공:', result.files.length, '개 파일');\n * console.log('처리 시간:', result.metadata.processingTime, 'ms');\n * }\n * ```\n *\n * @example\n * ```tsx\n * // try-catch 없이 에러 처리\n * const handleDrop = async (event: React.DragEvent<HTMLDivElement>) => {\n * event.preventDefault();\n *\n * const result = await processFileTreeDropSafe(event, {\n * filter: { maxSize: 5 * 1024 * 1024 }, // 5MB 제한\n * callbacks: {\n * onError: (error, item) => {\n * // 개별 파일 에러는 여기서 처리\n * console.warn(`${item?.name} 건너뜀:`, error.message);\n * }\n * }\n * });\n *\n * // 타입 가드를 사용한 안전한 처리\n * if ('error' in result) {\n * setError(result.error.message);\n * } else {\n * setFiles(result.files);\n * setProcessingTime(result.metadata.processingTime);\n * }\n * };\n * ```\n *\n * @param source - 파일 드롭 소스 (React DragEvent, FileList, FileSystemHandle[], File[])\n * @param options - 처리 옵션 (필터링, 콜백, 중단 신호 등)\n *\n * @returns Promise<SafeProcessResult> - 성공시 ProcessResult, 실패시 ErrorResult\n * - 성공: ProcessResult와 동일한 구조\n * - 실패: { success: false, error: FileDropError, partialResult?: ProcessResult }\n *\n * @see {@link processFileTreeDrop} 에러를 예외로 던지는 기본 버전\n * @see {@link SafeProcessResult} 반환 타입 상세 정보\n * @see {@link ErrorResult} 실패시 반환 구조\n *\n * @since 1.0.0\n */\nexport async function processFileTreeDropSafe(\n source: FileDropSource,\n options: FileDropOptions = {},\n): Promise<SafeProcessResult> {\n try {\n const result = await processFileTreeDrop(source, options);\n return result;\n } catch (error) {\n const fileError =\n error instanceof FileDropError\n ? error\n : new FileDropError('UNKNOWN', undefined, String(error));\n\n return {\n success: false,\n error: fileError,\n };\n }\n}\n\nfunction normalizeDebugLevel(debug: FileDropOptions['debug']): DebugLevel {\n if (debug === true) return 'verbose';\n if (debug === false) return 'none';\n if (debug === undefined) return 'warn';\n return debug;\n}\n"],"mappings":"sQA4BA,eAAee,EACb,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AAkB,OACzBA,CACT"}
|
|
1
|
+
{"version":3,"file":"process-file-drop.cjs","names":["createFileDropLogger","FileDropError","traverseTree","PathHolder","createFileItem","ProgressTracker","FileFilter","buildFileTree","require_debug_logger","require_path_util","require_traverse_tree","require_types","require_file_utils","require_filter","require_progress_tracker","normalizeSource","source","supportsFileSystemAccessAPI","supportsWebkitGetAsEntry","handles","item","handle","processFileTree","filter","tracker","callbacks","signal","debugLevel","processing","output","errors","totalFilesEncountered","simpleParallelMap","normalizedConcurrency","enableParallel","logger","processHandle","file","filterResult","error","fileError","items","directories","entry","processedFile","directory","processFileTreeDrop","options","startTime","normalizeDebugLevel","normalized","estimatedCount","files","sum","allItems","processFileTreeDropSafe","debug"],"sources":["../../src/file-drop/process-file-drop.ts"],"sourcesContent":["import { createFileDropLogger } from './internal/debug-logger.js';\nimport { PathHolder } from './internal/path-util.js';\nimport { traverseTree } from './internal/traverse-tree.js';\nimport type { PathAndEntry } from './internal/visit-file-system/internal-types.js';\nimport type {\n DebugLevel,\n FileDropOptions,\n FileDropSource,\n FileItem,\n ProcessedDirectory,\n ProcessedFile,\n ProcessingOptions,\n ProcessResult,\n SafeProcessResult,\n} from './types.js';\nimport { FileDropError } from './types.js';\nimport { buildFileTree, createFileItem } from './utils/file-utils.js';\nimport { FileFilter } from './utils/filter.js';\nimport { ProgressTracker } from './utils/progress-tracker.js';\n\n/**\n * 다양한 파일 드롭 소스를 내부적으로 처리 가능한 형태로 정규화\n * React DragEvent, FileList, FileSystemHandle[] 등을 통합 처리\n *\n * @internal\n * @param source - 정규화할 파일 드롭 소스\n * @returns 정규화된 File[] 또는 FileSystemHandle[] 배열, 실패시 null\n */\nasync function normalizeSource(\n source: FileDropSource,\n): Promise<File[] | FileSystemHandle[] | null> {\n if ('dataTransfer' in source) {\n // React DragEvent - 드래그앤드롭 이벤트 처리\n const supportsFileSystemAccessAPI = 'getAsFileSystemHandle' in DataTransferItem.prototype;\n const supportsWebkitGetAsEntry = 'webkitGetAsEntry' in DataTransferItem.prototype;\n\n // 브라우저가 고급 파일 API를 지원하지 않으면 기본 파일 리스트만 반환\n if (!supportsFileSystemAccessAPI && !supportsWebkitGetAsEntry) {\n return Array.from(source.dataTransfer.files);\n }\n\n // 브라우저 능력에 따라 적절한 API 사용\n // Chrome: getAsFileSystemHandle (최신)\n // Firefox/Safari: webkitGetAsEntry (레거시)\n const handles = Array.from(source.dataTransfer.items)\n .filter((item) => item.kind === 'file') // 파일 아이템만 필터링\n .map((item) => {\n if (supportsWebkitGetAsEntry) {\n return item.webkitGetAsEntry(); // 레거시 웹킷 API 사용\n } else if (supportsFileSystemAccessAPI) {\n // File System Access API - getAsFileSystemHandle은 표준 타입에 없음\n return (\n item as DataTransferItem & { getAsFileSystemHandle(): Promise<FileSystemHandle> }\n ).getAsFileSystemHandle();\n }\n return item.getAsFile(); // fallback\n })\n .filter(Boolean); // null/undefined 제거\n\n const resolvedHandles = await Promise.all(\n handles.map((handle) => {\n if (handle && handle instanceof Promise) {\n return handle;\n }\n return Promise.resolve(handle);\n }),\n );\n\n return resolvedHandles.filter(Boolean) as FileSystemHandle[];\n }\n\n if ('length' in source) {\n // FileList 또는 File[]\n return Array.from(source as FileList);\n }\n\n if (Array.isArray(source)) {\n // FileSystemHandle[]\n return source;\n }\n\n return null;\n}\n\n/**\n * 파일 핸들들을 순회하며 파일 트리를 처리\n * FileSystemHandle, FileSystemEntry, File 객체들을 병렬로 처리하여 성능 최적화\n *\n * @internal\n * @param handles - 처리할 파일/디렉토리 핸들 배열\n * @param filter - 파일 필터링 객체\n * @param tracker - 진행상황 추적 객체\n * @param callbacks - 콜백 함수들\n * @param signal - 중단 신호 (optional)\n * @returns 처리된 파일, 디렉토리, 에러 정보\n */\nasync function processFileTree(\n handles: (FileSystemHandle | FileSystemEntry | File)[],\n filter: FileFilter,\n tracker: ProgressTracker,\n callbacks: FileDropOptions['callbacks'] = {},\n signal?: AbortSignal,\n debugLevel: DebugLevel = 'warn',\n processing?: ProcessingOptions,\n): Promise<{ items: ProcessedFile[]; directories: ProcessedDirectory[]; errors: FileDropError[] }> {\n const output: PathAndEntry[] = [];\n const errors: FileDropError[] = [];\n let totalFilesEncountered = 0;\n\n // 자체 구현한 parallelMap 사용\n const { simpleParallelMap } = await import('./utils/parallel-map.js');\n\n const normalizedConcurrency = Math.max(1, processing?.concurrency ?? 4);\n const enableParallel = processing?.parallel ?? true;\n const logger = createFileDropLogger(debugLevel);\n\n const processHandle = async (handle: FileSystemHandle | FileSystemEntry | File) => {\n if (signal?.aborted) {\n throw new FileDropError('UNKNOWN', undefined, 'Operation aborted');\n }\n\n try {\n await traverseTree(\n PathHolder.EMPTY,\n handle,\n output,\n (file: File) => {\n totalFilesEncountered++;\n tracker.updateTotalItems(totalFilesEncountered);\n const item = createFileItem(file, file.name);\n tracker.setCurrentItem(item);\n\n const filterResult = filter.filter(item);\n if (filterResult.error) {\n errors.push(filterResult.error);\n callbacks.onError?.(filterResult.error, item);\n }\n\n if (!filterResult.accepted) {\n tracker.completeItem();\n }\n\n return filterResult.accepted;\n },\n debugLevel,\n enableParallel,\n normalizedConcurrency,\n );\n } catch (error) {\n const fileError =\n error instanceof FileDropError\n ? error\n : new FileDropError('UNKNOWN', undefined, String(error));\n errors.push(fileError);\n callbacks.onError?.(fileError);\n }\n };\n\n // 병렬 또는 순차 처리\n const shouldProcessInParallel = enableParallel && normalizedConcurrency > 1 && handles.length > 1;\n\n if (shouldProcessInParallel) {\n logger.info(\n `🚀 Processing ${handles.length} handles in parallel (custom implementation, concurrency=${normalizedConcurrency})`,\n );\n await simpleParallelMap(handles, processHandle, normalizedConcurrency);\n } else {\n logger.info(`📝 Processing ${handles.length} handle directly`);\n for (const handle of handles) {\n await processHandle(handle);\n }\n }\n\n // 결과 변환\n const items: ProcessedFile[] = [];\n const directories: ProcessedDirectory[] = [];\n\n tracker.updateTotalItems(totalFilesEncountered);\n\n logger.info(`🔄 Processing ${output.length} total items from traversal`);\n\n for (const entry of output) {\n if (entry.type === 'file') {\n const processedFile = createFileItem(\n entry.file,\n entry.path.toString(),\n entry.path.toString(),\n );\n items.push(processedFile);\n callbacks.onFile?.(processedFile);\n tracker.completeItem();\n logger.verbose(` ✅ File: ${entry.path.toString()}`);\n } else {\n const directory: ProcessedDirectory = {\n type: 'directory',\n name: entry.path.lastSegment(),\n path: entry.path.toString(),\n pathSegments: entry.path.segments,\n relativePath: entry.path.toString(),\n };\n directories.push(directory);\n logger.verbose(` 📁 Directory: ${entry.path.toString()}`);\n }\n }\n\n logger.info(`📊 Final results: ${items.length} files, ${directories.length} directories`);\n\n return { items, directories, errors };\n}\n\n/**\n * 파일 드래그앤드롭 이벤트를 처리하여 파일 트리를 순회하는 메인 API 함수\n *\n * React 드래그 이벤트, FileList, FileSystemHandle 배열 등 다양한 소스를 지원하며,\n * 깊은 디렉토리 구조도 완전히 순회합니다. 병렬 처리로 성능을 최적화하고,\n * 부분 실패시에도 처리 가능한 파일들은 계속 처리합니다.\n *\n * @example\n * ```tsx\n * // 기본 사용법\n * const handleDrop = async (event: React.DragEvent<HTMLDivElement>) => {\n * event.preventDefault();\n *\n * try {\n * const result = await processFileTreeDrop(event);\n * console.log(`처리된 파일: ${result.files.length}개`);\n * console.log(`처리 시간: ${result.metadata.processingTime}ms`);\n * } catch (error) {\n * console.error('파일 처리 중 오류:', error);\n * }\n * };\n * ```\n *\n * @example\n * ```tsx\n * // 고급 옵션 사용\n * const result = await processFileTreeDrop(event, {\n * filter: {\n * maxSize: 10 * 1024 * 1024, // 10MB 제한\n * maxFiles: 50, // 최대 50개 파일\n * allowedExtensions: ['.jpg', '.png', '.gif']\n * },\n * callbacks: {\n * onProgress: (progress) => {\n * console.log(`진행률: ${progress.percentage}%`);\n * },\n * onError: (error, item) => {\n * console.error(`${item?.name} 처리 실패:`, error.message);\n * }\n * },\n * signal: abortController.signal // 취소 가능\n * });\n * ```\n *\n * @param source - 파일 드롭 소스 (React DragEvent, FileList, FileSystemHandle[], File[])\n * @param options - 처리 옵션 (필터링, 콜백, 중단 신호 등)\n *\n * @returns Promise<ProcessResult> - 처리된 파일들, 디렉토리 구조, 메타데이터, 에러 정보\n *\n * @throws {FileDropError} 전체 처리가 실패한 경우\n * - 'UNSUPPORTED_API': 브라우저가 File API를 지원하지 않음\n * - 'ACCESS_DENIED': 파일 접근 권한이 거부됨\n * - 'UNKNOWN': 기타 알 수 없는 오류\n *\n * @see {@link processFileTreeDropSafe} 에러를 예외로 던지지 않는 안전한 버전\n * @see {@link FileDropOptions} 사용 가능한 모든 옵션\n * @see {@link ProcessResult} 반환 데이터 구조\n *\n * @since 1.0.0\n */\nexport async function processFileTreeDrop(\n source: FileDropSource,\n options: FileDropOptions = {},\n): Promise<ProcessResult> {\n const startTime = Date.now();\n const debugLevel = normalizeDebugLevel(options.debug);\n\n try {\n // 중단 신호 확인\n if (options.signal?.aborted) {\n throw new FileDropError('UNKNOWN', undefined, 'Operation aborted');\n }\n\n // 소스 정규화\n const normalized = await normalizeSource(source);\n if (!normalized) {\n throw new FileDropError('UNSUPPORTED_API', undefined, 'Unsupported file drop source');\n }\n\n // 초기 파일 개수 추정\n const estimatedCount = normalized.length;\n const tracker = new ProgressTracker(estimatedCount, options.callbacks);\n const filter = new FileFilter(options.filter);\n\n // 단순 파일 리스트인 경우\n if (normalized.length > 0 && normalized[0] instanceof File) {\n const files = normalized as File[];\n const items: ProcessedFile[] = [];\n const errors: FileDropError[] = [];\n\n for (const file of files) {\n if (options.signal?.aborted) {\n throw new FileDropError('UNKNOWN', undefined, 'Operation aborted');\n }\n\n const item = createFileItem(file, file.name);\n tracker.setCurrentItem(item);\n\n const filterResult = filter.filter(item);\n if (filterResult.accepted) {\n items.push(item);\n options.callbacks?.onFile?.(item);\n } else if (filterResult.error) {\n errors.push(filterResult.error);\n options.callbacks?.onError?.(filterResult.error, item);\n }\n\n tracker.completeItem();\n }\n\n // 트리 빌드\n const tree = buildFileTree(items);\n\n return {\n files: items,\n directories: [],\n tree,\n metadata: {\n totalFiles: items.length,\n totalDirectories: 0,\n totalSize: items.reduce((sum, item) => sum + (item.size || 0), 0),\n processingTime: Date.now() - startTime,\n },\n errors,\n };\n }\n\n // FileSystemHandle 처리\n const { items, directories, errors } = await processFileTree(\n normalized as FileSystemHandle[],\n filter,\n tracker,\n options.callbacks,\n options.signal,\n debugLevel,\n options.processing,\n );\n\n // 트리 빌드\n const allItems: FileItem[] = [...items, ...directories];\n const tree = buildFileTree(allItems);\n\n const result: ProcessResult = {\n files: items,\n directories,\n tree,\n metadata: {\n totalFiles: items.length,\n totalDirectories: directories.length,\n totalSize: items.reduce((sum, item) => sum + (item.size || 0), 0),\n processingTime: Date.now() - startTime,\n },\n errors,\n };\n\n return result;\n } catch (error) {\n const fileError =\n error instanceof FileDropError\n ? error\n : new FileDropError('UNKNOWN', undefined, String(error));\n\n throw fileError;\n }\n}\n\n/**\n * 안전한 버전의 파일 트리 처리 함수\n *\n * processFileTreeDrop과 동일한 기능을 제공하지만, 에러를 예외로 던지지 않고\n * 결과 객체에 포함시켜 반환합니다. 에러 처리가 복잡한 상황이나\n * 부분 실패를 허용해야 하는 경우에 유용합니다.\n *\n * @example\n * ```tsx\n * // 에러를 안전하게 처리\n * const result = await processFileTreeDropSafe(event, options);\n *\n * if ('error' in result) {\n * // 실패한 경우\n * console.error('처리 실패:', result.error.message);\n * console.log('에러 코드:', result.error.code);\n *\n * // 부분적으로 처리된 결과가 있다면 활용\n * if (result.partialResult) {\n * console.log('부분 결과:', result.partialResult.files.length, '개 파일');\n * }\n * } else {\n * // 성공한 경우\n * console.log('처리 성공:', result.files.length, '개 파일');\n * console.log('처리 시간:', result.metadata.processingTime, 'ms');\n * }\n * ```\n *\n * @example\n * ```tsx\n * // try-catch 없이 에러 처리\n * const handleDrop = async (event: React.DragEvent<HTMLDivElement>) => {\n * event.preventDefault();\n *\n * const result = await processFileTreeDropSafe(event, {\n * filter: { maxSize: 5 * 1024 * 1024 }, // 5MB 제한\n * callbacks: {\n * onError: (error, item) => {\n * // 개별 파일 에러는 여기서 처리\n * console.warn(`${item?.name} 건너뜀:`, error.message);\n * }\n * }\n * });\n *\n * // 타입 가드를 사용한 안전한 처리\n * if ('error' in result) {\n * setError(result.error.message);\n * } else {\n * setFiles(result.files);\n * setProcessingTime(result.metadata.processingTime);\n * }\n * };\n * ```\n *\n * @param source - 파일 드롭 소스 (React DragEvent, FileList, FileSystemHandle[], File[])\n * @param options - 처리 옵션 (필터링, 콜백, 중단 신호 등)\n *\n * @returns Promise<SafeProcessResult> - 성공시 ProcessResult, 실패시 ErrorResult\n * - 성공: ProcessResult와 동일한 구조\n * - 실패: { success: false, error: FileDropError, partialResult?: ProcessResult }\n *\n * @see {@link processFileTreeDrop} 에러를 예외로 던지는 기본 버전\n * @see {@link SafeProcessResult} 반환 타입 상세 정보\n * @see {@link ErrorResult} 실패시 반환 구조\n *\n * @since 1.0.0\n */\nexport async function processFileTreeDropSafe(\n source: FileDropSource,\n options: FileDropOptions = {},\n): Promise<SafeProcessResult> {\n try {\n const result = await processFileTreeDrop(source, options);\n return result;\n } catch (error) {\n const fileError =\n error instanceof FileDropError\n ? error\n : new FileDropError('UNKNOWN', undefined, String(error));\n\n return {\n success: false,\n error: fileError,\n };\n }\n}\n\nfunction normalizeDebugLevel(debug: FileDropOptions['debug']): DebugLevel {\n if (debug === true) return 'verbose';\n if (debug === false) return 'none';\n if (debug === undefined) return 'warn';\n return debug;\n}\n"],"mappings":"A,sQA4BA,eAAee,EACbC,EAC6C,CAC7C,GAAI,iBAAkBA,EAAQ,CAE5B,IAAMC,EAA8B,0BAA2B,iBAAiB,UAC1EC,EAA2B,qBAAsB,iBAAiB,UAGxE,GAAI,CAACD,GAA+B,CAACC,EACnC,OAAO,MAAM,KAAKF,EAAO,aAAa,KAAK,EAM7C,IAAMG,EAAU,MAAM,KAAKH,EAAO,aAAa,KAAK,CAAC,CAClD,OAAQI,GAASA,EAAK,OAAS,MAAM,CAAC,CACtC,IAAKA,GACAF,EACKE,EAAK,iBAAiB,EACpBH,EAGPG,E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B,KAAK,IAAI,EAAI4B,CAC/B,EACAlB,QACF,CACF,CAGA,GAAM,CAAEW,QAAOC,cAAaZ,UAAW,MAAMR,EAC3C4B,EACA3B,EACAC,EACAuB,EAAQ,UACRA,EAAQ,OACRpB,EACAoB,EAAQ,UACV,EAGMO,EAAuB,CAAC,GAAGb,EAAO,GAAGC,CAAW,EAgBtD,MAAO,CAZL,MAAOD,EACPC,cACA,KALWnC,EAAAA,cAAc+C,CAKtB,EACH,SAAU,CACR,WAAYb,EAAM,OAClB,iBAAkBC,EAAY,OAC9B,UAAWD,EAAM,QAAQY,EAAKjC,IAASiC,GAAOjC,EAAK,MAAQ,GAAI,CAAC,EAChE,eAAgB,KAAK,IAAI,EAAI4B,CAC/B,EACAlB,QAGU,CACd,OAASS,EAAO,CAMd,MAJEA,aAAiBtC,EAAAA,cACbsC,EACA,IAAItC,EAAAA,cAAc,UAAW,IAAA,GAAW,OAAOsC,CAAK,CAAC,CAG7D,CACF,CAqEA,eAAsBgB,EACpBvC,EACA+B,EAA2B,CAAC,EACA,CAC5B,GAAI,CAEF,OAAO,MADcD,EAAoB9B,EAAQ+B,CAAO,CAE1D,OAASR,EAAO,CAMd,MAAO,CACL,QAAS,GACT,MANAA,aAAiBtC,EAAAA,cACbsC,EACA,IAAItC,EAAAA,cAAc,UAAW,IAAA,GAAW,OAAOsC,CAAK,CAAC,CAK3D,CACF,CACF,CAEA,SAASU,EAAoBO,EAA6C,CAIxE,OAHIA,IAAU,GAAa,UACvBA,IAAU,GAAc,OACxBA,IAAU,IAAA,GAAkB,OACzBA,CACT,C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FileDropOptions, FileDropSource, ProcessResult, SafeProcessResult } from "./types.cjs";
|
|
2
|
-
//#region src/file-drop/process-file-drop.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* 파일 드래그앤드롭 이벤트를 처리하여 파일 트리를 순회하는 메인 API 함수
|
|
5
4
|
*
|
|
@@ -128,6 +127,4 @@ export declare function processFileTreeDrop(source: FileDropSource, options?: Fi
|
|
|
128
127
|
*
|
|
129
128
|
* @since 1.0.0
|
|
130
129
|
*/
|
|
131
|
-
export declare function processFileTreeDropSafe(source: FileDropSource, options?: FileDropOptions): Promise<SafeProcessResult>;
|
|
132
|
-
//#endregion
|
|
133
|
-
//# sourceMappingURL=process-file-drop.d.cts.map
|
|
130
|
+
export declare function processFileTreeDropSafe(source: FileDropSource, options?: FileDropOptions): Promise<SafeProcessResult>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FileDropOptions, FileDropSource, ProcessResult, SafeProcessResult } from "./types.js";
|
|
2
|
-
//#region src/file-drop/process-file-drop.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* 파일 드래그앤드롭 이벤트를 처리하여 파일 트리를 순회하는 메인 API 함수
|
|
5
4
|
*
|
|
@@ -128,6 +127,4 @@ export declare function processFileTreeDrop(source: FileDropSource, options?: Fi
|
|
|
128
127
|
*
|
|
129
128
|
* @since 1.0.0
|
|
130
129
|
*/
|
|
131
|
-
export declare function processFileTreeDropSafe(source: FileDropSource, options?: FileDropOptions): Promise<SafeProcessResult>;
|
|
132
|
-
//#endregion
|
|
133
|
-
//# sourceMappingURL=process-file-drop.d.ts.map
|
|
130
|
+
export declare function processFileTreeDropSafe(source: FileDropSource, options?: FileDropOptions): Promise<SafeProcessResult>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createFileDropLogger as e}from"./internal/debug-logger.js";import{PathHolder as t}from"./internal/path-util.js";import{traverseTree as n}from"./internal/traverse-tree.js";import{FileDropError as r}from"./types.js";import{buildFileTree as i,createFileItem as a}from"./utils/file-utils.js";import{FileFilter as o}from"./utils/filter.js";import{ProgressTracker as s}from"./utils/progress-tracker.js";async function c(e){if(`dataTransfer`in e){let t=`getAsFileSystemHandle`in DataTransferItem.prototype,n=`webkitGetAsEntry`in DataTransferItem.prototype;if(!t&&!n)return Array.from(e.dataTransfer.files);let r=Array.from(e.dataTransfer.items).filter(e=>e.kind===`file`).map(e=>n?e.webkitGetAsEntry():t?e.getAsFileSystemHandle():e.getAsFile()).filter(Boolean);return(await Promise.all(r.map(e=>e&&e instanceof Promise?e:Promise.resolve(e)))).filter(Boolean)}return`length`in e?Array.from(e):Array.isArray(e)?e:null}async function l(i,o,s,c={},l,u=`warn`,d){let f=[],p=[],m=0,{simpleParallelMap:h}=await import(`./utils/parallel-map.js`),g=Math.max(1,d?.concurrency??4),_=d?.parallel??!0,v=e(u),y=async e=>{if(l?.aborted)throw new r(`UNKNOWN`,void 0,`Operation aborted`);try{await n(t.EMPTY,e,f,e=>{m++,s.updateTotalItems(m);let t=a(e,e.name);s.setCurrentItem(t);let n=o.filter(t);return n.error&&(p.push(n.error),c.onError?.(n.error,t)),n.accepted||s.completeItem(),n.accepted},u,_,g)}catch(e){let t=e instanceof r?e:new r(`UNKNOWN`,void 0,String(e));p.push(t),c.onError?.(t)}};if(_&&g>1&&i.length>1)v.info(`🚀 Processing ${i.length} handles in parallel (custom implementation, concurrency=${g})`),await h(i,y,g);else{v.info(`📝 Processing ${i.length} handle directly`);for(let e of i)await y(e)}let b=[],x=[];s.updateTotalItems(m),v.info(`🔄 Processing ${f.length} total items from traversal`);for(let e of f)if(e.type===`file`){let t=a(e.file,e.path.toString(),e.path.toString());b.push(t),c.onFile?.(t),s.completeItem(),v.verbose(` ✅ File: ${e.path.toString()}`)}else{let t={type:`directory`,name:e.path.lastSegment(),path:e.path.toString(),pathSegments:e.path.segments,relativePath:e.path.toString()};x.push(t),v.verbose(` 📁 Directory: ${e.path.toString()}`)}return v.info(`📊 Final results: ${b.length} files, ${x.length} directories`),{items:b,directories:x,errors:p}}async function u(e,t={}){let n=Date.now(),u=f(t.debug);try{if(t.signal?.aborted)throw new r(`UNKNOWN`,void 0,`Operation aborted`);let d=await c(e);if(!d)throw new r(`UNSUPPORTED_API`,void 0,`Unsupported file drop source`);let f=d.length,p=new s(f,t.callbacks),m=new o(t.filter);if(d.length>0&&d[0]instanceof File){let e=d,o=[],s=[];for(let n of e){if(t.signal?.aborted)throw new r(`UNKNOWN`,void 0,`Operation aborted`);let e=a(n,n.name);p.setCurrentItem(e);let i=m.filter(e);i.accepted?(o.push(e),t.callbacks?.onFile?.(e)):i.error&&(s.push(i.error),t.callbacks?.onError?.(i.error,e)),p.completeItem()}return{files:o,directories:[],tree:i(o),metadata:{totalFiles:o.length,totalDirectories:0,totalSize:o.reduce((e,t)=>e+(t.size||0),0),processingTime:Date.now()-n},errors:s}}let{items:h,directories:g,errors:_}=await l(d,m,p,t.callbacks,t.signal,u,t.processing),v=[...h,...g];return{files:h,directories:g,tree:i(v),metadata:{totalFiles:h.length,totalDirectories:g.length,totalSize:h.reduce((e,t)=>e+(t.size||0),0),processingTime:Date.now()-n},errors:_}}catch(e){throw e instanceof r?e:new r(`UNKNOWN`,void 0,String(e))}}async function d(e,t={}){try{return await u(e,t)}catch(e){return{success:!1,error:e instanceof r?e:new r(`UNKNOWN`,void 0,String(e))}}}function f(e){return e===!0?`verbose`:e===!1?`none`:e===void 0?`warn`:e}export{u as processFileTreeDrop,d as processFileTreeDropSafe};
|
|
2
2
|
//# sourceMappingURL=process-file-drop.js.map
|