@agent-ui-kit/web-components 0.0.8 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -4
- package/dist/agent-ui.css +1 -1
- package/dist/api.colors.json +2 -2
- package/dist/api.colors.yaml +2 -2
- package/dist/api.components.json +8214 -2794
- package/dist/api.tokens.json +35 -3
- package/dist/api.tokens.yaml +27 -3
- package/dist/blocks/agent-chat/agent-chat.d.ts +0 -0
- package/dist/blocks/announcement-card/announcement-card.d.ts +0 -0
- package/dist/blocks/bpm-process/bpm-process.d.ts +0 -0
- package/dist/blocks/chart-activity/chart-activity.d.ts +0 -0
- package/dist/blocks/chart-card/chart-card.d.ts +0 -0
- package/dist/blocks/chart-donut/chart-donut.d.ts +0 -0
- package/dist/blocks/chart-grouped/chart-grouped.d.ts +0 -0
- package/dist/blocks/chart-horizontal/chart-horizontal.d.ts +0 -0
- package/dist/blocks/chart-interactive/chart-interactive.d.ts +0 -0
- package/dist/blocks/chart-labeled/chart-labeled.d.ts +0 -0
- package/dist/blocks/checkout-form/checkout-form.d.ts +0 -0
- package/dist/blocks/clinical-trial/clinical-trial.d.ts +0 -0
- package/dist/blocks/contributors/contributors.d.ts +0 -0
- package/dist/blocks/cyber-threat/cyber-threat.d.ts +0 -0
- package/dist/blocks/dashboard-layout/dashboard-layout.d.ts +0 -0
- package/dist/blocks/data-eng-dag/data-eng-dag.d.ts +0 -0
- package/dist/blocks/date-picker/date-picker.d.ts +0 -0
- package/dist/blocks/ddx-workflow/ddx-workflow.d.ts +0 -0
- package/dist/blocks/empty-state/empty-state.d.ts +0 -0
- package/dist/blocks/env-variables/env-variables.d.ts +0 -0
- package/dist/blocks/feature-upgrade/feature-upgrade.d.ts +0 -0
- package/dist/blocks/financial-risk/financial-risk.d.ts +0 -0
- package/dist/blocks/flow-editor/flow-editor.d.ts +0 -0
- package/dist/blocks/gen-ai-pipeline/gen-ai-pipeline.d.ts +0 -0
- package/dist/blocks/index.d.ts +0 -0
- package/dist/blocks/issue-assign/issue-assign.d.ts +0 -0
- package/dist/blocks/keyboard-shortcuts/keyboard-shortcuts.d.ts +0 -0
- package/dist/blocks/login-branded/login-branded.d.ts +0 -0
- package/dist/blocks/login-email-only/login-email-only.d.ts +0 -0
- package/dist/blocks/login-form/login-form.d.ts +0 -0
- package/dist/blocks/login-simple/login-simple.d.ts +0 -0
- package/dist/blocks/login-social/login-social.d.ts +0 -0
- package/dist/blocks/login-two-column/login-two-column.d.ts +0 -0
- package/dist/blocks/marketing-automation/marketing-automation.d.ts +0 -0
- package/dist/blocks/member-list/member-list.d.ts +0 -0
- package/dist/blocks/ml-pipeline/ml-pipeline.d.ts +0 -0
- package/dist/blocks/nav-card/nav-card.d.ts +0 -0
- package/dist/blocks/notification-list/notification-list.d.ts +0 -0
- package/dist/blocks/oncology-pathway/oncology-pathway.d.ts +0 -0
- package/dist/blocks/pricing-card/pricing-card.d.ts +0 -0
- package/dist/blocks/processing-state/processing-state.d.ts +0 -0
- package/dist/blocks/profile-card/profile-card.d.ts +0 -0
- package/dist/blocks/saas-onboarding/saas-onboarding.d.ts +0 -0
- package/dist/blocks/settings-form/settings-form.d.ts +0 -0
- package/dist/blocks/settings-panel/settings-panel.d.ts +0 -0
- package/dist/blocks/sidebar-nav/sidebar-nav.d.ts +0 -0
- package/dist/blocks/signup-form/signup-form.d.ts +0 -0
- package/dist/blocks/stat-cards/stat-cards.d.ts +0 -0
- package/dist/blocks/status-card/status-card.d.ts +0 -0
- package/dist/blocks/suggested-labs/suggested-labs.d.ts +0 -0
- package/dist/blocks/supply-chain/supply-chain.d.ts +0 -0
- package/dist/blocks/survey-card/survey-card.d.ts +0 -0
- package/dist/blocks/tabbed-panel/tabbed-panel.d.ts +0 -0
- package/dist/blocks/team-empty/team-empty.d.ts +0 -0
- package/dist/blocks/usage-billing/usage-billing.d.ts +0 -0
- package/dist/blocks-incoming/action-toolbar/action-toolbar.d.ts +0 -0
- package/dist/blocks-incoming/agent-artifact-card/agent-artifact-card.d.ts +0 -0
- package/dist/blocks-incoming/agent-chat-response/agent-chat-response.d.ts +0 -0
- package/dist/blocks-incoming/agent-code-result/agent-code-result.d.ts +0 -0
- package/dist/blocks-incoming/agent-context-panel/agent-context-panel.d.ts +0 -0
- package/dist/blocks-incoming/agent-feedback-controls/agent-feedback-controls.d.ts +0 -0
- package/dist/blocks-incoming/agent-follow-up-chips/agent-follow-up-chips.d.ts +0 -0
- package/dist/blocks-incoming/agent-model-selector/agent-model-selector.d.ts +0 -0
- package/dist/blocks-incoming/agent-prompt-input/agent-prompt-input.d.ts +0 -0
- package/dist/blocks-incoming/agent-streaming-message/agent-streaming-message.d.ts +0 -0
- package/dist/blocks-incoming/agent-suggestion-card/agent-suggestion-card.d.ts +0 -0
- package/dist/blocks-incoming/agent-task-card/agent-task-card.d.ts +0 -0
- package/dist/blocks-incoming/agent-thinking-state/agent-thinking-state.d.ts +0 -0
- package/dist/blocks-incoming/agent-tool-use-card/agent-tool-use-card.d.ts +0 -0
- package/dist/blocks-incoming/auth-card/auth-card.d.ts +0 -0
- package/dist/blocks-incoming/commerce-pricing-table/commerce-pricing-table.d.ts +0 -0
- package/dist/blocks-incoming/comms-chat-thread/comms-chat-thread.d.ts +0 -0
- package/dist/blocks-incoming/comms-notification-list/comms-notification-list.d.ts +0 -0
- package/dist/blocks-incoming/content-article-card/content-article-card.d.ts +0 -0
- package/dist/blocks-incoming/dashboard-kpi-grid/dashboard-kpi-grid.d.ts +0 -0
- package/dist/blocks-incoming/data-activity-log/data-activity-log.d.ts +0 -0
- package/dist/blocks-incoming/data-metric-card/data-metric-card.d.ts +0 -0
- package/dist/blocks-incoming/data-table/data-table.d.ts +0 -0
- package/dist/blocks-incoming/data-timeline/data-timeline.d.ts +0 -0
- package/dist/blocks-incoming/feedback-alert-banner/feedback-alert-banner.d.ts +0 -0
- package/dist/blocks-incoming/feedback-empty-state/feedback-empty-state.d.ts +0 -0
- package/dist/blocks-incoming/feedback-progress-stepper/feedback-progress-stepper.d.ts +0 -0
- package/dist/blocks-incoming/form-settings-section/form-settings-section.d.ts +0 -0
- package/dist/blocks-incoming/game-battleship/game-battleship.d.ts +0 -0
- package/dist/blocks-incoming/game-chess/game-chess.d.ts +0 -0
- package/dist/blocks-incoming/game-connect-four/game-connect-four.d.ts +0 -0
- package/dist/blocks-incoming/game-tic-tac-toe/game-tic-tac-toe.d.ts +0 -0
- package/dist/blocks-incoming/list-kanban-board/list-kanban-board.d.ts +0 -0
- package/dist/blocks-incoming/media-image-gallery/media-image-gallery.d.ts +0 -0
- package/dist/blocks-incoming/nav-sidebar/nav-sidebar.d.ts +0 -0
- package/dist/blocks-incoming/onboard-stepper/onboard-stepper.d.ts +0 -0
- package/dist/blocks-incoming/overlay-confirmation-modal/overlay-confirmation-modal.d.ts +0 -0
- package/dist/blocks-incoming/overlay-dropdown-menu/overlay-dropdown-menu.d.ts +0 -0
- package/dist/blocks-incoming/user-profile-card/user-profile-card.d.ts +0 -0
- package/dist/blocks-incoming/user-team-list/user-team-list.d.ts +0 -0
- package/dist/chunks/{agent-ciCayeod.js → agent-BF_R_HJk.js} +68 -64
- package/dist/chunks/{agent-ciCayeod.js.map → agent-BF_R_HJk.js.map} +1 -1
- package/dist/chunks/meter-Dju8ik6C.js +5395 -0
- package/dist/chunks/meter-Dju8ik6C.js.map +1 -0
- package/dist/components/accordion/accordion-item.d.ts +9 -0
- package/dist/components/accordion/accordion.d.ts +9 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/agent/agent-activity.d.ts +13 -0
- package/dist/components/agent/agent-feed.d.ts +13 -0
- package/dist/components/agent/agent-input.d.ts +18 -0
- package/dist/components/agent/agent-message.d.ts +22 -0
- package/dist/components/agent/agent-panel.d.ts +16 -0
- package/dist/components/agent/agent-prompt.d.ts +7 -0
- package/dist/components/agent/agent-seeds.d.ts +15 -0
- package/dist/components/agent/agent-text.d.ts +14 -0
- package/dist/components/agent/agent-thread.d.ts +11 -0
- package/dist/components/agent/index.d.ts +9 -0
- package/dist/components/agent.js +6 -6
- package/dist/components/alert/alert.d.ts +3 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/app-shell/app-shell.d.ts +4 -0
- package/dist/components/app-shell/index.d.ts +1 -0
- package/dist/components/avatar/avatar.d.ts +0 -0
- package/dist/components/avatar-group/avatar-group.d.ts +10 -0
- package/dist/components/avatar-group/index.d.ts +1 -0
- package/dist/components/badge/badge.d.ts +0 -0
- package/dist/components/bar/bar.d.ts +0 -0
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +8 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +9 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/button/button.d.ts +17 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button-group/button-group.d.ts +0 -0
- package/dist/components/calendar/calendar.d.ts +26 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/store/calendar-store.d.ts +60 -0
- package/dist/components/calendar-picker/calendar-picker.d.ts +14 -0
- package/dist/components/calendar-picker/index.d.ts +1 -0
- package/dist/components/calendar-range-picker/calendar-range-picker.d.ts +14 -0
- package/dist/components/calendar-range-picker/index.d.ts +1 -0
- package/dist/components/canvas/canvas.d.ts +19 -0
- package/dist/components/canvas/index.d.ts +1 -0
- package/dist/components/carousel/carousel.d.ts +13 -0
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +18 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/chip/chip.d.ts +8 -0
- package/dist/components/chip/index.d.ts +1 -0
- package/dist/components/code/code.d.ts +0 -0
- package/dist/components/code-block/code-block.d.ts +10 -0
- package/dist/components/code-block/index.d.ts +1 -0
- package/dist/components/color-area/color-area.d.ts +12 -0
- package/dist/components/color-area/index.d.ts +1 -0
- package/dist/components/color-field/color-field.d.ts +10 -0
- package/dist/components/color-field/index.d.ts +1 -0
- package/dist/components/color-picker/color-picker.d.ts +11 -0
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/color-picker/oklch-utils.d.ts +18 -0
- package/dist/components/color-slider/color-slider.d.ts +15 -0
- package/dist/components/color-slider/index.d.ts +1 -0
- package/dist/components/color-swatch/color-swatch.d.ts +0 -0
- package/dist/components/command/command-empty.d.ts +4 -0
- package/dist/components/command/command-group.d.ts +6 -0
- package/dist/components/command/command-input.d.ts +12 -0
- package/dist/components/command/command-item.d.ts +10 -0
- package/dist/components/command/command-list.d.ts +4 -0
- package/dist/components/command/command.d.ts +6 -0
- package/dist/components/command/index.d.ts +6 -0
- package/dist/components/container/container.d.ts +11 -0
- package/dist/components/container/index.d.ts +1 -0
- package/dist/components/content/content.d.ts +0 -0
- package/dist/components/context-menu/context-menu.d.ts +12 -0
- package/dist/components/context-menu/index.d.ts +1 -0
- package/dist/components/copy-button/copy-button.d.ts +10 -0
- package/dist/components/copy-button/index.d.ts +1 -0
- package/dist/components/date-field/date-field.d.ts +13 -0
- package/dist/components/date-field/index.d.ts +1 -0
- package/dist/components/description-list/description-list.d.ts +0 -0
- package/dist/components/dialog/dialog.d.ts +12 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/disclosure/disclosure.d.ts +10 -0
- package/dist/components/disclosure/index.d.ts +1 -0
- package/dist/components/disclosure-group/disclosure-group.d.ts +8 -0
- package/dist/components/disclosure-group/index.d.ts +1 -0
- package/dist/components/divider/divider.d.ts +0 -0
- package/dist/components/drawer/drawer.d.ts +13 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +12 -0
- package/dist/components/dropdown-menu/index.d.ts +1 -0
- package/dist/components/editor/context.d.ts +15 -0
- package/dist/components/editor/editor-layer.d.ts +11 -0
- package/dist/components/editor/editor.d.ts +32 -0
- package/dist/components/editor/index.d.ts +4 -0
- package/dist/components/editor.js +1 -1
- package/dist/components/empty-state/empty-state.d.ts +10 -0
- package/dist/components/empty-state/index.d.ts +1 -0
- package/dist/components/feed/feed.d.ts +11 -0
- package/dist/components/feed/index.d.ts +1 -0
- package/dist/components/field/index.d.ts +0 -0
- package/dist/components/fieldset/fieldset.d.ts +0 -0
- package/dist/components/file-upload/file-upload.d.ts +13 -0
- package/dist/components/file-upload/index.d.ts +1 -0
- package/dist/components/footer/footer.d.ts +0 -0
- package/dist/components/graph/graph-layer.d.ts +3 -0
- package/dist/components/graph/graph-node.d.ts +13 -0
- package/dist/components/graph/graph-noodle.d.ts +19 -0
- package/dist/components/graph/graph-port.d.ts +17 -0
- package/dist/components/graph/graph-ui.d.ts +10 -0
- package/dist/components/graph/index.d.ts +5 -0
- package/dist/components/graph.js +1 -1
- package/dist/components/grid/grid.d.ts +0 -0
- package/dist/components/gripper/gripper.d.ts +9 -0
- package/dist/components/gripper/index.d.ts +1 -0
- package/dist/components/header/header.d.ts +0 -0
- package/dist/components/heading/heading.d.ts +0 -0
- package/dist/components/hover-card/hover-card.d.ts +11 -0
- package/dist/components/hover-card/index.d.ts +1 -0
- package/dist/components/icon/icon.d.ts +12 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/registry.d.ts +8 -0
- package/dist/components/image/image.d.ts +13 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/index.d.ts +72 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input-otp.d.ts +17 -0
- package/dist/components/input/input.d.ts +29 -0
- package/dist/components/input-group/input-group.d.ts +0 -0
- package/dist/components/inset/inset.d.ts +0 -0
- package/dist/components/kbd/kbd.d.ts +0 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/link.d.ts +3 -0
- package/dist/components/meter/index.d.ts +1 -0
- package/dist/components/meter/meter.d.ts +8 -0
- package/dist/components/nav-item/index.d.ts +1 -0
- package/dist/components/nav-item/nav-item.d.ts +3 -0
- package/dist/components/noodles/datasets.d.ts +16 -0
- package/dist/components/noodles/index.d.ts +3 -0
- package/dist/components/noodles/noodle-controller.d.ts +71 -0
- package/dist/components/noodles/noodles.d.ts +30 -0
- package/dist/components/notification-center/index.d.ts +2 -0
- package/dist/components/notification-center/notification-center.d.ts +27 -0
- package/dist/components/optgroup/index.d.ts +1 -0
- package/dist/components/optgroup/optgroup.d.ts +9 -0
- package/dist/components/option/index.d.ts +1 -0
- package/dist/components/option/option.d.ts +11 -0
- package/dist/components/page/index.d.ts +3 -0
- package/dist/components/page/page-context.d.ts +4 -0
- package/dist/components/page/page-main.d.ts +3 -0
- package/dist/components/page/page.d.ts +4 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +10 -0
- package/dist/components/pane/index.d.ts +2 -0
- package/dist/components/pane/pane.d.ts +27 -0
- package/dist/components/pane/panes.d.ts +10 -0
- package/dist/components/preview-app/index.d.ts +1 -0
- package/dist/components/preview-app/preview-app.d.ts +8 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/progress.d.ts +6 -0
- package/dist/components/progress-circle/index.d.ts +1 -0
- package/dist/components/progress-circle/progress-circle.d.ts +9 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio-group.d.ts +10 -0
- package/dist/components/radio/radio.d.ts +17 -0
- package/dist/components/range/index.d.ts +1 -0
- package/dist/components/range/range.d.ts +18 -0
- package/dist/components/root/index.d.ts +1 -0
- package/dist/components/root/root.d.ts +4 -0
- package/dist/components/segmented-control/index.d.ts +2 -0
- package/dist/components/segmented-control/segment.d.ts +8 -0
- package/dist/components/segmented-control/segmented-control.d.ts +13 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/select.d.ts +37 -0
- package/dist/components/sidebar/index.d.ts +4 -0
- package/dist/components/sidebar/sidebar-content.d.ts +4 -0
- package/dist/components/sidebar/sidebar-footer.d.ts +4 -0
- package/dist/components/sidebar/sidebar-header.d.ts +4 -0
- package/dist/components/sidebar/sidebar.d.ts +14 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/skeleton.d.ts +3 -0
- package/dist/components/sparkline/index.d.ts +1 -0
- package/dist/components/sparkline/sparkline.d.ts +8 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/spinner.d.ts +3 -0
- package/dist/components/stack/stack.d.ts +0 -0
- package/dist/components/stat/index.d.ts +1 -0
- package/dist/components/stat/stat.d.ts +15 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/step.d.ts +3 -0
- package/dist/components/stepper/stepper.d.ts +3 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/switch.d.ts +16 -0
- package/dist/components/tab/index.d.ts +3 -0
- package/dist/components/tab/tab-panel.d.ts +7 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tabs.d.ts +9 -0
- package/dist/components/table/index.d.ts +7 -0
- package/dist/components/table/table-body.d.ts +3 -0
- package/dist/components/table/table-cell.d.ts +3 -0
- package/dist/components/table/table-column.d.ts +11 -0
- package/dist/components/table/table-head.d.ts +3 -0
- package/dist/components/table/table-header.d.ts +3 -0
- package/dist/components/table/table-row.d.ts +3 -0
- package/dist/components/table/table.d.ts +16 -0
- package/dist/components/tag-group/index.d.ts +1 -0
- package/dist/components/tag-group/tag-group.d.ts +10 -0
- package/dist/components/text/text.d.ts +0 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/textarea.d.ts +23 -0
- package/dist/components/time-field/index.d.ts +1 -0
- package/dist/components/time-field/time-field.d.ts +15 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +19 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +9 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/tree-item.d.ts +11 -0
- package/dist/components/tree/tree.d.ts +6 -0
- package/dist/components/wrap/wrap.d.ts +0 -0
- package/dist/components.js +117 -3127
- package/dist/components.js.map +1 -1
- package/dist/docs/blocks/chart-interactive.yaml +4 -10
- package/dist/docs/blocks/checkout-form.yaml +13 -13
- package/dist/docs/blocks/contributors.yaml +25 -26
- package/dist/docs/blocks/dashboard-layout.yaml +24 -42
- package/dist/docs/blocks/empty-state.yaml +4 -9
- package/dist/docs/blocks/env-variables.yaml +2 -2
- package/dist/docs/blocks/feature-upgrade.yaml +4 -4
- package/dist/docs/blocks/issue-assign.yaml +7 -7
- package/dist/docs/blocks/login-two-column.yaml +6 -6
- package/dist/docs/blocks/profile-card.yaml +12 -21
- package/dist/docs/blocks/settings-form.yaml +4 -4
- package/dist/docs/blocks/sidebar-nav.yaml +19 -19
- package/dist/docs/blocks/stat-cards.yaml +9 -26
- package/dist/docs/blocks/status-card.yaml +3 -3
- package/dist/docs/blocks/suggested-labs.yaml +4 -4
- package/dist/docs/blocks/survey-card.yaml +9 -9
- package/dist/docs/blocks/tabbed-panel.yaml +1 -1
- package/dist/docs/blocks/team-empty.yaml +6 -14
- package/dist/docs/blocks/usage-billing.yaml +12 -37
- package/dist/docs/components/accordion-item.yaml +13 -21
- package/dist/docs/components/accordion.yaml +23 -29
- package/dist/docs/components/agent-activity.yaml +27 -39
- package/dist/docs/components/agent-feed.yaml +15 -22
- package/dist/docs/components/agent-input.yaml +238 -0
- package/dist/docs/components/agent-message.yaml +29 -48
- package/dist/docs/components/agent-panel.yaml +21 -24
- package/dist/docs/components/agent-prompt.yaml +28 -46
- package/dist/docs/components/agent-seeds.yaml +15 -23
- package/dist/docs/components/agent-text.yaml +14 -24
- package/dist/docs/components/agent-thread.yaml +15 -24
- package/dist/docs/components/alert.yaml +81 -0
- package/dist/docs/components/avatar-group.yaml +113 -0
- package/dist/docs/components/avatar.yaml +99 -0
- package/dist/docs/components/badge.yaml +110 -0
- package/dist/docs/components/bar.yaml +84 -0
- package/dist/docs/components/breadcrumb-item.yaml +8 -17
- package/dist/docs/components/breadcrumb.yaml +60 -25
- package/dist/docs/components/button-group.yaml +93 -0
- package/dist/docs/components/button.yaml +177 -261
- package/dist/docs/components/calendar-picker.yaml +122 -0
- package/dist/docs/components/calendar-range-picker.yaml +121 -0
- package/dist/docs/components/calendar.yaml +11 -29
- package/dist/docs/components/canvas.yaml +44 -61
- package/dist/docs/components/checkbox.yaml +37 -49
- package/dist/docs/components/chip.yaml +125 -0
- package/dist/docs/components/code-block.yaml +127 -0
- package/dist/docs/components/code.yaml +37 -0
- package/dist/docs/components/color-area.yaml +119 -0
- package/dist/docs/components/color-field.yaml +121 -0
- package/dist/docs/components/color-picker.yaml +104 -0
- package/dist/docs/components/color-slider.yaml +153 -0
- package/dist/docs/components/color-swatch.yaml +98 -0
- package/dist/docs/components/command.yaml +13 -18
- package/dist/docs/components/container.yaml +83 -73
- package/dist/docs/components/content.yaml +100 -0
- package/dist/docs/components/context-menu.yaml +93 -0
- package/dist/docs/components/date-field.yaml +163 -0
- package/dist/docs/components/description-list.yaml +81 -0
- package/dist/docs/components/disclosure-group.yaml +88 -0
- package/dist/docs/components/disclosure.yaml +95 -0
- package/dist/docs/components/divider.yaml +63 -0
- package/dist/docs/components/dropdown-menu.yaml +137 -0
- package/dist/docs/components/feed.yaml +15 -24
- package/dist/docs/components/field.yaml +50 -71
- package/dist/docs/components/fieldset.yaml +92 -0
- package/dist/docs/components/footer.yaml +147 -0
- package/dist/docs/components/grid.yaml +87 -0
- package/dist/docs/components/gripper.yaml +11 -23
- package/dist/docs/components/header.yaml +168 -0
- package/dist/docs/components/heading.yaml +54 -0
- package/dist/docs/components/hover-card.yaml +77 -0
- package/dist/docs/components/icon.yaml +32 -65
- package/dist/docs/components/index.yaml +168 -0
- package/dist/docs/components/input-group.yaml +102 -0
- package/dist/docs/components/input-otp.yaml +20 -19
- package/dist/docs/components/input.yaml +103 -118
- package/dist/docs/components/inset.yaml +59 -0
- package/dist/docs/components/kbd.yaml +57 -0
- package/dist/docs/components/link.yaml +76 -0
- package/dist/docs/components/meter.yaml +78 -0
- package/dist/docs/components/nav-item.yaml +104 -0
- package/dist/docs/components/noodles.yaml +72 -104
- package/dist/docs/components/option.yaml +12 -23
- package/dist/docs/components/pagination.yaml +21 -18
- package/dist/docs/components/pane.yaml +18 -32
- package/dist/docs/components/panes.yaml +19 -27
- package/dist/docs/components/progress-circle.yaml +114 -0
- package/dist/docs/components/progress.yaml +88 -0
- package/dist/docs/components/radio-group.yaml +99 -40
- package/dist/docs/components/radio.yaml +40 -41
- package/dist/docs/components/range.yaml +24 -27
- package/dist/docs/components/segmented-control.yaml +58 -17
- package/dist/docs/components/select.yaml +80 -100
- package/dist/docs/components/skeleton.yaml +81 -0
- package/dist/docs/components/sparkline.yaml +71 -0
- package/dist/docs/components/spinner.yaml +74 -0
- package/dist/docs/components/stack.yaml +126 -0
- package/dist/docs/components/step.yaml +91 -0
- package/dist/docs/components/stepper.yaml +84 -0
- package/dist/docs/components/switch.yaml +36 -47
- package/dist/docs/components/tab-panel.yaml +27 -18
- package/dist/docs/components/tab.yaml +25 -22
- package/dist/docs/components/table-header.yaml +22 -12
- package/dist/docs/components/tabs.yaml +103 -20
- package/dist/docs/components/tag-group.yaml +106 -0
- package/dist/docs/components/text.yaml +67 -0
- package/dist/docs/components/textarea.yaml +43 -60
- package/dist/docs/components/time-field.yaml +161 -0
- package/dist/docs/components/toast.yaml +13 -30
- package/dist/docs/components/tooltip.yaml +56 -49
- package/dist/docs/components/tree-item.yaml +9 -10
- package/dist/docs/components/tree.yaml +127 -10
- package/dist/docs/components/wrap.yaml +60 -0
- package/dist/docs/traits/toggle-theme.yaml +34 -0
- package/dist/element/agent-element.d.ts +29 -0
- package/dist/element/context.d.ts +20 -0
- package/dist/element/define.d.ts +2 -0
- package/dist/element/index.d.ts +4 -0
- package/dist/element/types.d.ts +23 -0
- package/dist/element.js +1 -1
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +85 -59
- package/dist/icons.js.map +1 -1
- package/dist/reactivity.js +2 -2
- package/dist/register.d.ts +0 -0
- package/dist/register.js +417 -376
- package/dist/register.js.map +1 -1
- package/dist/store.js +1 -1
- package/dist/styles-entry.d.ts +0 -0
- package/dist/traits/attach.d.ts +12 -0
- package/dist/traits/auto-dismiss/auto-dismiss.d.ts +0 -0
- package/dist/traits/auto-dismiss/auto-dismiss.trait.d.ts +2 -0
- package/dist/traits/backtick-wrap/backtick-wrap.d.ts +0 -0
- package/dist/traits/backtick-wrap/backtick-wrap.trait.d.ts +2 -0
- package/dist/traits/clipboard/clipboard.d.ts +0 -0
- package/dist/traits/clipboard/clipboard.trait.d.ts +2 -0
- package/dist/traits/collapsible/collapsible.d.ts +0 -0
- package/dist/traits/collapsible/collapsible.trait.d.ts +2 -0
- package/dist/traits/confetti/confetti.d.ts +0 -0
- package/dist/traits/confetti/confetti.trait.d.ts +2 -0
- package/dist/traits/copy/copy.d.ts +0 -0
- package/dist/traits/copy/copy.trait.d.ts +2 -0
- package/dist/traits/css-inspect/css-inspect-controller.d.ts +38 -0
- package/dist/traits/css-inspect/css-inspect.d.ts +0 -0
- package/dist/traits/css-inspect/css-inspect.trait.d.ts +2 -0
- package/dist/traits/dismiss/dismiss.d.ts +0 -0
- package/dist/traits/dismiss/dismiss.trait.d.ts +2 -0
- package/dist/traits/drag/drag.d.ts +0 -0
- package/dist/traits/drag/drag.trait.d.ts +2 -0
- package/dist/traits/drop-zone/drop-zone.d.ts +0 -0
- package/dist/traits/drop-zone/drop-zone.trait.d.ts +2 -0
- package/dist/traits/edit/edit.d.ts +0 -0
- package/dist/traits/edit/edit.trait.d.ts +2 -0
- package/dist/traits/flip/flip.d.ts +0 -0
- package/dist/traits/flip/flip.trait.d.ts +2 -0
- package/dist/traits/gateway/gateway.d.ts +0 -0
- package/dist/traits/gateway/gateway.trait.d.ts +2 -0
- package/dist/traits/hover/hover.d.ts +0 -0
- package/dist/traits/hover/hover.trait.d.ts +2 -0
- package/dist/traits/index.d.ts +6 -0
- package/dist/traits/intersect/intersect.d.ts +0 -0
- package/dist/traits/intersect/intersect.trait.d.ts +2 -0
- package/dist/traits/link-paste/link-paste.d.ts +0 -0
- package/dist/traits/link-paste/link-paste.trait.d.ts +2 -0
- package/dist/traits/linked-scroll/linked-scroll.d.ts +0 -0
- package/dist/traits/linked-scroll/linked-scroll.trait.d.ts +2 -0
- package/dist/traits/list-navigate/list-navigate.d.ts +0 -0
- package/dist/traits/list-navigate/list-navigate.trait.d.ts +2 -0
- package/dist/traits/magnet/magnet.d.ts +0 -0
- package/dist/traits/magnet/magnet.trait.d.ts +2 -0
- package/dist/traits/mention/mention.d.ts +0 -0
- package/dist/traits/mention/mention.trait.d.ts +2 -0
- package/dist/traits/modal/modal.d.ts +0 -0
- package/dist/traits/modal/modal.trait.d.ts +2 -0
- package/dist/traits/noodle/noodle.d.ts +0 -0
- package/dist/traits/noodle/noodle.trait.d.ts +2 -0
- package/dist/traits/overlay/overlay.d.ts +0 -0
- package/dist/traits/overlay/overlay.trait.d.ts +3 -0
- package/dist/traits/pan-zoom/pan-zoom.d.ts +0 -0
- package/dist/traits/pan-zoom/pan-zoom.trait.d.ts +2 -0
- package/dist/traits/parallax/parallax.d.ts +0 -0
- package/dist/traits/parallax/parallax.trait.d.ts +2 -0
- package/dist/traits/parse.d.ts +3 -0
- package/dist/traits/persist/persist.d.ts +0 -0
- package/dist/traits/persist/persist.trait.d.ts +2 -0
- package/dist/traits/popover/overlay.d.ts +2 -0
- package/dist/traits/popover/popover.d.ts +0 -0
- package/dist/traits/popover/popover.trait.d.ts +2 -0
- package/dist/traits/present/present.d.ts +0 -0
- package/dist/traits/present/present.trait.d.ts +2 -0
- package/dist/traits/press-hold/press-hold.d.ts +0 -0
- package/dist/traits/press-hold/press-hold.trait.d.ts +2 -0
- package/dist/traits/range-select/range-select.d.ts +0 -0
- package/dist/traits/range-select/range-select.trait.d.ts +2 -0
- package/dist/traits/registry.d.ts +17 -0
- package/dist/traits/resize/resize.d.ts +0 -0
- package/dist/traits/resize/resize.trait.d.ts +2 -0
- package/dist/traits/ripple/ripple.d.ts +0 -0
- package/dist/traits/ripple/ripple.trait.d.ts +2 -0
- package/dist/traits/roving-focus/roving-focus.d.ts +0 -0
- package/dist/traits/roving-focus/roving-focus.trait.d.ts +2 -0
- package/dist/traits/search/search.d.ts +0 -0
- package/dist/traits/search/search.trait.d.ts +2 -0
- package/dist/traits/selection/selection.d.ts +0 -0
- package/dist/traits/selection/selection.trait.d.ts +2 -0
- package/dist/traits/shortcut/shortcut.d.ts +0 -0
- package/dist/traits/shortcut/shortcut.trait.d.ts +2 -0
- package/dist/traits/slash-command/slash-command.d.ts +0 -0
- package/dist/traits/slash-command/slash-command.trait.d.ts +2 -0
- package/dist/traits/snap-resize/snap-resize.d.ts +0 -0
- package/dist/traits/snap-resize/snap-resize.trait.d.ts +2 -0
- package/dist/traits/sort/sort.d.ts +0 -0
- package/dist/traits/sort/sort.trait.d.ts +2 -0
- package/dist/traits/store/store.d.ts +0 -0
- package/dist/traits/store/store.trait.d.ts +2 -0
- package/dist/traits/swipe/swipe.d.ts +0 -0
- package/dist/traits/swipe/swipe.trait.d.ts +2 -0
- package/dist/traits/text-trigger/text-trigger.d.ts +0 -0
- package/dist/traits/text-trigger/text-trigger.trait.d.ts +2 -0
- package/dist/traits/toast/toast.d.ts +0 -0
- package/dist/traits/toast/toast.trait.d.ts +2 -0
- package/dist/traits/toggle-scheme/toggle-scheme.d.ts +0 -0
- package/dist/traits/toggle-scheme/toggle-scheme.trait.d.ts +2 -0
- package/dist/traits/toggle-state/toggle-state.d.ts +0 -0
- package/dist/traits/toggle-state/toggle-state.trait.d.ts +2 -0
- package/dist/traits/toggle-theme/toggle-theme.d.ts +0 -0
- package/dist/traits/toggle-theme/toggle-theme.trait.d.ts +2 -0
- package/dist/traits/tooltip/tooltip.d.ts +0 -0
- package/dist/traits/tooltip/tooltip.trait.d.ts +2 -0
- package/dist/traits/toss/toss.d.ts +0 -0
- package/dist/traits/toss/toss.trait.d.ts +2 -0
- package/dist/traits/trap-focus/trap-focus.d.ts +0 -0
- package/dist/traits/trap-focus/trap-focus.trait.d.ts +2 -0
- package/dist/traits/types.d.ts +45 -0
- package/dist/traits/validate/validate.d.ts +0 -0
- package/dist/traits/validate/validate.trait.d.ts +2 -0
- package/dist/traits/virtual-scroll/virtual-scroll.d.ts +0 -0
- package/dist/traits/virtual-scroll/virtual-scroll.trait.d.ts +2 -0
- package/dist/traits.js +553 -510
- package/dist/traits.js.map +1 -1
- package/package.json +52 -13
package/dist/traits.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { parseStoreAttr as
|
|
4
|
-
const
|
|
1
|
+
import { l as se, t as T } from "./chunks/agent-BF_R_HJk.js";
|
|
2
|
+
import { o as Zt, w as Gt, x as Jt, y as jt, q as Qt, v as xt } from "./chunks/agent-BF_R_HJk.js";
|
|
3
|
+
import { parseStoreAttr as me, parseOptionsAttr as ve, createListStore as de, isGrouped as Ce } from "./store.js";
|
|
4
|
+
const Pe = {
|
|
5
5
|
name: "drag",
|
|
6
6
|
category: "gesture",
|
|
7
7
|
channel: "pointer",
|
|
@@ -14,57 +14,57 @@ const Te = {
|
|
|
14
14
|
animate: "true"
|
|
15
15
|
},
|
|
16
16
|
attach(e) {
|
|
17
|
-
const t = e.config("selector") ?? "", s = e.config("drop-zone-selector") ?? "", n = e.config("zone-selector") ?? "", r = e.config("axis") ?? "both", o = e.config("mode") ?? "drop", a = e.config("animate") !== "false",
|
|
17
|
+
const t = e.config("selector") ?? "", s = e.config("drop-zone-selector") ?? "", n = e.config("zone-selector") ?? "", r = e.config("axis") ?? "both", o = e.config("mode") ?? "drop", a = e.config("animate") !== "false", d = e.config("ignore") ?? "aui-button, aui-select, aui-textarea, aui-input, aui-segment, aui-radio, aui-checkbox, aui-switch, aui-tab, aui-option, aui-range, aui-calendar, [data-resize-handle], [contenteditable]", f = e.config("modifier");
|
|
18
18
|
if (!t || o === "free") {
|
|
19
|
-
let w = !1, m = 0, y = 0, S = 0,
|
|
19
|
+
let w = !1, m = 0, y = 0, S = 0, I = 0;
|
|
20
20
|
getComputedStyle(e.host).position === "static" && (e.host.style.position = "relative");
|
|
21
|
-
const
|
|
22
|
-
if (D.button !== 0 ||
|
|
21
|
+
const B = (D) => {
|
|
22
|
+
if (D.button !== 0 || d && D.target.closest(d) || f === "alt" && !D.altKey || f === "meta" && !D.metaKey || f === "ctrl" && !D.ctrlKey || f === "shift" && !D.shiftKey) return;
|
|
23
23
|
w = !0, m = D.clientX, y = D.clientY;
|
|
24
|
-
const
|
|
25
|
-
S =
|
|
24
|
+
const q = e.host.style.transform.match(/translate\((-?[\d.]+)px,\s*(-?[\d.]+)px\)/);
|
|
25
|
+
S = q ? parseFloat(q[1]) : 0, I = q ? parseFloat(q[2]) : 0, e.host.setPointerCapture(D.pointerId), e.host.style.cursor = "grabbing", e.host.style.zIndex = "10", e.expose("dragging", !0), e.emit("drag-start", { item: e.host });
|
|
26
26
|
}, V = (D) => {
|
|
27
27
|
if (!w) return;
|
|
28
|
-
const J = r === "vertical" ? 0 : D.clientX - m,
|
|
29
|
-
e.host.style.transform = `translate(${S + J}px, ${
|
|
28
|
+
const J = r === "vertical" ? 0 : D.clientX - m, q = r === "horizontal" ? 0 : D.clientY - y;
|
|
29
|
+
e.host.style.transform = `translate(${S + J}px, ${I + q}px)`, e.emit("drag-move", { item: e.host, x: D.clientX, y: D.clientY });
|
|
30
30
|
}, G = () => {
|
|
31
31
|
w && (w = !1, e.host.style.cursor = "", e.host.style.zIndex = "", e.unexpose("dragging"), e.emit("drag-end", { item: e.host }));
|
|
32
32
|
};
|
|
33
|
-
return e.host.addEventListener("pointerdown",
|
|
34
|
-
w && G(), e.host.removeEventListener("pointerdown",
|
|
33
|
+
return e.host.addEventListener("pointerdown", B), e.host.addEventListener("pointermove", V), e.host.addEventListener("pointerup", G), () => {
|
|
34
|
+
w && G(), e.host.removeEventListener("pointerdown", B), e.host.removeEventListener("pointermove", V), e.host.removeEventListener("pointerup", G);
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
let i = null, l = null, c = null,
|
|
37
|
+
let i = null, l = null, c = null, h = 0, u = 0, p = 0, g = 0, v = -1, P = -1, M = null, k = null, b = null, O = null, E = -1, _ = -1;
|
|
38
38
|
const U = () => [...e.host.querySelectorAll(t)].filter((w) => !w.hasAttribute("popover")), j = () => s ? [...e.host.querySelectorAll(s)].filter((w) => !w.hasAttribute("popover")) : U(), Q = () => n ? [...e.host.querySelectorAll(n)] : [], H = (w) => [...w.querySelectorAll(t)].filter((m) => !m.hasAttribute("popover")), L = (w, m) => {
|
|
39
39
|
let y = null, S = 1 / 0;
|
|
40
|
-
for (const
|
|
41
|
-
const z =
|
|
42
|
-
G < S && (S = G, y =
|
|
40
|
+
for (const I of Q()) {
|
|
41
|
+
const z = I.getBoundingClientRect(), B = z.left + z.width / 2, V = z.top + z.height / 2, G = Math.hypot(w - B, m - V);
|
|
42
|
+
G < S && (S = G, y = I);
|
|
43
43
|
}
|
|
44
44
|
return y;
|
|
45
45
|
}, A = (w, m, y) => {
|
|
46
46
|
if (w.length === 0) return 0;
|
|
47
|
-
let S = 0,
|
|
47
|
+
let S = 0, I = 1 / 0;
|
|
48
48
|
for (let D = 0; D < w.length; D++) {
|
|
49
|
-
const J = w[D].getBoundingClientRect(),
|
|
50
|
-
re <
|
|
49
|
+
const J = w[D].getBoundingClientRect(), q = J.left + J.width / 2, te = J.top + J.height / 2, re = Math.hypot(m - q, y - te);
|
|
50
|
+
re < I && (I = re, S = D);
|
|
51
51
|
}
|
|
52
52
|
let z = r === "horizontal" ? "h" : "v";
|
|
53
53
|
if (w.length >= 2) {
|
|
54
|
-
const D = w[0].getBoundingClientRect(), J = w[1].getBoundingClientRect(),
|
|
55
|
-
z =
|
|
54
|
+
const D = w[0].getBoundingClientRect(), J = w[1].getBoundingClientRect(), q = Math.abs(J.left + J.width / 2 - D.left - D.width / 2), te = Math.abs(J.top + J.height / 2 - D.top - D.height / 2);
|
|
55
|
+
z = q > te ? "h" : "v";
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const B = w[S].getBoundingClientRect(), V = z === "h" ? B.left + B.width / 2 : B.top + B.height / 2;
|
|
58
58
|
return (z === "h" ? m : y) > V ? S + 1 : S;
|
|
59
|
-
},
|
|
59
|
+
}, $ = (w) => {
|
|
60
60
|
if (!i) return;
|
|
61
61
|
const m = i.getBoundingClientRect(), y = i.cloneNode(!0);
|
|
62
|
-
y.setAttribute("popover", "manual"), y.setAttribute("aria-hidden", "true"), document.body.appendChild(y), y.showPopover(), y.style.position = "fixed", y.style.inset = "unset", y.style.left = `${m.left}px`, y.style.top = `${m.top}px`, y.style.width = `${m.width}px`, y.style.height = `${m.height}px`, y.style.margin = "0", y.style.pointerEvents = "none", y.style.opacity = "0.7", y.style.transform = "scale(0.85)", y.style.transformOrigin = "center center", y.style.border = "none", y.style.outline = "none", l = y,
|
|
62
|
+
y.setAttribute("popover", "manual"), y.setAttribute("aria-hidden", "true"), document.body.appendChild(y), y.showPopover(), y.style.position = "fixed", y.style.inset = "unset", y.style.left = `${m.left}px`, y.style.top = `${m.top}px`, y.style.width = `${m.width}px`, y.style.height = `${m.height}px`, y.style.margin = "0", y.style.pointerEvents = "none", y.style.opacity = "0.7", y.style.transform = "scale(0.85)", y.style.transformOrigin = "center center", y.style.border = "none", y.style.outline = "none", l = y, h = w.clientX, u = w.clientY;
|
|
63
63
|
}, Y = () => {
|
|
64
64
|
const w = U();
|
|
65
65
|
for (let m = 0; m < w.length; m++)
|
|
66
66
|
w[m].style.viewTransitionName = w[m] === i ? "none" : `drag-item-${m}`;
|
|
67
|
-
},
|
|
67
|
+
}, X = () => {
|
|
68
68
|
for (const w of U()) w.style.removeProperty("view-transition-name");
|
|
69
69
|
}, Z = () => {
|
|
70
70
|
if (o !== "preview" || !i || !b) return;
|
|
@@ -75,19 +75,19 @@ const Te = {
|
|
|
75
75
|
S(), Y();
|
|
76
76
|
}).finished.catch(() => {
|
|
77
77
|
}) : S();
|
|
78
|
-
},
|
|
78
|
+
}, F = (w) => {
|
|
79
79
|
for (const m of w)
|
|
80
80
|
m.removeAttribute("drag-slot-before"), m.removeAttribute("drag-slot-after");
|
|
81
81
|
}, C = (w, m, y) => {
|
|
82
82
|
if (m === -1 || m === P) return;
|
|
83
|
-
P = m,
|
|
84
|
-
const S = w.filter((
|
|
85
|
-
r !== "both" && (!c && i && (c = i.cloneNode(!0), c.setAttribute("data-drag-placeholder", ""), c.setAttribute("aria-hidden", "true"), c.removeAttribute("dragging"), c.style.display = "", c.style.opacity = "0.5", c.style.pointerEvents = "none", c.style.outline = "2px dashed var(--aui-accent, highlight)", c.style.outlineOffset = "-2px"), c && (
|
|
86
|
-
const z =
|
|
83
|
+
P = m, F(w);
|
|
84
|
+
const S = w.filter((B) => B !== i && B !== c), I = Math.min(m, S.length);
|
|
85
|
+
r !== "both" && (!c && i && (c = i.cloneNode(!0), c.setAttribute("data-drag-placeholder", ""), c.setAttribute("aria-hidden", "true"), c.removeAttribute("dragging"), c.style.display = "", c.style.opacity = "0.5", c.style.pointerEvents = "none", c.style.outline = "2px dashed var(--aui-accent, highlight)", c.style.outlineOffset = "-2px"), c && (I < S.length ? S[I].before(c) : S.length > 0 ? S[S.length - 1].after(c) : (y ?? e.host).appendChild(c))), I < S.length && S[I].setAttribute("drag-slot-before", ""), I > 0 && I - 1 < S.length && S[I - 1].setAttribute("drag-slot-after", "");
|
|
86
|
+
const z = I < S.length ? S[I] : null;
|
|
87
87
|
e.emit("drag-over", { item: i, index: m, insertBefore: z });
|
|
88
|
-
},
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
88
|
+
}, N = (w, m, y, S) => {
|
|
89
|
+
const I = w.filter((G) => G !== i);
|
|
90
|
+
if (I.length === 0) {
|
|
91
91
|
if (S && i && E !== 0) {
|
|
92
92
|
E = 0;
|
|
93
93
|
const G = () => S.appendChild(i);
|
|
@@ -98,21 +98,21 @@ const Te = {
|
|
|
98
98
|
}
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
let z = A(
|
|
101
|
+
let z = A(I, m, y);
|
|
102
102
|
if (z === E) return;
|
|
103
103
|
E = z;
|
|
104
|
-
const
|
|
105
|
-
|
|
104
|
+
const B = z < I.length ? I[z] : null, V = () => {
|
|
105
|
+
B ? B.before(i) : I[I.length - 1].after(i);
|
|
106
106
|
};
|
|
107
107
|
a && typeof document.startViewTransition == "function" ? document.startViewTransition(() => {
|
|
108
108
|
V(), Y();
|
|
109
109
|
}).finished.catch(() => {
|
|
110
|
-
}) : V(), e.emit("drag-over", { item: i, index: z, insertBefore:
|
|
110
|
+
}) : V(), e.emit("drag-over", { item: i, index: z, insertBefore: B });
|
|
111
111
|
}, R = (w, m, y) => {
|
|
112
112
|
for (const S of w)
|
|
113
113
|
S !== m && (S.removeAttribute("drag-over"), S.style.removeProperty("outline"), S.style.removeProperty("outline-offset"));
|
|
114
114
|
m && (m.setAttribute("drag-over", ""), m.style.outline = "2px solid var(--aui-focus, highlight)", m.style.outlineOffset = "2px", e.emit("drag-over", { item: i, target: m, index: y }));
|
|
115
|
-
},
|
|
115
|
+
}, K = () => {
|
|
116
116
|
if (l) {
|
|
117
117
|
if (l.isConnected) try {
|
|
118
118
|
l.hidePopover();
|
|
@@ -120,22 +120,22 @@ const Te = {
|
|
|
120
120
|
}
|
|
121
121
|
l.remove(), l = null;
|
|
122
122
|
}
|
|
123
|
-
i && (i.removeAttribute("dragging"), i.style.removeProperty("display")), o === "preview" && a &&
|
|
123
|
+
i && (i.removeAttribute("dragging"), i.style.removeProperty("display")), o === "preview" && a && X();
|
|
124
124
|
const w = j();
|
|
125
125
|
if (o === "slot")
|
|
126
|
-
|
|
126
|
+
F(w);
|
|
127
127
|
else
|
|
128
128
|
for (const m of w)
|
|
129
129
|
m.removeAttribute("drag-over"), m.style.removeProperty("outline"), m.style.removeProperty("outline-offset");
|
|
130
130
|
if (c && (c.remove(), c = null), n) for (const m of Q()) m.removeAttribute("drag-zone-active");
|
|
131
131
|
if (i && _ >= 0) {
|
|
132
|
-
i.removeEventListener("lostpointercapture",
|
|
132
|
+
i.removeEventListener("lostpointercapture", ae);
|
|
133
133
|
try {
|
|
134
134
|
i.releasePointerCapture(_);
|
|
135
135
|
} catch {
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
i = null, v = -1, P = -1, M = null, k = null, b = null, O = null, E = -1, _ = -1, document.removeEventListener("pointermove", ee), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel",
|
|
138
|
+
i = null, v = -1, P = -1, M = null, k = null, b = null, O = null, E = -1, _ = -1, document.removeEventListener("pointermove", ee), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel", le), document.removeEventListener("keydown", ce);
|
|
139
139
|
}, W = (w) => {
|
|
140
140
|
if (l) return;
|
|
141
141
|
const y = w.target.closest?.(t);
|
|
@@ -143,77 +143,77 @@ const Te = {
|
|
|
143
143
|
}, x = (w) => {
|
|
144
144
|
const y = w.target.closest?.(t);
|
|
145
145
|
!y || !e.host.contains(y) || (y.style.removeProperty("outline"), y.style.removeProperty("outline-offset"));
|
|
146
|
-
},
|
|
146
|
+
}, ne = (w) => {
|
|
147
147
|
const m = w;
|
|
148
148
|
if (m.button !== 0 || f === "alt" && !m.altKey || f === "meta" && !m.metaKey || f === "ctrl" && !m.ctrlKey || f === "shift" && !m.shiftKey) return;
|
|
149
149
|
const y = m.target.closest?.(t);
|
|
150
150
|
if (!y || !e.host.contains(y)) return;
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
m.preventDefault(), i = y, v =
|
|
151
|
+
const I = U().indexOf(y);
|
|
152
|
+
if (I === -1) return;
|
|
153
|
+
m.preventDefault(), i = y, v = I, h = m.clientX, u = m.clientY;
|
|
154
154
|
const z = y.getBoundingClientRect();
|
|
155
|
-
p = z.left + z.width / 2 - m.clientX, g = z.top + z.height / 2 - m.clientY, n && (M = y.closest(n)), document.addEventListener("pointermove", ee), document.addEventListener("pointerup", oe), document.addEventListener("pointercancel",
|
|
155
|
+
p = z.left + z.width / 2 - m.clientX, g = z.top + z.height / 2 - m.clientY, n && (M = y.closest(n)), document.addEventListener("pointermove", ee), document.addEventListener("pointerup", oe), document.addEventListener("pointercancel", le), document.addEventListener("keydown", ce);
|
|
156
156
|
try {
|
|
157
157
|
y.setPointerCapture(m.pointerId);
|
|
158
158
|
} catch {
|
|
159
159
|
}
|
|
160
|
-
_ = m.pointerId, y.addEventListener("lostpointercapture",
|
|
160
|
+
_ = m.pointerId, y.addEventListener("lostpointercapture", ae);
|
|
161
161
|
}, ee = (w) => {
|
|
162
162
|
if (!i) return;
|
|
163
163
|
const m = w;
|
|
164
164
|
if (!l) {
|
|
165
165
|
i.style.removeProperty("outline"), i.style.removeProperty("outline-offset");
|
|
166
166
|
try {
|
|
167
|
-
|
|
167
|
+
$(m);
|
|
168
168
|
} catch {
|
|
169
|
-
|
|
169
|
+
K();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
i.setAttribute("dragging", ""), o === "slot" && (i.style.display = "none"), o === "preview" && (b = i.parentElement, O = i.nextElementSibling, E = -1, a && Y()), e.emit("drag-start", { item: i, index: v });
|
|
173
173
|
}
|
|
174
|
-
const y = m.clientX -
|
|
174
|
+
const y = m.clientX - h, S = m.clientY - u;
|
|
175
175
|
l.style.transform = `translate(${y}px, ${S}px) scale(0.85)`, e.emit("drag-move", { item: i, x: m.clientX, y: m.clientY });
|
|
176
|
-
const
|
|
176
|
+
const I = j().filter((z) => z !== l);
|
|
177
177
|
if (o === "slot") {
|
|
178
|
-
const z = m.clientX + p,
|
|
178
|
+
const z = m.clientX + p, B = m.clientY + g;
|
|
179
179
|
let V, G;
|
|
180
180
|
if (n) {
|
|
181
|
-
const
|
|
182
|
-
if (!
|
|
183
|
-
|
|
181
|
+
const q = L(z, B);
|
|
182
|
+
if (!q) return;
|
|
183
|
+
q !== k && (k && (F(H(k)), k.removeAttribute("drag-zone-active")), q.setAttribute("drag-zone-active", ""), k = q, P = -1), V = H(q).filter((te) => te !== l), G = q;
|
|
184
184
|
} else
|
|
185
|
-
V =
|
|
186
|
-
const D = V.filter((
|
|
185
|
+
V = I;
|
|
186
|
+
const D = V.filter((q) => q !== i && q !== c), J = A(D, z, B);
|
|
187
187
|
C(V, J, G);
|
|
188
188
|
} else if (o === "preview") {
|
|
189
|
-
const z = m.clientX + p,
|
|
189
|
+
const z = m.clientX + p, B = m.clientY + g;
|
|
190
190
|
if (n) {
|
|
191
|
-
const V = L(z,
|
|
191
|
+
const V = L(z, B);
|
|
192
192
|
if (!V) return;
|
|
193
193
|
V !== k && (k && k.removeAttribute("drag-zone-active"), V.setAttribute("drag-zone-active", ""), k = V, E = -1);
|
|
194
194
|
const G = H(V).filter((D) => D !== l);
|
|
195
|
-
|
|
195
|
+
N(G, z, B, V);
|
|
196
196
|
} else
|
|
197
|
-
|
|
197
|
+
N(I, z, B);
|
|
198
198
|
} else {
|
|
199
|
-
const z =
|
|
199
|
+
const z = I.filter((J) => J !== i), B = m.clientX + p, V = m.clientY + g;
|
|
200
200
|
let G = null, D = -1;
|
|
201
201
|
if (z.length > 0) {
|
|
202
202
|
let J = 1 / 0;
|
|
203
|
-
for (let
|
|
204
|
-
const te = z[
|
|
205
|
-
re < J && (J = re, G = z[
|
|
203
|
+
for (let q = 0; q < z.length; q++) {
|
|
204
|
+
const te = z[q].getBoundingClientRect(), re = Math.hypot(B - te.left - te.width / 2, V - te.top - te.height / 2);
|
|
205
|
+
re < J && (J = re, G = z[q], D = q);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
R(
|
|
208
|
+
R(I, G, D);
|
|
209
209
|
}
|
|
210
210
|
}, oe = (w) => {
|
|
211
211
|
if (i) {
|
|
212
|
-
if (i.removeEventListener("lostpointercapture",
|
|
212
|
+
if (i.removeEventListener("lostpointercapture", ae), _ >= 0) try {
|
|
213
213
|
i.releasePointerCapture(_);
|
|
214
214
|
} catch {
|
|
215
215
|
}
|
|
216
|
-
if (document.removeEventListener("pointermove", ee), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel",
|
|
216
|
+
if (document.removeEventListener("pointermove", ee), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel", le), document.removeEventListener("keydown", ce), l)
|
|
217
217
|
if (o === "slot") {
|
|
218
218
|
let m;
|
|
219
219
|
n && k ? m = H(k).filter((S) => S !== i) : m = U().filter((S) => S !== i);
|
|
@@ -238,7 +238,7 @@ const Te = {
|
|
|
238
238
|
targetZone: k
|
|
239
239
|
});
|
|
240
240
|
} else {
|
|
241
|
-
const m = j(), y = m.find((
|
|
241
|
+
const m = j(), y = m.find((I) => I.hasAttribute("drag-over")) ?? null, S = y ? m.indexOf(y) : -1;
|
|
242
242
|
e.emit("drop", {
|
|
243
243
|
item: i,
|
|
244
244
|
target: y,
|
|
@@ -248,21 +248,21 @@ const Te = {
|
|
|
248
248
|
targetZone: k
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
K();
|
|
252
252
|
}
|
|
253
|
-
}, ie = () => {
|
|
254
|
-
i && oe();
|
|
255
253
|
}, ae = () => {
|
|
256
|
-
i && (
|
|
257
|
-
}, le = (
|
|
254
|
+
i && oe();
|
|
255
|
+
}, le = () => {
|
|
256
|
+
i && (Z(), l && e.emit("drag-cancel", { item: i }), K());
|
|
257
|
+
}, ce = (w) => {
|
|
258
258
|
const m = w;
|
|
259
|
-
m.key === "Escape" && i && (m.preventDefault(), Z(), l && e.emit("drag-cancel", { item: i }),
|
|
259
|
+
m.key === "Escape" && i && (m.preventDefault(), Z(), l && e.emit("drag-cancel", { item: i }), K());
|
|
260
260
|
};
|
|
261
|
-
return e.host.addEventListener("pointerdown",
|
|
262
|
-
i && l && (Z(), e.emit("drag-cancel", { item: i })),
|
|
261
|
+
return e.host.addEventListener("pointerdown", ne), e.host.addEventListener("pointerenter", W, !0), e.host.addEventListener("pointerleave", x, !0), () => {
|
|
262
|
+
i && l && (Z(), e.emit("drag-cancel", { item: i })), K(), e.host.removeEventListener("pointerdown", ne), e.host.removeEventListener("pointerenter", W, !0), e.host.removeEventListener("pointerleave", x, !0);
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
},
|
|
265
|
+
}, Se = {
|
|
266
266
|
name: "press-hold",
|
|
267
267
|
category: "gesture",
|
|
268
268
|
channel: "pointer",
|
|
@@ -285,7 +285,7 @@ const Te = {
|
|
|
285
285
|
n(), e.host.removeEventListener("pointerdown", r), e.host.removeEventListener("pointerup", o), e.host.removeEventListener("pointerleave", o), e.host.removeEventListener("pointercancel", o);
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
},
|
|
288
|
+
}, Me = {
|
|
289
289
|
name: "swipe",
|
|
290
290
|
category: "gesture",
|
|
291
291
|
channel: "pointer",
|
|
@@ -295,11 +295,11 @@ const Te = {
|
|
|
295
295
|
},
|
|
296
296
|
attach(e) {
|
|
297
297
|
const t = parseInt(e.config("threshold") ?? "50", 10), s = parseInt(e.config("timeout") ?? "300", 10);
|
|
298
|
-
let n = 0, r = 0, o = 0, a = !1,
|
|
298
|
+
let n = 0, r = 0, o = 0, a = !1, d = -1, f = null;
|
|
299
299
|
const i = (u) => {
|
|
300
300
|
const p = u;
|
|
301
301
|
if (p.button === 0) {
|
|
302
|
-
p.preventDefault(), n = p.clientX, r = p.clientY, o = Date.now(), a = !0,
|
|
302
|
+
p.preventDefault(), n = p.clientX, r = p.clientY, o = Date.now(), a = !0, d = p.pointerId;
|
|
303
303
|
try {
|
|
304
304
|
e.host.setPointerCapture(p.pointerId);
|
|
305
305
|
} catch {
|
|
@@ -314,12 +314,12 @@ const Te = {
|
|
|
314
314
|
if (!a) return;
|
|
315
315
|
a = !1;
|
|
316
316
|
const p = u;
|
|
317
|
-
if (
|
|
317
|
+
if (d >= 0) {
|
|
318
318
|
try {
|
|
319
|
-
e.host.releasePointerCapture(
|
|
319
|
+
e.host.releasePointerCapture(d);
|
|
320
320
|
} catch {
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
d = -1;
|
|
323
323
|
}
|
|
324
324
|
e.host.style.touchAction = "", e.host.style.removeProperty("--_swipe-x"), e.host.style.removeProperty("--_swipe-y"), e.unexpose("swiping");
|
|
325
325
|
const g = p.clientX - n, v = p.clientY - r, P = Date.now() - o;
|
|
@@ -330,28 +330,28 @@ const Te = {
|
|
|
330
330
|
e.emit("swipe", { direction: O, distance: b, velocity: E, dx: g, dy: v }), f !== null && clearTimeout(f), e.expose("direction", O), f = setTimeout(() => {
|
|
331
331
|
e.unexpose("direction"), f = null;
|
|
332
332
|
}, 500);
|
|
333
|
-
},
|
|
333
|
+
}, h = () => {
|
|
334
334
|
if (a) {
|
|
335
|
-
if (a = !1,
|
|
335
|
+
if (a = !1, d >= 0) {
|
|
336
336
|
try {
|
|
337
|
-
e.host.releasePointerCapture(
|
|
337
|
+
e.host.releasePointerCapture(d);
|
|
338
338
|
} catch {
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
d = -1;
|
|
341
341
|
}
|
|
342
342
|
e.host.style.touchAction = "", e.host.style.removeProperty("--_swipe-x"), e.host.style.removeProperty("--_swipe-y"), e.unexpose("swiping");
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
|
-
return e.host.addEventListener("pointerdown", i), e.host.addEventListener("pointermove", l), e.host.addEventListener("pointerup", c), e.host.addEventListener("pointercancel",
|
|
346
|
-
if (f !== null && clearTimeout(f),
|
|
345
|
+
return e.host.addEventListener("pointerdown", i), e.host.addEventListener("pointermove", l), e.host.addEventListener("pointerup", c), e.host.addEventListener("pointercancel", h), () => {
|
|
346
|
+
if (f !== null && clearTimeout(f), d >= 0)
|
|
347
347
|
try {
|
|
348
|
-
e.host.releasePointerCapture(
|
|
348
|
+
e.host.releasePointerCapture(d);
|
|
349
349
|
} catch {
|
|
350
350
|
}
|
|
351
|
-
e.host.style.touchAction = "", e.host.style.removeProperty("--_swipe-x"), e.host.style.removeProperty("--_swipe-y"), e.host.removeEventListener("pointerdown", i), e.host.removeEventListener("pointermove", l), e.host.removeEventListener("pointerup", c), e.host.removeEventListener("pointercancel",
|
|
351
|
+
e.host.style.touchAction = "", e.host.style.removeProperty("--_swipe-x"), e.host.style.removeProperty("--_swipe-y"), e.host.removeEventListener("pointerdown", i), e.host.removeEventListener("pointermove", l), e.host.removeEventListener("pointerup", c), e.host.removeEventListener("pointercancel", h);
|
|
352
352
|
};
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, $e = {
|
|
355
355
|
name: "sort",
|
|
356
356
|
category: "gesture",
|
|
357
357
|
channel: "pointer",
|
|
@@ -362,21 +362,21 @@ const Te = {
|
|
|
362
362
|
},
|
|
363
363
|
attach(e) {
|
|
364
364
|
const t = e.config("selector") ?? "> *", s = e.config("handle") ?? "", n = e.config("axis") ?? "vertical", r = t.startsWith("> ") ? `:scope ${t}` : t;
|
|
365
|
-
let o = null, a = null,
|
|
365
|
+
let o = null, a = null, d = null, f = 0, i = 0, l = 0, c = 0, h = -1, u = -1;
|
|
366
366
|
const p = () => [...e.host.querySelectorAll(r)].filter((L) => !L.hasAttribute("popover")), g = (L) => {
|
|
367
367
|
const A = L[0].getBoundingClientRect();
|
|
368
|
-
let
|
|
368
|
+
let $ = 1;
|
|
369
369
|
for (let Z = 1; Z < L.length && Math.abs(L[Z].getBoundingClientRect().top - A.top) < A.height * 0.5; Z++)
|
|
370
|
-
|
|
371
|
-
const Y =
|
|
372
|
-
return { cols:
|
|
373
|
-
}, v = (L, A,
|
|
374
|
-
const { cols:
|
|
375
|
-
return Math.max(0, Math.min(x *
|
|
370
|
+
$ = Z + 1;
|
|
371
|
+
const Y = $ > 1 ? L[1].getBoundingClientRect().left - A.left : A.width, X = $ < L.length ? L[$].getBoundingClientRect().top - A.top : A.height;
|
|
372
|
+
return { cols: $, stepX: Y, stepY: X, firstRect: A };
|
|
373
|
+
}, v = (L, A, $, Y) => {
|
|
374
|
+
const { cols: X, stepX: Z, stepY: F, firstRect: C } = g($), N = Math.round((L - (C.left + C.width / 2)) / Z), R = Math.round((A - (C.top + C.height / 2)) / F), K = Math.ceil(Y / X) - 1, W = Math.max(0, Math.min(N, X - 1)), x = Math.max(0, Math.min(R, Math.max(0, K)));
|
|
375
|
+
return Math.max(0, Math.min(x * X + W, Y));
|
|
376
376
|
}, P = (L) => {
|
|
377
377
|
if (!o) return;
|
|
378
|
-
const A = o.getBoundingClientRect(),
|
|
379
|
-
|
|
378
|
+
const A = o.getBoundingClientRect(), $ = o.cloneNode(!0);
|
|
379
|
+
$.setAttribute("popover", "manual"), $.setAttribute("aria-hidden", "true"), e.host.appendChild($), $.showPopover(), $.style.position = "fixed", $.style.inset = "unset", $.style.left = `${A.left}px`, $.style.top = `${A.top}px`, $.style.width = `${A.width}px`, $.style.height = `${A.height}px`, $.style.margin = "0", $.style.pointerEvents = "none", $.style.opacity = "0.8", $.style.transformOrigin = "center center", $.style.border = "none", $.style.outline = "none", a = $, f = L.clientX, i = L.clientY;
|
|
380
380
|
}, M = (L) => {
|
|
381
381
|
for (const A of L)
|
|
382
382
|
A.removeAttribute("drag-slot-before"), A.removeAttribute("drag-slot-after");
|
|
@@ -388,37 +388,37 @@ const Te = {
|
|
|
388
388
|
}
|
|
389
389
|
a.remove(), a = null;
|
|
390
390
|
}
|
|
391
|
-
if (o && o.removeAttribute("dragging"), M(p()),
|
|
391
|
+
if (o && o.removeAttribute("dragging"), M(p()), d && (d.remove(), d = null), o && h >= 0) {
|
|
392
392
|
o.removeEventListener("lostpointercapture", _);
|
|
393
393
|
try {
|
|
394
|
-
o.releasePointerCapture(
|
|
394
|
+
o.releasePointerCapture(h);
|
|
395
395
|
} catch {
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
o = null, u = -1,
|
|
398
|
+
o = null, u = -1, h = -1, document.removeEventListener("pointermove", O), document.removeEventListener("pointerup", E), document.removeEventListener("pointercancel", U), document.removeEventListener("keydown", j);
|
|
399
399
|
}, b = (L) => {
|
|
400
400
|
const A = L;
|
|
401
401
|
if (A.button !== 0) return;
|
|
402
|
-
const
|
|
403
|
-
let
|
|
404
|
-
for (const
|
|
405
|
-
if (
|
|
402
|
+
const $ = A.target, Y = p();
|
|
403
|
+
let X = null;
|
|
404
|
+
for (const F of Y)
|
|
405
|
+
if (F.contains($)) {
|
|
406
406
|
if (s) {
|
|
407
|
-
const C =
|
|
408
|
-
if (!C || !C.contains(
|
|
407
|
+
const C = F.querySelector(s);
|
|
408
|
+
if (!C || !C.contains($)) continue;
|
|
409
409
|
}
|
|
410
|
-
|
|
410
|
+
X = F;
|
|
411
411
|
break;
|
|
412
412
|
}
|
|
413
|
-
if (!
|
|
414
|
-
A.preventDefault(), o =
|
|
415
|
-
const Z =
|
|
413
|
+
if (!X) return;
|
|
414
|
+
A.preventDefault(), o = X, f = A.clientX, i = A.clientY;
|
|
415
|
+
const Z = X.getBoundingClientRect();
|
|
416
416
|
l = Z.left + Z.width / 2 - A.clientX, c = Z.top + Z.height / 2 - A.clientY, document.addEventListener("pointermove", O), document.addEventListener("pointerup", E), document.addEventListener("pointercancel", U), document.addEventListener("keydown", j);
|
|
417
417
|
try {
|
|
418
|
-
|
|
418
|
+
X.setPointerCapture(A.pointerId);
|
|
419
419
|
} catch {
|
|
420
420
|
}
|
|
421
|
-
|
|
421
|
+
h = A.pointerId, X.addEventListener("lostpointercapture", _);
|
|
422
422
|
}, O = (L) => {
|
|
423
423
|
if (!o) return;
|
|
424
424
|
const A = L;
|
|
@@ -432,28 +432,28 @@ const Te = {
|
|
|
432
432
|
}
|
|
433
433
|
o.setAttribute("dragging", ""), e.expose("dragging", !0);
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
a.style.transform = `translate(${
|
|
437
|
-
const
|
|
438
|
-
let
|
|
439
|
-
if (n === "both" &&
|
|
440
|
-
|
|
435
|
+
const $ = A.clientX - f, Y = A.clientY - i;
|
|
436
|
+
a.style.transform = `translate(${$}px, ${Y}px) scale(0.9)`;
|
|
437
|
+
const X = A.clientX + l, Z = A.clientY + c, F = p().filter((W) => W !== a), C = F.filter((W) => W !== o);
|
|
438
|
+
let N = 0;
|
|
439
|
+
if (n === "both" && F.length >= 2)
|
|
440
|
+
N = v(X, Z, F, C.length);
|
|
441
441
|
else
|
|
442
442
|
for (let W = 0; W < C.length; W++) {
|
|
443
|
-
const x = C[W].getBoundingClientRect(),
|
|
444
|
-
if (n === "horizontal" ?
|
|
443
|
+
const x = C[W].getBoundingClientRect(), ne = x.left + x.width / 2, ee = x.top + x.height / 2;
|
|
444
|
+
if (n === "horizontal" ? X > ne : Z > ee) N = W + 1;
|
|
445
445
|
else break;
|
|
446
446
|
}
|
|
447
|
-
if (
|
|
448
|
-
u =
|
|
449
|
-
const R =
|
|
450
|
-
n !== "both" && (
|
|
447
|
+
if (N === u) return;
|
|
448
|
+
u = N, M(F);
|
|
449
|
+
const R = F.filter((W) => W !== o), K = Math.min(N, R.length);
|
|
450
|
+
n !== "both" && (d || (d = document.createElement("div"), d.setAttribute("data-drag-placeholder", ""), d.setAttribute("aria-hidden", "true")), K < R.length ? R[K].before(d) : R.length > 0 ? R[R.length - 1].after(d) : e.host.appendChild(d)), K < R.length && R[K].setAttribute("drag-slot-before", ""), K > 0 && K - 1 < R.length && R[K - 1].setAttribute("drag-slot-after", "");
|
|
451
451
|
}, E = () => {
|
|
452
452
|
if (o) {
|
|
453
453
|
if (a) {
|
|
454
|
-
const A = p().filter((
|
|
454
|
+
const A = p().filter((F) => F !== a).filter((F) => F !== o), $ = Math.min(Math.max(u, 0), A.length), Y = $ < A.length ? A[$] : null;
|
|
455
455
|
Y ? Y.before(o) : A.length > 0 && A[A.length - 1].after(o);
|
|
456
|
-
const Z = p().filter((
|
|
456
|
+
const Z = p().filter((F) => !F.hasAttribute("popover")).map((F, C) => F.dataset.sortKey ?? String(C));
|
|
457
457
|
e.emit("sort", { order: Z });
|
|
458
458
|
}
|
|
459
459
|
e.unexpose("dragging"), k();
|
|
@@ -467,20 +467,20 @@ const Te = {
|
|
|
467
467
|
A.key === "Escape" && o && (A.preventDefault(), e.unexpose("dragging"), k());
|
|
468
468
|
}, Q = (L) => {
|
|
469
469
|
if (a) return;
|
|
470
|
-
const A = L,
|
|
470
|
+
const A = L, $ = p();
|
|
471
471
|
let Y = null;
|
|
472
|
-
for (const
|
|
473
|
-
if (
|
|
474
|
-
Y =
|
|
472
|
+
for (const X of $)
|
|
473
|
+
if (X.contains(A.target)) {
|
|
474
|
+
Y = X;
|
|
475
475
|
break;
|
|
476
476
|
}
|
|
477
477
|
Y && (Y.style.outline = "2px solid var(--aui-focus, highlight)", Y.style.outlineOffset = "2px");
|
|
478
478
|
}, H = (L) => {
|
|
479
|
-
const A = L,
|
|
479
|
+
const A = L, $ = p();
|
|
480
480
|
let Y = null;
|
|
481
|
-
for (const
|
|
482
|
-
if (
|
|
483
|
-
Y =
|
|
481
|
+
for (const X of $)
|
|
482
|
+
if (X.contains(A.target)) {
|
|
483
|
+
Y = X;
|
|
484
484
|
break;
|
|
485
485
|
}
|
|
486
486
|
Y && (Y.style.removeProperty("outline"), Y.style.removeProperty("outline-offset"));
|
|
@@ -489,7 +489,7 @@ const Te = {
|
|
|
489
489
|
k(), e.host.removeEventListener("pointerdown", b), e.host.removeEventListener("pointerenter", Q, !0), e.host.removeEventListener("pointerleave", H, !0);
|
|
490
490
|
};
|
|
491
491
|
}
|
|
492
|
-
},
|
|
492
|
+
}, Ie = {
|
|
493
493
|
n: "ns-resize",
|
|
494
494
|
s: "ns-resize",
|
|
495
495
|
e: "ew-resize",
|
|
@@ -498,7 +498,7 @@ const Te = {
|
|
|
498
498
|
sw: "nesw-resize",
|
|
499
499
|
nw: "nwse-resize",
|
|
500
500
|
se: "nwse-resize"
|
|
501
|
-
},
|
|
501
|
+
}, ge = (e) => e.includes("e") || e.includes("w"), ye = (e) => e.includes("n") || e.includes("s"), ze = {
|
|
502
502
|
name: "resize",
|
|
503
503
|
category: "gesture",
|
|
504
504
|
channel: "pointer",
|
|
@@ -510,7 +510,7 @@ const Te = {
|
|
|
510
510
|
attach(e) {
|
|
511
511
|
const t = (e.config("handles") ?? "se").split(",").map((C) => C.trim()), s = parseInt(e.config("min-width") ?? "50", 10), n = parseInt(e.config("min-height") ?? "50", 10), r = e.config("modifier");
|
|
512
512
|
getComputedStyle(e.host).position === "static" && (e.host.style.position = "relative");
|
|
513
|
-
let a = !1,
|
|
513
|
+
let a = !1, d = null, f = 0, i = 0, l = 0, c = 0, h = 0, u = 0;
|
|
514
514
|
const p = (C) => {
|
|
515
515
|
e.host.style.width = `${C}px`, e.host.style.overflowX = "hidden", e.host.setAttribute("data-resize-fixed-w", "");
|
|
516
516
|
}, g = (C) => {
|
|
@@ -520,23 +520,23 @@ const Te = {
|
|
|
520
520
|
}, P = () => {
|
|
521
521
|
e.host.style.height = "", e.host.style.overflowY = "", e.host.removeAttribute("data-resize-fixed-h");
|
|
522
522
|
}, M = (C) => {
|
|
523
|
-
if (!a || !
|
|
524
|
-
const
|
|
525
|
-
let
|
|
526
|
-
if (
|
|
527
|
-
const ee = Math.max(s, l -
|
|
528
|
-
x =
|
|
523
|
+
if (!a || !d) return;
|
|
524
|
+
const N = C.clientX - f, R = C.clientY - i;
|
|
525
|
+
let K = l, W = c, x = h, ne = u;
|
|
526
|
+
if (d.includes("e") && (K = Math.max(s, l + N)), d.includes("w")) {
|
|
527
|
+
const ee = Math.max(s, l - N);
|
|
528
|
+
x = h + (l - ee), K = ee;
|
|
529
529
|
}
|
|
530
|
-
if (
|
|
530
|
+
if (d.includes("s") && (W = Math.max(n, c + R)), d.includes("n")) {
|
|
531
531
|
const ee = Math.max(n, c - R);
|
|
532
|
-
|
|
532
|
+
ne = u + (c - ee), W = ee;
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
ge(d) && p(K), ye(d) && g(W), d.includes("w") && (e.host.style.left = `${x}px`), d.includes("n") && (e.host.style.top = `${ne}px`), E(), e.emit("aui:resize-move", { width: K, height: W });
|
|
535
535
|
}, k = (C) => {
|
|
536
536
|
if (!a) return;
|
|
537
|
-
a = !1,
|
|
538
|
-
const
|
|
539
|
-
e.emit("aui:resize-end", { width:
|
|
537
|
+
a = !1, d = null, O.removeAttribute("data-resize-label-visible"), C.target?.releasePointerCapture(C.pointerId), document.documentElement.style.cursor = "", e.unexpose("resizing");
|
|
538
|
+
const N = e.host.getBoundingClientRect();
|
|
539
|
+
e.emit("aui:resize-end", { width: N.width, height: N.height }), document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", k);
|
|
540
540
|
}, b = document.createElement("div");
|
|
541
541
|
b.setAttribute("data-resize-overlay", "");
|
|
542
542
|
const O = document.createElement("div");
|
|
@@ -546,50 +546,50 @@ const Te = {
|
|
|
546
546
|
}, _ = new MutationObserver(E);
|
|
547
547
|
_.observe(e.host, { attributes: !0, attributeFilter: ["style"] });
|
|
548
548
|
for (const C of t) {
|
|
549
|
-
const
|
|
550
|
-
|
|
549
|
+
const N = document.createElement("div");
|
|
550
|
+
N.setAttribute("data-resize-handle", C), N.addEventListener("dblclick", (R) => {
|
|
551
551
|
R.preventDefault(), R.stopPropagation();
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
552
|
+
const K = ge(C) && e.host.hasAttribute("data-resize-fixed-w"), W = ye(C) && e.host.hasAttribute("data-resize-fixed-h");
|
|
553
|
+
if (K && v(), W && P(), K || W) {
|
|
554
554
|
E();
|
|
555
|
-
const x =
|
|
555
|
+
const x = K && W ? "both" : K ? "width" : "height";
|
|
556
556
|
e.emit("aui:resize-reset", { axis: x });
|
|
557
557
|
}
|
|
558
|
-
}),
|
|
559
|
-
R.button === 0 && (r === "alt" && !R.altKey || r === "meta" && !R.metaKey || r === "ctrl" && !R.ctrlKey || r === "shift" && !R.shiftKey || (R.preventDefault(), R.stopPropagation(), a = !0,
|
|
560
|
-
}), b.appendChild(
|
|
558
|
+
}), N.addEventListener("pointerdown", (R) => {
|
|
559
|
+
R.button === 0 && (r === "alt" && !R.altKey || r === "meta" && !R.metaKey || r === "ctrl" && !R.ctrlKey || r === "shift" && !R.shiftKey || (R.preventDefault(), R.stopPropagation(), a = !0, d = C, f = R.clientX, i = R.clientY, l = e.host.offsetWidth, c = e.host.offsetHeight, h = e.host.offsetLeft, u = e.host.offsetTop, N.setPointerCapture(R.pointerId), document.documentElement.style.cursor = Ie[C], e.expose("resizing", !0), O.setAttribute("data-resize-label-visible", ""), e.emit("aui:resize-start", { width: l, height: c }), document.addEventListener("pointermove", M), document.addEventListener("pointerup", k)));
|
|
560
|
+
}), b.appendChild(N);
|
|
561
561
|
}
|
|
562
562
|
const U = e.host.closest("aui-editor, aui-graph-ui")?.querySelector('aui-editor-layer[name="chrome"], aui-graph-layer[name="chrome"]');
|
|
563
563
|
U ? U.appendChild(b) : e.host.after(b);
|
|
564
564
|
let j = 0, Q = "";
|
|
565
565
|
const H = () => {
|
|
566
566
|
const C = () => {
|
|
567
|
-
const
|
|
568
|
-
|
|
567
|
+
const N = `${e.host.offsetLeft},${e.host.offsetTop},${e.host.offsetWidth},${e.host.offsetHeight}`;
|
|
568
|
+
N !== Q && (Q = N, E()), j = requestAnimationFrame(C);
|
|
569
569
|
};
|
|
570
570
|
Q = "", j = requestAnimationFrame(C);
|
|
571
571
|
}, L = () => {
|
|
572
572
|
cancelAnimationFrame(j), j = 0;
|
|
573
573
|
}, A = () => {
|
|
574
574
|
b.setAttribute("data-resize-visible", ""), E(), H();
|
|
575
|
-
},
|
|
575
|
+
}, $ = () => {
|
|
576
576
|
a || (b.removeAttribute("data-resize-visible"), O.removeAttribute("data-resize-label-visible"), L());
|
|
577
577
|
}, Y = 12;
|
|
578
|
-
let
|
|
579
|
-
const Z = (C) => r ? r === "alt" ? C.altKey : r === "meta" ? C.metaKey : r === "ctrl" ? C.ctrlKey : r === "shift" ? C.shiftKey : !0 : !0,
|
|
578
|
+
let X = !1;
|
|
579
|
+
const Z = (C) => r ? r === "alt" ? C.altKey : r === "meta" ? C.metaKey : r === "ctrl" ? C.ctrlKey : r === "shift" ? C.shiftKey : !0 : !0, F = (C) => {
|
|
580
580
|
if (a) return;
|
|
581
581
|
if (!Z(C)) {
|
|
582
|
-
|
|
582
|
+
X && (X = !1, $());
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
R && !
|
|
585
|
+
const N = e.host.getBoundingClientRect(), R = C.clientX >= N.left - Y && C.clientX <= N.right + Y && C.clientY >= N.top - Y && C.clientY <= N.bottom + Y;
|
|
586
|
+
R && !X ? (X = !0, A()) : !R && X && (X = !1, $());
|
|
587
587
|
};
|
|
588
|
-
return document.addEventListener("pointermove",
|
|
589
|
-
a && (document.documentElement.style.cursor = "", e.unexpose("resizing")), document.removeEventListener("pointermove",
|
|
588
|
+
return document.addEventListener("pointermove", F, { passive: !0 }), () => {
|
|
589
|
+
a && (document.documentElement.style.cursor = "", e.unexpose("resizing")), document.removeEventListener("pointermove", F), document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", k), _.disconnect(), L(), b.remove();
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
|
-
},
|
|
592
|
+
}, Re = {
|
|
593
593
|
name: "pan-zoom",
|
|
594
594
|
category: "gesture",
|
|
595
595
|
channel: "pointer",
|
|
@@ -600,15 +600,15 @@ const Te = {
|
|
|
600
600
|
},
|
|
601
601
|
attach(e) {
|
|
602
602
|
const t = Number(e.config("min-zoom") ?? "0.1"), s = Number(e.config("max-zoom") ?? "5"), n = Number(e.config("zoom-step") ?? "0.1");
|
|
603
|
-
let r = 0, o = 0, a = 1,
|
|
603
|
+
let r = 0, o = 0, a = 1, d = !1, f = !1, i = 0, l = 0, c = 0, h = 0;
|
|
604
604
|
const u = () => {
|
|
605
605
|
e.host.style.setProperty("--_pan-x", `${r}px`), e.host.style.setProperty("--_pan-y", `${o}px`), e.host.style.setProperty("--_pan-zoom", `${a}`), e.expose("scale", a.toFixed(2)), e.expose("x", Math.round(r).toString()), e.expose("y", Math.round(o).toString()), e.emit("pan-zoom-change", { x: r, y: o, scale: a });
|
|
606
606
|
}, p = (E) => Math.min(s, Math.max(t, E)), g = (E) => {
|
|
607
|
-
(E.button === 1 || E.button === 0 && f) && (E.preventDefault(),
|
|
607
|
+
(E.button === 1 || E.button === 0 && f) && (E.preventDefault(), d = !0, i = E.clientX, l = E.clientY, c = r, h = o, e.host.setPointerCapture(E.pointerId));
|
|
608
608
|
}, v = (E) => {
|
|
609
|
-
|
|
609
|
+
d && (E.preventDefault(), r = c + (E.clientX - i), o = h + (E.clientY - l), u());
|
|
610
610
|
}, P = (E) => {
|
|
611
|
-
|
|
611
|
+
d && (d = !1, e.host.releasePointerCapture(E.pointerId));
|
|
612
612
|
}, M = (E) => {
|
|
613
613
|
if (!E.ctrlKey) return;
|
|
614
614
|
E.preventDefault();
|
|
@@ -631,7 +631,7 @@ const Te = {
|
|
|
631
631
|
e.host.removeEventListener("pointerdown", g), e.host.removeEventListener("pointermove", v), e.host.removeEventListener("pointerup", P), e.host.removeEventListener("wheel", M), e.host.removeEventListener("dblclick", O), document.removeEventListener("keydown", k), document.removeEventListener("keyup", b), e.host.style.removeProperty("--_pan-x"), e.host.style.removeProperty("--_pan-y"), e.host.style.removeProperty("--_pan-zoom");
|
|
632
632
|
};
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, De = {
|
|
635
635
|
name: "hover",
|
|
636
636
|
category: "state",
|
|
637
637
|
targets: "self",
|
|
@@ -646,16 +646,16 @@ const Te = {
|
|
|
646
646
|
e.expose("active", !0), e.emit("hover-enter", {});
|
|
647
647
|
}, a = () => {
|
|
648
648
|
e.expose("active", !1), e.emit("hover-leave", {});
|
|
649
|
-
},
|
|
649
|
+
}, d = () => {
|
|
650
650
|
clearTimeout(r), t > 0 ? n = setTimeout(o, t) : o();
|
|
651
651
|
}, f = () => {
|
|
652
652
|
clearTimeout(n), s > 0 ? r = setTimeout(a, s) : a();
|
|
653
653
|
};
|
|
654
|
-
return e.host.addEventListener("mouseenter",
|
|
655
|
-
e.host.removeEventListener("mouseenter",
|
|
654
|
+
return e.host.addEventListener("mouseenter", d), e.host.addEventListener("mouseleave", f), () => {
|
|
655
|
+
e.host.removeEventListener("mouseenter", d), e.host.removeEventListener("mouseleave", f), clearTimeout(n), clearTimeout(r);
|
|
656
656
|
};
|
|
657
657
|
}
|
|
658
|
-
},
|
|
658
|
+
}, He = {
|
|
659
659
|
name: "toggle-state",
|
|
660
660
|
category: "state",
|
|
661
661
|
targets: "self",
|
|
@@ -664,7 +664,7 @@ const Te = {
|
|
|
664
664
|
},
|
|
665
665
|
actions: ["press"],
|
|
666
666
|
attach(e) {
|
|
667
|
-
const t =
|
|
667
|
+
const t = se(e.config("active") === "true"), s = () => {
|
|
668
668
|
t.value = !t.value, e.emit("toggle", { active: t.value });
|
|
669
669
|
};
|
|
670
670
|
return e.host.addEventListener("press", s), e.addEffect(() => {
|
|
@@ -673,35 +673,31 @@ const Te = {
|
|
|
673
673
|
e.host.removeEventListener("press", s), e.host.removeAttribute("aria-pressed");
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
},
|
|
677
|
-
system: "
|
|
678
|
-
light: "sun",
|
|
679
|
-
dark: "moon"
|
|
680
|
-
}, ue = () => matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", De = (e, t) => {
|
|
681
|
-
const n = (e === "system" ? ue() : e) === "dark" ? "light" : "dark", r = t.indexOf(e);
|
|
676
|
+
}, Ae = "aui-color-scheme", fe = () => matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ye = (e, t) => {
|
|
677
|
+
const n = (e === "system" ? fe() : e) === "dark" ? "light" : "dark", r = t.indexOf(e);
|
|
682
678
|
for (let o = 1; o < t.length; o++) {
|
|
683
679
|
const a = t[(r + o) % t.length];
|
|
684
|
-
if ((a === "system" ?
|
|
680
|
+
if ((a === "system" ? fe() : a) === n) return a;
|
|
685
681
|
}
|
|
686
682
|
return t[(r + 1) % t.length];
|
|
687
|
-
},
|
|
683
|
+
}, Xe = (e) => e === "light" || e === "dark" || e === "system" ? e : "system", Ne = (e) => e ? e.split(",").map((t) => t.trim()).filter(
|
|
688
684
|
(t) => t === "system" || t === "light" || t === "dark"
|
|
689
|
-
) : ["system", "light", "dark"],
|
|
685
|
+
) : ["system", "light", "dark"], Oe = () => {
|
|
690
686
|
try {
|
|
691
|
-
const e = localStorage.getItem(
|
|
687
|
+
const e = localStorage.getItem(Ae);
|
|
692
688
|
if (e === "light" || e === "dark" || e === "system") return e;
|
|
693
689
|
} catch {
|
|
694
690
|
}
|
|
695
691
|
return null;
|
|
696
|
-
},
|
|
692
|
+
}, _e = (e) => {
|
|
697
693
|
try {
|
|
698
|
-
localStorage.setItem(
|
|
694
|
+
localStorage.setItem(Ae, e);
|
|
699
695
|
} catch {
|
|
700
696
|
}
|
|
701
|
-
},
|
|
697
|
+
}, Fe = (e, t, s) => {
|
|
702
698
|
const n = e === "document" ? document.documentElement : document.querySelector(e);
|
|
703
699
|
n && (t === "system" ? (n.style.removeProperty("color-scheme"), n.removeAttribute("data-color-scheme")) : (n.style.colorScheme = s, n.setAttribute("data-color-scheme", s)));
|
|
704
|
-
},
|
|
700
|
+
}, qe = {
|
|
705
701
|
name: "toggle-scheme",
|
|
706
702
|
category: "state",
|
|
707
703
|
targets: "external",
|
|
@@ -713,22 +709,69 @@ const Te = {
|
|
|
713
709
|
},
|
|
714
710
|
actions: ["press"],
|
|
715
711
|
attach(e) {
|
|
716
|
-
const t = e.config("persist") === "true", s =
|
|
717
|
-
const i =
|
|
718
|
-
o.value = i, t &&
|
|
712
|
+
const t = e.config("persist") === "true", s = Ne(e.config("schemes")), n = e.config("target") ?? "document", r = t ? Oe() : null, o = se(r ?? Xe(e.config("scheme"))), a = () => {
|
|
713
|
+
const i = Ye(o.value, s);
|
|
714
|
+
o.value = i, t && _e(i), e.emit("scheme-change", { scheme: i });
|
|
719
715
|
};
|
|
720
716
|
e.host.addEventListener("press", a), e.addEffect(() => {
|
|
721
|
-
const i = o.value, l = i === "system" ?
|
|
722
|
-
e.
|
|
717
|
+
const i = o.value, l = i === "system" ? fe() : i;
|
|
718
|
+
e.expose("scheme", i), Fe(n, i, l);
|
|
723
719
|
});
|
|
724
|
-
const
|
|
720
|
+
const d = matchMedia("(prefers-color-scheme: dark)"), f = () => {
|
|
725
721
|
o.value === "system" && (o.value = "system");
|
|
726
722
|
};
|
|
727
|
-
return
|
|
728
|
-
e.host.removeEventListener("press", a),
|
|
723
|
+
return d.addEventListener("change", f), () => {
|
|
724
|
+
e.host.removeEventListener("press", a), d.removeEventListener("change", f);
|
|
729
725
|
};
|
|
730
726
|
}
|
|
731
|
-
},
|
|
727
|
+
}, Te = "aui-theme", pe = [
|
|
728
|
+
{ key: "default", name: "Default" },
|
|
729
|
+
{ key: "forest", name: "Forest" },
|
|
730
|
+
{ key: "rose", name: "Rose" },
|
|
731
|
+
{ key: "zinc", name: "Zinc" }
|
|
732
|
+
], ie = (e) => e.charAt(0).toUpperCase() + e.slice(1), Ke = (e) => e ? Array.isArray(e) ? e.map((t) => typeof t == "string" ? { key: t, name: ie(t) } : { key: t.key ?? t.value ?? "", name: t.name ?? t.label ?? ie(t.key ?? "") }) : typeof e == "string" ? e.split(",").map((t) => {
|
|
733
|
+
const s = t.trim();
|
|
734
|
+
return { key: s, name: ie(s) };
|
|
735
|
+
}) : pe : pe, Be = () => {
|
|
736
|
+
try {
|
|
737
|
+
return localStorage.getItem(Te);
|
|
738
|
+
} catch {
|
|
739
|
+
return null;
|
|
740
|
+
}
|
|
741
|
+
}, We = (e) => {
|
|
742
|
+
try {
|
|
743
|
+
localStorage.setItem(Te, e);
|
|
744
|
+
} catch {
|
|
745
|
+
}
|
|
746
|
+
}, Ue = (e, t) => {
|
|
747
|
+
const s = e === "document" ? document.documentElement : document.querySelector(e);
|
|
748
|
+
s && (t === "default" ? s.removeAttribute("theme") : s.setAttribute("theme", t));
|
|
749
|
+
}, Ve = {
|
|
750
|
+
name: "toggle-theme",
|
|
751
|
+
category: "state",
|
|
752
|
+
targets: "external",
|
|
753
|
+
defaults: {
|
|
754
|
+
theme: "default",
|
|
755
|
+
themes: pe,
|
|
756
|
+
target: "document",
|
|
757
|
+
persist: "false"
|
|
758
|
+
},
|
|
759
|
+
actions: ["press"],
|
|
760
|
+
attach(e) {
|
|
761
|
+
const t = e.config("persist") === "true", s = Ke(e.config("themes")), n = s.map((i) => i.key), r = e.config("target") ?? "document", o = t ? Be() : null, a = o && n.includes(o) ? o : e.config("theme") ?? "default", d = se(a), f = () => {
|
|
762
|
+
const i = n.indexOf(d.value), l = n[(i + 1) % n.length];
|
|
763
|
+
d.value = l, t && We(l);
|
|
764
|
+
const c = s.find((h) => h.key === l);
|
|
765
|
+
e.emit("theme-change", { theme: l, name: c?.name ?? l });
|
|
766
|
+
};
|
|
767
|
+
return e.host.addEventListener("press", f), e.addEffect(() => {
|
|
768
|
+
const i = d.value, l = s.find((c) => c.key === i);
|
|
769
|
+
e.expose("theme", i), e.expose("name", l?.name ?? ie(i)), Ue(r, i);
|
|
770
|
+
}), () => {
|
|
771
|
+
e.host.removeEventListener("press", f);
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
}, Ze = {
|
|
732
775
|
name: "copy",
|
|
733
776
|
category: "state",
|
|
734
777
|
targets: "self",
|
|
@@ -745,16 +788,16 @@ const Te = {
|
|
|
745
788
|
}, o = () => {
|
|
746
789
|
r(), e.unexpose("copied"), n !== null && (e.host.setAttribute("label", n), n = null);
|
|
747
790
|
}, a = () => {
|
|
748
|
-
const
|
|
749
|
-
navigator.clipboard.writeText(
|
|
750
|
-
o(), n = e.host.getAttribute("label"), e.expose("copied", !0), e.host.setAttribute("label", "Copied!"), e.emit("copy", { text:
|
|
791
|
+
const d = e.config("text") || e.host.textContent || "";
|
|
792
|
+
navigator.clipboard.writeText(d).then(() => {
|
|
793
|
+
o(), n = e.host.getAttribute("label"), e.expose("copied", !0), e.host.setAttribute("label", "Copied!"), e.emit("copy", { text: d }), s = setTimeout(o, t);
|
|
751
794
|
});
|
|
752
795
|
};
|
|
753
796
|
return e.host.addEventListener("press", a), () => {
|
|
754
797
|
o(), e.host.removeEventListener("press", a);
|
|
755
798
|
};
|
|
756
799
|
}
|
|
757
|
-
},
|
|
800
|
+
}, Ge = {
|
|
758
801
|
name: "clipboard",
|
|
759
802
|
category: "state",
|
|
760
803
|
targets: "self",
|
|
@@ -764,30 +807,30 @@ const Te = {
|
|
|
764
807
|
},
|
|
765
808
|
attach(e) {
|
|
766
809
|
const t = (s) => {
|
|
767
|
-
const n = s, r = e.config("prevent") !== "false", o = (e.config("accept") ?? "").split(",").map((
|
|
810
|
+
const n = s, r = e.config("prevent") !== "false", o = (e.config("accept") ?? "").split(",").map((h) => h.trim());
|
|
768
811
|
r && n.preventDefault();
|
|
769
812
|
const a = n.clipboardData;
|
|
770
813
|
if (!a) return;
|
|
771
|
-
const
|
|
814
|
+
const d = Array.from(a.types);
|
|
772
815
|
let f, i;
|
|
773
|
-
const l = [], c = (
|
|
816
|
+
const l = [], c = (h) => o.some((u) => u.endsWith("/*") ? h.startsWith(u.slice(0, -1)) : h === u);
|
|
774
817
|
c("text/plain") && (f = a.getData("text/plain") || void 0), c("text/html") && (i = a.getData("text/html") || void 0);
|
|
775
|
-
for (let
|
|
776
|
-
const u = a.files[
|
|
818
|
+
for (let h = 0; h < a.files.length; h++) {
|
|
819
|
+
const u = a.files[h];
|
|
777
820
|
c(u.type) && l.push(u);
|
|
778
821
|
}
|
|
779
822
|
e.expose("has-data", !0), e.emit("paste", {
|
|
780
823
|
text: f ?? "",
|
|
781
824
|
html: i ?? "",
|
|
782
825
|
files: l,
|
|
783
|
-
types:
|
|
826
|
+
types: d
|
|
784
827
|
});
|
|
785
828
|
};
|
|
786
829
|
return e.host.addEventListener("paste", t), () => {
|
|
787
830
|
e.host.removeEventListener("paste", t), e.unexpose("has-data");
|
|
788
831
|
};
|
|
789
832
|
}
|
|
790
|
-
},
|
|
833
|
+
}, Je = (e) => {
|
|
791
834
|
const t = e.toLowerCase().split("+").map((s) => s.trim());
|
|
792
835
|
return {
|
|
793
836
|
ctrl: t.includes("ctrl"),
|
|
@@ -796,7 +839,7 @@ const Te = {
|
|
|
796
839
|
meta: t.includes("meta"),
|
|
797
840
|
key: t.filter((s) => !["ctrl", "alt", "shift", "meta"].includes(s))[0] ?? ""
|
|
798
841
|
};
|
|
799
|
-
},
|
|
842
|
+
}, je = (e, t) => e.ctrlKey === t.ctrl && e.altKey === t.alt && e.shiftKey === t.shift && e.metaKey === t.meta && e.key.toLowerCase() === t.key, Qe = {
|
|
800
843
|
name: "shortcut",
|
|
801
844
|
category: "state",
|
|
802
845
|
defaults: {
|
|
@@ -806,15 +849,15 @@ const Te = {
|
|
|
806
849
|
attach(e) {
|
|
807
850
|
const t = e.config("key") ?? "";
|
|
808
851
|
if (t === "") return;
|
|
809
|
-
const s = (e.config("global") ?? "false") === "true", n =
|
|
810
|
-
const
|
|
811
|
-
|
|
852
|
+
const s = (e.config("global") ?? "false") === "true", n = Je(t), r = s ? document : e.host, o = (a) => {
|
|
853
|
+
const d = a;
|
|
854
|
+
je(d, n) && (d.preventDefault(), e.emit("shortcut", { key: t }), e.emit("press", {}));
|
|
812
855
|
};
|
|
813
856
|
return r.addEventListener("keydown", o), () => {
|
|
814
857
|
r.removeEventListener("keydown", o);
|
|
815
858
|
};
|
|
816
859
|
}
|
|
817
|
-
},
|
|
860
|
+
}, xe = {
|
|
818
861
|
name: "search",
|
|
819
862
|
category: "state",
|
|
820
863
|
targets: "self",
|
|
@@ -827,9 +870,9 @@ const Te = {
|
|
|
827
870
|
attach(e) {
|
|
828
871
|
const t = e.config("selector") ?? "> *", s = e.config("attr") ?? "textContent", n = Number(e.config("debounce") ?? "150");
|
|
829
872
|
let r, o = "";
|
|
830
|
-
const a = t.startsWith("> ") ? `:scope ${t}` : t,
|
|
873
|
+
const a = t.startsWith("> ") ? `:scope ${t}` : t, d = () => [...e.host.querySelectorAll(a)].filter((u) => u.tagName !== "INPUT"), f = (u) => s === "textContent" ? (u.textContent ?? "").trim() : (u.getAttribute(s) ?? "").trim(), i = (u) => {
|
|
831
874
|
o = u;
|
|
832
|
-
const p = u.toLowerCase(), g =
|
|
875
|
+
const p = u.toLowerCase(), g = d();
|
|
833
876
|
let v = 0;
|
|
834
877
|
for (const P of g) {
|
|
835
878
|
const M = f(P).toLowerCase();
|
|
@@ -841,16 +884,16 @@ const Te = {
|
|
|
841
884
|
}, c = (u) => {
|
|
842
885
|
const g = u.detail?.query ?? "";
|
|
843
886
|
l(g);
|
|
844
|
-
},
|
|
887
|
+
}, h = (u) => {
|
|
845
888
|
const p = u.target;
|
|
846
889
|
p?.tagName === "INPUT" && l(p.value);
|
|
847
890
|
};
|
|
848
|
-
return e.host.addEventListener("search", c), e.host.addEventListener("input",
|
|
849
|
-
e.host.removeEventListener("search", c), e.host.removeEventListener("input",
|
|
891
|
+
return e.host.addEventListener("search", c), e.host.addEventListener("input", h), () => {
|
|
892
|
+
e.host.removeEventListener("search", c), e.host.removeEventListener("input", h), clearTimeout(r);
|
|
850
893
|
};
|
|
851
894
|
}
|
|
852
895
|
};
|
|
853
|
-
function
|
|
896
|
+
function et(e, t) {
|
|
854
897
|
if (t === "*" || t === "*/*") return !0;
|
|
855
898
|
if (t.endsWith("/*")) {
|
|
856
899
|
const s = t.slice(0, t.indexOf("/"));
|
|
@@ -858,15 +901,15 @@ function Ve(e, t) {
|
|
|
858
901
|
}
|
|
859
902
|
return e === t;
|
|
860
903
|
}
|
|
861
|
-
function
|
|
904
|
+
function he(e, t) {
|
|
862
905
|
if (t.length === 1 && (t[0] === "*" || t[0] === "*/*")) return !0;
|
|
863
906
|
for (let s = 0; s < e.items.length; s++) {
|
|
864
907
|
const n = e.items[s];
|
|
865
|
-
if (t.some((r) =>
|
|
908
|
+
if (t.some((r) => et(n.type, r))) return !0;
|
|
866
909
|
}
|
|
867
910
|
return !1;
|
|
868
911
|
}
|
|
869
|
-
const
|
|
912
|
+
const tt = {
|
|
870
913
|
name: "drop-zone",
|
|
871
914
|
category: "state",
|
|
872
915
|
defaults: {
|
|
@@ -878,15 +921,15 @@ const Ze = {
|
|
|
878
921
|
let n = 0;
|
|
879
922
|
const r = (f) => {
|
|
880
923
|
const i = f;
|
|
881
|
-
i.dataTransfer &&
|
|
924
|
+
i.dataTransfer && he(i.dataTransfer, s) && (i.preventDefault(), i.dataTransfer.dropEffect = "copy");
|
|
882
925
|
}, o = (f) => {
|
|
883
926
|
const i = f;
|
|
884
|
-
i.dataTransfer &&
|
|
927
|
+
i.dataTransfer && he(i.dataTransfer, s) && (i.preventDefault(), n++, n === 1 && e.expose("over", !0));
|
|
885
928
|
}, a = (f) => {
|
|
886
929
|
n--, n <= 0 && (n = 0, e.expose("over", !1));
|
|
887
|
-
},
|
|
930
|
+
}, d = (f) => {
|
|
888
931
|
const i = f;
|
|
889
|
-
if (i.preventDefault(), n = 0, e.expose("over", !1), !i.dataTransfer || !
|
|
932
|
+
if (i.preventDefault(), n = 0, e.expose("over", !1), !i.dataTransfer || !he(i.dataTransfer, s)) return;
|
|
890
933
|
const l = i.dataTransfer.getData("text/plain");
|
|
891
934
|
e.emit("drop", {
|
|
892
935
|
files: i.dataTransfer.files,
|
|
@@ -894,11 +937,11 @@ const Ze = {
|
|
|
894
937
|
text: l
|
|
895
938
|
});
|
|
896
939
|
};
|
|
897
|
-
return e.host.addEventListener("dragover", r), e.host.addEventListener("dragenter", o), e.host.addEventListener("dragleave", a), e.host.addEventListener("drop",
|
|
898
|
-
e.host.removeEventListener("dragover", r), e.host.removeEventListener("dragenter", o), e.host.removeEventListener("dragleave", a), e.host.removeEventListener("drop",
|
|
940
|
+
return e.host.addEventListener("dragover", r), e.host.addEventListener("dragenter", o), e.host.addEventListener("dragleave", a), e.host.addEventListener("drop", d), () => {
|
|
941
|
+
e.host.removeEventListener("dragover", r), e.host.removeEventListener("dragenter", o), e.host.removeEventListener("dragleave", a), e.host.removeEventListener("drop", d);
|
|
899
942
|
};
|
|
900
943
|
}
|
|
901
|
-
},
|
|
944
|
+
}, st = {
|
|
902
945
|
name: "edit",
|
|
903
946
|
category: "state",
|
|
904
947
|
defaults: {
|
|
@@ -909,37 +952,37 @@ const Ze = {
|
|
|
909
952
|
const t = e.config("event") ?? "dblclick", s = e.config("commit") ?? "blur";
|
|
910
953
|
let n = !1, r = "";
|
|
911
954
|
const o = () => {
|
|
912
|
-
const
|
|
913
|
-
|
|
955
|
+
const h = document.createRange();
|
|
956
|
+
h.selectNodeContents(e.host);
|
|
914
957
|
const u = window.getSelection();
|
|
915
|
-
u && (u.removeAllRanges(), u.addRange(
|
|
958
|
+
u && (u.removeAllRanges(), u.addRange(h));
|
|
916
959
|
}, a = () => {
|
|
917
960
|
n || (n = !0, r = e.host.textContent ?? "", e.host.contentEditable = "true", e.host.focus(), o(), e.expose("editing", !0));
|
|
918
|
-
},
|
|
961
|
+
}, d = () => {
|
|
919
962
|
if (!n) return;
|
|
920
963
|
n = !1, e.host.contentEditable = "false", e.unexpose("editing");
|
|
921
|
-
const
|
|
922
|
-
e.emit("edit-commit", { value:
|
|
964
|
+
const h = e.host.textContent ?? "";
|
|
965
|
+
e.emit("edit-commit", { value: h, previous: r });
|
|
923
966
|
}, f = () => {
|
|
924
967
|
n && (n = !1, e.host.textContent = r, e.host.contentEditable = "false", e.unexpose("editing"), e.emit("edit-cancel", {}));
|
|
925
968
|
}, i = () => {
|
|
926
969
|
a();
|
|
927
970
|
}, l = () => {
|
|
928
|
-
s === "blur" &&
|
|
929
|
-
}, c = (
|
|
971
|
+
s === "blur" && d();
|
|
972
|
+
}, c = (h) => {
|
|
930
973
|
if (!n) return;
|
|
931
|
-
const u =
|
|
974
|
+
const u = h;
|
|
932
975
|
if (u.key === "Escape") {
|
|
933
976
|
u.preventDefault(), f();
|
|
934
977
|
return;
|
|
935
978
|
}
|
|
936
|
-
u.key === "Enter" && s === "enter" && (u.preventDefault(),
|
|
979
|
+
u.key === "Enter" && s === "enter" && (u.preventDefault(), d());
|
|
937
980
|
};
|
|
938
981
|
return e.host.addEventListener(t, i), e.host.addEventListener("blur", l), e.host.addEventListener("keydown", c), () => {
|
|
939
982
|
n && (e.host.contentEditable = "false", e.unexpose("editing")), e.host.removeEventListener(t, i), e.host.removeEventListener("blur", l), e.host.removeEventListener("keydown", c);
|
|
940
983
|
};
|
|
941
984
|
}
|
|
942
|
-
},
|
|
985
|
+
}, nt = {
|
|
943
986
|
name: "intersect",
|
|
944
987
|
category: "state",
|
|
945
988
|
targets: "self",
|
|
@@ -952,11 +995,11 @@ const Ze = {
|
|
|
952
995
|
const t = Number(e.config("threshold") ?? "0"), s = e.config("root-margin") ?? "0px", n = (e.config("once") ?? "false") === "true", r = new IntersectionObserver(
|
|
953
996
|
(o) => {
|
|
954
997
|
for (const a of o) {
|
|
955
|
-
const
|
|
956
|
-
e.expose("visible",
|
|
957
|
-
isIntersecting:
|
|
998
|
+
const d = a.isIntersecting;
|
|
999
|
+
e.expose("visible", d), e.emit("intersect", {
|
|
1000
|
+
isIntersecting: d,
|
|
958
1001
|
ratio: a.intersectionRatio
|
|
959
|
-
}), n &&
|
|
1002
|
+
}), n && d && r.disconnect();
|
|
960
1003
|
}
|
|
961
1004
|
},
|
|
962
1005
|
{
|
|
@@ -968,7 +1011,7 @@ const Ze = {
|
|
|
968
1011
|
r.disconnect();
|
|
969
1012
|
};
|
|
970
1013
|
}
|
|
971
|
-
},
|
|
1014
|
+
}, ot = /https?:\/\/[^\s<>"{}|\\^`[\]]+/, rt = {
|
|
972
1015
|
name: "link-paste",
|
|
973
1016
|
category: "state",
|
|
974
1017
|
targets: "self",
|
|
@@ -983,19 +1026,19 @@ const Ze = {
|
|
|
983
1026
|
if (!o) return;
|
|
984
1027
|
const a = o.getData("text/plain");
|
|
985
1028
|
if (!a) return;
|
|
986
|
-
const
|
|
987
|
-
if (!
|
|
1029
|
+
const d = ot.exec(a.trim());
|
|
1030
|
+
if (!d) {
|
|
988
1031
|
e.expose("url", "");
|
|
989
1032
|
return;
|
|
990
1033
|
}
|
|
991
|
-
const f =
|
|
1034
|
+
const f = d[0];
|
|
992
1035
|
e.expose("url", f), e.emit("link-paste", { url: f, text: a.trim() });
|
|
993
1036
|
};
|
|
994
1037
|
return e.host.addEventListener("paste", t), () => {
|
|
995
1038
|
e.host.removeEventListener("paste", t), e.unexpose("url");
|
|
996
1039
|
};
|
|
997
1040
|
}
|
|
998
|
-
},
|
|
1041
|
+
}, it = {
|
|
999
1042
|
name: "linked-scroll",
|
|
1000
1043
|
category: "state",
|
|
1001
1044
|
targets: "external",
|
|
@@ -1019,23 +1062,23 @@ const Ze = {
|
|
|
1019
1062
|
const o = (f, i) => {
|
|
1020
1063
|
if (!n) {
|
|
1021
1064
|
if (n = !0, e.expose("syncing", !0), s === "both" || s === "x") {
|
|
1022
|
-
const l = f.scrollWidth - f.clientWidth, c = l > 0 ? f.scrollLeft / l : 0,
|
|
1023
|
-
i.scrollLeft = c *
|
|
1065
|
+
const l = f.scrollWidth - f.clientWidth, c = l > 0 ? f.scrollLeft / l : 0, h = i.scrollWidth - i.clientWidth;
|
|
1066
|
+
i.scrollLeft = c * h;
|
|
1024
1067
|
}
|
|
1025
1068
|
if (s === "both" || s === "y") {
|
|
1026
|
-
const l = f.scrollHeight - f.clientHeight, c = l > 0 ? f.scrollTop / l : 0,
|
|
1027
|
-
i.scrollTop = c *
|
|
1069
|
+
const l = f.scrollHeight - f.clientHeight, c = l > 0 ? f.scrollTop / l : 0, h = i.scrollHeight - i.clientHeight;
|
|
1070
|
+
i.scrollTop = c * h;
|
|
1028
1071
|
}
|
|
1029
1072
|
requestAnimationFrame(() => {
|
|
1030
1073
|
n = !1, e.expose("syncing", !1);
|
|
1031
1074
|
});
|
|
1032
1075
|
}
|
|
1033
|
-
}, a = () => o(e.host, r),
|
|
1034
|
-
return e.host.addEventListener("scroll", a, { passive: !0 }), r.addEventListener("scroll",
|
|
1035
|
-
e.host.removeEventListener("scroll", a), r.removeEventListener("scroll",
|
|
1076
|
+
}, a = () => o(e.host, r), d = () => o(r, e.host);
|
|
1077
|
+
return e.host.addEventListener("scroll", a, { passive: !0 }), r.addEventListener("scroll", d, { passive: !0 }), () => {
|
|
1078
|
+
e.host.removeEventListener("scroll", a), r.removeEventListener("scroll", d);
|
|
1036
1079
|
};
|
|
1037
1080
|
}
|
|
1038
|
-
},
|
|
1081
|
+
}, at = {
|
|
1039
1082
|
name: "mention",
|
|
1040
1083
|
category: "state",
|
|
1041
1084
|
targets: "self",
|
|
@@ -1045,7 +1088,7 @@ const Ze = {
|
|
|
1045
1088
|
},
|
|
1046
1089
|
actions: ["mention-select"],
|
|
1047
1090
|
attach(e) {
|
|
1048
|
-
const t = e.config("trigger") ?? "@", s = parseInt(e.config("min-length") ?? "1", 10), n =
|
|
1091
|
+
const t = e.config("trigger") ?? "@", s = parseInt(e.config("min-length") ?? "1", 10), n = se(!1);
|
|
1049
1092
|
let r = -1;
|
|
1050
1093
|
const o = () => {
|
|
1051
1094
|
const i = e.host;
|
|
@@ -1056,41 +1099,41 @@ const Ze = {
|
|
|
1056
1099
|
return i.selectionStart ?? i.value.length;
|
|
1057
1100
|
const l = window.getSelection();
|
|
1058
1101
|
return l && l.rangeCount > 0 && i.contains(l.anchorNode) ? l.anchorOffset : (i.textContent ?? "").length;
|
|
1059
|
-
},
|
|
1060
|
-
const i = o(), l = a(), c = i.slice(0, l),
|
|
1061
|
-
if (
|
|
1102
|
+
}, d = () => {
|
|
1103
|
+
const i = o(), l = a(), c = i.slice(0, l), h = c.lastIndexOf(t);
|
|
1104
|
+
if (h === -1) {
|
|
1062
1105
|
n.value && (n.value = !1);
|
|
1063
1106
|
return;
|
|
1064
1107
|
}
|
|
1065
|
-
if (
|
|
1108
|
+
if (h > 0 && !/\s/.test(c[h - 1])) {
|
|
1066
1109
|
n.value && (n.value = !1);
|
|
1067
1110
|
return;
|
|
1068
1111
|
}
|
|
1069
|
-
const u = c.slice(
|
|
1112
|
+
const u = c.slice(h + t.length);
|
|
1070
1113
|
if (/\s/.test(u)) {
|
|
1071
1114
|
n.value && (n.value = !1);
|
|
1072
1115
|
return;
|
|
1073
1116
|
}
|
|
1074
|
-
u.length >= s ? (r =
|
|
1117
|
+
u.length >= s ? (r = h, n.value = !0, e.emit("mention-search", { query: u })) : n.value && (n.value = !1);
|
|
1075
1118
|
}, f = (i) => {
|
|
1076
1119
|
const l = i.detail, c = String(l?.text ?? "");
|
|
1077
1120
|
if (!c || r === -1) return;
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
|
|
1121
|
+
const h = e.host, u = o(), p = a(), g = u.slice(0, r), v = u.slice(p), P = `${t}${c} `;
|
|
1122
|
+
if (h instanceof HTMLInputElement || h instanceof HTMLTextAreaElement) {
|
|
1123
|
+
h.value = g + P + v;
|
|
1081
1124
|
const M = g.length + P.length;
|
|
1082
|
-
|
|
1125
|
+
h.setSelectionRange(M, M);
|
|
1083
1126
|
} else
|
|
1084
|
-
|
|
1127
|
+
h.textContent = g + P + v;
|
|
1085
1128
|
n.value = !1, r = -1;
|
|
1086
1129
|
};
|
|
1087
|
-
return e.host.addEventListener("input",
|
|
1130
|
+
return e.host.addEventListener("input", d), e.host.addEventListener("mention-select", f), e.addEffect(() => {
|
|
1088
1131
|
e.expose("active", n.value);
|
|
1089
1132
|
}), () => {
|
|
1090
|
-
e.host.removeEventListener("input",
|
|
1133
|
+
e.host.removeEventListener("input", d), e.host.removeEventListener("mention-select", f);
|
|
1091
1134
|
};
|
|
1092
1135
|
}
|
|
1093
|
-
},
|
|
1136
|
+
}, lt = {
|
|
1094
1137
|
name: "persist",
|
|
1095
1138
|
category: "state",
|
|
1096
1139
|
targets: "self",
|
|
@@ -1129,7 +1172,7 @@ const Ze = {
|
|
|
1129
1172
|
e.host.removeEventListener("persist-save", r), n !== null && clearTimeout(n);
|
|
1130
1173
|
};
|
|
1131
1174
|
}
|
|
1132
|
-
},
|
|
1175
|
+
}, ct = {
|
|
1133
1176
|
name: "range-select",
|
|
1134
1177
|
category: "state",
|
|
1135
1178
|
defaults: {
|
|
@@ -1139,17 +1182,17 @@ const Ze = {
|
|
|
1139
1182
|
attach(e) {
|
|
1140
1183
|
const t = e.config("selector") ?? "> *", s = e.config("attr") ?? "selected";
|
|
1141
1184
|
let n = -1;
|
|
1142
|
-
const r = t.startsWith("> ") ? `:scope ${t}` : t, o = () => Array.from(e.host.querySelectorAll(r)), a = (l) => l.reduce((c,
|
|
1185
|
+
const r = t.startsWith("> ") ? `:scope ${t}` : t, o = () => Array.from(e.host.querySelectorAll(r)), a = (l) => l.reduce((c, h, u) => (h.hasAttribute(s) && c.push(u), c), []), d = (l) => {
|
|
1143
1186
|
const c = a(l);
|
|
1144
1187
|
e.expose("count", String(c.length)), e.emit("selection-change", { selected: c, count: c.length });
|
|
1145
1188
|
}, f = (l) => {
|
|
1146
1189
|
for (const c of l)
|
|
1147
1190
|
c.removeAttribute(s);
|
|
1148
1191
|
}, i = (l) => {
|
|
1149
|
-
const c = l,
|
|
1192
|
+
const c = l, h = c.target, u = o();
|
|
1150
1193
|
let p = -1;
|
|
1151
1194
|
for (let g = 0; g < u.length; g++)
|
|
1152
|
-
if (u[g].contains(
|
|
1195
|
+
if (u[g].contains(h)) {
|
|
1153
1196
|
p = g;
|
|
1154
1197
|
break;
|
|
1155
1198
|
}
|
|
@@ -1160,14 +1203,14 @@ const Ze = {
|
|
|
1160
1203
|
for (let P = g; P <= v; P++)
|
|
1161
1204
|
u[P].setAttribute(s, "");
|
|
1162
1205
|
} else c.metaKey || c.ctrlKey ? (u[p].hasAttribute(s) ? u[p].removeAttribute(s) : u[p].setAttribute(s, ""), n = p) : (f(u), u[p].setAttribute(s, ""), n = p);
|
|
1163
|
-
|
|
1206
|
+
d(u);
|
|
1164
1207
|
}
|
|
1165
1208
|
};
|
|
1166
1209
|
return e.host.addEventListener("click", i), e.expose("count", "0"), () => {
|
|
1167
1210
|
e.host.removeEventListener("click", i);
|
|
1168
1211
|
};
|
|
1169
1212
|
}
|
|
1170
|
-
},
|
|
1213
|
+
}, dt = {
|
|
1171
1214
|
name: "selection",
|
|
1172
1215
|
category: "state",
|
|
1173
1216
|
defaults: {
|
|
@@ -1176,27 +1219,27 @@ const Ze = {
|
|
|
1176
1219
|
},
|
|
1177
1220
|
actions: ["press"],
|
|
1178
1221
|
attach(e) {
|
|
1179
|
-
const t = e.config("mode") ?? "single", s = e.config("selector") ?? "> *", n = "selected", r = s.startsWith("> ") ? `:scope ${s}` : s, o = () => Array.from(e.host.querySelectorAll(r)), a = (i) => i.filter((l) => l.hasAttribute(n)).map((l) => l.dataset.value ?? ""),
|
|
1222
|
+
const t = e.config("mode") ?? "single", s = e.config("selector") ?? "> *", n = "selected", r = s.startsWith("> ") ? `:scope ${s}` : s, o = () => Array.from(e.host.querySelectorAll(r)), a = (i) => i.filter((l) => l.hasAttribute(n)).map((l) => l.dataset.value ?? ""), d = (i) => {
|
|
1180
1223
|
const l = i.filter((c) => c.hasAttribute(n)).length;
|
|
1181
1224
|
e.expose("count", String(l));
|
|
1182
1225
|
}, f = (i) => {
|
|
1183
1226
|
const l = i.target, c = o();
|
|
1184
|
-
let
|
|
1227
|
+
let h = null;
|
|
1185
1228
|
for (const v of c)
|
|
1186
1229
|
if (v === l || v.contains(l)) {
|
|
1187
|
-
|
|
1230
|
+
h = v;
|
|
1188
1231
|
break;
|
|
1189
1232
|
}
|
|
1190
|
-
if (!
|
|
1191
|
-
const u =
|
|
1233
|
+
if (!h) return;
|
|
1234
|
+
const u = h.hasAttribute(n), p = h.dataset.value ?? "";
|
|
1192
1235
|
if (t === "single") {
|
|
1193
1236
|
for (const v of c)
|
|
1194
1237
|
v.removeAttribute(n);
|
|
1195
|
-
u ||
|
|
1238
|
+
u || h.setAttribute(n, "");
|
|
1196
1239
|
} else
|
|
1197
|
-
u ?
|
|
1240
|
+
u ? h.removeAttribute(n) : h.setAttribute(n, "");
|
|
1198
1241
|
const g = a(c);
|
|
1199
|
-
|
|
1242
|
+
d(c), e.emit("select", {
|
|
1200
1243
|
value: p,
|
|
1201
1244
|
selected: !u,
|
|
1202
1245
|
all: g
|
|
@@ -1206,7 +1249,7 @@ const Ze = {
|
|
|
1206
1249
|
e.host.removeEventListener("press", f);
|
|
1207
1250
|
};
|
|
1208
1251
|
}
|
|
1209
|
-
},
|
|
1252
|
+
}, ht = {
|
|
1210
1253
|
name: "slash-command",
|
|
1211
1254
|
category: "state",
|
|
1212
1255
|
targets: "self",
|
|
@@ -1215,24 +1258,24 @@ const Ze = {
|
|
|
1215
1258
|
commands: ""
|
|
1216
1259
|
},
|
|
1217
1260
|
attach(e) {
|
|
1218
|
-
const t = e.config("trigger") ?? "/", s =
|
|
1261
|
+
const t = e.config("trigger") ?? "/", s = se(!1);
|
|
1219
1262
|
let n = "";
|
|
1220
1263
|
const r = () => {
|
|
1221
|
-
const
|
|
1222
|
-
return
|
|
1264
|
+
const d = e.host;
|
|
1265
|
+
return d instanceof HTMLInputElement || d instanceof HTMLTextAreaElement ? d.value : d.textContent ?? "";
|
|
1223
1266
|
}, o = () => {
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
const f =
|
|
1267
|
+
const d = r();
|
|
1268
|
+
if (d.startsWith(t)) {
|
|
1269
|
+
const f = d.slice(t.length);
|
|
1227
1270
|
n = f, s.value = !0, e.emit("command-input", { partial: f });
|
|
1228
1271
|
} else
|
|
1229
1272
|
s.value && (s.value = !1, n = "");
|
|
1230
|
-
}, a = (
|
|
1231
|
-
const f =
|
|
1273
|
+
}, a = (d) => {
|
|
1274
|
+
const f = d;
|
|
1232
1275
|
if (f.key !== "Enter" || !s.value) return;
|
|
1233
1276
|
f.preventDefault();
|
|
1234
|
-
const i = n.split(/\s+/), l = i[0] ?? "", c = i.slice(1).join(" "),
|
|
1235
|
-
|
|
1277
|
+
const i = n.split(/\s+/), l = i[0] ?? "", c = i.slice(1).join(" "), h = (e.config("commands") ?? "").split(",").map((u) => u.trim()).filter(Boolean);
|
|
1278
|
+
h.length > 0 && !h.includes(l) || (e.emit("command", { command: l, args: c }), s.value = !1, n = "");
|
|
1236
1279
|
};
|
|
1237
1280
|
return e.host.addEventListener("input", o), e.host.addEventListener("keydown", a), e.addEffect(() => {
|
|
1238
1281
|
e.expose("active", s.value);
|
|
@@ -1240,7 +1283,7 @@ const Ze = {
|
|
|
1240
1283
|
e.host.removeEventListener("input", o), e.host.removeEventListener("keydown", a);
|
|
1241
1284
|
};
|
|
1242
1285
|
}
|
|
1243
|
-
},
|
|
1286
|
+
}, ue = "data-stamped", ut = {
|
|
1244
1287
|
name: "store",
|
|
1245
1288
|
category: "state",
|
|
1246
1289
|
defaults: {
|
|
@@ -1250,57 +1293,57 @@ const Ze = {
|
|
|
1250
1293
|
attach(e) {
|
|
1251
1294
|
const t = e.host, s = e.config("target") ?? ":scope", n = e.config("group-tag") ?? "aui-group", r = () => s === ":scope" ? t : t.querySelector(s) ?? t, a = (() => {
|
|
1252
1295
|
if (t.__listStore) return t.__listStore;
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1255
|
-
const p =
|
|
1256
|
-
if (p) return
|
|
1296
|
+
const h = t.getAttribute("store");
|
|
1297
|
+
if (h) {
|
|
1298
|
+
const p = me(h);
|
|
1299
|
+
if (p) return de(p);
|
|
1257
1300
|
}
|
|
1258
1301
|
const u = t.getAttribute("options");
|
|
1259
1302
|
if (u) {
|
|
1260
|
-
const p =
|
|
1261
|
-
if (p) return
|
|
1303
|
+
const p = ve(u);
|
|
1304
|
+
if (p) return de(p);
|
|
1262
1305
|
}
|
|
1263
|
-
return
|
|
1264
|
-
})(),
|
|
1306
|
+
return de([]);
|
|
1307
|
+
})(), d = (h) => {
|
|
1265
1308
|
const u = document.createElement("aui-option");
|
|
1266
|
-
return u.setAttribute("value",
|
|
1267
|
-
}, f = (
|
|
1309
|
+
return u.setAttribute("value", h.id), u.setAttribute("label", h.label), h.disabled && u.setAttribute("disabled", ""), h.icon && u.setAttribute("icon", h.icon), h.prefix && u.setAttribute("prefix", h.prefix), h.suffix && u.setAttribute("suffix", h.suffix), h.keywords && u.setAttribute("keywords", h.keywords), u.setAttribute(ue, ""), u;
|
|
1310
|
+
}, f = (h) => {
|
|
1268
1311
|
const u = document.createElement(n);
|
|
1269
|
-
u.setAttribute("heading",
|
|
1270
|
-
for (const p of
|
|
1271
|
-
u.appendChild(
|
|
1312
|
+
u.setAttribute("heading", h.heading), u.setAttribute(ue, "");
|
|
1313
|
+
for (const p of h.items)
|
|
1314
|
+
u.appendChild(d(p));
|
|
1272
1315
|
return u;
|
|
1273
|
-
}, i = (
|
|
1274
|
-
const u =
|
|
1316
|
+
}, i = (h) => {
|
|
1317
|
+
const u = h.querySelectorAll(`[${ue}]`);
|
|
1275
1318
|
for (const p of u) p.remove();
|
|
1276
|
-
}, l = (
|
|
1319
|
+
}, l = (h, u) => {
|
|
1277
1320
|
i(u);
|
|
1278
1321
|
const p = document.createDocumentFragment();
|
|
1279
1322
|
let g = 0;
|
|
1280
|
-
if (
|
|
1281
|
-
for (const v of
|
|
1323
|
+
if (Ce(h))
|
|
1324
|
+
for (const v of h)
|
|
1282
1325
|
p.appendChild(f(v)), g += v.items.length;
|
|
1283
1326
|
else
|
|
1284
|
-
for (const v of
|
|
1285
|
-
p.appendChild(
|
|
1327
|
+
for (const v of h)
|
|
1328
|
+
p.appendChild(d(v)), g++;
|
|
1286
1329
|
u.appendChild(p), e.expose("count", String(g));
|
|
1287
1330
|
};
|
|
1288
1331
|
e.addEffect(() => {
|
|
1289
|
-
const
|
|
1290
|
-
l(
|
|
1332
|
+
const h = a.data.value, u = r();
|
|
1333
|
+
l(h, u);
|
|
1291
1334
|
});
|
|
1292
|
-
const c = new MutationObserver((
|
|
1293
|
-
for (const u of
|
|
1335
|
+
const c = new MutationObserver((h) => {
|
|
1336
|
+
for (const u of h)
|
|
1294
1337
|
if (u.type === "attributes") {
|
|
1295
1338
|
const p = u.attributeName;
|
|
1296
1339
|
if (p === "store" || p === "options") {
|
|
1297
1340
|
let g = null;
|
|
1298
1341
|
if (p === "store") {
|
|
1299
1342
|
const v = t.getAttribute("store");
|
|
1300
|
-
v && (g =
|
|
1343
|
+
v && (g = me(v));
|
|
1301
1344
|
} else {
|
|
1302
1345
|
const v = t.getAttribute("options");
|
|
1303
|
-
v && (g =
|
|
1346
|
+
v && (g = ve(v));
|
|
1304
1347
|
}
|
|
1305
1348
|
g && (a.data.value = g);
|
|
1306
1349
|
}
|
|
@@ -1313,7 +1356,7 @@ const Ze = {
|
|
|
1313
1356
|
c.disconnect(), i(r());
|
|
1314
1357
|
};
|
|
1315
1358
|
}
|
|
1316
|
-
},
|
|
1359
|
+
}, ft = {
|
|
1317
1360
|
name: "text-trigger",
|
|
1318
1361
|
category: "state",
|
|
1319
1362
|
targets: "self",
|
|
@@ -1324,7 +1367,7 @@ const Ze = {
|
|
|
1324
1367
|
attach(e) {
|
|
1325
1368
|
const t = e.config("pattern") ?? "";
|
|
1326
1369
|
if (!t) return;
|
|
1327
|
-
const s = e.config("trigger") ?? "", n =
|
|
1370
|
+
const s = e.config("trigger") ?? "", n = se(!1);
|
|
1328
1371
|
let r;
|
|
1329
1372
|
try {
|
|
1330
1373
|
r = new RegExp(t);
|
|
@@ -1332,15 +1375,15 @@ const Ze = {
|
|
|
1332
1375
|
return;
|
|
1333
1376
|
}
|
|
1334
1377
|
const o = () => {
|
|
1335
|
-
const
|
|
1336
|
-
return
|
|
1378
|
+
const d = e.host;
|
|
1379
|
+
return d instanceof HTMLInputElement || d instanceof HTMLTextAreaElement ? d.value : d.textContent ?? "";
|
|
1337
1380
|
}, a = () => {
|
|
1338
|
-
const
|
|
1339
|
-
if (s && !
|
|
1381
|
+
const d = o();
|
|
1382
|
+
if (s && !d.includes(s)) {
|
|
1340
1383
|
n.value && (n.value = !1);
|
|
1341
1384
|
return;
|
|
1342
1385
|
}
|
|
1343
|
-
const f = r.exec(
|
|
1386
|
+
const f = r.exec(d);
|
|
1344
1387
|
f ? (n.value = !0, e.emit("text-trigger", {
|
|
1345
1388
|
match: f[0],
|
|
1346
1389
|
groups: f.slice(1)
|
|
@@ -1352,7 +1395,7 @@ const Ze = {
|
|
|
1352
1395
|
e.host.removeEventListener("input", a);
|
|
1353
1396
|
};
|
|
1354
1397
|
}
|
|
1355
|
-
},
|
|
1398
|
+
}, pt = {
|
|
1356
1399
|
name: "backtick-wrap",
|
|
1357
1400
|
category: "state",
|
|
1358
1401
|
targets: "self",
|
|
@@ -1361,9 +1404,9 @@ const Ze = {
|
|
|
1361
1404
|
const n = s;
|
|
1362
1405
|
if (n.key !== "`") return;
|
|
1363
1406
|
const r = e.host;
|
|
1364
|
-
let o = "", a = 0,
|
|
1407
|
+
let o = "", a = 0, d = 0;
|
|
1365
1408
|
if (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement)
|
|
1366
|
-
a = r.selectionStart ?? 0,
|
|
1409
|
+
a = r.selectionStart ?? 0, d = r.selectionEnd ?? 0, o = r.value.slice(a, d);
|
|
1367
1410
|
else {
|
|
1368
1411
|
const l = window.getSelection();
|
|
1369
1412
|
l && l.rangeCount > 0 && (o = l.toString());
|
|
@@ -1375,10 +1418,10 @@ const Ze = {
|
|
|
1375
1418
|
${o}
|
|
1376
1419
|
\`\`\`` : `\`${o}\``;
|
|
1377
1420
|
if (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement) {
|
|
1378
|
-
const l = r.value.slice(0, a), c = r.value.slice(
|
|
1421
|
+
const l = r.value.slice(0, a), c = r.value.slice(d);
|
|
1379
1422
|
r.value = l + i + c;
|
|
1380
|
-
const
|
|
1381
|
-
r.setSelectionRange(
|
|
1423
|
+
const h = a + i.length;
|
|
1424
|
+
r.setSelectionRange(h, h);
|
|
1382
1425
|
} else {
|
|
1383
1426
|
const l = window.getSelection();
|
|
1384
1427
|
if (l && l.rangeCount > 0) {
|
|
@@ -1392,7 +1435,7 @@ ${o}
|
|
|
1392
1435
|
e.host.removeEventListener("keydown", t);
|
|
1393
1436
|
};
|
|
1394
1437
|
}
|
|
1395
|
-
},
|
|
1438
|
+
}, mt = {
|
|
1396
1439
|
name: "validate",
|
|
1397
1440
|
category: "state",
|
|
1398
1441
|
targets: "self",
|
|
@@ -1404,11 +1447,11 @@ ${o}
|
|
|
1404
1447
|
message: ""
|
|
1405
1448
|
},
|
|
1406
1449
|
attach(e) {
|
|
1407
|
-
const t =
|
|
1450
|
+
const t = se(!0), s = se(""), n = () => {
|
|
1408
1451
|
const o = e.host;
|
|
1409
1452
|
return o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement ? o.value : o.textContent ?? "";
|
|
1410
1453
|
}, r = () => {
|
|
1411
|
-
const o = n(), a = e.config("required") === "true",
|
|
1454
|
+
const o = n(), a = e.config("required") === "true", d = e.config("pattern") ?? "", f = e.config("min-length") ?? "", i = e.config("max-length") ?? "", l = e.config("message") ?? "";
|
|
1412
1455
|
let c = "";
|
|
1413
1456
|
if (a && !o.trim() && (c = l || "This field is required"), !c && f) {
|
|
1414
1457
|
const p = parseInt(f, 10);
|
|
@@ -1418,15 +1461,15 @@ ${o}
|
|
|
1418
1461
|
const p = parseInt(i, 10);
|
|
1419
1462
|
!isNaN(p) && o.length > p && (c = l || `Maximum ${p} characters`);
|
|
1420
1463
|
}
|
|
1421
|
-
if (!c &&
|
|
1464
|
+
if (!c && d)
|
|
1422
1465
|
try {
|
|
1423
|
-
new RegExp(
|
|
1466
|
+
new RegExp(d).test(o) || (c = l || "Invalid format");
|
|
1424
1467
|
} catch {
|
|
1425
1468
|
}
|
|
1426
|
-
const
|
|
1427
|
-
t.value =
|
|
1469
|
+
const h = !c;
|
|
1470
|
+
t.value = h, s.value = c;
|
|
1428
1471
|
const u = e.host.internals;
|
|
1429
|
-
u?.setValidity && (
|
|
1472
|
+
u?.setValidity && (h ? u.setValidity({}) : u.setValidity({ customError: !0 }, c)), e.emit("validate", { valid: h, message: c, value: o });
|
|
1430
1473
|
};
|
|
1431
1474
|
return e.host.addEventListener("blur", r), e.host.addEventListener("input", r), e.addEffect(() => {
|
|
1432
1475
|
e.expose("valid", t.value), e.expose("message", s.value);
|
|
@@ -1434,18 +1477,18 @@ ${o}
|
|
|
1434
1477
|
e.host.removeEventListener("blur", r), e.host.removeEventListener("input", r);
|
|
1435
1478
|
};
|
|
1436
1479
|
}
|
|
1437
|
-
},
|
|
1480
|
+
}, vt = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])', gt = {
|
|
1438
1481
|
name: "trap-focus",
|
|
1439
1482
|
category: "focus",
|
|
1440
1483
|
targets: "self",
|
|
1441
1484
|
attach(e) {
|
|
1442
|
-
const t = () => [...e.host.querySelectorAll(
|
|
1485
|
+
const t = () => [...e.host.querySelectorAll(vt)], s = (n) => {
|
|
1443
1486
|
const r = n;
|
|
1444
1487
|
if (r.key !== "Tab") return;
|
|
1445
1488
|
const o = t();
|
|
1446
1489
|
if (o.length === 0) return;
|
|
1447
|
-
const a = o[0],
|
|
1448
|
-
r.shiftKey && f === a ? (r.preventDefault(),
|
|
1490
|
+
const a = o[0], d = o[o.length - 1], f = document.activeElement;
|
|
1491
|
+
r.shiftKey && f === a ? (r.preventDefault(), d.focus()) : !r.shiftKey && f === d && (r.preventDefault(), a.focus());
|
|
1449
1492
|
};
|
|
1450
1493
|
return e.host.addEventListener("keydown", s), queueMicrotask(() => {
|
|
1451
1494
|
const n = t();
|
|
@@ -1454,19 +1497,19 @@ ${o}
|
|
|
1454
1497
|
e.host.removeEventListener("keydown", s);
|
|
1455
1498
|
};
|
|
1456
1499
|
}
|
|
1457
|
-
},
|
|
1500
|
+
}, be = "[tabindex], button, a, input, select, textarea, aui-button", yt = {
|
|
1458
1501
|
name: "roving-focus",
|
|
1459
1502
|
category: "focus",
|
|
1460
1503
|
targets: "self",
|
|
1461
1504
|
defaults: {
|
|
1462
1505
|
orientation: "both",
|
|
1463
1506
|
wrap: "true",
|
|
1464
|
-
selector:
|
|
1507
|
+
selector: be
|
|
1465
1508
|
},
|
|
1466
1509
|
attach(e) {
|
|
1467
|
-
const t = e.config("orientation") ?? "both", s = (e.config("wrap") ?? "true") === "true", n = e.config("selector") ??
|
|
1468
|
-
for (let
|
|
1469
|
-
l[
|
|
1510
|
+
const t = e.config("orientation") ?? "both", s = (e.config("wrap") ?? "true") === "true", n = e.config("selector") ?? be, r = n.startsWith("> ") ? `:scope ${n}` : n, o = () => [...e.host.querySelectorAll(r)], a = (l, c) => {
|
|
1511
|
+
for (let h = 0; h < l.length; h++)
|
|
1512
|
+
l[h].setAttribute("tabindex", h === c ? "0" : "-1");
|
|
1470
1513
|
l[c].focus(), e.expose("active", String(c));
|
|
1471
1514
|
};
|
|
1472
1515
|
queueMicrotask(() => {
|
|
@@ -1475,19 +1518,19 @@ ${o}
|
|
|
1475
1518
|
l[c].setAttribute("tabindex", c === 0 ? "0" : "-1");
|
|
1476
1519
|
l.length > 0 && e.expose("active", "0");
|
|
1477
1520
|
});
|
|
1478
|
-
const
|
|
1479
|
-
const c = l,
|
|
1480
|
-
if (
|
|
1481
|
-
const u =
|
|
1521
|
+
const d = (l) => t === "horizontal" ? l === "ArrowRight" : t === "vertical" ? l === "ArrowDown" : l === "ArrowRight" || l === "ArrowDown", f = (l) => t === "horizontal" ? l === "ArrowLeft" : t === "vertical" ? l === "ArrowUp" : l === "ArrowLeft" || l === "ArrowUp", i = (l) => {
|
|
1522
|
+
const c = l, h = o();
|
|
1523
|
+
if (h.length === 0) return;
|
|
1524
|
+
const u = h.indexOf(document.activeElement);
|
|
1482
1525
|
if (u === -1) return;
|
|
1483
1526
|
let p;
|
|
1484
|
-
|
|
1527
|
+
d(c.key) ? (p = u + 1, p >= h.length && (p = s ? 0 : u)) : f(c.key) ? (p = u - 1, p < 0 && (p = s ? h.length - 1 : u)) : c.key === "Home" ? p = 0 : c.key === "End" && (p = h.length - 1), p !== void 0 && (c.preventDefault(), a(h, p));
|
|
1485
1528
|
};
|
|
1486
1529
|
return e.host.addEventListener("keydown", i), () => {
|
|
1487
1530
|
e.host.removeEventListener("keydown", i);
|
|
1488
1531
|
};
|
|
1489
1532
|
}
|
|
1490
|
-
},
|
|
1533
|
+
}, bt = {
|
|
1491
1534
|
name: "list-navigate",
|
|
1492
1535
|
category: "focus",
|
|
1493
1536
|
targets: "self",
|
|
@@ -1499,55 +1542,55 @@ ${o}
|
|
|
1499
1542
|
attach(e) {
|
|
1500
1543
|
const t = e.config("selector") ?? "> *", s = (e.config("typeahead") ?? "true") === "true", n = Number(e.config("timeout") ?? "500");
|
|
1501
1544
|
let r = -1, o = "", a;
|
|
1502
|
-
const
|
|
1545
|
+
const d = () => {
|
|
1503
1546
|
const l = t.startsWith("> ") ? `:scope ${t}` : t;
|
|
1504
1547
|
return [...e.host.querySelectorAll(l)];
|
|
1505
1548
|
}, f = (l, c) => {
|
|
1506
|
-
for (let
|
|
1507
|
-
|
|
1549
|
+
for (let h = 0; h < l.length; h++)
|
|
1550
|
+
h === c ? l[h].setAttribute("data-list-navigate-highlighted", "") : l[h].removeAttribute("data-list-navigate-highlighted");
|
|
1508
1551
|
r = c, e.expose("index", String(c)), l[c]?.scrollIntoView({ block: "nearest" });
|
|
1509
1552
|
}, i = (l) => {
|
|
1510
|
-
const c = l,
|
|
1511
|
-
if (
|
|
1553
|
+
const c = l, h = d();
|
|
1554
|
+
if (h.length === 0) return;
|
|
1512
1555
|
let u;
|
|
1513
1556
|
switch (c.key) {
|
|
1514
1557
|
case "ArrowDown":
|
|
1515
|
-
u = r <
|
|
1558
|
+
u = r < h.length - 1 ? r + 1 : 0;
|
|
1516
1559
|
break;
|
|
1517
1560
|
case "ArrowUp":
|
|
1518
|
-
u = r > 0 ? r - 1 :
|
|
1561
|
+
u = r > 0 ? r - 1 : h.length - 1;
|
|
1519
1562
|
break;
|
|
1520
1563
|
case "Home":
|
|
1521
1564
|
u = 0;
|
|
1522
1565
|
break;
|
|
1523
1566
|
case "End":
|
|
1524
|
-
u =
|
|
1567
|
+
u = h.length - 1;
|
|
1525
1568
|
break;
|
|
1526
1569
|
case "Enter":
|
|
1527
|
-
r >= 0 && r <
|
|
1570
|
+
r >= 0 && r < h.length && e.emit("activate", { index: r }), c.preventDefault();
|
|
1528
1571
|
return;
|
|
1529
1572
|
default:
|
|
1530
1573
|
if (s && c.key.length === 1 && !c.ctrlKey && !c.metaKey && !c.altKey) {
|
|
1531
1574
|
o += c.key.toLowerCase(), clearTimeout(a), a = setTimeout(() => {
|
|
1532
1575
|
o = "";
|
|
1533
1576
|
}, n);
|
|
1534
|
-
const p =
|
|
1577
|
+
const p = h.findIndex(
|
|
1535
1578
|
(g) => (g.textContent ?? "").trim().toLowerCase().startsWith(o)
|
|
1536
1579
|
);
|
|
1537
1580
|
p !== -1 && (u = p);
|
|
1538
1581
|
}
|
|
1539
1582
|
break;
|
|
1540
1583
|
}
|
|
1541
|
-
u !== void 0 && (c.preventDefault(), f(
|
|
1584
|
+
u !== void 0 && (c.preventDefault(), f(h, u));
|
|
1542
1585
|
};
|
|
1543
1586
|
return queueMicrotask(() => {
|
|
1544
|
-
const l =
|
|
1587
|
+
const l = d();
|
|
1545
1588
|
l.length > 0 && f(l, 0);
|
|
1546
1589
|
}), e.host.addEventListener("keydown", i), () => {
|
|
1547
1590
|
e.host.removeEventListener("keydown", i), clearTimeout(a);
|
|
1548
1591
|
};
|
|
1549
1592
|
}
|
|
1550
|
-
},
|
|
1593
|
+
}, Et = CSS.supports?.("position-anchor: --x") ?? !1, wt = {
|
|
1551
1594
|
name: "tooltip",
|
|
1552
1595
|
category: "present",
|
|
1553
1596
|
targets: "self",
|
|
@@ -1558,28 +1601,28 @@ ${o}
|
|
|
1558
1601
|
attach(e) {
|
|
1559
1602
|
const t = e.config("text") ?? "", s = parseInt(e.config("delay") ?? "500", 10), n = e.config("position") ?? "top";
|
|
1560
1603
|
let r, o;
|
|
1561
|
-
const a = 6,
|
|
1562
|
-
const c = e.host.getBoundingClientRect(),
|
|
1604
|
+
const a = 6, d = (l) => {
|
|
1605
|
+
const c = e.host.getBoundingClientRect(), h = l.getBoundingClientRect();
|
|
1563
1606
|
let u = 0, p = 0;
|
|
1564
1607
|
switch (n) {
|
|
1565
1608
|
case "top":
|
|
1566
|
-
u = c.top -
|
|
1609
|
+
u = c.top - h.height - a, p = c.left + (c.width - h.width) / 2;
|
|
1567
1610
|
break;
|
|
1568
1611
|
case "bottom":
|
|
1569
|
-
u = c.bottom + a, p = c.left + (c.width -
|
|
1612
|
+
u = c.bottom + a, p = c.left + (c.width - h.width) / 2;
|
|
1570
1613
|
break;
|
|
1571
1614
|
case "left":
|
|
1572
|
-
u = c.top + (c.height -
|
|
1615
|
+
u = c.top + (c.height - h.height) / 2, p = c.left - h.width - a;
|
|
1573
1616
|
break;
|
|
1574
1617
|
case "right":
|
|
1575
|
-
u = c.top + (c.height -
|
|
1618
|
+
u = c.top + (c.height - h.height) / 2, p = c.right + a;
|
|
1576
1619
|
break;
|
|
1577
1620
|
}
|
|
1578
|
-
u = Math.max(4, Math.min(u, window.innerHeight -
|
|
1621
|
+
u = Math.max(4, Math.min(u, window.innerHeight - h.height - 4)), p = Math.max(4, Math.min(p, window.innerWidth - h.width - 4)), l.style.top = `${u}px`, l.style.left = `${p}px`;
|
|
1579
1622
|
}, f = () => {
|
|
1580
1623
|
r = setTimeout(() => {
|
|
1581
|
-
if (o = document.createElement("div"), o.setAttribute("data-aui-tooltip", ""), o.setAttribute("popover", "manual"), o.setAttribute("role", "tooltip"), o.setAttribute("data-tooltip-position", n), o.textContent = t, document.body.appendChild(o), o.showPopover(), !
|
|
1582
|
-
|
|
1624
|
+
if (o = document.createElement("div"), o.setAttribute("data-aui-tooltip", ""), o.setAttribute("popover", "manual"), o.setAttribute("role", "tooltip"), o.setAttribute("data-tooltip-position", n), o.textContent = t, document.body.appendChild(o), o.showPopover(), !Et)
|
|
1625
|
+
d(o);
|
|
1583
1626
|
else {
|
|
1584
1627
|
const l = `--aui-tt-${Date.now()}`;
|
|
1585
1628
|
e.host.style.setProperty("anchor-name", l), o.style.setProperty("position-anchor", l);
|
|
@@ -1600,7 +1643,7 @@ ${o}
|
|
|
1600
1643
|
i(), e.host.removeEventListener("mouseenter", f), e.host.removeEventListener("focusin", f), e.host.removeEventListener("mouseleave", i), e.host.removeEventListener("focusout", i);
|
|
1601
1644
|
};
|
|
1602
1645
|
}
|
|
1603
|
-
},
|
|
1646
|
+
}, Lt = {
|
|
1604
1647
|
name: "collapsible",
|
|
1605
1648
|
category: "present",
|
|
1606
1649
|
targets: "self",
|
|
@@ -1631,8 +1674,8 @@ ${o}
|
|
|
1631
1674
|
};
|
|
1632
1675
|
}
|
|
1633
1676
|
};
|
|
1634
|
-
let
|
|
1635
|
-
const
|
|
1677
|
+
let At = 0;
|
|
1678
|
+
const ke = (e, t) => ({
|
|
1636
1679
|
name: e,
|
|
1637
1680
|
category: "present",
|
|
1638
1681
|
targets: "self",
|
|
@@ -1646,14 +1689,14 @@ const Le = (e, t) => ({
|
|
|
1646
1689
|
},
|
|
1647
1690
|
actions: ["open", "close", "dismiss"],
|
|
1648
1691
|
attach(s) {
|
|
1649
|
-
const n = (s.config("closable") ?? "true") === "true", r = s.config("anchor") ?? "", o = s.config("placement") ?? "block-end span-inline-end", a = s.config("type") ?? (t ? "manual" : "auto"),
|
|
1692
|
+
const n = (s.config("closable") ?? "true") === "true", r = s.config("anchor") ?? "", o = s.config("placement") ?? "block-end span-inline-end", a = s.config("type") ?? (t ? "manual" : "auto"), d = (s.config("matchWidth") ?? "false") === "true", f = s.config("animation") ?? "scale";
|
|
1650
1693
|
let i = !1, l = null;
|
|
1651
1694
|
const c = [];
|
|
1652
1695
|
s.host.setAttribute("popover", a), s.expose("open", !1), f !== "none" && (s.host.setAttribute("data-overlay-animation", f), r && s.host.setAttribute("data-overlay-direction", o.split(" ")[0] ?? "block-end"), requestAnimationFrame(() => {
|
|
1653
1696
|
s.host.setAttribute("data-overlay-ready", "");
|
|
1654
1697
|
}));
|
|
1655
|
-
let
|
|
1656
|
-
r && (s.host.setAttribute("data-overlay-anchored", ""),
|
|
1698
|
+
let h = "", u = null;
|
|
1699
|
+
r && (s.host.setAttribute("data-overlay-anchored", ""), h = `--aui-overlay-${++At}`, s.host.style.setProperty("position-anchor", h), s.host.style.setProperty("position-area", o), d && s.host.setAttribute("data-overlay-match-width", ""), u = document.querySelector(r), u && u.style.setProperty("anchor-name", h));
|
|
1657
1700
|
const p = () => {
|
|
1658
1701
|
if (!r) return;
|
|
1659
1702
|
const H = document.querySelector(r);
|
|
@@ -1707,7 +1750,7 @@ const Le = (e, t) => ({
|
|
|
1707
1750
|
s.host.removeAttribute("popover"), s.host.removeAttribute("data-overlay-anchored"), s.host.removeAttribute("data-overlay-match-width"), s.host.removeAttribute("data-overlay-animation"), s.host.removeAttribute("data-overlay-ready"), s.host.removeAttribute("data-overlay-direction"), s.host.style.removeProperty("position-anchor"), s.host.style.removeProperty("position-area");
|
|
1708
1751
|
};
|
|
1709
1752
|
}
|
|
1710
|
-
}),
|
|
1753
|
+
}), Tt = ke("popover", !1), kt = ke("modal", !0), Ct = {
|
|
1711
1754
|
name: "dismiss",
|
|
1712
1755
|
category: "present",
|
|
1713
1756
|
targets: "self",
|
|
@@ -1718,17 +1761,17 @@ const Le = (e, t) => ({
|
|
|
1718
1761
|
},
|
|
1719
1762
|
attach(e) {
|
|
1720
1763
|
const t = (e.config("escape") ?? "true") === "true", s = (e.config("outside") ?? "true") === "true", n = e.config("event") ?? "dismiss", r = (a) => {
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1764
|
+
const d = a;
|
|
1765
|
+
d.key === "Escape" && (d.preventDefault(), e.emit(n));
|
|
1723
1766
|
}, o = (a) => {
|
|
1724
|
-
const
|
|
1725
|
-
e.host.contains(
|
|
1767
|
+
const d = a;
|
|
1768
|
+
e.host.contains(d.target) || e.emit(n);
|
|
1726
1769
|
};
|
|
1727
1770
|
return t && document.addEventListener("keydown", r), s && document.addEventListener("pointerdown", o), () => {
|
|
1728
1771
|
t && document.removeEventListener("keydown", r), s && document.removeEventListener("pointerdown", o);
|
|
1729
1772
|
};
|
|
1730
1773
|
}
|
|
1731
|
-
},
|
|
1774
|
+
}, Pt = {
|
|
1732
1775
|
name: "auto-dismiss",
|
|
1733
1776
|
category: "present",
|
|
1734
1777
|
targets: "self",
|
|
@@ -1749,7 +1792,7 @@ const Le = (e, t) => ({
|
|
|
1749
1792
|
clearTimeout(r), clearInterval(n), e.host.removeEventListener("pointerenter", o), e.host.removeEventListener("pointerleave", a);
|
|
1750
1793
|
};
|
|
1751
1794
|
}
|
|
1752
|
-
},
|
|
1795
|
+
}, St = {
|
|
1753
1796
|
name: "gateway",
|
|
1754
1797
|
category: "present",
|
|
1755
1798
|
targets: "external",
|
|
@@ -1773,7 +1816,7 @@ const Le = (e, t) => ({
|
|
|
1773
1816
|
r.remove(), n.remove();
|
|
1774
1817
|
};
|
|
1775
1818
|
}
|
|
1776
|
-
},
|
|
1819
|
+
}, Mt = {
|
|
1777
1820
|
name: "present",
|
|
1778
1821
|
category: "present",
|
|
1779
1822
|
targets: "self",
|
|
@@ -1797,21 +1840,21 @@ const Le = (e, t) => ({
|
|
|
1797
1840
|
s && (r(), s = !1, e.expose("visible", !1), e.host.setAttribute("data-present-leaving", ""), n = setTimeout(() => {
|
|
1798
1841
|
e.host.removeAttribute("data-present-leaving"), e.host.setAttribute("data-present-hidden", ""), n = null;
|
|
1799
1842
|
}, t));
|
|
1800
|
-
},
|
|
1843
|
+
}, d = () => {
|
|
1801
1844
|
s ? a() : o();
|
|
1802
|
-
}, f = () =>
|
|
1845
|
+
}, f = () => d(), i = () => o(), l = () => a();
|
|
1803
1846
|
return e.host.addEventListener("toggle", f), e.host.addEventListener("show", i), e.host.addEventListener("hide", l), () => {
|
|
1804
1847
|
r(), e.host.removeEventListener("toggle", f), e.host.removeEventListener("show", i), e.host.removeEventListener("hide", l), e.host.removeAttribute("data-present-entering"), e.host.removeAttribute("data-present-leaving"), e.host.removeAttribute("data-present-hidden");
|
|
1805
1848
|
};
|
|
1806
1849
|
}
|
|
1807
|
-
},
|
|
1850
|
+
}, Ee = {
|
|
1808
1851
|
"top-right": { top: "1rem", right: "1rem", left: "", bottom: "" },
|
|
1809
1852
|
"top-left": { top: "1rem", left: "1rem", right: "", bottom: "" },
|
|
1810
1853
|
"bottom-right": { bottom: "1rem", right: "1rem", top: "", left: "" },
|
|
1811
1854
|
"bottom-left": { bottom: "1rem", left: "1rem", top: "", right: "" },
|
|
1812
1855
|
"top-center": { top: "1rem", left: "50%", right: "", bottom: "", translate: "-50% 0" },
|
|
1813
1856
|
"bottom-center": { bottom: "1rem", left: "50%", right: "", top: "", translate: "-50% 0" }
|
|
1814
|
-
},
|
|
1857
|
+
}, $t = (e, t) => {
|
|
1815
1858
|
const s = document.querySelectorAll("[data-toast-visible]");
|
|
1816
1859
|
let n = 0;
|
|
1817
1860
|
for (const r of s) {
|
|
@@ -1820,7 +1863,7 @@ const Le = (e, t) => ({
|
|
|
1820
1863
|
n += o.height + 8;
|
|
1821
1864
|
}
|
|
1822
1865
|
return n;
|
|
1823
|
-
},
|
|
1866
|
+
}, It = {
|
|
1824
1867
|
name: "toast",
|
|
1825
1868
|
category: "present",
|
|
1826
1869
|
targets: "self",
|
|
@@ -1830,33 +1873,33 @@ const Le = (e, t) => ({
|
|
|
1830
1873
|
stack: "true"
|
|
1831
1874
|
},
|
|
1832
1875
|
attach(e) {
|
|
1833
|
-
const t = parseInt(e.config("duration") ?? "3000", 10), s = e.config("position") ?? "bottom-right", n = e.config("stack") !== "false", r =
|
|
1834
|
-
for (const [
|
|
1835
|
-
e.host.style.setProperty(
|
|
1876
|
+
const t = parseInt(e.config("duration") ?? "3000", 10), s = e.config("position") ?? "bottom-right", n = e.config("stack") !== "false", r = Ee[s] ?? Ee["bottom-right"];
|
|
1877
|
+
for (const [d, f] of Object.entries(r))
|
|
1878
|
+
e.host.style.setProperty(d, f);
|
|
1836
1879
|
if (n) {
|
|
1837
|
-
const
|
|
1880
|
+
const d = $t(s, e.host);
|
|
1838
1881
|
if (s.startsWith("top")) {
|
|
1839
1882
|
const i = parseFloat(r.top ?? "16");
|
|
1840
|
-
e.host.style.top = `calc(${i}rem + ${
|
|
1883
|
+
e.host.style.top = `calc(${i}rem + ${d}px)`;
|
|
1841
1884
|
} else {
|
|
1842
1885
|
const i = parseFloat(r.bottom ?? "16");
|
|
1843
|
-
e.host.style.bottom = `calc(${i}rem + ${
|
|
1886
|
+
e.host.style.bottom = `calc(${i}rem + ${d}px)`;
|
|
1844
1887
|
}
|
|
1845
1888
|
}
|
|
1846
1889
|
e.expose("visible", !0);
|
|
1847
1890
|
let o;
|
|
1848
1891
|
const a = () => {
|
|
1849
1892
|
e.host.setAttribute("data-toast-dismissing", "");
|
|
1850
|
-
const
|
|
1851
|
-
e.host.removeEventListener("transitionend",
|
|
1893
|
+
const d = () => {
|
|
1894
|
+
e.host.removeEventListener("transitionend", d), e.expose("visible", !1), e.host.removeAttribute("data-toast-dismissing"), e.host.setAttribute("data-toast-hidden", ""), e.emit("toast-dismiss");
|
|
1852
1895
|
};
|
|
1853
|
-
e.host.addEventListener("transitionend",
|
|
1896
|
+
e.host.addEventListener("transitionend", d);
|
|
1854
1897
|
};
|
|
1855
1898
|
return t > 0 && (o = setTimeout(a, t)), () => {
|
|
1856
1899
|
o !== void 0 && clearTimeout(o), e.host.removeAttribute("data-toast-dismissing"), e.host.removeAttribute("data-toast-hidden"), e.host.style.top = "", e.host.style.right = "", e.host.style.bottom = "", e.host.style.left = "", e.host.style.translate = "", e.unexpose("visible");
|
|
1857
1900
|
};
|
|
1858
1901
|
}
|
|
1859
|
-
},
|
|
1902
|
+
}, zt = {
|
|
1860
1903
|
name: "virtual-scroll",
|
|
1861
1904
|
category: "present",
|
|
1862
1905
|
targets: "self",
|
|
@@ -1871,28 +1914,28 @@ const Le = (e, t) => ({
|
|
|
1871
1914
|
const r = document.createElement("div");
|
|
1872
1915
|
r.style.height = `${n * t}px`, r.setAttribute("aria-hidden", "true"), r.setAttribute("data-virtual-spacer", ""), e.host.prepend(r);
|
|
1873
1916
|
const o = () => {
|
|
1874
|
-
const a = e.host.scrollTop,
|
|
1917
|
+
const a = e.host.scrollTop, d = e.host.clientHeight, f = Math.floor(a / t), i = Math.ceil((a + d) / t), l = Math.max(0, f - s), c = Math.min(n - 1, i + s);
|
|
1875
1918
|
e.expose("start", String(l)), e.expose("end", String(c)), e.emit("virtual-range", { start: l, end: c });
|
|
1876
|
-
const
|
|
1919
|
+
const h = [...e.host.children].filter(
|
|
1877
1920
|
(u) => !u.hasAttribute("data-virtual-spacer")
|
|
1878
1921
|
);
|
|
1879
|
-
for (let u = 0; u <
|
|
1922
|
+
for (let u = 0; u < h.length; u++) {
|
|
1880
1923
|
const p = l + u;
|
|
1881
|
-
p <= c && (
|
|
1924
|
+
p <= c && (h[u].style.height = `${t}px`, h[u].style.transform = `translateY(${p * t}px)`);
|
|
1882
1925
|
}
|
|
1883
1926
|
};
|
|
1884
1927
|
return queueMicrotask(o), e.host.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
1885
1928
|
e.host.removeEventListener("scroll", o), r.remove();
|
|
1886
1929
|
};
|
|
1887
1930
|
}
|
|
1888
|
-
},
|
|
1931
|
+
}, Rt = {
|
|
1889
1932
|
name: "ripple",
|
|
1890
1933
|
category: "effect",
|
|
1891
1934
|
targets: "self",
|
|
1892
1935
|
attach(e) {
|
|
1893
1936
|
const t = (n) => {
|
|
1894
|
-
const r = n, o = e.host, a = o.getBoundingClientRect(),
|
|
1895
|
-
o.style.setProperty("--ripple-x", `${r.clientX - a.left}px`), o.style.setProperty("--ripple-y", `${r.clientY - a.top}px`), o.style.setProperty("--ripple-size", `${
|
|
1937
|
+
const r = n, o = e.host, a = o.getBoundingClientRect(), d = Math.max(a.width, a.height) * 2;
|
|
1938
|
+
o.style.setProperty("--ripple-x", `${r.clientX - a.left}px`), o.style.setProperty("--ripple-y", `${r.clientY - a.top}px`), o.style.setProperty("--ripple-size", `${d}px`), o.removeAttribute("data-ripple-active"), o.offsetWidth, o.setAttribute("data-ripple-active", "");
|
|
1896
1939
|
}, s = (n) => {
|
|
1897
1940
|
n.animationName === "aui-ripple" && e.host.removeAttribute("data-ripple-active");
|
|
1898
1941
|
};
|
|
@@ -1900,7 +1943,7 @@ const Le = (e, t) => ({
|
|
|
1900
1943
|
e.host.removeEventListener("pointerdown", t), e.host.removeEventListener("animationend", s), e.host.removeAttribute("data-ripple-active"), e.host.style.removeProperty("--ripple-x"), e.host.style.removeProperty("--ripple-y"), e.host.style.removeProperty("--ripple-size");
|
|
1901
1944
|
};
|
|
1902
1945
|
}
|
|
1903
|
-
},
|
|
1946
|
+
}, we = ["#ff577f", "#ff884b", "#ffd384", "#fff9b0", "#3ec1d3", "#7c5cbf", "#ff6b6b", "#48dbfb"], Dt = {
|
|
1904
1947
|
name: "confetti",
|
|
1905
1948
|
category: "effect",
|
|
1906
1949
|
targets: "self",
|
|
@@ -1913,15 +1956,15 @@ const Le = (e, t) => ({
|
|
|
1913
1956
|
},
|
|
1914
1957
|
actions: ["press"],
|
|
1915
1958
|
attach(e) {
|
|
1916
|
-
const t = parseInt(e.config("count") ?? "30", 10), s = parseInt(e.config("spread") ?? "90", 10), n = parseFloat(e.config("velocity") ?? "12"), r = parseFloat(e.config("gravity") ?? "0.5"), o = parseInt(e.config("duration") ?? "2000", 10), a = /* @__PURE__ */ new Set(),
|
|
1959
|
+
const t = parseInt(e.config("count") ?? "30", 10), s = parseInt(e.config("spread") ?? "90", 10), n = parseFloat(e.config("velocity") ?? "12"), r = parseFloat(e.config("gravity") ?? "0.5"), o = parseInt(e.config("duration") ?? "2000", 10), a = /* @__PURE__ */ new Set(), d = () => {
|
|
1917
1960
|
const f = e.host.getBoundingClientRect(), i = f.left + f.width / 2, l = f.top + f.height / 2, c = document.createElement("div");
|
|
1918
1961
|
c.style.cssText = "position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:9999;", document.body.appendChild(c), a.add(c);
|
|
1919
|
-
const
|
|
1962
|
+
const h = [], u = s / 2 * (Math.PI / 180), p = -Math.PI / 2;
|
|
1920
1963
|
for (let M = 0; M < t; M++) {
|
|
1921
|
-
const k = document.createElement("div"), b = 6 + Math.random() * 5, O =
|
|
1964
|
+
const k = document.createElement("div"), b = 6 + Math.random() * 5, O = we[M % we.length], E = Math.random() > 0.5;
|
|
1922
1965
|
k.style.cssText = `position:absolute;width:${b}px;height:${b}px;background:${O};border-radius:${E ? "50%" : "2px"};left:${i}px;top:${l}px;pointer-events:none;`, c.appendChild(k);
|
|
1923
1966
|
const _ = p + (Math.random() * 2 - 1) * u, U = n * (0.7 + Math.random() * 0.6);
|
|
1924
|
-
|
|
1967
|
+
h.push({
|
|
1925
1968
|
el: k,
|
|
1926
1969
|
x: 0,
|
|
1927
1970
|
y: 0,
|
|
@@ -1939,19 +1982,19 @@ const Le = (e, t) => ({
|
|
|
1939
1982
|
c.remove(), a.delete(c), a.size === 0 && e.host.removeAttribute("data-confetti-active");
|
|
1940
1983
|
return;
|
|
1941
1984
|
}
|
|
1942
|
-
for (const b of
|
|
1985
|
+
for (const b of h)
|
|
1943
1986
|
b.vy += r, b.vx *= 0.98, b.vy *= 0.98, b.x += b.vx, b.y += b.vy, b.rotation += b.rotationSpeed, k > v && (b.opacity = 1 - (k - v) / (o - v)), b.el.style.transform = `translate(${b.x}px, ${b.y}px) rotate(${b.rotation}deg)`, b.el.style.opacity = String(b.opacity);
|
|
1944
1987
|
requestAnimationFrame(P);
|
|
1945
1988
|
};
|
|
1946
1989
|
requestAnimationFrame(P);
|
|
1947
1990
|
};
|
|
1948
|
-
return e.host.addEventListener("press",
|
|
1949
|
-
e.host.removeEventListener("press",
|
|
1991
|
+
return e.host.addEventListener("press", d), () => {
|
|
1992
|
+
e.host.removeEventListener("press", d);
|
|
1950
1993
|
for (const f of a) f.remove();
|
|
1951
1994
|
a.clear();
|
|
1952
1995
|
};
|
|
1953
1996
|
}
|
|
1954
|
-
},
|
|
1997
|
+
}, Ht = {
|
|
1955
1998
|
name: "flip",
|
|
1956
1999
|
category: "effect",
|
|
1957
2000
|
targets: "self",
|
|
@@ -1971,7 +2014,7 @@ const Le = (e, t) => ({
|
|
|
1971
2014
|
e.host.removeEventListener("press", r), e.host.removeAttribute("data-flip-direction"), e.host.style.removeProperty("--aui-flip-duration"), e.unexpose("flipped");
|
|
1972
2015
|
};
|
|
1973
2016
|
}
|
|
1974
|
-
},
|
|
2017
|
+
}, Yt = {
|
|
1975
2018
|
name: "parallax",
|
|
1976
2019
|
category: "effect",
|
|
1977
2020
|
targets: "self",
|
|
@@ -1983,17 +2026,17 @@ const Le = (e, t) => ({
|
|
|
1983
2026
|
const t = parseFloat(e.config("speed") ?? "0.5"), n = (e.config("direction") ?? "vertical") === "vertical", r = "--_parallax-offset";
|
|
1984
2027
|
e.host.style.transform = n ? `translateY(var(${r}, 0px))` : `translateX(var(${r}, 0px))`, e.host.style.willChange = "transform";
|
|
1985
2028
|
let o = 0, a = !1;
|
|
1986
|
-
const
|
|
1987
|
-
const i = e.host.getBoundingClientRect(), l = n ? window.innerHeight : window.innerWidth,
|
|
1988
|
-
e.host.style.setProperty(r, `${
|
|
2029
|
+
const d = () => {
|
|
2030
|
+
const i = e.host.getBoundingClientRect(), l = n ? window.innerHeight : window.innerWidth, h = ((n ? i.top + i.height / 2 : i.left + i.width / 2) - l / 2) * t;
|
|
2031
|
+
e.host.style.setProperty(r, `${h}px`), a = !1;
|
|
1989
2032
|
}, f = () => {
|
|
1990
|
-
a || (o = requestAnimationFrame(
|
|
2033
|
+
a || (o = requestAnimationFrame(d), a = !0);
|
|
1991
2034
|
};
|
|
1992
|
-
return
|
|
2035
|
+
return d(), window.addEventListener("scroll", f, { passive: !0 }), window.addEventListener("resize", f, { passive: !0 }), () => {
|
|
1993
2036
|
cancelAnimationFrame(o), window.removeEventListener("scroll", f), window.removeEventListener("resize", f), e.host.style.transform = "", e.host.style.willChange = "", e.host.style.removeProperty(r);
|
|
1994
2037
|
};
|
|
1995
2038
|
}
|
|
1996
|
-
},
|
|
2039
|
+
}, Xt = {
|
|
1997
2040
|
name: "toss",
|
|
1998
2041
|
category: "effect",
|
|
1999
2042
|
targets: "self",
|
|
@@ -2009,25 +2052,25 @@ const Le = (e, t) => ({
|
|
|
2009
2052
|
const a = (f) => {
|
|
2010
2053
|
const i = f, l = performance.now();
|
|
2011
2054
|
r.push({ x: i.clientX, y: i.clientY, t: l }), r.length > 4 && (r = r.slice(-4));
|
|
2012
|
-
},
|
|
2055
|
+
}, d = () => {
|
|
2013
2056
|
if (r.length < 2) {
|
|
2014
2057
|
r = [];
|
|
2015
2058
|
return;
|
|
2016
2059
|
}
|
|
2017
2060
|
const f = r[0], i = r[r.length - 1], l = i.t - f.t || 1;
|
|
2018
|
-
let c = (i.x - f.x) / l * 16,
|
|
2061
|
+
let c = (i.x - f.x) / l * 16, h = (i.y - f.y) / l * 16;
|
|
2019
2062
|
r = [];
|
|
2020
2063
|
let u = 0, p = 0;
|
|
2021
2064
|
o !== null && cancelAnimationFrame(o), e.expose("active", !0);
|
|
2022
2065
|
const g = () => {
|
|
2023
|
-
u += c, p +=
|
|
2066
|
+
u += c, p += h;
|
|
2024
2067
|
const v = Math.sqrt(u * u + p * p);
|
|
2025
2068
|
if (v > n) {
|
|
2026
2069
|
const k = n / v;
|
|
2027
|
-
u *= k, p *= k, c *= 0.5,
|
|
2070
|
+
u *= k, p *= k, c *= 0.5, h *= 0.5;
|
|
2028
2071
|
}
|
|
2029
|
-
c *= t,
|
|
2030
|
-
const P = Math.abs(c) + Math.abs(
|
|
2072
|
+
c *= t, h *= t, u -= u * s, p -= p * s, e.host.style.setProperty("--_toss-x", `${u}px`), e.host.style.setProperty("--_toss-y", `${p}px`);
|
|
2073
|
+
const P = Math.abs(c) + Math.abs(h), M = Math.abs(u) + Math.abs(p);
|
|
2031
2074
|
if (P < 0.1 && M < 0.5) {
|
|
2032
2075
|
e.host.style.setProperty("--_toss-x", "0px"), e.host.style.setProperty("--_toss-y", "0px"), e.unexpose("active"), o = null;
|
|
2033
2076
|
return;
|
|
@@ -2036,11 +2079,11 @@ const Le = (e, t) => ({
|
|
|
2036
2079
|
};
|
|
2037
2080
|
o = requestAnimationFrame(g);
|
|
2038
2081
|
};
|
|
2039
|
-
return e.host.addEventListener("pointermove", a), e.host.addEventListener("pointerup",
|
|
2040
|
-
e.host.removeEventListener("pointermove", a), e.host.removeEventListener("pointerup",
|
|
2082
|
+
return e.host.addEventListener("pointermove", a), e.host.addEventListener("pointerup", d), () => {
|
|
2083
|
+
e.host.removeEventListener("pointermove", a), e.host.removeEventListener("pointerup", d), o !== null && (cancelAnimationFrame(o), o = null), e.host.style.removeProperty("--_toss-x"), e.host.style.removeProperty("--_toss-y");
|
|
2041
2084
|
};
|
|
2042
2085
|
}
|
|
2043
|
-
},
|
|
2086
|
+
}, Nt = {
|
|
2044
2087
|
name: "magnet",
|
|
2045
2088
|
category: "effect",
|
|
2046
2089
|
targets: "self",
|
|
@@ -2052,8 +2095,8 @@ const Le = (e, t) => ({
|
|
|
2052
2095
|
const t = parseFloat(e.config("strength") ?? "10"), s = parseFloat(e.config("tilt") ?? "5");
|
|
2053
2096
|
e.host.style.setProperty("--_magnet-x", "0px"), e.host.style.setProperty("--_magnet-y", "0px"), e.host.style.setProperty("--_magnet-rx", "0deg"), e.host.style.setProperty("--_magnet-ry", "0deg"), e.host.style.transform = "perspective(800px) translate(var(--_magnet-x), var(--_magnet-y)) rotateX(var(--_magnet-rx)) rotateY(var(--_magnet-ry))", e.host.style.willChange = "transform";
|
|
2054
2097
|
const n = (a) => {
|
|
2055
|
-
const
|
|
2056
|
-
e.host.style.setProperty("--_magnet-x", `${c * t}px`), e.host.style.setProperty("--_magnet-y", `${
|
|
2098
|
+
const d = a, f = e.host.getBoundingClientRect(), i = f.left + f.width / 2, l = f.top + f.height / 2, c = (d.clientX - i) / (f.width / 2), h = (d.clientY - l) / (f.height / 2);
|
|
2099
|
+
e.host.style.setProperty("--_magnet-x", `${c * t}px`), e.host.style.setProperty("--_magnet-y", `${h * t}px`), e.host.style.setProperty("--_magnet-rx", `${-h * s}deg`), e.host.style.setProperty("--_magnet-ry", `${c * s}deg`);
|
|
2057
2100
|
}, r = () => {
|
|
2058
2101
|
e.host.style.transition = "none";
|
|
2059
2102
|
}, o = () => {
|
|
@@ -2063,7 +2106,7 @@ const Le = (e, t) => ({
|
|
|
2063
2106
|
e.host.removeEventListener("mousemove", n), e.host.removeEventListener("mouseenter", r), e.host.removeEventListener("mouseleave", o), e.host.style.willChange = "", e.host.style.transition = "", e.host.style.transform = "", e.host.style.removeProperty("--_magnet-x"), e.host.style.removeProperty("--_magnet-y"), e.host.style.removeProperty("--_magnet-rx"), e.host.style.removeProperty("--_magnet-ry");
|
|
2064
2107
|
};
|
|
2065
2108
|
}
|
|
2066
|
-
},
|
|
2109
|
+
}, Le = "http://www.w3.org/2000/svg", Ot = {
|
|
2067
2110
|
name: "noodle",
|
|
2068
2111
|
category: "effect",
|
|
2069
2112
|
targets: "external",
|
|
@@ -2076,11 +2119,11 @@ const Le = (e, t) => ({
|
|
|
2076
2119
|
attach(e) {
|
|
2077
2120
|
const t = e.config("target") ?? "", s = e.config("color") ?? "currentColor", n = parseFloat(e.config("width") ?? "2"), r = parseFloat(e.config("curvature") ?? "0.5");
|
|
2078
2121
|
if (!t) return;
|
|
2079
|
-
const o = document.createElementNS(
|
|
2122
|
+
const o = document.createElementNS(Le, "svg");
|
|
2080
2123
|
o.setAttribute("data-noodle-svg", ""), o.setAttribute("aria-hidden", "true");
|
|
2081
|
-
const a = document.createElementNS(
|
|
2124
|
+
const a = document.createElementNS(Le, "path");
|
|
2082
2125
|
a.setAttribute("fill", "none"), a.setAttribute("stroke", s), a.setAttribute("stroke-width", String(n)), a.setAttribute("stroke-linecap", "round"), o.appendChild(a), document.body.appendChild(o);
|
|
2083
|
-
let
|
|
2126
|
+
let d = 0, f = !1;
|
|
2084
2127
|
const i = () => {
|
|
2085
2128
|
const u = document.querySelector(t);
|
|
2086
2129
|
if (!u) {
|
|
@@ -2091,18 +2134,18 @@ const Le = (e, t) => ({
|
|
|
2091
2134
|
const p = e.host.getBoundingClientRect(), g = u.getBoundingClientRect(), v = p.left + p.width / 2, P = p.top + p.height / 2, M = g.left + g.width / 2, k = g.top + g.height / 2, b = Math.abs(M - v) * r, O = v + b, E = P, _ = M - b, U = k;
|
|
2092
2135
|
a.setAttribute("d", `M ${v} ${P} C ${O} ${E}, ${_} ${U}, ${M} ${k}`), f = !1;
|
|
2093
2136
|
}, l = () => {
|
|
2094
|
-
f || (
|
|
2137
|
+
f || (d = requestAnimationFrame(i), f = !0);
|
|
2095
2138
|
};
|
|
2096
2139
|
i();
|
|
2097
2140
|
const c = new ResizeObserver(l);
|
|
2098
2141
|
c.observe(e.host);
|
|
2099
|
-
const
|
|
2100
|
-
return
|
|
2101
|
-
cancelAnimationFrame(
|
|
2142
|
+
const h = document.querySelector(t);
|
|
2143
|
+
return h && c.observe(h), window.addEventListener("scroll", l, { passive: !0, capture: !0 }), window.addEventListener("resize", l, { passive: !0 }), () => {
|
|
2144
|
+
cancelAnimationFrame(d), c.disconnect(), window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l), o.remove(), e.unexpose("connected");
|
|
2102
2145
|
};
|
|
2103
2146
|
}
|
|
2104
2147
|
};
|
|
2105
|
-
class
|
|
2148
|
+
class _t {
|
|
2106
2149
|
host;
|
|
2107
2150
|
depth;
|
|
2108
2151
|
scale;
|
|
@@ -2143,10 +2186,10 @@ class Rt {
|
|
|
2143
2186
|
return this.#t ?? this.host;
|
|
2144
2187
|
}
|
|
2145
2188
|
attach() {
|
|
2146
|
-
this.#p || (this.#p = !0, this.host.addEventListener("pointerenter", this.#C), this.host.addEventListener("pointerleave", this.#P), this.host.addEventListener("pointermove", this.#g), this.host.addEventListener("pointerdown", this
|
|
2189
|
+
this.#p || (this.#p = !0, this.host.addEventListener("pointerenter", this.#C), this.host.addEventListener("pointerleave", this.#P), this.host.addEventListener("pointermove", this.#g), this.host.addEventListener("pointerdown", this.#I), this.host.addEventListener("click", this.#y), document.addEventListener("keydown", this.#S), document.addEventListener("keyup", this.#M));
|
|
2147
2190
|
}
|
|
2148
2191
|
detach() {
|
|
2149
|
-
this.#p && (this.#p = !1, this.host.removeEventListener("pointerenter", this.#C), this.host.removeEventListener("pointerleave", this.#P), this.host.removeEventListener("pointermove", this.#g), this.host.removeEventListener("pointerdown", this
|
|
2192
|
+
this.#p && (this.#p = !1, this.host.removeEventListener("pointerenter", this.#C), this.host.removeEventListener("pointerleave", this.#P), this.host.removeEventListener("pointermove", this.#g), this.host.removeEventListener("pointerdown", this.#I), this.host.removeEventListener("click", this.#y), document.removeEventListener("keydown", this.#S), document.removeEventListener("keyup", this.#M), this.#e && this.#E(), this.#o(), this.#T());
|
|
2150
2193
|
}
|
|
2151
2194
|
destroy() {
|
|
2152
2195
|
this.detach();
|
|
@@ -2172,13 +2215,13 @@ class Rt {
|
|
|
2172
2215
|
#M = (t) => {
|
|
2173
2216
|
t.key === "Alt" && (this.#i = !1, !(this.#e || this.alwaysReady) && (this.#u(!1), this.#o(), this.#T()));
|
|
2174
2217
|
};
|
|
2175
|
-
|
|
2218
|
+
#$ = (t) => {
|
|
2176
2219
|
const s = this.#t;
|
|
2177
2220
|
if (!s) return;
|
|
2178
2221
|
const n = (this.#n ?? s).getBoundingClientRect(), r = t.clientX - (n.left + n.width / 2), o = t.clientY - (n.top + n.height / 2), a = Math.max(-1, Math.min(1, r / this.tiltRadius)), f = Math.max(-1, Math.min(1, o / this.tiltRadius)) * this.maxTilt, i = a * -this.maxTilt, l = this.#a * this.#r;
|
|
2179
2222
|
s.style.transform = `translateZ(${l}px) perspective(${this.perspective}px) scale(${this.scale}) rotateX(${f}deg) rotateY(${i}deg)`, s.style.setProperty("--inspect-tilt-x", `${f}deg`), s.style.setProperty("--inspect-tilt-y", `${i}deg`);
|
|
2180
2223
|
};
|
|
2181
|
-
|
|
2224
|
+
#I = (t) => {
|
|
2182
2225
|
if (!(this.disabled || this.#e) && t.button === 0 && !(!t.altKey && !this.alwaysReady))
|
|
2183
2226
|
if (t.preventDefault(), this.#c = !0, this.pick) {
|
|
2184
2227
|
if (!this.#s) return;
|
|
@@ -2192,7 +2235,7 @@ class Rt {
|
|
|
2192
2235
|
const s = this.#t ?? this.host, n = t.target, r = n === s ? null : this.#_(n, s);
|
|
2193
2236
|
if (r !== this.#s && (this.#o(), r))
|
|
2194
2237
|
if (this.#s = r, !this.#e)
|
|
2195
|
-
this.#Y(), this.#
|
|
2238
|
+
this.#Y(), this.#N(this.#h, r, this.labels ? this.#k(r) : void 0);
|
|
2196
2239
|
else {
|
|
2197
2240
|
r.toggleAttribute("inspect-hover", !0);
|
|
2198
2241
|
let o = r.parentElement;
|
|
@@ -2221,7 +2264,7 @@ class Rt {
|
|
|
2221
2264
|
r && this.#W(r);
|
|
2222
2265
|
};
|
|
2223
2266
|
#b = (t) => {
|
|
2224
|
-
this.#e && (t.preventDefault(), this.#r = Math.max(0.1, this.#r + (t.deltaY > 0 ? -0.5 : 0.5)), this.#
|
|
2267
|
+
this.#e && (t.preventDefault(), this.#r = Math.max(0.1, this.#r + (t.deltaY > 0 ? -0.5 : 0.5)), this.#B());
|
|
2225
2268
|
};
|
|
2226
2269
|
#z = (t) => {
|
|
2227
2270
|
if (this.#e) {
|
|
@@ -2243,20 +2286,20 @@ class Rt {
|
|
|
2243
2286
|
};
|
|
2244
2287
|
// ── Internals ──
|
|
2245
2288
|
#u(t) {
|
|
2246
|
-
t ? (this.host.toggleAttribute("inspect-ready", !0), this.#Y(), this.#
|
|
2289
|
+
t ? (this.host.toggleAttribute("inspect-ready", !0), this.#Y(), this.#N(this.#d, this.host, this.labels ? this.#k(this.host) : void 0)) : (this.host.removeAttribute("inspect-ready"), this.#O(this.#d));
|
|
2247
2290
|
}
|
|
2248
2291
|
#Y() {
|
|
2249
2292
|
if (this.#l) return;
|
|
2250
2293
|
const t = document.createElement("div");
|
|
2251
|
-
t.setAttribute("popover", "manual"), t.style.cssText = "position:fixed;inset:0;margin:0;padding:0;border:none;background:transparent;pointer-events:none;overflow:visible;", this.#d = this.#
|
|
2294
|
+
t.setAttribute("popover", "manual"), t.style.cssText = "position:fixed;inset:0;margin:0;padding:0;border:none;background:transparent;pointer-events:none;overflow:visible;", this.#d = this.#X("oklch(0.6 0.2 250 / 0.5)"), this.#h = this.#X("oklch(0.6 0.2 250 / 0.7)"), t.append(this.#d, this.#h), document.body.appendChild(t), typeof t.showPopover == "function" && t.showPopover(), this.#l = t;
|
|
2252
2295
|
}
|
|
2253
|
-
#
|
|
2296
|
+
#X(t) {
|
|
2254
2297
|
const s = document.createElement("div");
|
|
2255
2298
|
s.style.cssText = `position:fixed;pointer-events:none;display:none;box-sizing:border-box;outline:2px solid ${t};outline-offset:-1px;`;
|
|
2256
2299
|
const n = document.createElement("span");
|
|
2257
2300
|
return n.style.cssText = "position:absolute;bottom:100%;left:0.25rem;margin-bottom:2px;font:500 0.625rem/1.4 ui-monospace,monospace;color:oklch(0.85 0.15 250);background:oklch(0.2 0.05 250/0.85);padding:0.1rem 0.35rem;border-radius:0.2rem;white-space:nowrap;display:none;", s.appendChild(n), s;
|
|
2258
2301
|
}
|
|
2259
|
-
#
|
|
2302
|
+
#N(t, s, n) {
|
|
2260
2303
|
const r = s.getBoundingClientRect();
|
|
2261
2304
|
t.style.top = `${r.top}px`, t.style.left = `${r.left}px`, t.style.width = `${r.width}px`, t.style.height = `${r.height}px`, t.style.display = "block";
|
|
2262
2305
|
const o = t.firstElementChild;
|
|
@@ -2274,10 +2317,10 @@ class Rt {
|
|
|
2274
2317
|
this.#l.remove(), this.#l = null, this.#d = null, this.#h = null;
|
|
2275
2318
|
}
|
|
2276
2319
|
}
|
|
2277
|
-
#
|
|
2320
|
+
#B() {
|
|
2278
2321
|
const t = this.#t ?? this.host;
|
|
2279
2322
|
if (this.#v.forEach((s, n) => {
|
|
2280
|
-
const r = this.recursive ? this.#
|
|
2323
|
+
const r = this.recursive ? this.#K(s, t) * this.depth : (n + 1) * this.depth;
|
|
2281
2324
|
s.style.transform = `translateZ(${r * this.#r}px)`;
|
|
2282
2325
|
}), this.#t && this.#a) {
|
|
2283
2326
|
const s = this.#t.style.transform, n = this.#a * this.#r;
|
|
@@ -2302,13 +2345,13 @@ class Rt {
|
|
|
2302
2345
|
this.#O(this.#h), this.#s = null;
|
|
2303
2346
|
}
|
|
2304
2347
|
#W(t) {
|
|
2305
|
-
this.#
|
|
2348
|
+
this.#F(), this.#m = t;
|
|
2306
2349
|
const s = this.#t ?? this.host;
|
|
2307
2350
|
let n = t;
|
|
2308
2351
|
for (; n && n !== s; )
|
|
2309
2352
|
n.toggleAttribute("inspect-selected", !0), n = n.parentElement;
|
|
2310
2353
|
}
|
|
2311
|
-
#
|
|
2354
|
+
#F() {
|
|
2312
2355
|
if (!this.#m) return;
|
|
2313
2356
|
const t = this.#t ?? this.host;
|
|
2314
2357
|
let s = this.#m;
|
|
@@ -2320,10 +2363,10 @@ class Rt {
|
|
|
2320
2363
|
const s = t.tagName.toLowerCase(), n = t.id ? `#${t.id}` : "", r = typeof t.className == "string" && t.className ? `.${t.className.split(/\s+/)[0]}` : "";
|
|
2321
2364
|
return `${s}${n}${r}`;
|
|
2322
2365
|
}
|
|
2323
|
-
#
|
|
2366
|
+
#q(t) {
|
|
2324
2367
|
t.setAttribute("data-inspect-label", this.#k(t));
|
|
2325
2368
|
}
|
|
2326
|
-
#
|
|
2369
|
+
#K(t, s) {
|
|
2327
2370
|
let n = 0, r = t;
|
|
2328
2371
|
for (; r && r !== s; )
|
|
2329
2372
|
n++, r = r.parentElement;
|
|
@@ -2347,20 +2390,20 @@ class Rt {
|
|
|
2347
2390
|
a.setAttribute("data-inspect-clone", ""), a.querySelectorAll("*").forEach((v) => {
|
|
2348
2391
|
v.tagName.includes("-") && v.setAttribute("data-inspect-clone", "");
|
|
2349
2392
|
});
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2352
|
-
const f = s - (o.left + o.width / 2), i = n - (o.top + o.height / 2), l = Math.max(-1, Math.min(1, f / this.tiltRadius)),
|
|
2353
|
-
a.style.transform = `translateZ(${p}px) perspective(${this.perspective}px) scale(${this.scale}) rotateX(${
|
|
2393
|
+
const d = document.createElement("div");
|
|
2394
|
+
d.setAttribute("popover", "manual"), d.style.cssText = `position:fixed;inset:auto;margin:0;padding:0;border:none;background:transparent;overflow:visible;top:${o.top}px;left:${o.left}px;width:${o.width}px;height:${o.height}px;`, d.appendChild(a), document.body.appendChild(d), typeof d.showPopover == "function" && d.showPopover(), this.#t = a, this.#n = d, t.style.visibility = "hidden", this.#a = this.pick ? this.depth * 2 : 0, a.toggleAttribute("inspecting", !0), a.style.transformStyle = "preserve-3d", a.style.transformOrigin = "center center", a.style.userSelect = "none", a.style.overflow = "visible", d.style.transformStyle = "preserve-3d", d.style.perspective = `${this.perspective}px`;
|
|
2395
|
+
const f = s - (o.left + o.width / 2), i = n - (o.top + o.height / 2), l = Math.max(-1, Math.min(1, f / this.tiltRadius)), h = Math.max(-1, Math.min(1, i / this.tiltRadius)) * this.maxTilt, u = l * -this.maxTilt, p = this.#a * this.#r;
|
|
2396
|
+
a.style.transform = `translateZ(${p}px) perspective(${this.perspective}px) scale(${this.scale}) rotateX(${h}deg) rotateY(${u}deg)`, a.style.transition = "transform 500ms cubic-bezier(0.2, 0, 0, 1)";
|
|
2354
2397
|
const g = this.#U(a);
|
|
2355
2398
|
this.#v = g, g.forEach((v, P) => {
|
|
2356
|
-
const M = this.recursive ? this.#
|
|
2357
|
-
v.toggleAttribute("inspect-layer", !0), v.style.transformStyle = "preserve-3d", v.style.overflow = "visible", v.style.transform = `translateZ(${M}px)`, v.style.transition = "transform 500ms cubic-bezier(0.2, 0, 0, 1)", this.labels && this.#
|
|
2358
|
-
}), this.labels && this.#
|
|
2399
|
+
const M = this.recursive ? this.#K(v, a) * this.depth : (P + 1) * this.depth;
|
|
2400
|
+
v.toggleAttribute("inspect-layer", !0), v.style.transformStyle = "preserve-3d", v.style.overflow = "visible", v.style.transform = `translateZ(${M}px)`, v.style.transition = "transform 500ms cubic-bezier(0.2, 0, 0, 1)", this.labels && this.#q(v);
|
|
2401
|
+
}), this.labels && this.#q(a), setTimeout(() => {
|
|
2359
2402
|
this.#L === r && this.#e && (a.style.transition = "transform 60ms ease-out");
|
|
2360
|
-
}, 520), a.addEventListener("pointermove", this.#g), a.addEventListener("click", this.#y),
|
|
2403
|
+
}, 520), a.addEventListener("pointermove", this.#g), a.addEventListener("click", this.#y), d.addEventListener("wheel", this.#b, { passive: !1 }), this.dismissOnClickOutside && document.addEventListener("click", this.#z, !0), document.addEventListener("keydown", this.#R), (this.tiltElement ?? document).addEventListener("pointermove", this.#$), document.addEventListener("wheel", this.#b, { passive: !1 }), document.addEventListener("selectstart", this.#D), document.addEventListener("pointerdown", this.#H), this.host.dispatchEvent(new CustomEvent("aui:inspect", { bubbles: !0, composed: !0, detail: { active: !0, layers: g.length } }));
|
|
2361
2404
|
}
|
|
2362
2405
|
#E() {
|
|
2363
|
-
this.#e = !1, ++this.#L, this.#
|
|
2406
|
+
this.#e = !1, ++this.#L, this.#F(), this.#o();
|
|
2364
2407
|
const t = this.#v.length;
|
|
2365
2408
|
if (this.#v = [], this.#t && (this.#t.removeEventListener("pointermove", this.#g), this.#t.removeEventListener("click", this.#y)), this.#n) {
|
|
2366
2409
|
this.#n.removeEventListener("wheel", this.#b);
|
|
@@ -2372,10 +2415,10 @@ class Rt {
|
|
|
2372
2415
|
}
|
|
2373
2416
|
this.#t = null, this.#n = null, this.#r = 1, this.#a = 0;
|
|
2374
2417
|
const s = this.#A ?? this.host;
|
|
2375
|
-
s.style.visibility = "", s.removeAttribute("inspecting"), this.#A = null, document.removeEventListener("click", this.#z, !0), document.removeEventListener("keydown", this.#R), (this.tiltElement ?? document).removeEventListener("pointermove", this
|
|
2418
|
+
s.style.visibility = "", s.removeAttribute("inspecting"), this.#A = null, document.removeEventListener("click", this.#z, !0), document.removeEventListener("keydown", this.#R), (this.tiltElement ?? document).removeEventListener("pointermove", this.#$), document.removeEventListener("wheel", this.#b), document.removeEventListener("selectstart", this.#D), document.removeEventListener("pointerdown", this.#H), this.host.dispatchEvent(new CustomEvent("aui:inspect", { bubbles: !0, composed: !0, detail: { active: !1, layers: t } }));
|
|
2376
2419
|
}
|
|
2377
2420
|
}
|
|
2378
|
-
const
|
|
2421
|
+
const Ft = {
|
|
2379
2422
|
name: "css-inspect",
|
|
2380
2423
|
category: "effect",
|
|
2381
2424
|
targets: "self",
|
|
@@ -2391,7 +2434,7 @@ const Dt = {
|
|
|
2391
2434
|
"always-ready": "false"
|
|
2392
2435
|
},
|
|
2393
2436
|
attach(e) {
|
|
2394
|
-
const t = new
|
|
2437
|
+
const t = new _t(e.host, {
|
|
2395
2438
|
depth: Number(e.config("depth") ?? "16"),
|
|
2396
2439
|
scale: Number(e.config("scale") ?? "0.85"),
|
|
2397
2440
|
maxTilt: Number(e.config("max-tilt") ?? "60"),
|
|
@@ -2408,7 +2451,7 @@ const Dt = {
|
|
|
2408
2451
|
t.destroy();
|
|
2409
2452
|
};
|
|
2410
2453
|
}
|
|
2411
|
-
},
|
|
2454
|
+
}, qt = {
|
|
2412
2455
|
name: "snap-resize",
|
|
2413
2456
|
category: "effect",
|
|
2414
2457
|
targets: "self",
|
|
@@ -2425,29 +2468,29 @@ const Dt = {
|
|
|
2425
2468
|
const i = f.detail;
|
|
2426
2469
|
if (!i?.sizes) return;
|
|
2427
2470
|
const l = i.sizes.map(r), c = [...e.host.children];
|
|
2428
|
-
for (let
|
|
2429
|
-
c[
|
|
2471
|
+
for (let h = 0; h < c.length && h < l.length; h++)
|
|
2472
|
+
c[h].style.flexBasis = `${l[h]}px`;
|
|
2430
2473
|
}, a = (f) => {
|
|
2431
2474
|
s && f.key === s && (n = !0);
|
|
2432
|
-
},
|
|
2475
|
+
}, d = (f) => {
|
|
2433
2476
|
s && f.key === s && (n = !1);
|
|
2434
2477
|
};
|
|
2435
|
-
return e.host.addEventListener("aui:panes-resize", o), s && (document.addEventListener("keydown", a), document.addEventListener("keyup",
|
|
2436
|
-
e.host.removeEventListener("aui:panes-resize", o), s && (document.removeEventListener("keydown", a), document.removeEventListener("keyup",
|
|
2478
|
+
return e.host.addEventListener("aui:panes-resize", o), s && (document.addEventListener("keydown", a), document.addEventListener("keyup", d)), () => {
|
|
2479
|
+
e.host.removeEventListener("aui:panes-resize", o), s && (document.removeEventListener("keydown", a), document.removeEventListener("keyup", d));
|
|
2437
2480
|
};
|
|
2438
2481
|
}
|
|
2439
2482
|
};
|
|
2440
|
-
function
|
|
2441
|
-
T(
|
|
2483
|
+
function Wt() {
|
|
2484
|
+
T(Pe), T(Se), T(Me), T($e), T(ze), T(Re), T(De), T(He), T(qe), T(Ve), T(Ze), T(Ge), T(Qe), T(xe), T(tt), T(st), T(nt), T(rt), T(it), T(at), T(lt), T(ct), T(dt), T(ht), T(ut), T(ft), T(pt), T(mt), T(gt), T(yt), T(bt), T(wt), T(Lt), T(Tt), T(kt), T(Ct), T(Pt), T(St), T(Mt), T(It), T(zt), T(Rt), T(Dt), T(Ht), T(Yt), T(Xt), T(Nt), T(Ot), T(Ft), T(qt);
|
|
2442
2485
|
}
|
|
2443
2486
|
export {
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2487
|
+
Zt as attachTrait,
|
|
2488
|
+
Gt as getTrait,
|
|
2489
|
+
Jt as getTraitNames,
|
|
2490
|
+
jt as getTraitsByCategory,
|
|
2491
|
+
Qt as parseTraitsAttribute,
|
|
2492
|
+
Wt as registerBuiltinTraits,
|
|
2450
2493
|
T as registerTrait,
|
|
2451
|
-
|
|
2494
|
+
xt as validateComposition
|
|
2452
2495
|
};
|
|
2453
2496
|
//# sourceMappingURL=traits.js.map
|