@vezham/react 26.0.0-alpha.4 → 26.0.0-alpha.6
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/README.md +2 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/lib/components/actions-header/index.d.ts +26 -0
- package/dist/lib/components/actions-header/index.d.ts.map +1 -0
- package/dist/lib/components/actions-header/index.js +126 -0
- package/dist/lib/components/app-icon/index.d.ts +499 -0
- package/dist/lib/components/app-icon/index.d.ts.map +1 -0
- package/dist/lib/components/app-icon/index.js +513 -0
- package/dist/lib/components/app-menu/index.d.ts +22 -0
- package/dist/lib/components/app-menu/index.d.ts.map +1 -0
- package/dist/lib/components/app-menu/index.js +17 -0
- package/dist/lib/components/command/command-dialog.d.ts +10 -0
- package/dist/lib/components/command/command-dialog.d.ts.map +1 -0
- package/dist/lib/components/command/command-dialog.js +129 -0
- package/dist/lib/components/command/command-provider.d.ts +8 -0
- package/dist/lib/components/command/command-provider.d.ts.map +1 -0
- package/dist/lib/components/command/command-provider.js +44 -0
- package/dist/lib/components/command/index.d.ts +3 -0
- package/dist/lib/components/command/index.d.ts.map +1 -0
- package/dist/lib/components/command/index.js +3 -0
- package/dist/lib/components/menu/drawer.d.ts +4 -0
- package/dist/lib/components/menu/drawer.d.ts.map +1 -0
- package/dist/lib/components/menu/drawer.js +56 -0
- package/dist/lib/components/menu/index.d.ts +5 -0
- package/dist/lib/components/menu/index.d.ts.map +1 -0
- package/dist/lib/components/menu/index.js +138 -0
- package/dist/lib/components/menu/sheet.d.ts +15 -0
- package/dist/lib/components/menu/sheet.d.ts.map +1 -0
- package/dist/lib/components/menu/sheet.js +40 -0
- package/dist/lib/components/menu/types.d.ts +30 -0
- package/dist/lib/components/menu/types.d.ts.map +1 -0
- package/dist/lib/components/menu/types.js +7 -0
- package/dist/lib/components/menu/variant.d.ts +27 -0
- package/dist/lib/components/menu/variant.d.ts.map +1 -0
- package/dist/lib/components/menu/variant.js +28 -0
- package/dist/lib/components/mobile-controls/index.d.ts +11 -0
- package/dist/lib/components/mobile-controls/index.d.ts.map +1 -0
- package/dist/lib/components/mobile-controls/index.js +21 -0
- package/dist/lib/components/pagination/index.d.ts +10 -0
- package/dist/lib/components/pagination/index.d.ts.map +1 -0
- package/dist/lib/components/pagination/index.js +25 -0
- package/dist/lib/components/panel/footer/ai/chat-header.d.ts +9 -0
- package/dist/lib/components/panel/footer/ai/chat-header.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/chat-header.js +63 -0
- package/dist/lib/components/panel/footer/ai/composer.d.ts +7 -0
- package/dist/lib/components/panel/footer/ai/composer.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/composer.js +77 -0
- package/dist/lib/components/panel/footer/ai/content.d.ts +13 -0
- package/dist/lib/components/panel/footer/ai/content.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/content.js +148 -0
- package/dist/lib/components/panel/footer/ai/conversation.d.ts +47 -0
- package/dist/lib/components/panel/footer/ai/conversation.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/conversation.js +222 -0
- package/dist/lib/components/panel/footer/ai/index.d.ts +3 -0
- package/dist/lib/components/panel/footer/ai/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/index.js +41 -0
- package/dist/lib/components/panel/footer/ai/message-actions.d.ts +8 -0
- package/dist/lib/components/panel/footer/ai/message-actions.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/message-actions.js +63 -0
- package/dist/lib/components/panel/footer/ai/mock-result.d.ts +6 -0
- package/dist/lib/components/panel/footer/ai/mock-result.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/mock-result.js +121 -0
- package/dist/lib/components/panel/footer/ai/model-logo.d.ts +5 -0
- package/dist/lib/components/panel/footer/ai/model-logo.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/model-logo.js +13 -0
- package/dist/lib/components/panel/footer/ai/model-logos.d.ts +2 -0
- package/dist/lib/components/panel/footer/ai/model-logos.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/model-logos.js +10 -0
- package/dist/lib/components/panel/footer/ai/model-picker.d.ts +8 -0
- package/dist/lib/components/panel/footer/ai/model-picker.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/model-picker.js +166 -0
- package/dist/lib/components/panel/footer/ai/models.d.ts +9 -0
- package/dist/lib/components/panel/footer/ai/models.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/models.js +72 -0
- package/dist/lib/components/panel/footer/ai/permission-picker.d.ts +5 -0
- package/dist/lib/components/panel/footer/ai/permission-picker.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/permission-picker.js +63 -0
- package/dist/lib/components/panel/footer/ai/use-chat-scroll.d.ts +9 -0
- package/dist/lib/components/panel/footer/ai/use-chat-scroll.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/ai/use-chat-scroll.js +57 -0
- package/dist/lib/components/panel/footer/control-center/appearance.d.ts +16 -0
- package/dist/lib/components/panel/footer/control-center/appearance.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/appearance.js +100 -0
- package/dist/lib/components/panel/footer/control-center/configured.d.ts +13 -0
- package/dist/lib/components/panel/footer/control-center/configured.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/configured.js +157 -0
- package/dist/lib/components/panel/footer/control-center/control-center.d.ts +8 -0
- package/dist/lib/components/panel/footer/control-center/control-center.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/control-center.js +180 -0
- package/dist/lib/components/panel/footer/control-center/default.d.ts +3 -0
- package/dist/lib/components/panel/footer/control-center/default.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/default.js +37 -0
- package/dist/lib/components/panel/footer/control-center/direction.d.ts +9 -0
- package/dist/lib/components/panel/footer/control-center/direction.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/direction.js +40 -0
- package/dist/lib/components/panel/footer/control-center/document.d.ts +5 -0
- package/dist/lib/components/panel/footer/control-center/document.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/document.js +19 -0
- package/dist/lib/components/panel/footer/control-center/editor.d.ts +25 -0
- package/dist/lib/components/panel/footer/control-center/editor.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/editor.js +72 -0
- package/dist/lib/components/panel/footer/control-center/footer-context.d.ts +6 -0
- package/dist/lib/components/panel/footer/control-center/footer-context.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/footer-context.js +5 -0
- package/dist/lib/components/panel/footer/control-center/index.d.ts +15 -0
- package/dist/lib/components/panel/footer/control-center/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/index.js +11 -0
- package/dist/lib/components/panel/footer/control-center/language.d.ts +19 -0
- package/dist/lib/components/panel/footer/control-center/language.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/language.js +44 -0
- package/dist/lib/components/panel/footer/control-center/options.d.ts +7 -0
- package/dist/lib/components/panel/footer/control-center/options.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/options.js +27 -0
- package/dist/lib/components/panel/footer/control-center/preview.d.ts +34 -0
- package/dist/lib/components/panel/footer/control-center/preview.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/preview.js +366 -0
- package/dist/lib/components/panel/footer/control-center/theme.d.ts +6 -0
- package/dist/lib/components/panel/footer/control-center/theme.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/theme.js +150 -0
- package/dist/lib/components/panel/footer/control-center/tile.d.ts +10 -0
- package/dist/lib/components/panel/footer/control-center/tile.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/tile.js +34 -0
- package/dist/lib/components/panel/footer/control-center/types.d.ts +94 -0
- package/dist/lib/components/panel/footer/control-center/types.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/variant.d.ts +268 -0
- package/dist/lib/components/panel/footer/control-center/variant.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/control-center/variant.js +89 -0
- package/dist/lib/components/panel/footer/data.d.ts +38 -0
- package/dist/lib/components/panel/footer/data.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/data.js +90 -0
- package/dist/lib/components/panel/footer/drawer-accessors.d.ts +46 -0
- package/dist/lib/components/panel/footer/drawer-accessors.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/drawer-accessors.js +21 -0
- package/dist/lib/components/panel/footer/drawer-frame.d.ts +12 -0
- package/dist/lib/components/panel/footer/drawer-frame.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/drawer-frame.js +19 -0
- package/dist/lib/components/panel/footer/index.d.ts +4 -0
- package/dist/lib/components/panel/footer/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/index.js +147 -0
- package/dist/lib/components/panel/footer/notification-center/index.d.ts +4 -0
- package/dist/lib/components/panel/footer/notification-center/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/notification-center/index.js +98 -0
- package/dist/lib/components/panel/footer/notification-center/types.d.ts +525 -0
- package/dist/lib/components/panel/footer/notification-center/types.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/notification-center/types.js +62 -0
- package/dist/lib/components/panel/footer/notification-center/variant.d.ts +322 -0
- package/dist/lib/components/panel/footer/notification-center/variant.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/notification-center/variant.js +119 -0
- package/dist/lib/components/panel/footer/notification-center/widget-tiles.d.ts +49 -0
- package/dist/lib/components/panel/footer/notification-center/widget-tiles.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/notification-center/widget-tiles.js +182 -0
- package/dist/lib/components/panel/footer/preferences/data.d.ts +14 -0
- package/dist/lib/components/panel/footer/preferences/data.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/data.js +304 -0
- package/dist/lib/components/panel/footer/preferences/modal.d.ts +8 -0
- package/dist/lib/components/panel/footer/preferences/modal.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/modal.js +75 -0
- package/dist/lib/components/panel/footer/preferences/sidebar.d.ts +9 -0
- package/dist/lib/components/panel/footer/preferences/sidebar.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/sidebar.js +105 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/account/index.d.ts +3 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/account/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/account/index.js +16 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/content-social/index.d.ts +3 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/content-social/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/content-social/index.js +16 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/data-privacy/index.d.ts +3 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/data-privacy/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/data-privacy/index.js +101 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/family-center/index.d.ts +3 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/family-center/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/family-center/index.js +24 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/profiles/index.d.ts +3 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/profiles/index.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/preferences/user-settings/profiles/index.js +103 -0
- package/dist/lib/components/panel/footer/tabs.d.ts +12 -0
- package/dist/lib/components/panel/footer/tabs.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/tabs.js +23 -0
- package/dist/lib/components/panel/footer/types.d.ts +39 -0
- package/dist/lib/components/panel/footer/types.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/user-menu.d.ts +10 -0
- package/dist/lib/components/panel/footer/user-menu.d.ts.map +1 -0
- package/dist/lib/components/panel/footer/user-menu.js +290 -0
- package/dist/lib/components/panel/header/application-menu-sheet.d.ts +21 -0
- package/dist/lib/components/panel/header/application-menu-sheet.d.ts.map +1 -0
- package/dist/lib/components/panel/header/application-menu-sheet.js +227 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/index.d.ts +5 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/index.js +225 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/types.d.ts +13 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/variants.d.ts +28 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/variants.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/variants.js +249 -0
- package/dist/lib/components/panel/header/bookmarks/context-menu/index.d.ts +5 -0
- package/dist/lib/components/panel/header/bookmarks/context-menu/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/context-menu/index.js +147 -0
- package/dist/lib/components/panel/header/bookmarks/context-menu/types.d.ts +25 -0
- package/dist/lib/components/panel/header/bookmarks/context-menu/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/data.d.ts +2 -0
- package/dist/lib/components/panel/header/bookmarks/data.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/empty-state.d.ts +8 -0
- package/dist/lib/components/panel/header/bookmarks/empty-state.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/empty-state.js +15 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/data.d.ts +2 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/data.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/grid-list.d.ts +4 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/grid-list.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/grid-list.js +65 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/index.d.ts +5 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/index.js +76 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/types.d.ts +12 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/variant.d.ts +211 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/variant.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/favorites/variant.js +77 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/index.d.ts +7 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/index.js +221 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/types.d.ts +25 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/variants.d.ts +14 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/variants.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/folder-modal/variants.js +95 -0
- package/dist/lib/components/panel/header/bookmarks/index.d.ts +5 -0
- package/dist/lib/components/panel/header/bookmarks/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/index.js +247 -0
- package/dist/lib/components/panel/header/bookmarks/membership.d.ts +14 -0
- package/dist/lib/components/panel/header/bookmarks/membership.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/membership.js +13 -0
- package/dist/lib/components/panel/header/bookmarks/quick-access/index.d.ts +4 -0
- package/dist/lib/components/panel/header/bookmarks/quick-access/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/quick-access/index.js +224 -0
- package/dist/lib/components/panel/header/bookmarks/quick-access/types.d.ts +38 -0
- package/dist/lib/components/panel/header/bookmarks/quick-access/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/shortcut-context-menu.d.ts +11 -0
- package/dist/lib/components/panel/header/bookmarks/shortcut-context-menu.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/shortcut-context-menu.js +39 -0
- package/dist/lib/components/panel/header/bookmarks/tree-data.d.ts +4 -0
- package/dist/lib/components/panel/header/bookmarks/tree-data.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/tree-data.js +97 -0
- package/dist/lib/components/panel/header/bookmarks/types.d.ts +648 -0
- package/dist/lib/components/panel/header/bookmarks/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/types.js +198 -0
- package/dist/lib/components/panel/header/bookmarks/variant.d.ts +334 -0
- package/dist/lib/components/panel/header/bookmarks/variant.d.ts.map +1 -0
- package/dist/lib/components/panel/header/bookmarks/variant.js +121 -0
- package/dist/lib/components/panel/header/index.d.ts +4 -0
- package/dist/lib/components/panel/header/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/index.js +366 -0
- package/dist/lib/components/panel/header/storage/archive/index.d.ts +4 -0
- package/dist/lib/components/panel/header/storage/archive/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/archive/index.js +138 -0
- package/dist/lib/components/panel/header/storage/archive/types.d.ts +27 -0
- package/dist/lib/components/panel/header/storage/archive/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/archive/variants.d.ts +6 -0
- package/dist/lib/components/panel/header/storage/archive/variants.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/archive/variants.js +8 -0
- package/dist/lib/components/panel/header/storage/data.d.ts +2 -0
- package/dist/lib/components/panel/header/storage/data.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/history-actions.d.ts +16 -0
- package/dist/lib/components/panel/header/storage/history-actions.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/history-actions.js +18 -0
- package/dist/lib/components/panel/header/storage/history-date-group.d.ts +9 -0
- package/dist/lib/components/panel/header/storage/history-date-group.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/history-date-group.js +19 -0
- package/dist/lib/components/panel/header/storage/history-item-content.d.ts +11 -0
- package/dist/lib/components/panel/header/storage/history-item-content.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/history-item-content.js +17 -0
- package/dist/lib/components/panel/header/storage/history-shell.d.ts +8 -0
- package/dist/lib/components/panel/header/storage/history-shell.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/history-shell.js +19 -0
- package/dist/lib/components/panel/header/storage/history-utils.d.ts +7 -0
- package/dist/lib/components/panel/header/storage/history-utils.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/history-utils.js +25 -0
- package/dist/lib/components/panel/header/storage/index.d.ts +5 -0
- package/dist/lib/components/panel/header/storage/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/index.js +120 -0
- package/dist/lib/components/panel/header/storage/trash/index.d.ts +4 -0
- package/dist/lib/components/panel/header/storage/trash/index.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/trash/index.js +126 -0
- package/dist/lib/components/panel/header/storage/trash/types.d.ts +27 -0
- package/dist/lib/components/panel/header/storage/trash/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/trash/variants.d.ts +6 -0
- package/dist/lib/components/panel/header/storage/trash/variants.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/trash/variants.js +12 -0
- package/dist/lib/components/panel/header/storage/types.d.ts +482 -0
- package/dist/lib/components/panel/header/storage/types.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/types.js +155 -0
- package/dist/lib/components/panel/header/storage/variant.d.ts +289 -0
- package/dist/lib/components/panel/header/storage/variant.d.ts.map +1 -0
- package/dist/lib/components/panel/header/storage/variant.js +106 -0
- package/dist/lib/components/panel/header/types.d.ts +26 -0
- package/dist/lib/components/panel/header/types.d.ts.map +1 -0
- package/dist/lib/components/panel/info-panel/container.d.ts +9 -0
- package/dist/lib/components/panel/info-panel/container.d.ts.map +1 -0
- package/dist/lib/components/panel/info-panel/container.js +90 -0
- package/dist/lib/components/panel/info-panel/container.module.css +48 -0
- package/dist/lib/components/panel/info-panel/container.module.js +8 -0
- package/dist/lib/components/panel/info-panel/index.d.ts +4 -0
- package/dist/lib/components/panel/info-panel/index.d.ts.map +1 -0
- package/dist/lib/components/panel/info-panel/provider.d.ts +7 -0
- package/dist/lib/components/panel/info-panel/provider.d.ts.map +1 -0
- package/dist/lib/components/panel/info-panel/provider.js +104 -0
- package/dist/lib/components/panel/info-panel/sheet.d.ts +9 -0
- package/dist/lib/components/panel/info-panel/sheet.d.ts.map +1 -0
- package/dist/lib/components/panel/info-panel/sheet.js +70 -0
- package/dist/lib/components/panel/info-panel/styles.d.ts +6 -0
- package/dist/lib/components/panel/info-panel/styles.d.ts.map +1 -0
- package/dist/lib/components/panel/info-panel/styles.js +8 -0
- package/dist/lib/components/panel/info-panel/types.d.ts +21 -0
- package/dist/lib/components/panel/info-panel/types.d.ts.map +1 -0
- package/dist/lib/components/panel/menu/index.d.ts +4 -0
- package/dist/lib/components/panel/menu/index.d.ts.map +1 -0
- package/dist/lib/components/panel/menu/index.js +156 -0
- package/dist/lib/components/panel/menu/types.d.ts +522 -0
- package/dist/lib/components/panel/menu/types.d.ts.map +1 -0
- package/dist/lib/components/panel/menu/types.js +71 -0
- package/dist/lib/components/panel/menu/variant.d.ts +259 -0
- package/dist/lib/components/panel/menu/variant.d.ts.map +1 -0
- package/dist/lib/components/panel/menu/variant.js +131 -0
- package/dist/lib/components/panel/responsive.d.ts +3 -0
- package/dist/lib/components/panel/responsive.d.ts.map +1 -0
- package/dist/lib/components/panel/responsive.js +5 -0
- package/dist/lib/components/responsive-toolbar-action/index.d.ts +11 -0
- package/dist/lib/components/responsive-toolbar-action/index.d.ts.map +1 -0
- package/dist/lib/components/responsive-toolbar-action/index.js +21 -0
- package/dist/lib/components/shortcut-key/index.d.ts +18 -0
- package/dist/lib/components/shortcut-key/index.d.ts.map +1 -0
- package/dist/lib/components/shortcut-key/index.js +44 -0
- package/dist/lib/components/toolbar-actions/index.d.ts +31 -0
- package/dist/lib/components/toolbar-actions/index.d.ts.map +1 -0
- package/dist/lib/components/toolbar-actions/index.js +75 -0
- package/dist/lib/components/workspace-navigation/index.d.ts +24 -0
- package/dist/lib/components/workspace-navigation/index.d.ts.map +1 -0
- package/dist/lib/components/workspace-navigation/index.js +74 -0
- package/dist/lib/layouts/app/frame.d.ts +8 -0
- package/dist/lib/layouts/app/frame.d.ts.map +1 -0
- package/dist/lib/layouts/app/frame.js +20 -0
- package/dist/lib/layouts/app/index.d.ts +27 -0
- package/dist/lib/layouts/app/index.d.ts.map +1 -0
- package/dist/lib/layouts/app/index.js +89 -0
- package/dist/lib/layouts/menu-layout/home-navigation-bubble.d.ts +7 -0
- package/dist/lib/layouts/menu-layout/home-navigation-bubble.d.ts.map +1 -0
- package/dist/lib/layouts/menu-layout/home-navigation-bubble.js +22 -0
- package/dist/lib/layouts/menu-layout/index-md.d.ts +4 -0
- package/dist/lib/layouts/menu-layout/index-md.d.ts.map +1 -0
- package/dist/lib/layouts/menu-layout/index-md.js +142 -0
- package/dist/lib/layouts/menu-layout/index-sm.d.ts +5 -0
- package/dist/lib/layouts/menu-layout/index-sm.d.ts.map +1 -0
- package/dist/lib/layouts/menu-layout/index-sm.js +124 -0
- package/dist/lib/layouts/menu-layout/index.d.ts +8 -0
- package/dist/lib/layouts/menu-layout/index.d.ts.map +1 -0
- package/dist/lib/layouts/menu-layout/index.js +17 -0
- package/dist/lib/layouts/section/index.d.ts +29 -0
- package/dist/lib/layouts/section/index.d.ts.map +1 -0
- package/dist/lib/layouts/section/index.js +285 -0
- package/dist/lib/layouts/section/preferences.d.ts +10 -0
- package/dist/lib/layouts/section/preferences.d.ts.map +1 -0
- package/dist/lib/layouts/section/preferences.js +41 -0
- package/dist/lib/layouts/section/sidebar-state.d.ts +7 -0
- package/dist/lib/layouts/section/sidebar-state.d.ts.map +1 -0
- package/dist/lib/layouts/section/sidebar-state.js +35 -0
- package/dist/lib/layouts/section/sidebar.d.ts +11 -0
- package/dist/lib/layouts/section/sidebar.d.ts.map +1 -0
- package/dist/lib/layouts/section/sidebar.js +84 -0
- package/dist/lib/layouts/section/sort-menu.d.ts +27 -0
- package/dist/lib/layouts/section/sort-menu.d.ts.map +1 -0
- package/dist/lib/layouts/section/sort-menu.js +72 -0
- package/dist/lib/layouts/section/toolbar-content.d.ts +11 -0
- package/dist/lib/layouts/section/toolbar-content.d.ts.map +1 -0
- package/dist/lib/layouts/section/toolbar-content.js +31 -0
- package/dist/lib/layouts/section/toolbar-more-sheet.d.ts +38 -0
- package/dist/lib/layouts/section/toolbar-more-sheet.d.ts.map +1 -0
- package/dist/lib/layouts/section/toolbar-more-sheet.js +288 -0
- package/dist/lib/layouts/section/toolbar.d.ts +60 -0
- package/dist/lib/layouts/section/toolbar.d.ts.map +1 -0
- package/dist/lib/layouts/section/toolbar.js +518 -0
- package/dist/lib/layouts/settings/index.d.ts +5 -0
- package/dist/lib/layouts/settings/index.d.ts.map +1 -0
- package/dist/lib/layouts/settings/index.js +9 -0
- package/dist/lib/navigation-toolbar.d.ts +32 -0
- package/dist/lib/navigation-toolbar.d.ts.map +1 -0
- package/dist/lib/navigation-toolbar.js +29 -0
- package/dist/lib/navigation.d.ts +21 -0
- package/dist/lib/navigation.d.ts.map +1 -0
- package/dist/lib/navigation.js +39 -0
- package/dist/lib/pages/settings/index.d.ts +17 -0
- package/dist/lib/pages/settings/index.d.ts.map +1 -0
- package/dist/lib/pages/settings/index.js +276 -0
- package/dist/lib/pages/settings/navigation.d.ts +4 -0
- package/dist/lib/pages/settings/navigation.d.ts.map +1 -0
- package/dist/lib/pages/settings/navigation.js +6 -0
- package/dist/lib/pages/settings/settings-content.d.ts +5 -0
- package/dist/lib/pages/settings/settings-content.d.ts.map +1 -0
- package/dist/lib/pages/settings/settings-content.js +213 -0
- package/dist/lib/pages/settings/tile-gallery.d.ts +19 -0
- package/dist/lib/pages/settings/tile-gallery.d.ts.map +1 -0
- package/dist/lib/pages/settings/tile-gallery.js +411 -0
- package/dist/lib/store/useBookmarks/action.d.ts +6 -0
- package/dist/lib/store/useBookmarks/action.d.ts.map +1 -0
- package/dist/lib/store/useBookmarks/action.js +7 -0
- package/dist/lib/store/useBookmarks/data.d.ts +4 -0
- package/dist/lib/store/useBookmarks/data.d.ts.map +1 -0
- package/dist/lib/store/useBookmarks/data.js +231 -0
- package/dist/lib/store/useBookmarks/index.d.ts +12 -0
- package/dist/lib/store/useBookmarks/index.d.ts.map +1 -0
- package/dist/lib/store/useBookmarks/index.js +29 -0
- package/dist/lib/store/useBookmarks/types.d.ts +30 -0
- package/dist/lib/store/useBookmarks/types.d.ts.map +1 -0
- package/dist/lib/store/useStorage/action.d.ts +6 -0
- package/dist/lib/store/useStorage/action.d.ts.map +1 -0
- package/dist/lib/store/useStorage/action.js +7 -0
- package/dist/lib/store/useStorage/data.d.ts +3 -0
- package/dist/lib/store/useStorage/data.d.ts.map +1 -0
- package/dist/lib/store/useStorage/data.js +219 -0
- package/dist/lib/store/useStorage/index.d.ts +7 -0
- package/dist/lib/store/useStorage/index.d.ts.map +1 -0
- package/dist/lib/store/useStorage/index.js +13 -0
- package/dist/lib/store/useStorage/types.d.ts +20 -0
- package/dist/lib/store/useStorage/types.d.ts.map +1 -0
- package/dist/lib/store/users/useUserStore.d.ts +22 -0
- package/dist/lib/store/users/useUserStore.d.ts.map +1 -0
- package/dist/lib/store/users/useUserStore.js +46 -0
- package/dist/lib/utils/date.d.ts +2 -0
- package/dist/lib/utils/date.d.ts.map +1 -0
- package/dist/lib/utils/date.js +8 -0
- package/dist/lib/utils/url.d.ts +4 -0
- package/dist/lib/utils/url.d.ts.map +1 -0
- package/dist/lib/utils/url.js +19 -0
- package/dist/react.css +49 -0
- package/package.json +90 -2
- package/dist/lib/react.d.ts +0 -2
- package/dist/lib/react.d.ts.map +0 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
//#region src/lib/components/panel/header/bookmarks/bookmark-file-tree/variants.ts
|
|
2
|
+
var getUniqueTreeId = (baseId, counts) => {
|
|
3
|
+
const count = counts.get(baseId) ?? 0;
|
|
4
|
+
counts.set(baseId, count + 1);
|
|
5
|
+
return count === 0 ? baseId : `${baseId}:${count + 1}`;
|
|
6
|
+
};
|
|
7
|
+
var getExpandableBookmarkKeys = (items) => {
|
|
8
|
+
const keys = [];
|
|
9
|
+
const collect = (item) => {
|
|
10
|
+
if (item.kind === "folder") keys.push(item.id);
|
|
11
|
+
item.children?.forEach(collect);
|
|
12
|
+
};
|
|
13
|
+
items.forEach(collect);
|
|
14
|
+
return keys;
|
|
15
|
+
};
|
|
16
|
+
var removeTreeItem = (items, itemId) => items.filter((item) => item.id !== itemId).map((item) => ({
|
|
17
|
+
...item,
|
|
18
|
+
children: item.children ? removeTreeItem(item.children, itemId) : item.children
|
|
19
|
+
}));
|
|
20
|
+
var updateTreeItem = (items, itemId, updater) => items.map((item) => {
|
|
21
|
+
if (item.id === itemId) return updater(item);
|
|
22
|
+
return {
|
|
23
|
+
...item,
|
|
24
|
+
children: item.children ? updateTreeItem(item.children, itemId, updater) : item.children
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
var insertFolderItem = (items, folder, parentId) => {
|
|
28
|
+
if (!parentId) return {
|
|
29
|
+
inserted: true,
|
|
30
|
+
items: [...items, folder]
|
|
31
|
+
};
|
|
32
|
+
let inserted = false;
|
|
33
|
+
const nextItems = items.map((item) => {
|
|
34
|
+
if (item.id === parentId && item.kind === "folder") {
|
|
35
|
+
inserted = true;
|
|
36
|
+
return {
|
|
37
|
+
...item,
|
|
38
|
+
children: [...item.children ?? [], folder]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (!item.children?.length) return item;
|
|
42
|
+
const childResult = insertFolderItem(item.children, folder, parentId);
|
|
43
|
+
inserted = inserted || childResult.inserted;
|
|
44
|
+
return {
|
|
45
|
+
...item,
|
|
46
|
+
children: childResult.items
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
inserted,
|
|
51
|
+
items: nextItems
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
var createTreeItemId = (prefix, existingIds) => {
|
|
55
|
+
const baseId = `${prefix}:${typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
|
|
56
|
+
let nextId = baseId;
|
|
57
|
+
let index = 1;
|
|
58
|
+
while (existingIds.has(nextId)) {
|
|
59
|
+
index += 1;
|
|
60
|
+
nextId = `${baseId}:${index}`;
|
|
61
|
+
}
|
|
62
|
+
existingIds.add(nextId);
|
|
63
|
+
return nextId;
|
|
64
|
+
};
|
|
65
|
+
var dedupeTreeItems = (items, seen = /* @__PURE__ */ new Set()) => items.reduce((acc, item) => {
|
|
66
|
+
if (seen.has(item.id)) return acc;
|
|
67
|
+
seen.add(item.id);
|
|
68
|
+
acc.push({
|
|
69
|
+
...item,
|
|
70
|
+
children: item.children ? dedupeTreeItems(item.children, seen) : void 0
|
|
71
|
+
});
|
|
72
|
+
return acc;
|
|
73
|
+
}, []);
|
|
74
|
+
var collectTreeItemIds = (items, ids = /* @__PURE__ */ new Set()) => {
|
|
75
|
+
items.forEach((item) => {
|
|
76
|
+
ids.add(item.id);
|
|
77
|
+
if (item.children) collectTreeItemIds(item.children, ids);
|
|
78
|
+
});
|
|
79
|
+
return ids;
|
|
80
|
+
};
|
|
81
|
+
var getUniqueFolderGroupId = (targetId, existingIds) => {
|
|
82
|
+
const baseId = `folder:group:${targetId}`;
|
|
83
|
+
let nextId = baseId;
|
|
84
|
+
let index = 1;
|
|
85
|
+
while (existingIds.has(nextId)) {
|
|
86
|
+
index += 1;
|
|
87
|
+
nextId = `${baseId}:${index}`;
|
|
88
|
+
}
|
|
89
|
+
existingIds.add(nextId);
|
|
90
|
+
return nextId;
|
|
91
|
+
};
|
|
92
|
+
var getFolderTitleFromMovedItems = (movedItems) => {
|
|
93
|
+
return movedItems[0]?.title.trim() || "New Folder";
|
|
94
|
+
};
|
|
95
|
+
var cloneTreeItem = (item) => ({
|
|
96
|
+
...item,
|
|
97
|
+
children: item.children?.map(cloneTreeItem)
|
|
98
|
+
});
|
|
99
|
+
var normalizeBookmarkGroups = (items, existingIds = collectTreeItemIds(items)) => items.map((item) => {
|
|
100
|
+
const children = item.children ? normalizeBookmarkGroups(item.children, existingIds) : void 0;
|
|
101
|
+
if (item.kind !== "bookmark" || !children?.length) return {
|
|
102
|
+
...item,
|
|
103
|
+
children
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
id: getUniqueFolderGroupId(item.id, existingIds),
|
|
107
|
+
title: getFolderTitleFromMovedItems(children),
|
|
108
|
+
kind: "folder",
|
|
109
|
+
children: [{
|
|
110
|
+
...item,
|
|
111
|
+
children: void 0
|
|
112
|
+
}, ...children]
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
var findTreeItem = (items, itemId) => {
|
|
116
|
+
for (const item of items) {
|
|
117
|
+
if (item.id === itemId) return item;
|
|
118
|
+
const childItem = item.children ? findTreeItem(item.children, itemId) : void 0;
|
|
119
|
+
if (childItem) return childItem;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var collectFolderTargets = (items, excludedId, path = []) => items.reduce((acc, item) => {
|
|
123
|
+
if (item.kind !== "folder" || item.id === excludedId) return acc;
|
|
124
|
+
const nextPath = [...path, item.title];
|
|
125
|
+
acc.push({
|
|
126
|
+
id: item.id,
|
|
127
|
+
title: nextPath.join(" / "),
|
|
128
|
+
depth: nextPath.length - 1
|
|
129
|
+
});
|
|
130
|
+
acc.push(...collectFolderTargets(item.children ?? [], excludedId, nextPath));
|
|
131
|
+
return acc;
|
|
132
|
+
}, []);
|
|
133
|
+
var removeTreeItems = (items, itemIds, removedItems = []) => items.reduce((acc, item) => {
|
|
134
|
+
if (itemIds.has(item.id)) {
|
|
135
|
+
removedItems.push(cloneTreeItem(item));
|
|
136
|
+
return acc;
|
|
137
|
+
}
|
|
138
|
+
acc.push({
|
|
139
|
+
...item,
|
|
140
|
+
children: item.children ? removeTreeItems(item.children, itemIds, removedItems) : item.children
|
|
141
|
+
});
|
|
142
|
+
return acc;
|
|
143
|
+
}, []);
|
|
144
|
+
var insertTreeItemsRelativeToTarget = (items, targetId, movedItems, placement) => {
|
|
145
|
+
let inserted = false;
|
|
146
|
+
const nextItems = items.reduce((acc, item) => {
|
|
147
|
+
if (item.id === targetId) {
|
|
148
|
+
inserted = true;
|
|
149
|
+
if (placement === "before") acc.push(...movedItems, item);
|
|
150
|
+
else acc.push(item, ...movedItems);
|
|
151
|
+
return acc;
|
|
152
|
+
}
|
|
153
|
+
if (item.children?.length) {
|
|
154
|
+
const childResult = insertTreeItemsRelativeToTarget(item.children, targetId, movedItems, placement);
|
|
155
|
+
inserted = inserted || childResult.inserted;
|
|
156
|
+
acc.push({
|
|
157
|
+
...item,
|
|
158
|
+
children: childResult.items
|
|
159
|
+
});
|
|
160
|
+
return acc;
|
|
161
|
+
}
|
|
162
|
+
acc.push(item);
|
|
163
|
+
return acc;
|
|
164
|
+
}, []);
|
|
165
|
+
return {
|
|
166
|
+
inserted,
|
|
167
|
+
items: nextItems
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
var insertTreeItemsOnTarget = (items, targetId, movedItems, existingIds) => {
|
|
171
|
+
let expandedKey;
|
|
172
|
+
let inserted = false;
|
|
173
|
+
const nextItems = items.map((item) => {
|
|
174
|
+
if (item.id === targetId) {
|
|
175
|
+
inserted = true;
|
|
176
|
+
if (item.kind === "folder") {
|
|
177
|
+
expandedKey = item.id;
|
|
178
|
+
return {
|
|
179
|
+
...item,
|
|
180
|
+
children: [...item.children ?? [], ...movedItems]
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const folderId = getUniqueFolderGroupId(item.id, existingIds);
|
|
184
|
+
expandedKey = folderId;
|
|
185
|
+
return {
|
|
186
|
+
id: folderId,
|
|
187
|
+
title: getFolderTitleFromMovedItems(movedItems),
|
|
188
|
+
kind: "folder",
|
|
189
|
+
children: [{
|
|
190
|
+
...item,
|
|
191
|
+
children: void 0
|
|
192
|
+
}, ...movedItems]
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (!item.children?.length) return item;
|
|
196
|
+
const childResult = insertTreeItemsOnTarget(item.children, targetId, movedItems, existingIds);
|
|
197
|
+
if (childResult.inserted) {
|
|
198
|
+
inserted = true;
|
|
199
|
+
expandedKey = childResult.expandedKey;
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
...item,
|
|
203
|
+
children: childResult.items
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
expandedKey,
|
|
208
|
+
inserted,
|
|
209
|
+
items: nextItems
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
var moveTreeItemToFolder = (items, movedId, targetFolderId) => {
|
|
213
|
+
if (targetFolderId && movedId === targetFolderId) return { items };
|
|
214
|
+
const movedItems = [];
|
|
215
|
+
const itemsWithoutMoved = removeTreeItems(items, new Set([movedId]), movedItems);
|
|
216
|
+
if (!movedItems.length) return { items };
|
|
217
|
+
if (!targetFolderId) return { items: normalizeBookmarkGroups([...itemsWithoutMoved, ...movedItems]) };
|
|
218
|
+
if (!findTreeItem(itemsWithoutMoved, targetFolderId)) return { items };
|
|
219
|
+
const result = insertTreeItemsOnTarget(itemsWithoutMoved, targetFolderId, movedItems, collectTreeItemIds([...itemsWithoutMoved, ...movedItems]));
|
|
220
|
+
return result.inserted ? {
|
|
221
|
+
expandedKey: result.expandedKey,
|
|
222
|
+
items: normalizeBookmarkGroups(result.items)
|
|
223
|
+
} : { items };
|
|
224
|
+
};
|
|
225
|
+
var moveBookmarkTreeItems = (items, movedIds, targetId, dropPosition) => {
|
|
226
|
+
if (!movedIds.length || movedIds.includes(targetId)) return { items };
|
|
227
|
+
const movedIdSet = new Set(movedIds);
|
|
228
|
+
if (!findTreeItem(items, targetId)) return { items };
|
|
229
|
+
const movedItems = [];
|
|
230
|
+
const itemsWithoutMoved = removeTreeItems(items, movedIdSet, movedItems);
|
|
231
|
+
if (!movedItems.length || !findTreeItem(itemsWithoutMoved, targetId)) return { items };
|
|
232
|
+
if (dropPosition === "on") {
|
|
233
|
+
const result = insertTreeItemsOnTarget(itemsWithoutMoved, targetId, movedItems, collectTreeItemIds([...itemsWithoutMoved, ...movedItems]));
|
|
234
|
+
return result.inserted ? {
|
|
235
|
+
expandedKey: result.expandedKey,
|
|
236
|
+
items: normalizeBookmarkGroups(result.items)
|
|
237
|
+
} : { items };
|
|
238
|
+
}
|
|
239
|
+
const result = insertTreeItemsRelativeToTarget(itemsWithoutMoved, targetId, movedItems, dropPosition === "after" ? "after" : "before");
|
|
240
|
+
return result.inserted ? { items: normalizeBookmarkGroups(result.items) } : { items };
|
|
241
|
+
};
|
|
242
|
+
var getBookmarkTreeSignature = (items) => items.map((item) => [
|
|
243
|
+
item.id,
|
|
244
|
+
item.kind,
|
|
245
|
+
item.title,
|
|
246
|
+
item.children ? getBookmarkTreeSignature(item.children) : ""
|
|
247
|
+
].join(":")).join("|");
|
|
248
|
+
//#endregion
|
|
249
|
+
export { collectFolderTargets, collectTreeItemIds, createTreeItemId, dedupeTreeItems, getBookmarkTreeSignature, getExpandableBookmarkKeys, getUniqueTreeId, insertFolderItem, moveBookmarkTreeItems, moveTreeItemToFolder, removeTreeItem, updateTreeItem };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type BookmarkContextMenuItemsProps } from './types';
|
|
2
|
+
declare const BookmarkContextMenuItems: ({ contextTarget, folderTargets, onBookmarkRemove, onFolderEdit, onFolderDelete, onNewFolder, onBookmarkMove }: BookmarkContextMenuItemsProps) => import("react").JSX.Element;
|
|
3
|
+
declare const BrowserContextMenuItems: () => import("react").JSX.Element;
|
|
4
|
+
export { BookmarkContextMenuItems, BrowserContextMenuItems };
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/components/panel/header/bookmarks/context-menu/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,SAAS,CAAA;AA6D5D,QAAA,MAAM,wBAAwB,GAAI,+GAQ/B,6BAA6B,gCA0E/B,CAAA;AAED,QAAA,MAAM,uBAAuB,mCAsB5B,CAAA;AAED,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { AppIcon } from "../../../../app-icon/index.js";
|
|
2
|
+
import { panelContextMenuClass } from "../../../info-panel/styles.js";
|
|
3
|
+
import { ShortcutKey } from "../../../../shortcut-key/index.js";
|
|
4
|
+
import { Label } from "@vezham/react-v3";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ContextMenu } from "@vezham/react-pro-v3";
|
|
7
|
+
//#region src/lib/components/panel/header/bookmarks/context-menu/index.tsx
|
|
8
|
+
var renderContextMenuLabel = (icon, label) => /* @__PURE__ */ jsxs(Label, {
|
|
9
|
+
className: "flex w-full items-center gap-2",
|
|
10
|
+
children: [/* @__PURE__ */ jsx(AppIcon, {
|
|
11
|
+
icon,
|
|
12
|
+
size: 16,
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}), /* @__PURE__ */ jsx("span", { children: label })]
|
|
15
|
+
});
|
|
16
|
+
var FolderMenuItems = ({ item, onFolderEdit, onFolderDelete, onNewFolder }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
18
|
+
id: "create-folder",
|
|
19
|
+
textValue: "Create Folder",
|
|
20
|
+
onPress: () => onNewFolder(item?.id),
|
|
21
|
+
children: renderContextMenuLabel("vx:folder-add", "Create Folder")
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx(ContextMenu.Separator, {}),
|
|
24
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
25
|
+
id: "rename-folder",
|
|
26
|
+
textValue: "Rename Folder",
|
|
27
|
+
isDisabled: !item,
|
|
28
|
+
onPress: () => item && onFolderEdit(item),
|
|
29
|
+
children: renderContextMenuLabel("vx:pen", "Rename Folder")
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
32
|
+
id: "change-color",
|
|
33
|
+
textValue: "Change Color",
|
|
34
|
+
isDisabled: !item,
|
|
35
|
+
onPress: () => item && onFolderEdit(item),
|
|
36
|
+
children: renderContextMenuLabel("vx:palette-round", "Change Color")
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
39
|
+
id: "change-icon",
|
|
40
|
+
textValue: "Change Emoji/Icon",
|
|
41
|
+
isDisabled: !item,
|
|
42
|
+
onPress: () => item && onFolderEdit(item),
|
|
43
|
+
children: renderContextMenuLabel("vx:smile-circle", "Change Emoji/Icon")
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx(ContextMenu.Separator, {}),
|
|
46
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
47
|
+
id: "delete-folder",
|
|
48
|
+
textValue: "Delete Folder",
|
|
49
|
+
variant: "danger",
|
|
50
|
+
isDisabled: !item,
|
|
51
|
+
onPress: () => item && onFolderDelete(item.id),
|
|
52
|
+
children: renderContextMenuLabel("vx:trash", "Delete Folder")
|
|
53
|
+
})
|
|
54
|
+
] });
|
|
55
|
+
var BookmarkContextMenuItems = ({ contextTarget, folderTargets, onBookmarkRemove, onFolderEdit, onFolderDelete, onNewFolder, onBookmarkMove }) => {
|
|
56
|
+
const renderMoveTargets = (itemId) => /* @__PURE__ */ jsxs(ContextMenu.SubmenuTrigger, { children: [/* @__PURE__ */ jsxs(ContextMenu.Item, {
|
|
57
|
+
id: "move",
|
|
58
|
+
textValue: "Move",
|
|
59
|
+
children: [renderContextMenuLabel("vx:folder-with-files", "Move"), /* @__PURE__ */ jsx(ContextMenu.SubmenuIndicator, {})]
|
|
60
|
+
}), /* @__PURE__ */ jsx(ContextMenu.Popover, {
|
|
61
|
+
className: panelContextMenuClass,
|
|
62
|
+
children: /* @__PURE__ */ jsxs(ContextMenu.Menu, { children: [/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
63
|
+
id: "move-root",
|
|
64
|
+
textValue: "Bookmarks",
|
|
65
|
+
onPress: () => onBookmarkMove(itemId),
|
|
66
|
+
children: /* @__PURE__ */ jsx(Label, { children: "Bookmarks" })
|
|
67
|
+
}), folderTargets.map((target) => /* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
68
|
+
id: `move-${target.id}`,
|
|
69
|
+
textValue: target.title,
|
|
70
|
+
onPress: () => onBookmarkMove(itemId, target.id),
|
|
71
|
+
children: /* @__PURE__ */ jsx(Label, {
|
|
72
|
+
className: "block truncate",
|
|
73
|
+
style: { paddingInlineStart: target.depth * 10 },
|
|
74
|
+
children: target.title
|
|
75
|
+
})
|
|
76
|
+
}, target.id))] })
|
|
77
|
+
})] });
|
|
78
|
+
if (contextTarget.type === "folder") return /* @__PURE__ */ jsx(FolderMenuItems, {
|
|
79
|
+
item: contextTarget.item,
|
|
80
|
+
onFolderEdit,
|
|
81
|
+
onFolderDelete,
|
|
82
|
+
onNewFolder
|
|
83
|
+
});
|
|
84
|
+
if (contextTarget.type === "bookmark") return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
86
|
+
id: "create-folder",
|
|
87
|
+
textValue: "Create Folder",
|
|
88
|
+
onPress: () => onNewFolder(),
|
|
89
|
+
children: renderContextMenuLabel("vx:folder-add", "Create Folder")
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ jsx(ContextMenu.Separator, {}),
|
|
92
|
+
renderMoveTargets(contextTarget.item.id),
|
|
93
|
+
/* @__PURE__ */ jsx(ContextMenu.Separator, {}),
|
|
94
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
95
|
+
id: "delete-bookmark",
|
|
96
|
+
textValue: "Delete",
|
|
97
|
+
variant: "danger",
|
|
98
|
+
onPress: () => onBookmarkRemove(contextTarget.item.id),
|
|
99
|
+
children: renderContextMenuLabel("vx:trash", "Delete")
|
|
100
|
+
})
|
|
101
|
+
] });
|
|
102
|
+
return /* @__PURE__ */ jsx(FolderMenuItems, {
|
|
103
|
+
onFolderEdit,
|
|
104
|
+
onFolderDelete,
|
|
105
|
+
onNewFolder
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
var BrowserContextMenuItems = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
/* @__PURE__ */ jsxs(ContextMenu.Item, {
|
|
110
|
+
id: "back",
|
|
111
|
+
textValue: "Back",
|
|
112
|
+
children: [/* @__PURE__ */ jsx(Label, { children: "Back" }), /* @__PURE__ */ jsx(ShortcutKey, {
|
|
113
|
+
className: "ms-auto",
|
|
114
|
+
shortcut: "⌘ ["
|
|
115
|
+
})]
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ jsxs(ContextMenu.Item, {
|
|
118
|
+
isDisabled: true,
|
|
119
|
+
id: "forward",
|
|
120
|
+
textValue: "Forward",
|
|
121
|
+
children: [/* @__PURE__ */ jsx(Label, { children: "Forward" }), /* @__PURE__ */ jsx(ShortcutKey, {
|
|
122
|
+
className: "ms-auto",
|
|
123
|
+
shortcut: "⌘ ]"
|
|
124
|
+
})]
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsxs(ContextMenu.Item, {
|
|
127
|
+
id: "reload",
|
|
128
|
+
textValue: "Reload",
|
|
129
|
+
children: [/* @__PURE__ */ jsx(Label, { children: "Reload" }), /* @__PURE__ */ jsx(ShortcutKey, {
|
|
130
|
+
className: "ms-auto",
|
|
131
|
+
shortcut: "⌘ R"
|
|
132
|
+
})]
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ jsx(ContextMenu.Separator, {}),
|
|
135
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
136
|
+
id: "view-source",
|
|
137
|
+
textValue: "View Page Source",
|
|
138
|
+
children: /* @__PURE__ */ jsx(Label, { children: "View Page Source" })
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
141
|
+
id: "inspect",
|
|
142
|
+
textValue: "Inspect",
|
|
143
|
+
children: /* @__PURE__ */ jsx(Label, { children: "Inspect" })
|
|
144
|
+
})
|
|
145
|
+
] });
|
|
146
|
+
//#endregion
|
|
147
|
+
export { BookmarkContextMenuItems, BrowserContextMenuItems };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type BookmarkTreeItem } from '../types';
|
|
2
|
+
export type BookmarkContextTarget = {
|
|
3
|
+
type: 'folder';
|
|
4
|
+
item: BookmarkTreeItem;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'bookmark';
|
|
7
|
+
item: BookmarkTreeItem;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'area';
|
|
10
|
+
};
|
|
11
|
+
export interface FolderTarget {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
depth: number;
|
|
15
|
+
}
|
|
16
|
+
export interface BookmarkContextMenuItemsProps {
|
|
17
|
+
contextTarget: BookmarkContextTarget;
|
|
18
|
+
folderTargets: FolderTarget[];
|
|
19
|
+
onBookmarkRemove: (id: string) => void;
|
|
20
|
+
onFolderEdit: (item: BookmarkTreeItem) => void;
|
|
21
|
+
onFolderDelete: (id: string) => void;
|
|
22
|
+
onNewFolder: (parentId?: string) => void;
|
|
23
|
+
onBookmarkMove: (id: string, targetFolderId?: string) => void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/components/panel/header/bookmarks/context-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpB,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,6BAA6B;IAC5C,aAAa,EAAE,qBAAqB,CAAA;IACpC,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC9C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/panel/header/bookmarks/data.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/panel/header/bookmarks/empty-state.tsx"],"names":[],"mappings":"AAEA,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,mCAIvC,KAAK,gCASP,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "@vezham/react-v3";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/lib/components/panel/header/bookmarks/empty-state.tsx
|
|
4
|
+
var BookmarkSectionEmptyState = ({ title, description, className }) => /* @__PURE__ */ jsxs("div", {
|
|
5
|
+
className: cn("text-muted flex min-h-20 w-full flex-col items-center justify-center gap-1 px-4 py-4 text-center not-italic", className),
|
|
6
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
7
|
+
className: "text-xs font-medium",
|
|
8
|
+
children: title
|
|
9
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
10
|
+
className: "max-w-56 text-[11px] leading-4",
|
|
11
|
+
children: description
|
|
12
|
+
})]
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BookmarkSectionEmptyState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/components/panel/header/bookmarks/favorites/data.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FavoriteGridListProps } from './types';
|
|
2
|
+
declare const FavoriteGridList: ({ items, onAction, onRemove, onReorder, dragAndDropHooks, classNames, ...variantProps }: FavoriteGridListProps) => import("react").JSX.Element;
|
|
3
|
+
export { FavoriteGridList };
|
|
4
|
+
//# sourceMappingURL=grid-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/components/panel/header/bookmarks/favorites/grid-list.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGpD,QAAA,MAAM,gBAAgB,GAAI,yFAQvB,qBAAqB,gCAuFvB,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { sampleFavorites } from "../../../../../store/useBookmarks/data.js";
|
|
2
|
+
import { BookmarkSectionEmptyState } from "../empty-state.js";
|
|
3
|
+
import { ShortcutContextMenu } from "../shortcut-context-menu.js";
|
|
4
|
+
import { tva } from "./variant.js";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { Avatar, cn } from "@vezham/react-v3";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Button as Button$1, GridList, GridListItem } from "react-aria-components";
|
|
9
|
+
//#region src/lib/components/panel/header/bookmarks/favorites/grid-list.tsx
|
|
10
|
+
var FavoriteGridList = ({ items = sampleFavorites, onAction, onRemove, onReorder, dragAndDropHooks, classNames, ...variantProps }) => {
|
|
11
|
+
const slots = tva(variantProps);
|
|
12
|
+
const visibleItems = useMemo(() => items.length > 12 ? items.slice(0, 12) : items, [items]);
|
|
13
|
+
return /* @__PURE__ */ jsx(ShortcutContextMenu, {
|
|
14
|
+
items,
|
|
15
|
+
kind: "favorite",
|
|
16
|
+
onRemove,
|
|
17
|
+
children: /* @__PURE__ */ jsx(GridList, {
|
|
18
|
+
"aria-label": "Favorites",
|
|
19
|
+
className: slots.grid({ class: classNames?.grid }),
|
|
20
|
+
dragAndDropHooks,
|
|
21
|
+
items: visibleItems,
|
|
22
|
+
onAction: (key) => {
|
|
23
|
+
const item = items.find((item) => item.id === key);
|
|
24
|
+
if (item) onAction?.(item);
|
|
25
|
+
},
|
|
26
|
+
layout: "grid",
|
|
27
|
+
renderEmptyState: () => /* @__PURE__ */ jsx(BookmarkSectionEmptyState, {
|
|
28
|
+
title: "No favorites yet.",
|
|
29
|
+
description: "Keep your most-used items here.",
|
|
30
|
+
className: slots.emptyState({ class: classNames?.emptyState })
|
|
31
|
+
}),
|
|
32
|
+
selectionMode: "multiple",
|
|
33
|
+
children: (item) => /* @__PURE__ */ jsx(GridListItem, {
|
|
34
|
+
className: ({ isDragging, isDropTarget }) => cn(slots.item({ class: classNames?.item }), isDragging && slots.itemDragging({ class: classNames?.itemDragging }), isDropTarget && slots.itemDropTarget({ class: classNames?.itemDropTarget })) ?? "",
|
|
35
|
+
"data-shortcut-id": item.id,
|
|
36
|
+
id: item.id,
|
|
37
|
+
textValue: item.name,
|
|
38
|
+
children: ({ allowsDragging }) => /* @__PURE__ */ jsxs(Fragment, { children: [allowsDragging && /* @__PURE__ */ jsx(Button$1, {
|
|
39
|
+
"aria-label": `Drag ${item.name}`,
|
|
40
|
+
className: slots.dragButton({ class: classNames?.dragButton }),
|
|
41
|
+
slot: "drag"
|
|
42
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "favorite-tile-content",
|
|
44
|
+
title: item.name,
|
|
45
|
+
className: slots.avatarContainer({ class: classNames?.avatarContainer }),
|
|
46
|
+
children: /* @__PURE__ */ jsxs(Avatar, {
|
|
47
|
+
className: slots.avatar({ class: classNames?.avatar }),
|
|
48
|
+
size: "sm",
|
|
49
|
+
children: [(item.avatar || item.backgroundImage) && /* @__PURE__ */ jsx(Avatar.Image, {
|
|
50
|
+
draggable: false,
|
|
51
|
+
className: "h-full w-full object-cover",
|
|
52
|
+
src: item.avatar || item.backgroundImage,
|
|
53
|
+
alt: ""
|
|
54
|
+
}), /* @__PURE__ */ jsx(Avatar.Fallback, {
|
|
55
|
+
className: slots.avatarFallback({ class: classNames?.avatarFallback }),
|
|
56
|
+
children: item.name.charAt(0)
|
|
57
|
+
})]
|
|
58
|
+
})
|
|
59
|
+
})] })
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { FavoriteGridList };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type FavoriteGridListProps } from './types';
|
|
2
|
+
type Props = Omit<FavoriteGridListProps, 'dragAndDropHooks'>;
|
|
3
|
+
declare const ReorderableGridList: (props: Props) => import("react").JSX.Element;
|
|
4
|
+
export { ReorderableGridList };
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/components/panel/header/bookmarks/favorites/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,KAAK,KAAK,GAAG,IAAI,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAA;AAwB5D,QAAA,MAAM,mBAAmB,GAAI,OAAO,KAAK,gCA6DxC,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { sampleFavorites } from "../../../../../store/useBookmarks/data.js";
|
|
2
|
+
import { FavoriteGridList } from "./grid-list.js";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useDragAndDrop } from "react-aria-components";
|
|
6
|
+
//#region src/lib/components/panel/header/bookmarks/favorites/index.tsx
|
|
7
|
+
var reorder = (items, keys, target) => {
|
|
8
|
+
if (keys.has(target.key) || target.dropPosition === "on") return items;
|
|
9
|
+
const moved = items.filter((item) => keys.has(item.id));
|
|
10
|
+
const remaining = items.filter((item) => !keys.has(item.id));
|
|
11
|
+
const index = remaining.findIndex((item) => item.id === target.key);
|
|
12
|
+
if (index < 0 || moved.length === 0) return items;
|
|
13
|
+
remaining.splice(index + (target.dropPosition === "after" ? 1 : 0), 0, ...moved);
|
|
14
|
+
return remaining.every((item, index) => item.id === items[index].id) ? items : remaining;
|
|
15
|
+
};
|
|
16
|
+
var ReorderableGridList = (props) => {
|
|
17
|
+
const [internalItems, setInternalItems] = useState(props.items ?? sampleFavorites);
|
|
18
|
+
const controlled = Boolean(props.items && props.onReorder);
|
|
19
|
+
const items = controlled ? props.items ?? internalItems : internalItems;
|
|
20
|
+
const [draft, setDraft] = useState(null);
|
|
21
|
+
const drag = useRef(null);
|
|
22
|
+
const displayedItems = draft?.source === items ? draft.items : items;
|
|
23
|
+
const { dragAndDropHooks } = useDragAndDrop({
|
|
24
|
+
getAllowedDropOperations: () => ["move"],
|
|
25
|
+
getItems(_keys, items) {
|
|
26
|
+
return items.map((item) => ({
|
|
27
|
+
"text/plain": item.name,
|
|
28
|
+
favorite: JSON.stringify(item)
|
|
29
|
+
}));
|
|
30
|
+
},
|
|
31
|
+
onDragStart(event) {
|
|
32
|
+
drag.current = {
|
|
33
|
+
source: items,
|
|
34
|
+
items,
|
|
35
|
+
keys: event.keys,
|
|
36
|
+
committed: false
|
|
37
|
+
};
|
|
38
|
+
setDraft(null);
|
|
39
|
+
},
|
|
40
|
+
onDropEnter(event) {
|
|
41
|
+
const current = drag.current;
|
|
42
|
+
if (!current || event.target.type !== "item") return;
|
|
43
|
+
const next = reorder(current.items, current.keys, event.target);
|
|
44
|
+
if (next === current.items) return;
|
|
45
|
+
current.items = next;
|
|
46
|
+
setDraft({
|
|
47
|
+
source: current.source,
|
|
48
|
+
items: next
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
onReorder(event) {
|
|
52
|
+
const current = drag.current;
|
|
53
|
+
const next = reorder(current?.items ?? items, event.keys, event.target);
|
|
54
|
+
setDraft({
|
|
55
|
+
source: current?.source ?? items,
|
|
56
|
+
items: next
|
|
57
|
+
});
|
|
58
|
+
if (current) current.committed = true;
|
|
59
|
+
if (!controlled) setInternalItems(next);
|
|
60
|
+
props.onReorder?.(next);
|
|
61
|
+
},
|
|
62
|
+
onDragEnd(event) {
|
|
63
|
+
if (event.dropOperation !== "move" || !event.isInternal) {
|
|
64
|
+
setDraft(null);
|
|
65
|
+
drag.current = null;
|
|
66
|
+
} else if (drag.current?.committed) drag.current = null;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ jsx(FavoriteGridList, {
|
|
70
|
+
...props,
|
|
71
|
+
items: displayedItems,
|
|
72
|
+
dragAndDropHooks
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { ReorderableGridList };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DragAndDropHooks } from 'react-aria-components';
|
|
2
|
+
import type { FavoriteItem } from '../../../../../store/useBookmarks/types';
|
|
3
|
+
import { type tvProps, type tvSlots } from './variant';
|
|
4
|
+
export interface FavoriteGridListProps extends tvProps {
|
|
5
|
+
items?: FavoriteItem[];
|
|
6
|
+
onAction?: (item: FavoriteItem) => void;
|
|
7
|
+
onRemove?: (id: string) => void;
|
|
8
|
+
onReorder?: (items: FavoriteItem[]) => void;
|
|
9
|
+
dragAndDropHooks?: DragAndDropHooks<FavoriteItem>;
|
|
10
|
+
classNames?: Partial<Record<tvSlots, string>>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/components/panel/header/bookmarks/favorites/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAA;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,OAAO;IACpD,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAA;IAC3C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;CAC9C"}
|