@talex-touch/tuffex 0.3.3 → 0.3.4
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 +49 -221
- package/dist/es/agents/index.js +1 -1
- package/dist/es/alert/index.d.ts +104 -1
- package/dist/es/alert/index.js +6 -0
- package/dist/es/alert/src/TxAlert.vue.d.ts +1 -0
- package/dist/es/alert/src/TxAlert.vue.js +2 -2
- package/dist/es/alert/src/TxAlert.vue2.js +6 -2
- package/dist/es/auto-sizer/index.js +1 -1
- package/dist/es/auto-sizer/src/TxAutoSizer.vue.js +2 -2
- package/dist/es/avatar/index.js +1 -1
- package/dist/es/avatar/src/TxAvatar.vue.js +1 -1
- package/dist/es/avatar/src/TxAvatar.vue2.js +47 -6
- package/dist/es/avatar/src/TxAvatarGroup.vue.js +1 -1
- package/dist/es/avatar/src/TxAvatarGroup.vue2.js +1 -1
- package/dist/es/avatar/src/types.d.ts +2 -1
- package/dist/es/badge/index.d.ts +78 -1
- package/dist/es/badge/index.js +6 -0
- package/dist/es/badge/src/TxBadge.vue.js +2 -2
- package/dist/es/base-anchor/index.d.ts +464 -0
- package/dist/es/base-anchor/index.js +6 -0
- package/dist/es/base-anchor/src/TxBaseAnchor.vue.d.ts +124 -0
- package/dist/es/base-anchor/src/TxBaseAnchor.vue.js +7 -0
- package/dist/es/base-anchor/src/TxBaseAnchor.vue2.js +798 -0
- package/dist/es/base-anchor/src/types.d.ts +36 -0
- package/dist/es/base-surface/index.d.ts +561 -0
- package/dist/es/base-surface/index.js +7 -0
- package/dist/es/base-surface/src/TxBaseSurface.vue.d.ts +123 -0
- package/dist/es/base-surface/src/TxBaseSurface.vue.js +1012 -0
- package/dist/es/base-surface/src/TxBaseSurface.vue2.js +6 -0
- package/dist/es/base-surface/src/style/index.css +105 -0
- package/dist/es/base-surface/src/types.d.ts +87 -0
- package/dist/es/blank-slate/index.d.ts +9 -9
- package/dist/es/blank-slate/index.js +1 -1
- package/dist/es/button/index.d.ts +45 -15
- package/dist/es/button/index.js +2 -1
- package/dist/es/button/src/button.vue.d.ts +7 -1
- package/dist/es/button/src/button.vue.js +50 -20
- package/dist/es/button/src/split-button.vue.js +31 -5
- package/dist/es/button/src/style/index.css +72 -15
- package/dist/es/button/src/types.d.ts +4 -0
- package/dist/es/card/index.d.ts +236 -56
- package/dist/es/card/index.js +1 -1
- package/dist/es/card/src/TxCard.vue.d.ts +40 -4
- package/dist/es/card/src/TxCard.vue.js +1 -1
- package/dist/es/card/src/TxCard.vue2.js +288 -57
- package/dist/es/card/src/types.d.ts +14 -1
- package/dist/es/card-item/index.d.ts +7 -7
- package/dist/es/card-item/index.js +1 -1
- package/dist/es/cascader/index.d.ts +15 -15
- package/dist/es/cascader/index.js +1 -1
- package/dist/es/cascader/src/TxCascader.vue.d.ts +1 -1
- package/dist/es/cascader/src/TxCascader.vue.js +1 -1
- package/dist/es/cascader/src/TxCascader.vue2.js +1 -3
- package/dist/es/chat/index.d.ts +18 -18
- package/dist/es/chat/index.js +1 -1
- package/dist/es/chat/src/TxChatComposer.vue.js +1 -1
- package/dist/es/chat/src/TxChatComposer.vue2.js +1 -0
- package/dist/es/chat/src/TxTypingIndicator.vue.d.ts +1 -1
- package/dist/es/code-editor/index.d.ts +387 -0
- package/dist/es/code-editor/index.js +8 -0
- package/dist/es/code-editor/src/TxCodeEditor.vue.d.ts +117 -0
- package/dist/es/code-editor/src/TxCodeEditor.vue.js +7 -0
- package/dist/es/code-editor/src/TxCodeEditor.vue2.js +658 -0
- package/dist/es/code-editor/src/TxCodeEditorToolbar.vue.d.ts +40 -0
- package/dist/es/code-editor/src/TxCodeEditorToolbar.vue.js +7 -0
- package/dist/es/code-editor/src/TxCodeEditorToolbar.vue2.js +89 -0
- package/dist/es/code-editor/src/types.d.ts +47 -0
- package/dist/es/command-palette/index.js +1 -1
- package/dist/es/command-palette/src/TxCommandPalette.vue.js +1 -1
- package/dist/es/command-palette/src/TxCommandPalette.vue2.js +128 -21
- package/dist/es/components.css +4253 -3117
- package/dist/es/components.d.ts +15 -2
- package/dist/es/components.js +44 -7
- package/dist/es/container/src/TxCol.vue.d.ts +1 -1
- package/dist/es/container/src/TxCol.vue2.js +1 -1
- package/dist/es/container/src/TxContainer.vue.d.ts +1 -1
- package/dist/es/container/src/TxRow.vue.d.ts +2 -2
- package/dist/es/container/src/TxRow.vue2.js +1 -1
- package/dist/es/context-menu/index.js +1 -1
- package/dist/es/context-menu/src/TxContextMenu.vue.js +1 -1
- package/dist/es/context-menu/src/TxContextMenu.vue2.js +4 -1
- package/dist/es/corner-overlay/index.js +1 -1
- package/dist/es/data-table/index.d.ts +15 -15
- package/dist/es/data-table/index.js +1 -1
- package/dist/es/data-table/src/TxDataTable.vue.d.ts +1 -1
- package/dist/es/date-picker/index.js +1 -1
- package/dist/es/dialog/index.js +1 -1
- package/dist/es/dialog/src/TxBlowDialog.vue.js +6 -2
- package/dist/es/dialog/src/TxBottomDialog.vue.js +1 -1
- package/dist/es/dialog/src/TxBottomDialog.vue2.js +6 -2
- package/dist/es/dialog/src/TxPopperDialog.vue.js +6 -2
- package/dist/es/dialog/src/TxTouchTip.vue.js +1 -1
- package/dist/es/dialog/src/TxTouchTip.vue2.js +25 -22
- package/dist/es/dialog/src/types.d.ts +1 -1
- package/dist/es/drawer/index.d.ts +24 -30
- package/dist/es/drawer/index.js +1 -1
- package/dist/es/drawer/src/TxDrawer.vue.d.ts +1 -4
- package/dist/es/drawer/src/TxDrawer.vue.js +8 -2
- package/dist/es/dropdown-menu/index.d.ts +81 -18
- package/dist/es/dropdown-menu/index.js +1 -1
- package/dist/es/dropdown-menu/src/TxDropdownMenu.vue.d.ts +11 -2
- package/dist/es/dropdown-menu/src/TxDropdownMenu.vue.js +1 -1
- package/dist/es/dropdown-menu/src/TxDropdownMenu.vue2.js +13 -3
- package/dist/es/dropdown-menu/src/types.d.ts +8 -1
- package/dist/es/edge-fade-mask/index.d.ts +120 -0
- package/dist/es/edge-fade-mask/index.js +6 -0
- package/dist/es/edge-fade-mask/src/TxEdgeFadeMask.vue.d.ts +51 -0
- package/dist/es/edge-fade-mask/src/TxEdgeFadeMask.vue.js +7 -0
- package/dist/es/edge-fade-mask/src/TxEdgeFadeMask.vue2.js +154 -0
- package/dist/es/edge-fade-mask/src/types.d.ts +9 -0
- package/dist/es/empty/index.js +1 -1
- package/dist/es/empty-state/index.d.ts +9 -9
- package/dist/es/empty-state/index.js +1 -1
- package/dist/es/empty-state/src/TxEmptyState.vue.js +1 -1
- package/dist/es/empty-state/src/TxEmptyState.vue2.js +25 -17
- package/dist/es/error-state/index.d.ts +131 -0
- package/dist/es/error-state/index.js +6 -0
- package/dist/es/error-state/src/TxErrorState.vue.d.ts +13 -0
- package/dist/es/error-state/src/TxErrorState.vue.js +35 -0
- package/dist/es/error-state/src/TxErrorState.vue2.js +5 -0
- package/dist/es/error-state/src/types.d.ts +3 -0
- package/dist/es/file-uploader/index.js +1 -1
- package/dist/es/flat-radio/index.d.ts +201 -0
- package/dist/es/flat-radio/index.js +8 -0
- package/dist/es/flat-radio/src/TxFlatRadio.vue.d.ts +51 -0
- package/dist/es/flat-radio/src/TxFlatRadio.vue.js +7 -0
- package/dist/es/flat-radio/src/TxFlatRadio.vue2.js +237 -0
- package/dist/es/flat-radio/src/TxFlatRadioItem.vue.d.ts +43 -0
- package/dist/es/flat-radio/src/TxFlatRadioItem.vue.js +7 -0
- package/dist/es/flat-radio/src/TxFlatRadioItem.vue2.js +87 -0
- package/dist/es/flat-radio/src/types.d.ts +28 -0
- package/dist/es/flat-radio/src/types.js +3 -0
- package/dist/es/flat-select/index.d.ts +159 -0
- package/dist/es/flat-select/index.js +8 -0
- package/dist/es/flat-select/src/TxFlatSelect.vue.d.ts +56 -0
- package/dist/es/flat-select/src/TxFlatSelect.vue.js +7 -0
- package/dist/es/flat-select/src/TxFlatSelect.vue2.js +208 -0
- package/dist/es/flat-select/src/TxFlatSelectItem.vue.d.ts +47 -0
- package/dist/es/flat-select/src/TxFlatSelectItem.vue.js +7 -0
- package/dist/es/flat-select/src/TxFlatSelectItem.vue2.js +71 -0
- package/dist/es/flat-select/src/types.d.ts +21 -0
- package/dist/es/flat-select/src/types.js +3 -0
- package/dist/es/flex/index.d.ts +33 -33
- package/dist/es/flex/index.js +1 -1
- package/dist/es/flex/src/TxFlex.vue.d.ts +3 -3
- package/dist/es/flip-overlay/index.d.ts +579 -0
- package/dist/es/flip-overlay/index.js +7 -0
- package/dist/es/flip-overlay/src/TxFlipOverlay.vue.d.ts +175 -0
- package/dist/es/flip-overlay/src/TxFlipOverlay.vue.js +982 -0
- package/dist/es/flip-overlay/src/TxFlipOverlay.vue3.js +6 -0
- package/dist/es/flip-overlay/src/types.d.ts +53 -0
- package/dist/es/floating/index.d.ts +145 -0
- package/dist/es/floating/index.js +8 -0
- package/dist/es/floating/src/TxFloating.vue.d.ts +45 -0
- package/dist/es/floating/src/TxFloating.vue.js +7 -0
- package/dist/es/floating/src/TxFloating.vue2.js +118 -0
- package/dist/es/floating/src/TxFloatingElement.vue.d.ts +39 -0
- package/dist/es/floating/src/TxFloatingElement.vue.js +7 -0
- package/dist/es/floating/src/TxFloatingElement.vue2.js +43 -0
- package/dist/es/floating/src/context.d.ts +7 -0
- package/dist/es/floating/src/context.js +3 -0
- package/dist/es/floating/src/types.d.ts +10 -0
- package/dist/es/form/index.d.ts +9 -9
- package/dist/es/form/index.js +1 -1
- package/dist/es/fusion/index.d.ts +15 -15
- package/dist/es/fusion/index.js +1 -1
- package/dist/es/fusion/src/TxFusion.vue.d.ts +1 -1
- package/dist/es/glass-surface/index.d.ts +30 -30
- package/dist/es/glass-surface/index.js +1 -1
- package/dist/es/glass-surface/src/TxGlassSurface.vue.d.ts +2 -2
- package/dist/es/glass-surface/src/TxGlassSurface.vue.js +16 -38
- package/dist/es/glow-text/index.d.ts +24 -6
- package/dist/es/glow-text/index.js +1 -1
- package/dist/es/glow-text/src/TxGlowText.vue.d.ts +3 -3
- package/dist/es/glow-text/src/TxGlowText.vue.js +1 -1
- package/dist/es/glow-text/src/TxGlowText.vue2.js +93 -10
- package/dist/es/glow-text/src/types.d.ts +2 -0
- package/dist/es/gradient-border/index.js +1 -1
- package/dist/es/gradual-blur/index.d.ts +42 -42
- package/dist/es/gradual-blur/index.js +1 -1
- package/dist/es/gradual-blur/src/TxGradualBlur.vue.d.ts +3 -3
- package/dist/es/gradual-blur/src/TxGradualBlur.vue.js +1 -1
- package/dist/es/grid/src/TxGrid.vue.d.ts +2 -2
- package/dist/es/grid/src/TxGrid.vue2.js +1 -1
- package/dist/es/grid-layout/index.js +1 -1
- package/dist/es/group-block/index.d.ts +321 -4
- package/dist/es/group-block/index.js +8 -2
- package/dist/es/group-block/src/TxBlockInput.vue.d.ts +90 -0
- package/dist/es/group-block/src/TxBlockInput.vue.js +94 -0
- package/dist/es/group-block/src/TxBlockInput.vue3.js +6 -0
- package/dist/es/group-block/src/TxBlockSelect.vue.d.ts +73 -0
- package/dist/es/group-block/src/TxBlockSelect.vue.js +76 -0
- package/dist/es/group-block/src/TxBlockSelect.vue3.js +6 -0
- package/dist/es/group-block/src/TxGroupBlock.vue.js +1 -1
- package/dist/es/group-block/src/types.d.ts +138 -0
- package/dist/es/guide-state/index.d.ts +131 -0
- package/dist/es/guide-state/index.js +6 -0
- package/dist/es/guide-state/src/TxGuideState.vue.d.ts +13 -0
- package/dist/es/guide-state/src/TxGuideState.vue.js +35 -0
- package/dist/es/guide-state/src/TxGuideState.vue2.js +5 -0
- package/dist/es/guide-state/src/types.d.ts +3 -0
- package/dist/es/icon/index.js +1 -1
- package/dist/es/icon/src/TxIcon.vue.js +1 -1
- package/dist/es/icon/src/TxIcon.vue2.js +10 -4
- package/dist/es/image-gallery/index.js +1 -1
- package/dist/es/image-uploader/index.js +1 -1
- package/dist/es/index.js +53 -13
- package/dist/es/input/index.d.ts +211 -1
- package/dist/es/input/index.js +2 -1
- package/dist/es/input/src/TxInput.vue.d.ts +21 -11
- package/dist/es/input/src/TxInput.vue.js +1 -1
- package/dist/es/input/src/TxInput.vue2.js +80 -23
- package/dist/es/keyframe-stroke-text/index.d.ts +146 -0
- package/dist/es/keyframe-stroke-text/index.js +6 -0
- package/dist/es/keyframe-stroke-text/src/TxKeyframeStrokeText.vue.d.ts +48 -0
- package/dist/es/keyframe-stroke-text/src/TxKeyframeStrokeText.vue.js +7 -0
- package/dist/es/keyframe-stroke-text/src/TxKeyframeStrokeText.vue2.js +102 -0
- package/dist/es/keyframe-stroke-text/src/types.d.ts +10 -0
- package/dist/es/layout-skeleton/index.js +1 -1
- package/dist/es/loading-overlay/index.d.ts +15 -15
- package/dist/es/loading-overlay/index.js +1 -1
- package/dist/es/loading-overlay/src/TxLoadingOverlay.vue.d.ts +1 -1
- package/dist/es/loading-overlay/src/TxLoadingOverlay.vue.js +12 -2
- package/dist/es/loading-state/index.d.ts +9 -9
- package/dist/es/loading-state/index.js +1 -1
- package/dist/es/markdown-view/index.d.ts +3 -3
- package/dist/es/markdown-view/index.js +1 -1
- package/dist/es/markdown-view/src/TxMarkdownView.vue.js +3 -2
- package/dist/es/modal/index.js +1 -1
- package/dist/es/modal/src/TxModal.vue.js +1 -1
- package/dist/es/modal/src/TxModal.vue2.js +26 -4
- package/dist/es/nav-bar/index.js +1 -1
- package/dist/es/no-data/index.d.ts +9 -9
- package/dist/es/no-data/index.js +1 -1
- package/dist/es/no-selection/index.d.ts +9 -9
- package/dist/es/no-selection/index.js +1 -1
- package/dist/es/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/properties.js +62 -0
- package/dist/es/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/toml.js +76 -0
- package/dist/es/node_modules/.pnpm/@lezer_common@1.5.0/node_modules/@lezer/common/dist/index.js +252 -0
- package/dist/es/node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +682 -0
- package/dist/es/offline-state/index.d.ts +9 -9
- package/dist/es/offline-state/index.js +1 -1
- package/dist/es/outline-border/index.d.ts +18 -18
- package/dist/es/outline-border/index.js +1 -1
- package/dist/es/outline-border/src/TxOutlineBorder.vue.d.ts +1 -1
- package/dist/es/{utils → packages/tuffex/packages/utils}/toast.js +4 -1
- package/dist/es/packages/tuffex/packages/utils/z-index-manager.js +114 -0
- package/dist/es/packages/utils/env/index.js +8 -0
- package/dist/es/permission-state/index.d.ts +9 -9
- package/dist/es/permission-state/index.js +1 -1
- package/dist/es/picker/index.js +1 -1
- package/dist/es/picker/src/TxPicker.vue.js +1 -1
- package/dist/es/picker/src/TxPicker.vue2.js +6 -1
- package/dist/es/popover/index.d.ts +195 -82
- package/dist/es/popover/index.js +1 -1
- package/dist/es/popover/src/TxPopover.vue.d.ts +33 -16
- package/dist/es/popover/src/TxPopover.vue.js +1 -1
- package/dist/es/popover/src/TxPopover.vue2.js +147 -317
- package/dist/es/popover/src/types.d.ts +14 -3
- package/dist/es/progress-bar/index.d.ts +21 -21
- package/dist/es/progress-bar/index.js +1 -1
- package/dist/es/progress-bar/src/TxProgressBar.vue.d.ts +1 -1
- package/dist/es/radio/index.js +1 -1
- package/dist/es/radio/src/TxRadioGroup.vue2.js +1 -1
- package/dist/es/scroll/index.d.ts +42 -12
- package/dist/es/scroll/index.js +1 -1
- package/dist/es/scroll/src/TxScroll.vue.d.ts +11 -1
- package/dist/es/scroll/src/TxScroll.vue.js +1 -1
- package/dist/es/scroll/src/TxScroll.vue2.js +25 -13
- package/dist/es/scroll/src/runtime-capabilities.d.ts +2 -0
- package/dist/es/scroll/src/runtime-capabilities.js +67 -0
- package/dist/es/search-empty/index.d.ts +9 -9
- package/dist/es/search-empty/index.js +1 -1
- package/dist/es/search-input/index.js +1 -1
- package/dist/es/search-select/index.d.ts +9 -9
- package/dist/es/search-select/index.js +1 -1
- package/dist/es/search-select/src/TxSearchSelect.vue.d.ts +1 -1
- package/dist/es/search-select/src/TxSearchSelect.vue.js +1 -1
- package/dist/es/search-select/src/TxSearchSelect.vue2.js +105 -178
- package/dist/es/search-select/src/types.d.ts +1 -1
- package/dist/es/segmented-slider/index.js +1 -1
- package/dist/es/segmented-slider/src/TxSegmentedSlider.vue.js +1 -0
- package/dist/es/select/index.d.ts +366 -4
- package/dist/es/select/index.js +6 -9
- package/dist/es/select/src/TxSelect.vue.d.ts +23 -23
- package/dist/es/select/src/TxSelect.vue.js +2 -2
- package/dist/es/select/src/TxSelect.vue2.js +203 -152
- package/dist/es/select/src/TxSelectItem.vue.js +2 -2
- package/dist/es/select/src/TxSelectItem.vue2.js +44 -7
- package/dist/es/select/src/types.d.ts +34 -0
- package/dist/es/select/src/types.js +3 -0
- package/dist/es/skeleton/index.d.ts +7 -7
- package/dist/es/skeleton/index.js +1 -1
- package/dist/es/slider/index.d.ts +4 -4
- package/dist/es/slider/index.js +1 -1
- package/dist/es/sortable-list/index.js +1 -1
- package/dist/es/sortable-list/src/TxSortableList.vue.js +1 -1
- package/dist/es/sortable-list/src/TxSortableList.vue2.js +1 -1
- package/dist/es/spinner/index.d.ts +1 -1
- package/dist/es/spinner/index.js +1 -1
- package/dist/es/splitter/index.d.ts +15 -15
- package/dist/es/splitter/index.js +1 -1
- package/dist/es/splitter/src/TxSplitter.vue.d.ts +1 -1
- package/dist/es/stack/index.d.ts +33 -33
- package/dist/es/stack/index.js +1 -1
- package/dist/es/stack/src/TxStack.vue.d.ts +3 -3
- package/dist/es/stagger/index.d.ts +15 -15
- package/dist/es/stagger/index.js +1 -1
- package/dist/es/stagger/src/TxStagger.vue.d.ts +1 -1
- package/dist/es/stat-card/index.d.ts +46 -3
- package/dist/es/stat-card/index.js +1 -1
- package/dist/es/stat-card/src/TxStatCard.vue.d.ts +5 -1
- package/dist/es/stat-card/src/TxStatCard.vue.js +1 -1
- package/dist/es/stat-card/src/TxStatCard.vue2.js +247 -19
- package/dist/es/stat-card/src/types.d.ts +15 -0
- package/dist/es/status-badge/index.js +1 -1
- package/dist/es/switch/index.js +1 -0
- package/dist/es/tab-bar/index.d.ts +15 -15
- package/dist/es/tab-bar/index.js +1 -1
- package/dist/es/tab-bar/src/TxTabBar.vue.d.ts +1 -1
- package/dist/es/tabs/index.d.ts +18 -3
- package/dist/es/tabs/index.js +1 -1
- package/dist/es/tabs/src/TxTabs.vue.d.ts +10 -1
- package/dist/es/tabs/src/TxTabs.vue.js +1 -1
- package/dist/es/tabs/src/TxTabs.vue2.js +3 -1
- package/dist/es/tabs/src/types.d.ts +1 -0
- package/dist/es/tag/index.js +1 -1
- package/dist/es/tag-input/index.js +1 -1
- package/dist/es/text-transformer/index.d.ts +1 -1
- package/dist/es/text-transformer/index.js +1 -1
- package/dist/es/toast/index.js +1 -1
- package/dist/es/toast/src/TxToastHost.vue.js +18 -17
- package/dist/es/tooltip/index.d.ts +75 -178
- package/dist/es/tooltip/index.js +1 -1
- package/dist/es/tooltip/src/TxTooltip.vue.d.ts +21 -40
- package/dist/es/tooltip/src/TxTooltip.vue.js +1 -1
- package/dist/es/tooltip/src/TxTooltip.vue2.js +102 -350
- package/dist/es/tooltip/src/types.d.ts +8 -13
- package/dist/es/transfer/index.d.ts +131 -0
- package/dist/es/transfer/index.js +6 -0
- package/dist/es/transfer/src/TxTransfer.vue.d.ts +48 -0
- package/dist/es/transfer/src/TxTransfer.vue.js +7 -0
- package/dist/es/transfer/src/TxTransfer.vue2.js +217 -0
- package/dist/es/transfer/src/types.d.ts +17 -0
- package/dist/es/transition/index.d.ts +30 -30
- package/dist/es/transition/index.js +1 -1
- package/dist/es/transition/src/TxTransition.vue.d.ts +1 -1
- package/dist/es/transition/src/TxTransitionSmoothSize.vue.d.ts +1 -1
- package/dist/es/tree/index.d.ts +15 -15
- package/dist/es/tree/index.js +1 -1
- package/dist/es/tree/src/TxTree.vue.d.ts +1 -1
- package/dist/es/tree/src/TxTree.vue.js +1 -1
- package/dist/es/tree/src/TxTree.vue2.js +3 -2
- package/dist/es/tree/src/types.d.ts +1 -0
- package/dist/es/tree-select/index.d.ts +9 -9
- package/dist/es/tree-select/index.js +1 -1
- package/dist/es/tree-select/src/TxTreeSelect.vue.d.ts +1 -1
- package/dist/es/tree-select/src/TxTreeSelect.vue.js +1 -1
- package/dist/es/tree-select/src/TxTreeSelect.vue2.js +0 -2
- package/dist/es/tuff-logo-stroke/index.d.ts +146 -0
- package/dist/es/tuff-logo-stroke/index.js +6 -0
- package/dist/es/tuff-logo-stroke/src/TxTuffLogoStroke.vue.d.ts +48 -0
- package/dist/es/tuff-logo-stroke/src/TxTuffLogoStroke.vue.js +7 -0
- package/dist/es/tuff-logo-stroke/src/TxTuffLogoStroke.vue2.js +147 -0
- package/dist/es/tuff-logo-stroke/src/types.d.ts +10 -0
- package/dist/es/virtual-list/index.js +1 -1
- package/dist/lib/agents/index.js +1 -1
- package/dist/lib/alert/index.js +11 -0
- package/dist/lib/alert/src/TxAlert.vue.js +2 -2
- package/dist/lib/alert/src/TxAlert.vue2.js +5 -1
- package/dist/lib/auto-sizer/index.js +1 -1
- package/dist/lib/auto-sizer/src/TxAutoSizer.vue.js +2 -2
- package/dist/lib/avatar/index.js +1 -1
- package/dist/lib/avatar/src/TxAvatar.vue.js +1 -1
- package/dist/lib/avatar/src/TxAvatar.vue2.js +47 -6
- package/dist/lib/avatar/src/TxAvatarGroup.vue.js +1 -1
- package/dist/lib/avatar/src/TxAvatarGroup.vue2.js +1 -1
- package/dist/lib/badge/index.js +11 -0
- package/dist/lib/badge/src/TxBadge.vue.js +2 -2
- package/dist/lib/base-anchor/index.js +12 -0
- package/dist/lib/base-anchor/src/TxBaseAnchor.vue.js +11 -0
- package/dist/lib/base-anchor/src/TxBaseAnchor.vue2.js +802 -0
- package/dist/lib/base-surface/index.js +13 -0
- package/dist/lib/base-surface/src/TxBaseSurface.vue.js +1016 -0
- package/dist/lib/base-surface/src/TxBaseSurface.vue2.js +10 -0
- package/dist/lib/base-surface/src/style/index.css +105 -0
- package/dist/lib/blank-slate/index.js +1 -1
- package/dist/lib/button/index.js +2 -1
- package/dist/lib/button/src/button.vue.js +49 -19
- package/dist/lib/button/src/split-button.vue.js +30 -4
- package/dist/lib/button/src/style/index.css +72 -15
- package/dist/lib/card/index.js +1 -1
- package/dist/lib/card/src/TxCard.vue.js +1 -1
- package/dist/lib/card/src/TxCard.vue2.js +285 -54
- package/dist/lib/card-item/index.js +1 -1
- package/dist/lib/cascader/index.js +1 -1
- package/dist/lib/cascader/src/TxCascader.vue.js +1 -1
- package/dist/lib/cascader/src/TxCascader.vue2.js +1 -3
- package/dist/lib/chat/index.js +1 -1
- package/dist/lib/chat/src/TxChatComposer.vue.js +1 -1
- package/dist/lib/chat/src/TxChatComposer.vue2.js +1 -0
- package/dist/lib/code-editor/index.js +16 -0
- package/dist/lib/code-editor/src/TxCodeEditor.vue.js +11 -0
- package/dist/lib/code-editor/src/TxCodeEditor.vue2.js +662 -0
- package/dist/lib/code-editor/src/TxCodeEditorToolbar.vue.js +11 -0
- package/dist/lib/code-editor/src/TxCodeEditorToolbar.vue2.js +93 -0
- package/dist/lib/command-palette/index.js +1 -1
- package/dist/lib/command-palette/src/TxCommandPalette.vue.js +1 -1
- package/dist/lib/command-palette/src/TxCommandPalette.vue2.js +127 -20
- package/dist/lib/components.css +4253 -3117
- package/dist/lib/components.js +255 -178
- package/dist/lib/container/src/TxCol.vue2.js +1 -1
- package/dist/lib/container/src/TxRow.vue2.js +1 -1
- package/dist/lib/context-menu/index.js +1 -1
- package/dist/lib/context-menu/src/TxContextMenu.vue.js +1 -1
- package/dist/lib/context-menu/src/TxContextMenu.vue2.js +4 -1
- package/dist/lib/corner-overlay/index.js +1 -1
- package/dist/lib/data-table/index.js +1 -1
- package/dist/lib/date-picker/index.js +1 -1
- package/dist/lib/dialog/index.js +1 -1
- package/dist/lib/dialog/src/TxBlowDialog.vue.js +5 -1
- package/dist/lib/dialog/src/TxBottomDialog.vue.js +1 -1
- package/dist/lib/dialog/src/TxBottomDialog.vue2.js +5 -1
- package/dist/lib/dialog/src/TxPopperDialog.vue.js +5 -1
- package/dist/lib/dialog/src/TxTouchTip.vue.js +1 -1
- package/dist/lib/dialog/src/TxTouchTip.vue2.js +24 -21
- package/dist/lib/drawer/index.js +1 -1
- package/dist/lib/drawer/src/TxDrawer.vue.js +8 -2
- package/dist/lib/dropdown-menu/index.js +1 -1
- package/dist/lib/dropdown-menu/src/TxDropdownMenu.vue.js +1 -1
- package/dist/lib/dropdown-menu/src/TxDropdownMenu.vue2.js +13 -3
- package/dist/lib/edge-fade-mask/index.js +12 -0
- package/dist/lib/edge-fade-mask/src/TxEdgeFadeMask.vue.js +11 -0
- package/dist/lib/edge-fade-mask/src/TxEdgeFadeMask.vue2.js +158 -0
- package/dist/lib/empty/index.js +1 -1
- package/dist/lib/empty-state/index.js +1 -1
- package/dist/lib/empty-state/src/TxEmptyState.vue.js +1 -1
- package/dist/lib/empty-state/src/TxEmptyState.vue2.js +25 -17
- package/dist/lib/error-state/index.js +11 -0
- package/dist/lib/error-state/src/TxErrorState.vue.js +39 -0
- package/dist/lib/error-state/src/TxErrorState.vue2.js +9 -0
- package/dist/lib/file-uploader/index.js +1 -1
- package/dist/lib/flat-radio/index.js +16 -0
- package/dist/lib/flat-radio/src/TxFlatRadio.vue.js +11 -0
- package/dist/lib/flat-radio/src/TxFlatRadio.vue2.js +241 -0
- package/dist/lib/flat-radio/src/TxFlatRadioItem.vue.js +11 -0
- package/dist/lib/flat-radio/src/TxFlatRadioItem.vue2.js +91 -0
- package/dist/lib/flat-radio/src/types.js +7 -0
- package/dist/lib/flat-select/index.js +16 -0
- package/dist/lib/flat-select/src/TxFlatSelect.vue.js +11 -0
- package/dist/lib/flat-select/src/TxFlatSelect.vue2.js +212 -0
- package/dist/lib/flat-select/src/TxFlatSelectItem.vue.js +11 -0
- package/dist/lib/flat-select/src/TxFlatSelectItem.vue2.js +75 -0
- package/dist/lib/flat-select/src/types.js +7 -0
- package/dist/lib/flex/index.js +1 -1
- package/dist/lib/flip-overlay/index.js +13 -0
- package/dist/lib/flip-overlay/src/TxFlipOverlay.vue.js +986 -0
- package/dist/lib/flip-overlay/src/TxFlipOverlay.vue3.js +10 -0
- package/dist/lib/floating/index.js +16 -0
- package/dist/lib/floating/src/TxFloating.vue.js +11 -0
- package/dist/lib/floating/src/TxFloating.vue2.js +122 -0
- package/dist/lib/floating/src/TxFloatingElement.vue.js +11 -0
- package/dist/lib/floating/src/TxFloatingElement.vue2.js +47 -0
- package/dist/lib/floating/src/context.js +7 -0
- package/dist/lib/form/index.js +1 -1
- package/dist/lib/fusion/index.js +1 -1
- package/dist/lib/glass-surface/index.js +1 -1
- package/dist/lib/glass-surface/src/TxGlassSurface.vue.js +15 -37
- package/dist/lib/glow-text/index.js +1 -1
- package/dist/lib/glow-text/src/TxGlowText.vue.js +1 -1
- package/dist/lib/glow-text/src/TxGlowText.vue2.js +92 -9
- package/dist/lib/gradient-border/index.js +1 -1
- package/dist/lib/gradual-blur/index.js +1 -1
- package/dist/lib/gradual-blur/src/TxGradualBlur.vue.js +1 -1
- package/dist/lib/grid/src/TxGrid.vue2.js +1 -1
- package/dist/lib/grid-layout/index.js +1 -1
- package/dist/lib/group-block/index.js +11 -1
- package/dist/lib/group-block/src/TxBlockInput.vue.js +98 -0
- package/dist/lib/group-block/src/TxBlockInput.vue3.js +10 -0
- package/dist/lib/group-block/src/TxBlockSelect.vue.js +80 -0
- package/dist/lib/group-block/src/TxBlockSelect.vue3.js +10 -0
- package/dist/lib/group-block/src/TxGroupBlock.vue.js +1 -1
- package/dist/lib/guide-state/index.js +11 -0
- package/dist/lib/guide-state/src/TxGuideState.vue.js +39 -0
- package/dist/lib/guide-state/src/TxGuideState.vue2.js +9 -0
- package/dist/lib/icon/index.js +1 -1
- package/dist/lib/icon/src/TxIcon.vue.js +1 -1
- package/dist/lib/icon/src/TxIcon.vue2.js +9 -3
- package/dist/lib/image-gallery/index.js +1 -1
- package/dist/lib/image-uploader/index.js +1 -1
- package/dist/lib/index.js +269 -182
- package/dist/lib/input/index.js +7 -5
- package/dist/lib/input/src/TxInput.vue.js +1 -1
- package/dist/lib/input/src/TxInput.vue2.js +79 -22
- package/dist/lib/keyframe-stroke-text/index.js +12 -0
- package/dist/lib/keyframe-stroke-text/src/TxKeyframeStrokeText.vue.js +11 -0
- package/dist/lib/keyframe-stroke-text/src/TxKeyframeStrokeText.vue2.js +106 -0
- package/dist/lib/layout-skeleton/index.js +1 -1
- package/dist/lib/loading-overlay/index.js +1 -1
- package/dist/lib/loading-overlay/src/TxLoadingOverlay.vue.js +11 -1
- package/dist/lib/loading-state/index.js +1 -1
- package/dist/lib/markdown-view/index.js +1 -1
- package/dist/lib/markdown-view/src/TxMarkdownView.vue.js +3 -2
- package/dist/lib/modal/index.js +1 -1
- package/dist/lib/modal/src/TxModal.vue.js +1 -1
- package/dist/lib/modal/src/TxModal.vue2.js +25 -3
- package/dist/lib/nav-bar/index.js +1 -1
- package/dist/lib/no-data/index.js +1 -1
- package/dist/lib/no-selection/index.js +1 -1
- package/dist/lib/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/properties.js +66 -0
- package/dist/lib/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/toml.js +80 -0
- package/dist/lib/node_modules/.pnpm/@lezer_common@1.5.0/node_modules/@lezer/common/dist/index.js +257 -0
- package/dist/lib/node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +688 -0
- package/dist/lib/offline-state/index.js +1 -1
- package/dist/lib/outline-border/index.js +1 -1
- package/dist/lib/{utils → packages/tuffex/packages/utils}/toast.js +4 -1
- package/dist/lib/packages/tuffex/packages/utils/z-index-manager.js +124 -0
- package/dist/lib/packages/utils/env/index.js +13 -0
- package/dist/lib/permission-state/index.js +1 -1
- package/dist/lib/picker/index.js +1 -1
- package/dist/lib/picker/src/TxPicker.vue.js +1 -1
- package/dist/lib/picker/src/TxPicker.vue2.js +6 -1
- package/dist/lib/popover/index.js +1 -1
- package/dist/lib/popover/src/TxPopover.vue.js +1 -1
- package/dist/lib/popover/src/TxPopover.vue2.js +146 -316
- package/dist/lib/progress-bar/index.js +1 -1
- package/dist/lib/radio/index.js +1 -1
- package/dist/lib/radio/src/TxRadioGroup.vue2.js +1 -1
- package/dist/lib/scroll/index.js +1 -1
- package/dist/lib/scroll/src/TxScroll.vue.js +1 -1
- package/dist/lib/scroll/src/TxScroll.vue2.js +25 -13
- package/dist/lib/scroll/src/runtime-capabilities.js +72 -0
- package/dist/lib/search-empty/index.js +1 -1
- package/dist/lib/search-input/index.js +1 -1
- package/dist/lib/search-select/index.js +1 -1
- package/dist/lib/search-select/src/TxSearchSelect.vue.js +1 -1
- package/dist/lib/search-select/src/TxSearchSelect.vue2.js +104 -177
- package/dist/lib/segmented-slider/index.js +1 -1
- package/dist/lib/segmented-slider/src/TxSegmentedSlider.vue.js +1 -0
- package/dist/lib/select/index.js +6 -9
- package/dist/lib/select/src/TxSelect.vue.js +2 -2
- package/dist/lib/select/src/TxSelect.vue2.js +202 -151
- package/dist/lib/select/src/TxSelectItem.vue.js +2 -2
- package/dist/lib/select/src/TxSelectItem.vue2.js +43 -6
- package/dist/lib/select/src/types.js +7 -0
- package/dist/lib/skeleton/index.js +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/sortable-list/index.js +1 -1
- package/dist/lib/sortable-list/src/TxSortableList.vue.js +1 -1
- package/dist/lib/sortable-list/src/TxSortableList.vue2.js +1 -1
- package/dist/lib/spinner/index.js +1 -1
- package/dist/lib/splitter/index.js +1 -1
- package/dist/lib/stack/index.js +1 -1
- package/dist/lib/stagger/index.js +1 -1
- package/dist/lib/stat-card/index.js +1 -1
- package/dist/lib/stat-card/src/TxStatCard.vue.js +1 -1
- package/dist/lib/stat-card/src/TxStatCard.vue2.js +246 -18
- package/dist/lib/status-badge/index.js +1 -1
- package/dist/lib/switch/index.js +1 -0
- package/dist/lib/tab-bar/index.js +1 -1
- package/dist/lib/tabs/index.js +1 -1
- package/dist/lib/tabs/src/TxTabs.vue.js +1 -1
- package/dist/lib/tabs/src/TxTabs.vue2.js +3 -1
- package/dist/lib/tag/index.js +1 -1
- package/dist/lib/tag-input/index.js +1 -1
- package/dist/lib/text-transformer/index.js +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/src/TxToastHost.vue.js +17 -16
- package/dist/lib/tooltip/index.js +1 -1
- package/dist/lib/tooltip/src/TxTooltip.vue.js +1 -1
- package/dist/lib/tooltip/src/TxTooltip.vue2.js +101 -349
- package/dist/lib/transfer/index.js +12 -0
- package/dist/lib/transfer/src/TxTransfer.vue.js +11 -0
- package/dist/lib/transfer/src/TxTransfer.vue2.js +221 -0
- package/dist/lib/transition/index.js +1 -1
- package/dist/lib/tree/index.js +1 -1
- package/dist/lib/tree/src/TxTree.vue.js +1 -1
- package/dist/lib/tree/src/TxTree.vue2.js +3 -2
- package/dist/lib/tree-select/index.js +1 -1
- package/dist/lib/tree-select/src/TxTreeSelect.vue.js +1 -1
- package/dist/lib/tree-select/src/TxTreeSelect.vue2.js +0 -2
- package/dist/lib/tuff-logo-stroke/index.js +12 -0
- package/dist/lib/tuff-logo-stroke/src/TxTuffLogoStroke.vue.js +11 -0
- package/dist/lib/tuff-logo-stroke/src/TxTuffLogoStroke.vue2.js +151 -0
- package/dist/lib/virtual-list/index.js +1 -1
- package/package.json +37 -25
- package/dist/es/button/__tests__/button.test.d.ts +0 -1
- package/dist/es/button/__tests__/split-button.test.d.ts +0 -1
- package/dist/es/cascader/__tests__/cascader.test.d.ts +0 -1
- package/dist/es/command-palette/__tests__/command-palette.test.d.ts +0 -1
- package/dist/es/data-table/__tests__/data-table.test.d.ts +0 -1
- package/dist/es/file-uploader/__tests__/file-uploader.test.d.ts +0 -1
- package/dist/es/form/__tests__/form.test.d.ts +0 -1
- package/dist/es/search-select/__tests__/search-select.test.d.ts +0 -1
- package/dist/es/tag-input/__tests__/tag-input.test.d.ts +0 -1
- package/dist/es/tree/__tests__/tree.test.d.ts +0 -1
- package/dist/es/tree-select/__tests__/tree-select.test.d.ts +0 -1
- package/dist/es/virtual-list/__tests__/virtual-list.test.d.ts +0 -1
- /package/dist/es/{utils → packages/tuffex/packages/utils}/animation/auto-resize.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/animation/flip.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/dialog-manager.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/env.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/vibrate.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/withInstall.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/animation/auto-resize.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/animation/flip.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/dialog-manager.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/env.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/vibrate.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/withInstall.js +0 -0
|
@@ -0,0 +1,1012 @@
|
|
|
1
|
+
import { defineComponent, ref, useAttrs, computed, watch, onMounted, onBeforeUnmount, createBlock, openBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, withCtx, createVNode, createElementVNode, Transition, createCommentVNode, mergeProps, createElementBlock, renderSlot } from 'vue';
|
|
2
|
+
import { hasWindow } from '../../packages/tuffex/packages/utils/env.js';
|
|
3
|
+
import _sfc_main$1 from '../../glass-surface/src/TxGlassSurface.vue.js';
|
|
4
|
+
/* empty css */
|
|
5
|
+
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "tx-base-surface__layer tx-base-surface__layer--filter"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "tx-base-surface__layer tx-base-surface__layer--motion-cover"
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_3 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "tx-base-surface__layer tx-base-surface__layer--mask"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_4 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "tx-base-surface__layer tx-base-surface__layer--refraction-edge"
|
|
21
|
+
};
|
|
22
|
+
const _hoisted_5 = { class: "tx-base-surface__content" };
|
|
23
|
+
const SURFACE_MOTION_DURATION_MS = 299;
|
|
24
|
+
const REFRACTION_PARAM_BLEND_DURATION_MS = 182;
|
|
25
|
+
const REFRACTION_MASK_RELEASE_DELAY_AFTER_FALLBACK_MS = 100;
|
|
26
|
+
const REFRACTION_RECOVERY_DURATION_FACTOR = 0.7;
|
|
27
|
+
const REFRACTION_MASK_PEAK_OPACITY = 0.95;
|
|
28
|
+
const REFRACTION_MASK_PEAK_RAMP_DURATION_MS = 180;
|
|
29
|
+
const REFRACTION_EDGE_REVEAL_DELAY_MS = 60;
|
|
30
|
+
const REFRACTION_EDGE_REVEAL_DURATION_MS = 220;
|
|
31
|
+
const REFRACTION_MASK_RELEASE_SLOWDOWN = 1.2;
|
|
32
|
+
const REFRACTION_MOVING_PARAM_FLOOR = 0.28;
|
|
33
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
34
|
+
...{
|
|
35
|
+
name: "TxBaseSurface"
|
|
36
|
+
},
|
|
37
|
+
__name: "TxBaseSurface",
|
|
38
|
+
props: {
|
|
39
|
+
mode: { default: "pure" },
|
|
40
|
+
radius: {},
|
|
41
|
+
color: {},
|
|
42
|
+
opacity: { default: 0.75 },
|
|
43
|
+
fallbackMaskOpacity: {},
|
|
44
|
+
blur: { default: 10 },
|
|
45
|
+
filterSaturation: { default: 1.5 },
|
|
46
|
+
filterContrast: { default: 1 },
|
|
47
|
+
filterBrightness: { default: 1 },
|
|
48
|
+
saturation: { default: 1.8 },
|
|
49
|
+
brightness: { default: 70 },
|
|
50
|
+
backgroundOpacity: { default: 0 },
|
|
51
|
+
borderWidth: { default: 0.07 },
|
|
52
|
+
displace: { default: 0.5 },
|
|
53
|
+
distortionScale: { default: -180 },
|
|
54
|
+
refractionStrength: {},
|
|
55
|
+
refractionProfile: {},
|
|
56
|
+
refractionTone: { default: "balanced" },
|
|
57
|
+
refractionAngle: {},
|
|
58
|
+
refractionLightX: {},
|
|
59
|
+
refractionLightY: {},
|
|
60
|
+
refractionHaloOpacity: {},
|
|
61
|
+
redOffset: { default: 0 },
|
|
62
|
+
greenOffset: { default: 10 },
|
|
63
|
+
blueOffset: { default: 20 },
|
|
64
|
+
xChannel: { default: "R" },
|
|
65
|
+
yChannel: { default: "G" },
|
|
66
|
+
mixBlendMode: { default: "difference" },
|
|
67
|
+
moving: { type: Boolean, default: false },
|
|
68
|
+
fallbackMode: { default: "mask" },
|
|
69
|
+
settleDelay: { default: 150 },
|
|
70
|
+
autoDetect: { type: Boolean, default: false },
|
|
71
|
+
transitionDuration: { default: 299 },
|
|
72
|
+
fake: { type: Boolean, default: false },
|
|
73
|
+
fakeIndex: { default: 0 },
|
|
74
|
+
preset: { default: "default" },
|
|
75
|
+
refractionRenderer: { default: "svg" },
|
|
76
|
+
overlayOpacity: { default: 0 },
|
|
77
|
+
tag: { default: "div" }
|
|
78
|
+
},
|
|
79
|
+
setup(__props) {
|
|
80
|
+
const props = __props;
|
|
81
|
+
const rootRef = ref(null);
|
|
82
|
+
const attrs = useAttrs();
|
|
83
|
+
const autoMoving = ref(false);
|
|
84
|
+
const settling = ref(false);
|
|
85
|
+
let settleTimer;
|
|
86
|
+
const refractionRecovering = ref(false);
|
|
87
|
+
const refractionRecoveryProgress = ref(1);
|
|
88
|
+
const refractionRecoveryElapsed = ref(0);
|
|
89
|
+
const REFRACTION_MASK_RELEASE_DURATION_MS = Math.round(650 * REFRACTION_RECOVERY_DURATION_FACTOR);
|
|
90
|
+
let refractionRecoveryRaf = null;
|
|
91
|
+
let refractionMaskPeakRampRaf = null;
|
|
92
|
+
let refractionEdgeRevealRaf = null;
|
|
93
|
+
let refractionEdgeRevealTimer = null;
|
|
94
|
+
const refractionMaskPeakRampProgress = ref(1);
|
|
95
|
+
const refractionEdgeRevealProgress = ref(1);
|
|
96
|
+
const isMoving = computed(() => props.moving || autoMoving.value);
|
|
97
|
+
const settleDelayMs = computed(() => Math.max(toFinite(props.transitionDuration, SURFACE_MOTION_DURATION_MS), toFinite(props.settleDelay, 150)));
|
|
98
|
+
function clamp(value, min, max) {
|
|
99
|
+
return Math.max(min, Math.min(max, value));
|
|
100
|
+
}
|
|
101
|
+
function toNumber(value) {
|
|
102
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
106
|
+
const parsed = Number(value);
|
|
107
|
+
if (Number.isFinite(parsed)) {
|
|
108
|
+
return parsed;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return void 0;
|
|
112
|
+
}
|
|
113
|
+
function readAttr(keys) {
|
|
114
|
+
const source = attrs;
|
|
115
|
+
for (const key of keys) {
|
|
116
|
+
const value = source[key];
|
|
117
|
+
if (value != null) {
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return void 0;
|
|
122
|
+
}
|
|
123
|
+
function toFinite(value, fallback, attrKeys = []) {
|
|
124
|
+
const direct = toNumber(value);
|
|
125
|
+
if (direct != null) {
|
|
126
|
+
return direct;
|
|
127
|
+
}
|
|
128
|
+
const fromAttr = toNumber(readAttr(attrKeys));
|
|
129
|
+
if (fromAttr != null) {
|
|
130
|
+
return fromAttr;
|
|
131
|
+
}
|
|
132
|
+
return fallback;
|
|
133
|
+
}
|
|
134
|
+
function toEnum(value, allow, fallback, attrKeys = []) {
|
|
135
|
+
if (typeof value === "string" && allow.includes(value)) {
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
const fromAttr = readAttr(attrKeys);
|
|
139
|
+
if (typeof fromAttr === "string" && allow.includes(fromAttr)) {
|
|
140
|
+
return fromAttr;
|
|
141
|
+
}
|
|
142
|
+
return fallback;
|
|
143
|
+
}
|
|
144
|
+
function lerp(from, to, t) {
|
|
145
|
+
return from + (to - from) * t;
|
|
146
|
+
}
|
|
147
|
+
function smoothstep01(value) {
|
|
148
|
+
const t = clamp(value, 0, 1);
|
|
149
|
+
return t * t * (3 - 2 * t);
|
|
150
|
+
}
|
|
151
|
+
function normalizeAngleDeg(value) {
|
|
152
|
+
return ((value + 180) % 360 + 360) % 360 - 180;
|
|
153
|
+
}
|
|
154
|
+
function easeOutQuad(value) {
|
|
155
|
+
const t = clamp(value, 0, 1);
|
|
156
|
+
return 1 - (1 - t) * (1 - t);
|
|
157
|
+
}
|
|
158
|
+
const needsFallback = computed(
|
|
159
|
+
() => props.mode === "blur" || props.mode === "glass"
|
|
160
|
+
);
|
|
161
|
+
const fallbackActive = computed(
|
|
162
|
+
() => needsFallback.value && (isMoving.value || settling.value)
|
|
163
|
+
);
|
|
164
|
+
const activeMode = computed(() => {
|
|
165
|
+
if (props.mode === "refraction") {
|
|
166
|
+
return "refraction";
|
|
167
|
+
}
|
|
168
|
+
if (fallbackActive.value) {
|
|
169
|
+
return props.fallbackMode;
|
|
170
|
+
}
|
|
171
|
+
return props.mode;
|
|
172
|
+
});
|
|
173
|
+
const refractionParamProgress = computed(() => {
|
|
174
|
+
if (props.mode !== "refraction") {
|
|
175
|
+
return 1;
|
|
176
|
+
}
|
|
177
|
+
if (isMoving.value) {
|
|
178
|
+
return REFRACTION_MOVING_PARAM_FLOOR;
|
|
179
|
+
}
|
|
180
|
+
if (refractionRecovering.value) {
|
|
181
|
+
return lerp(REFRACTION_MOVING_PARAM_FLOOR, 1, refractionRecoveryProgress.value);
|
|
182
|
+
}
|
|
183
|
+
return 1;
|
|
184
|
+
});
|
|
185
|
+
const easedRefractionParamProgress = computed(() => {
|
|
186
|
+
return easeOutQuad(refractionParamProgress.value);
|
|
187
|
+
});
|
|
188
|
+
const showLayerGlass = computed(
|
|
189
|
+
() => activeMode.value === "glass" || activeMode.value === "refraction"
|
|
190
|
+
);
|
|
191
|
+
const showLayerFilter = computed(
|
|
192
|
+
() => activeMode.value === "blur" || activeMode.value === "refraction"
|
|
193
|
+
);
|
|
194
|
+
const glassBorderRadius = computed(() => {
|
|
195
|
+
if (typeof props.radius === "number") {
|
|
196
|
+
return props.radius;
|
|
197
|
+
}
|
|
198
|
+
if (typeof props.radius === "string") {
|
|
199
|
+
const parsed = Number.parseFloat(props.radius);
|
|
200
|
+
if (Number.isFinite(parsed)) {
|
|
201
|
+
return parsed;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return 0;
|
|
205
|
+
});
|
|
206
|
+
const normalizedBrightness = computed(() => {
|
|
207
|
+
const raw = toFinite(props.brightness, 70);
|
|
208
|
+
if (raw <= 3) {
|
|
209
|
+
return Math.round(raw * 100);
|
|
210
|
+
}
|
|
211
|
+
return raw;
|
|
212
|
+
});
|
|
213
|
+
const shouldUseRefractionModel = computed(
|
|
214
|
+
() => props.refractionStrength != null || props.refractionAngle != null || props.refractionProfile != null
|
|
215
|
+
);
|
|
216
|
+
const resolvedRefractionProfile = computed(() => toEnum(
|
|
217
|
+
props.refractionProfile,
|
|
218
|
+
["soft", "filmic", "cinematic"],
|
|
219
|
+
"filmic",
|
|
220
|
+
["refraction-profile", "refractionProfile"]
|
|
221
|
+
));
|
|
222
|
+
const resolvedRefractionTone = computed(() => toEnum(
|
|
223
|
+
props.refractionTone,
|
|
224
|
+
["mist", "balanced", "vivid"],
|
|
225
|
+
"balanced",
|
|
226
|
+
["refraction-tone", "refractionTone"]
|
|
227
|
+
));
|
|
228
|
+
const normalizedRefractionStrength = computed(() => {
|
|
229
|
+
const raw = toFinite(props.refractionStrength, 62, ["refraction-strength", "refractionStrength"]);
|
|
230
|
+
return clamp(raw, 0, 100) / 100;
|
|
231
|
+
});
|
|
232
|
+
const filmicRefractionStrength = computed(() => {
|
|
233
|
+
const eased = smoothstep01(normalizedRefractionStrength.value);
|
|
234
|
+
if (resolvedRefractionProfile.value === "soft") {
|
|
235
|
+
return 1 - (1 - eased) ** 1.15;
|
|
236
|
+
}
|
|
237
|
+
if (resolvedRefractionProfile.value === "cinematic") {
|
|
238
|
+
return 1 - (1 - eased) ** 2.2;
|
|
239
|
+
}
|
|
240
|
+
return 1 - (1 - eased) ** 1.65;
|
|
241
|
+
});
|
|
242
|
+
const normalizedRefractionAngleDeg = computed(() => {
|
|
243
|
+
const raw = toFinite(props.refractionAngle, -24, ["refraction-angle", "refractionAngle"]);
|
|
244
|
+
return normalizeAngleDeg(raw);
|
|
245
|
+
});
|
|
246
|
+
const normalizedRefractionAngleRad = computed(() => {
|
|
247
|
+
return normalizedRefractionAngleDeg.value * (Math.PI / 180);
|
|
248
|
+
});
|
|
249
|
+
const refractionModel = computed(() => {
|
|
250
|
+
const strength = filmicRefractionStrength.value;
|
|
251
|
+
const angle = normalizedRefractionAngleRad.value;
|
|
252
|
+
const profile = resolvedRefractionProfile.value;
|
|
253
|
+
const spectralAmplitude = profile === "soft" ? lerp(4, 24, strength) : profile === "cinematic" ? lerp(8, 44, strength) : lerp(5, 34, strength);
|
|
254
|
+
const spectralSeparation = profile === "soft" ? lerp(0.58, 0.92, strength) : profile === "cinematic" ? lerp(0.7, 1.32, strength) : lerp(0.62, 1.15, strength);
|
|
255
|
+
const baseScale = profile === "soft" ? lerp(-90, -240, strength) : profile === "cinematic" ? lerp(-140, -460, strength) : lerp(-110, -360, strength);
|
|
256
|
+
const displace = profile === "soft" ? lerp(0.14, 0.98, strength) : profile === "cinematic" ? lerp(0.28, 1.85, strength) : lerp(0.22, 1.45, strength);
|
|
257
|
+
const greenAngle = profile === "soft" ? angle + Math.PI * lerp(0.22, 0.38, strength) : profile === "cinematic" ? angle + Math.PI * lerp(0.34, 0.54, strength) : angle + Math.PI * lerp(0.28, 0.46, strength);
|
|
258
|
+
const blueAngle = profile === "soft" ? angle - Math.PI * lerp(0.18, 0.32, strength) : profile === "cinematic" ? angle - Math.PI * lerp(0.28, 0.48, strength) : angle - Math.PI * lerp(0.22, 0.4, strength);
|
|
259
|
+
const greenGain = profile === "soft" ? 0.62 : profile === "cinematic" ? 0.84 : 0.72;
|
|
260
|
+
return {
|
|
261
|
+
displace,
|
|
262
|
+
distortionScale: Math.round(baseScale),
|
|
263
|
+
redOffset: Math.round(spectralAmplitude * Math.cos(angle)),
|
|
264
|
+
greenOffset: Math.round(spectralAmplitude * greenGain * Math.cos(greenAngle)),
|
|
265
|
+
blueOffset: Math.round(spectralAmplitude * spectralSeparation * Math.cos(blueAngle))
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
const refractionToneModel = computed(() => {
|
|
269
|
+
const tone = resolvedRefractionTone.value;
|
|
270
|
+
const profile = resolvedRefractionProfile.value;
|
|
271
|
+
const strength = filmicRefractionStrength.value;
|
|
272
|
+
const base = tone === "mist" ? {
|
|
273
|
+
filterPrimaryTint: 24,
|
|
274
|
+
filterSecondaryTint: 16,
|
|
275
|
+
filterVeilTint: 42,
|
|
276
|
+
filterBaseTint: 16,
|
|
277
|
+
filterSaturationBoost: 1.22,
|
|
278
|
+
filterContrastBase: 1.04,
|
|
279
|
+
filterContrastGain: 0.07,
|
|
280
|
+
filterBrightnessBoost: 1.01,
|
|
281
|
+
maskPrimaryTint: 28,
|
|
282
|
+
maskSecondaryTint: 21,
|
|
283
|
+
maskVeilTint: 22,
|
|
284
|
+
maskStrengthGain: 0.06,
|
|
285
|
+
glassOpacityFrom: 0.66,
|
|
286
|
+
glassOpacityTo: 0.58,
|
|
287
|
+
glassSaturationBoost: 1.02,
|
|
288
|
+
glassBrightnessBoost: 4,
|
|
289
|
+
haloOpacityGain: 1.1,
|
|
290
|
+
streakTint: 20
|
|
291
|
+
} : tone === "vivid" ? {
|
|
292
|
+
filterPrimaryTint: 44,
|
|
293
|
+
filterSecondaryTint: 34,
|
|
294
|
+
filterVeilTint: 18,
|
|
295
|
+
filterBaseTint: 6,
|
|
296
|
+
filterSaturationBoost: 1.58,
|
|
297
|
+
filterContrastBase: 1.08,
|
|
298
|
+
filterContrastGain: 0.12,
|
|
299
|
+
filterBrightnessBoost: 1.07,
|
|
300
|
+
maskPrimaryTint: 48,
|
|
301
|
+
maskSecondaryTint: 38,
|
|
302
|
+
maskVeilTint: 8,
|
|
303
|
+
maskStrengthGain: 0.04,
|
|
304
|
+
glassOpacityFrom: 0.54,
|
|
305
|
+
glassOpacityTo: 0.42,
|
|
306
|
+
glassSaturationBoost: 1.22,
|
|
307
|
+
glassBrightnessBoost: 10,
|
|
308
|
+
haloOpacityGain: 0.82,
|
|
309
|
+
streakTint: 30
|
|
310
|
+
} : {
|
|
311
|
+
filterPrimaryTint: 34,
|
|
312
|
+
filterSecondaryTint: 24,
|
|
313
|
+
filterVeilTint: 28,
|
|
314
|
+
filterBaseTint: 10,
|
|
315
|
+
filterSaturationBoost: 1.4,
|
|
316
|
+
filterContrastBase: 1.06,
|
|
317
|
+
filterContrastGain: 0.1,
|
|
318
|
+
filterBrightnessBoost: 1.04,
|
|
319
|
+
maskPrimaryTint: 38,
|
|
320
|
+
maskSecondaryTint: 30,
|
|
321
|
+
maskVeilTint: 14,
|
|
322
|
+
maskStrengthGain: 0.05,
|
|
323
|
+
glassOpacityFrom: 0.62,
|
|
324
|
+
glassOpacityTo: 0.5,
|
|
325
|
+
glassSaturationBoost: 1.12,
|
|
326
|
+
glassBrightnessBoost: 7,
|
|
327
|
+
haloOpacityGain: 0.94,
|
|
328
|
+
streakTint: 24
|
|
329
|
+
};
|
|
330
|
+
const profileFactor = profile === "soft" ? 0.92 : profile === "cinematic" ? 1.1 : 1;
|
|
331
|
+
const primaryTint = clamp(base.filterPrimaryTint * lerp(0.86, 1.18, strength) * profileFactor, 10, 64);
|
|
332
|
+
const secondaryTint = clamp(base.filterSecondaryTint * lerp(0.88, 1.16, strength) * profileFactor, 8, 56);
|
|
333
|
+
const veilTint = clamp(base.filterVeilTint - strength * (tone === "vivid" ? 8 : 5), 6, 56);
|
|
334
|
+
const baseTint = clamp(base.filterBaseTint - strength * (tone === "vivid" ? 2.4 : 1.4), 2, 26);
|
|
335
|
+
const maskPrimaryTint = clamp(base.maskPrimaryTint * lerp(0.9, 1.16, strength) * profileFactor, 12, 68);
|
|
336
|
+
const maskSecondaryTint = clamp(base.maskSecondaryTint * lerp(0.9, 1.14, strength) * profileFactor, 10, 62);
|
|
337
|
+
const maskVeilTint = clamp(base.maskVeilTint - strength * (tone === "vivid" ? 4 : 2), 3, 28);
|
|
338
|
+
const saturationBoost = clamp(
|
|
339
|
+
base.filterSaturationBoost * lerp(0.96, 1.1, strength) * (profile === "soft" ? 0.96 : 1),
|
|
340
|
+
1,
|
|
341
|
+
2.2
|
|
342
|
+
);
|
|
343
|
+
const contrastBase = clamp(base.filterContrastBase + (profile === "cinematic" ? 0.02 : 0), 1, 1.2);
|
|
344
|
+
const contrastGain = clamp(base.filterContrastGain + (profile === "cinematic" ? 0.02 : 0), 0.04, 0.18);
|
|
345
|
+
const brightnessBoost = clamp(
|
|
346
|
+
base.filterBrightnessBoost + (profile === "cinematic" ? 0.02 : 0) + strength * 0.03,
|
|
347
|
+
1,
|
|
348
|
+
1.18
|
|
349
|
+
);
|
|
350
|
+
const maskStrengthGain = clamp(
|
|
351
|
+
base.maskStrengthGain + (profile === "cinematic" ? 8e-3 : 0),
|
|
352
|
+
0.03,
|
|
353
|
+
0.09
|
|
354
|
+
);
|
|
355
|
+
const glassOpacity = clamp(lerp(base.glassOpacityFrom, base.glassOpacityTo, strength), 0.36, 0.72);
|
|
356
|
+
const glassSaturationBoost = clamp(base.glassSaturationBoost * lerp(0.96, 1.08, strength), 0.9, 1.5);
|
|
357
|
+
const glassBrightnessBoost = clamp(
|
|
358
|
+
base.glassBrightnessBoost + strength * 8 + (profile === "cinematic" ? 2 : 0),
|
|
359
|
+
2,
|
|
360
|
+
18
|
|
361
|
+
);
|
|
362
|
+
const haloOpacityGain = clamp(base.haloOpacityGain * lerp(0.92, 1.06, strength), 0.72, 1.2);
|
|
363
|
+
const streakTint = clamp(base.streakTint * lerp(0.9, 1.15, strength), 12, 46);
|
|
364
|
+
return {
|
|
365
|
+
filterPrimaryTint: primaryTint,
|
|
366
|
+
filterSecondaryTint: secondaryTint,
|
|
367
|
+
filterVeilTint: veilTint,
|
|
368
|
+
filterBaseTint: baseTint,
|
|
369
|
+
filterSaturationBoost: saturationBoost,
|
|
370
|
+
filterContrastBase: contrastBase,
|
|
371
|
+
filterContrastGain: contrastGain,
|
|
372
|
+
filterBrightnessBoost: brightnessBoost,
|
|
373
|
+
maskPrimaryTint,
|
|
374
|
+
maskSecondaryTint,
|
|
375
|
+
maskVeilTint,
|
|
376
|
+
maskStrengthGain,
|
|
377
|
+
glassOpacity,
|
|
378
|
+
glassSaturationBoost,
|
|
379
|
+
glassBrightnessBoost,
|
|
380
|
+
haloOpacityGain,
|
|
381
|
+
streakTint
|
|
382
|
+
};
|
|
383
|
+
});
|
|
384
|
+
const baseRefractionMaskOpacity = computed(() => {
|
|
385
|
+
const base = clamp(toFinite(props.overlayOpacity, 0, ["overlay-opacity", "overlayOpacity"]), 0, 1);
|
|
386
|
+
if (base <= 0) {
|
|
387
|
+
return 0;
|
|
388
|
+
}
|
|
389
|
+
const tone = resolvedRefractionTone.value;
|
|
390
|
+
const toneBoost = tone === "mist" ? 0.11 : tone === "vivid" ? 0.05 : 0.08;
|
|
391
|
+
const profileBoost = resolvedRefractionProfile.value === "soft" ? -0.012 : resolvedRefractionProfile.value === "cinematic" ? 0.022 : 0;
|
|
392
|
+
const boost = clamp(toneBoost + profileBoost, 0.03, 0.16);
|
|
393
|
+
const blendedStrength = lerp(0, filmicRefractionStrength.value, easedRefractionParamProgress.value);
|
|
394
|
+
return clamp(base + blendedStrength * boost, 0, 0.62);
|
|
395
|
+
});
|
|
396
|
+
const refractionRecoveryBlendDurationMs = computed(() => {
|
|
397
|
+
const base = toFinite(props.transitionDuration, SURFACE_MOTION_DURATION_MS);
|
|
398
|
+
return Math.max(REFRACTION_PARAM_BLEND_DURATION_MS, base * REFRACTION_RECOVERY_DURATION_FACTOR);
|
|
399
|
+
});
|
|
400
|
+
const refractionMaskReleaseDelayMs = computed(() => {
|
|
401
|
+
return REFRACTION_MASK_RELEASE_DELAY_AFTER_FALLBACK_MS;
|
|
402
|
+
});
|
|
403
|
+
const refractionRecoveryTotalDurationMs = computed(() => {
|
|
404
|
+
return Math.max(
|
|
405
|
+
refractionRecoveryBlendDurationMs.value,
|
|
406
|
+
refractionMaskReleaseDelayMs.value + REFRACTION_MASK_RELEASE_DURATION_MS
|
|
407
|
+
);
|
|
408
|
+
});
|
|
409
|
+
const refractionMaskReleaseProgress = computed(() => {
|
|
410
|
+
if (props.mode !== "refraction" || !refractionRecovering.value) {
|
|
411
|
+
return 1;
|
|
412
|
+
}
|
|
413
|
+
const afterDelayElapsed = refractionRecoveryElapsed.value - refractionMaskReleaseDelayMs.value;
|
|
414
|
+
if (afterDelayElapsed <= 0) {
|
|
415
|
+
return 0;
|
|
416
|
+
}
|
|
417
|
+
const timeProgress = smoothstep01(afterDelayElapsed / REFRACTION_MASK_RELEASE_DURATION_MS);
|
|
418
|
+
const effectProgress = smoothstep01(refractionParamProgress.value);
|
|
419
|
+
return clamp(Math.min(timeProgress, effectProgress), 0, 1);
|
|
420
|
+
});
|
|
421
|
+
const refractionRestMaskOpacity = computed(() => {
|
|
422
|
+
const baseOpacity = baseRefractionMaskOpacity.value;
|
|
423
|
+
if (!refractionRecovering.value) {
|
|
424
|
+
return baseOpacity;
|
|
425
|
+
}
|
|
426
|
+
const releaseProgress = refractionMaskReleaseProgress.value;
|
|
427
|
+
return lerp(
|
|
428
|
+
REFRACTION_MASK_PEAK_OPACITY,
|
|
429
|
+
baseOpacity,
|
|
430
|
+
releaseProgress ** REFRACTION_MASK_RELEASE_SLOWDOWN
|
|
431
|
+
);
|
|
432
|
+
});
|
|
433
|
+
const refractionRestMotionCoverOpacity = computed(() => {
|
|
434
|
+
if (!refractionRecovering.value) {
|
|
435
|
+
return 0;
|
|
436
|
+
}
|
|
437
|
+
const releaseProgress = refractionMaskReleaseProgress.value;
|
|
438
|
+
return lerp(
|
|
439
|
+
REFRACTION_MASK_PEAK_OPACITY,
|
|
440
|
+
0,
|
|
441
|
+
releaseProgress ** REFRACTION_MASK_RELEASE_SLOWDOWN
|
|
442
|
+
);
|
|
443
|
+
});
|
|
444
|
+
const layerMaskOpacity = computed(() => {
|
|
445
|
+
if (activeMode.value === "mask") {
|
|
446
|
+
const triggeredByFallback = (fallbackActive.value || props.mode === "refraction" && isMoving.value) && props.fallbackMode === "mask";
|
|
447
|
+
if (triggeredByFallback) {
|
|
448
|
+
return REFRACTION_MASK_PEAK_OPACITY;
|
|
449
|
+
}
|
|
450
|
+
return clamp(toFinite(props.opacity, 0.75, ["opacity"]), 0, 1);
|
|
451
|
+
}
|
|
452
|
+
if (activeMode.value === "refraction") {
|
|
453
|
+
if (isMoving.value) {
|
|
454
|
+
return lerp(refractionRestMaskOpacity.value, REFRACTION_MASK_PEAK_OPACITY, refractionMaskPeakRampProgress.value);
|
|
455
|
+
}
|
|
456
|
+
return refractionRestMaskOpacity.value;
|
|
457
|
+
}
|
|
458
|
+
return clamp(toFinite(props.overlayOpacity, 0, ["overlay-opacity", "overlayOpacity"]), 0, 1);
|
|
459
|
+
});
|
|
460
|
+
const refractionMotionCoverOpacity = computed(() => {
|
|
461
|
+
if (activeMode.value !== "refraction") {
|
|
462
|
+
return 0;
|
|
463
|
+
}
|
|
464
|
+
if (isMoving.value) {
|
|
465
|
+
return lerp(refractionRestMotionCoverOpacity.value, REFRACTION_MASK_PEAK_OPACITY, refractionMaskPeakRampProgress.value);
|
|
466
|
+
}
|
|
467
|
+
return refractionRestMotionCoverOpacity.value;
|
|
468
|
+
});
|
|
469
|
+
const showLayerMotionCover = computed(() => {
|
|
470
|
+
return refractionMotionCoverOpacity.value > 0;
|
|
471
|
+
});
|
|
472
|
+
const refractionEdgeTargetOpacity = computed(() => {
|
|
473
|
+
if (activeMode.value !== "refraction") {
|
|
474
|
+
return 0;
|
|
475
|
+
}
|
|
476
|
+
return clamp(baseRefractionMaskOpacity.value * 0.36 + 8e-3, 0.018, 0.065);
|
|
477
|
+
});
|
|
478
|
+
const refractionEdgeOpacity = computed(() => {
|
|
479
|
+
if (activeMode.value !== "refraction") {
|
|
480
|
+
return 0;
|
|
481
|
+
}
|
|
482
|
+
return refractionEdgeTargetOpacity.value * refractionEdgeRevealProgress.value;
|
|
483
|
+
});
|
|
484
|
+
const showLayerRefractionEdge = computed(() => {
|
|
485
|
+
return activeMode.value === "refraction";
|
|
486
|
+
});
|
|
487
|
+
const showLayerMask = computed(() => {
|
|
488
|
+
if (activeMode.value === "pure") {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
if (activeMode.value === "mask") {
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
return layerMaskOpacity.value > 0;
|
|
495
|
+
});
|
|
496
|
+
const glassSurfaceProps = computed(() => {
|
|
497
|
+
const base = {
|
|
498
|
+
width: "100%",
|
|
499
|
+
height: "100%",
|
|
500
|
+
borderRadius: glassBorderRadius.value,
|
|
501
|
+
blur: Math.max(0, toFinite(props.blur, 10, ["blur"])),
|
|
502
|
+
saturation: Math.max(0, toFinite(props.saturation, 1.8, ["saturation"])),
|
|
503
|
+
brightness: normalizedBrightness.value,
|
|
504
|
+
opacity: 0.93,
|
|
505
|
+
backgroundOpacity: clamp(toFinite(props.backgroundOpacity, 0, ["background-opacity", "backgroundOpacity"]), 0, 1),
|
|
506
|
+
borderWidth: Math.max(0, toFinite(props.borderWidth, 0.07, ["border-width", "borderWidth"]))
|
|
507
|
+
};
|
|
508
|
+
if (activeMode.value === "refraction") {
|
|
509
|
+
const model = refractionModel.value;
|
|
510
|
+
const toneModel = refractionToneModel.value;
|
|
511
|
+
const parameterBlend = easedRefractionParamProgress.value;
|
|
512
|
+
const targetSaturation = clamp(Math.max(0, toFinite(props.saturation, 1.8, ["saturation"])) * toneModel.glassSaturationBoost, 0.6, 3.2);
|
|
513
|
+
const targetBrightness = clamp(normalizedBrightness.value + toneModel.glassBrightnessBoost, 24, 100);
|
|
514
|
+
const targetDisplace = shouldUseRefractionModel.value ? model.displace : toFinite(props.displace, 0.5, ["displace"]);
|
|
515
|
+
const targetDistortionScale = shouldUseRefractionModel.value ? model.distortionScale : toFinite(props.distortionScale, -180, ["distortion-scale", "distortionScale"]);
|
|
516
|
+
const targetRedOffset = shouldUseRefractionModel.value ? model.redOffset : toFinite(props.redOffset, 0, ["red-offset", "redOffset"]);
|
|
517
|
+
const targetGreenOffset = shouldUseRefractionModel.value ? model.greenOffset : toFinite(props.greenOffset, 10, ["green-offset", "greenOffset"]);
|
|
518
|
+
const targetBlueOffset = shouldUseRefractionModel.value ? model.blueOffset : toFinite(props.blueOffset, 20, ["blue-offset", "blueOffset"]);
|
|
519
|
+
return {
|
|
520
|
+
...base,
|
|
521
|
+
saturation: lerp(1.02, targetSaturation, parameterBlend),
|
|
522
|
+
brightness: lerp(Math.max(24, normalizedBrightness.value), targetBrightness, parameterBlend),
|
|
523
|
+
opacity: lerp(0.18, toneModel.glassOpacity, parameterBlend),
|
|
524
|
+
displace: lerp(0.06, targetDisplace, parameterBlend),
|
|
525
|
+
distortionScale: Math.round(lerp(-90, targetDistortionScale, parameterBlend)),
|
|
526
|
+
redOffset: Math.round(lerp(0, targetRedOffset, parameterBlend)),
|
|
527
|
+
greenOffset: Math.round(lerp(0, targetGreenOffset, parameterBlend)),
|
|
528
|
+
blueOffset: Math.round(lerp(0, targetBlueOffset, parameterBlend)),
|
|
529
|
+
xChannel: props.xChannel,
|
|
530
|
+
yChannel: props.yChannel,
|
|
531
|
+
mixBlendMode: props.mixBlendMode ?? "difference"
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
return {
|
|
535
|
+
...base,
|
|
536
|
+
displace: 0.5,
|
|
537
|
+
distortionScale: -180,
|
|
538
|
+
redOffset: 0,
|
|
539
|
+
greenOffset: 10,
|
|
540
|
+
blueOffset: 20,
|
|
541
|
+
xChannel: "R",
|
|
542
|
+
yChannel: "G",
|
|
543
|
+
mixBlendMode: "difference"
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
const cssVars = computed(() => {
|
|
547
|
+
const vars = {
|
|
548
|
+
"--tx-surface-transition": `${Math.max(0, toFinite(props.transitionDuration, SURFACE_MOTION_DURATION_MS))}ms`
|
|
549
|
+
};
|
|
550
|
+
if (props.radius != null) {
|
|
551
|
+
vars["--tx-surface-radius"] = typeof props.radius === "number" ? `${props.radius}px` : props.radius;
|
|
552
|
+
}
|
|
553
|
+
if (props.color) {
|
|
554
|
+
vars["--tx-surface-color"] = props.color;
|
|
555
|
+
}
|
|
556
|
+
if (showLayerFilter.value) {
|
|
557
|
+
vars["--tx-surface-filter-blur"] = `${Math.max(0, toFinite(props.blur, 10, ["blur"]))}px`;
|
|
558
|
+
vars["--tx-surface-filter-saturation"] = `${Math.max(0, toFinite(props.filterSaturation, 1.5, ["filter-saturation", "filterSaturation"]))}`;
|
|
559
|
+
vars["--tx-surface-filter-contrast"] = `${Math.max(0, toFinite(props.filterContrast, 1, ["filter-contrast", "filterContrast"]))}`;
|
|
560
|
+
vars["--tx-surface-filter-brightness"] = `${Math.max(0, toFinite(props.filterBrightness, 1, ["filter-brightness", "filterBrightness"]))}`;
|
|
561
|
+
}
|
|
562
|
+
if (showLayerMask.value) {
|
|
563
|
+
vars["--tx-surface-mask-opacity"] = `${layerMaskOpacity.value}`;
|
|
564
|
+
vars["--tx-surface-mask-opacity-percent"] = `${Math.round(layerMaskOpacity.value * 100)}%`;
|
|
565
|
+
}
|
|
566
|
+
if (showLayerMotionCover.value) {
|
|
567
|
+
vars["--tx-surface-motion-cover-opacity"] = `${refractionMotionCoverOpacity.value}`;
|
|
568
|
+
}
|
|
569
|
+
if (showLayerRefractionEdge.value) {
|
|
570
|
+
vars["--tx-surface-refraction-edge-opacity"] = `${refractionEdgeOpacity.value}`;
|
|
571
|
+
}
|
|
572
|
+
if (activeMode.value === "refraction") {
|
|
573
|
+
const angleDeg = normalizedRefractionAngleDeg.value;
|
|
574
|
+
const angleRad = normalizedRefractionAngleRad.value;
|
|
575
|
+
const toneModel = refractionToneModel.value;
|
|
576
|
+
const parameterBlend = easedRefractionParamProgress.value;
|
|
577
|
+
const blendedStrength = lerp(0, filmicRefractionStrength.value, parameterBlend);
|
|
578
|
+
const fallbackLightX = clamp(50 + Math.cos(angleRad) * 24, 0, 100);
|
|
579
|
+
const fallbackLightY = clamp(50 + Math.sin(angleRad) * 22, 0, 100);
|
|
580
|
+
const lightX = props.refractionLightX == null ? fallbackLightX : clamp(toFinite(props.refractionLightX, 0.5, ["refraction-light-x", "refractionLightX"]), 0, 1) * 100;
|
|
581
|
+
const lightY = props.refractionLightY == null ? fallbackLightY : clamp(toFinite(props.refractionLightY, 0.5, ["refraction-light-y", "refractionLightY"]), 0, 1) * 100;
|
|
582
|
+
vars["--tx-surface-refraction-strength"] = `${blendedStrength}`;
|
|
583
|
+
vars["--tx-surface-refraction-light-x"] = `${lightX}%`;
|
|
584
|
+
vars["--tx-surface-refraction-light-y"] = `${lightY}%`;
|
|
585
|
+
vars["--tx-surface-refraction-streak-angle"] = `${angleDeg + 92}deg`;
|
|
586
|
+
vars["--tx-surface-refraction-filter-primary-weight"] = `${Math.round(lerp(10, clamp(toneModel.filterPrimaryTint, 8, 76), parameterBlend))}%`;
|
|
587
|
+
vars["--tx-surface-refraction-filter-secondary-weight"] = `${Math.round(lerp(8, clamp(toneModel.filterSecondaryTint, 6, 68), parameterBlend))}%`;
|
|
588
|
+
vars["--tx-surface-refraction-filter-veil-weight"] = `${Math.round(lerp(6, clamp(toneModel.filterVeilTint, 4, 52), parameterBlend))}%`;
|
|
589
|
+
vars["--tx-surface-refraction-filter-base-weight"] = `${Math.round(lerp(2, clamp(toneModel.filterBaseTint, 2, 32), parameterBlend))}%`;
|
|
590
|
+
vars["--tx-surface-refraction-filter-saturation-boost"] = `${lerp(1, toneModel.filterSaturationBoost, parameterBlend)}`;
|
|
591
|
+
vars["--tx-surface-refraction-filter-contrast-base"] = `${lerp(1, toneModel.filterContrastBase, parameterBlend)}`;
|
|
592
|
+
vars["--tx-surface-refraction-filter-contrast-gain"] = `${lerp(0, toneModel.filterContrastGain, parameterBlend)}`;
|
|
593
|
+
vars["--tx-surface-refraction-filter-brightness-boost"] = `${lerp(1, toneModel.filterBrightnessBoost, parameterBlend)}`;
|
|
594
|
+
vars["--tx-surface-refraction-mask-primary-weight"] = `${Math.round(lerp(12, clamp(toneModel.maskPrimaryTint, 8, 78), parameterBlend))}%`;
|
|
595
|
+
vars["--tx-surface-refraction-mask-secondary-weight"] = `${Math.round(lerp(10, clamp(toneModel.maskSecondaryTint, 6, 72), parameterBlend))}%`;
|
|
596
|
+
vars["--tx-surface-refraction-mask-veil-weight"] = `${Math.round(lerp(4, clamp(toneModel.maskVeilTint, 3, 36), parameterBlend))}%`;
|
|
597
|
+
vars["--tx-surface-refraction-mask-strength-gain"] = `${lerp(0.01, toneModel.maskStrengthGain, parameterBlend)}`;
|
|
598
|
+
vars["--tx-surface-refraction-mask-effective-opacity"] = `${layerMaskOpacity.value}`;
|
|
599
|
+
vars["--tx-surface-refraction-streak-weight"] = `${Math.round(lerp(8, clamp(toneModel.streakTint, 8, 52), parameterBlend))}%`;
|
|
600
|
+
vars["--tx-surface-refraction-halo-opacity-gain"] = `${lerp(0.72, toneModel.haloOpacityGain, parameterBlend)}`;
|
|
601
|
+
const modelHaloMin = resolvedRefractionProfile.value === "soft" ? 0.16 : resolvedRefractionProfile.value === "cinematic" ? 0.28 : 0.22;
|
|
602
|
+
const modelHaloMax = resolvedRefractionProfile.value === "soft" ? 0.34 : resolvedRefractionProfile.value === "cinematic" ? 0.58 : 0.48;
|
|
603
|
+
const modelHaloOpacity = lerp(modelHaloMin, modelHaloMax, blendedStrength) * lerp(0.72, toneModel.haloOpacityGain, parameterBlend);
|
|
604
|
+
const haloOpacity = props.refractionHaloOpacity == null ? modelHaloOpacity : clamp(toFinite(props.refractionHaloOpacity, modelHaloOpacity, ["refraction-halo-opacity", "refractionHaloOpacity"]), 0, 1);
|
|
605
|
+
vars["--tx-surface-refraction-halo-opacity"] = `${haloOpacity}`;
|
|
606
|
+
}
|
|
607
|
+
if (props.fake) {
|
|
608
|
+
vars["--tx-surface-fake-index"] = String(props.fakeIndex);
|
|
609
|
+
const mode = activeMode.value;
|
|
610
|
+
if (mode === "pure") {
|
|
611
|
+
vars["--tx-surface-fake-bg"] = props.color || "var(--tx-fill-color-lighter, #fafafa)";
|
|
612
|
+
vars["--tx-surface-fake-opacity"] = "1";
|
|
613
|
+
} else if (mode === "mask") {
|
|
614
|
+
vars["--tx-surface-fake-bg"] = props.color || "var(--tx-fill-color-lighter, #fafafa)";
|
|
615
|
+
vars["--tx-surface-fake-opacity"] = String(layerMaskOpacity.value);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return vars;
|
|
619
|
+
});
|
|
620
|
+
const rootClasses = computed(() => {
|
|
621
|
+
const classes = ["tx-base-surface"];
|
|
622
|
+
classes.push(`tx-base-surface--preset-${props.preset}`);
|
|
623
|
+
classes.push(`tx-base-surface--${activeMode.value}`);
|
|
624
|
+
if (showLayerGlass.value) {
|
|
625
|
+
classes.push("tx-base-surface--with-glass");
|
|
626
|
+
}
|
|
627
|
+
if (showLayerFilter.value) {
|
|
628
|
+
classes.push("tx-base-surface--with-filter");
|
|
629
|
+
}
|
|
630
|
+
if (showLayerMask.value) {
|
|
631
|
+
classes.push("tx-base-surface--with-mask");
|
|
632
|
+
}
|
|
633
|
+
if (showLayerMotionCover.value) {
|
|
634
|
+
classes.push("tx-base-surface--with-motion-cover");
|
|
635
|
+
}
|
|
636
|
+
if (showLayerRefractionEdge.value) {
|
|
637
|
+
classes.push("tx-base-surface--with-refraction-edge");
|
|
638
|
+
}
|
|
639
|
+
if (activeMode.value === "refraction") {
|
|
640
|
+
classes.push(`tx-base-surface--refraction-renderer-${props.refractionRenderer}`);
|
|
641
|
+
classes.push(`tx-base-surface--refraction-profile-${resolvedRefractionProfile.value}`);
|
|
642
|
+
classes.push(`tx-base-surface--refraction-tone-${resolvedRefractionTone.value}`);
|
|
643
|
+
}
|
|
644
|
+
if (props.fake) {
|
|
645
|
+
classes.push("tx-base-surface--fake");
|
|
646
|
+
}
|
|
647
|
+
if (settling.value) {
|
|
648
|
+
classes.push("tx-base-surface--settling");
|
|
649
|
+
}
|
|
650
|
+
return classes;
|
|
651
|
+
});
|
|
652
|
+
let mutationObserver = null;
|
|
653
|
+
let observedElements = [];
|
|
654
|
+
function stopRefractionEdgeReveal(resetProgress = true) {
|
|
655
|
+
if (refractionEdgeRevealTimer != null) {
|
|
656
|
+
clearTimeout(refractionEdgeRevealTimer);
|
|
657
|
+
refractionEdgeRevealTimer = null;
|
|
658
|
+
}
|
|
659
|
+
if (refractionEdgeRevealRaf != null) {
|
|
660
|
+
cancelAnimationFrame(refractionEdgeRevealRaf);
|
|
661
|
+
refractionEdgeRevealRaf = null;
|
|
662
|
+
}
|
|
663
|
+
if (resetProgress) {
|
|
664
|
+
refractionEdgeRevealProgress.value = 1;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function hideRefractionEdge() {
|
|
668
|
+
stopRefractionEdgeReveal(false);
|
|
669
|
+
refractionEdgeRevealProgress.value = 0;
|
|
670
|
+
}
|
|
671
|
+
function startRefractionEdgeReveal() {
|
|
672
|
+
if (props.mode !== "refraction") {
|
|
673
|
+
refractionEdgeRevealProgress.value = 1;
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
if (!hasWindow()) {
|
|
677
|
+
refractionEdgeRevealProgress.value = 1;
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
stopRefractionEdgeReveal(false);
|
|
681
|
+
refractionEdgeRevealProgress.value = 0;
|
|
682
|
+
refractionEdgeRevealTimer = setTimeout(() => {
|
|
683
|
+
refractionEdgeRevealTimer = null;
|
|
684
|
+
const total = Math.max(80, REFRACTION_EDGE_REVEAL_DURATION_MS);
|
|
685
|
+
let startedAt = 0;
|
|
686
|
+
const tick = (timestamp) => {
|
|
687
|
+
if (!startedAt) {
|
|
688
|
+
startedAt = timestamp;
|
|
689
|
+
}
|
|
690
|
+
const elapsed = timestamp - startedAt;
|
|
691
|
+
const progress = clamp(elapsed / total, 0, 1);
|
|
692
|
+
refractionEdgeRevealProgress.value = smoothstep01(progress);
|
|
693
|
+
if (progress >= 1 || isMoving.value || refractionRecovering.value) {
|
|
694
|
+
if (isMoving.value || refractionRecovering.value) {
|
|
695
|
+
refractionEdgeRevealProgress.value = 0;
|
|
696
|
+
} else {
|
|
697
|
+
refractionEdgeRevealProgress.value = 1;
|
|
698
|
+
}
|
|
699
|
+
refractionEdgeRevealRaf = null;
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
refractionEdgeRevealRaf = requestAnimationFrame(tick);
|
|
703
|
+
};
|
|
704
|
+
refractionEdgeRevealRaf = requestAnimationFrame(tick);
|
|
705
|
+
}, Math.max(0, REFRACTION_EDGE_REVEAL_DELAY_MS));
|
|
706
|
+
}
|
|
707
|
+
function stopRefractionMaskPeakRamp(resetProgress = true) {
|
|
708
|
+
if (refractionMaskPeakRampRaf != null) {
|
|
709
|
+
cancelAnimationFrame(refractionMaskPeakRampRaf);
|
|
710
|
+
refractionMaskPeakRampRaf = null;
|
|
711
|
+
}
|
|
712
|
+
if (resetProgress) {
|
|
713
|
+
refractionMaskPeakRampProgress.value = 1;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
function startRefractionMaskPeakRamp() {
|
|
717
|
+
if (props.mode !== "refraction") {
|
|
718
|
+
refractionMaskPeakRampProgress.value = 1;
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (!hasWindow()) {
|
|
722
|
+
refractionMaskPeakRampProgress.value = 1;
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
stopRefractionMaskPeakRamp(false);
|
|
726
|
+
refractionMaskPeakRampProgress.value = 0;
|
|
727
|
+
const total = Math.max(40, REFRACTION_MASK_PEAK_RAMP_DURATION_MS);
|
|
728
|
+
let startedAt = 0;
|
|
729
|
+
const tick = (timestamp) => {
|
|
730
|
+
if (!startedAt) {
|
|
731
|
+
startedAt = timestamp;
|
|
732
|
+
}
|
|
733
|
+
const elapsed = timestamp - startedAt;
|
|
734
|
+
const progress = clamp(elapsed / total, 0, 1);
|
|
735
|
+
refractionMaskPeakRampProgress.value = smoothstep01(progress);
|
|
736
|
+
if (progress >= 1 || !isMoving.value) {
|
|
737
|
+
refractionMaskPeakRampProgress.value = 1;
|
|
738
|
+
refractionMaskPeakRampRaf = null;
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
refractionMaskPeakRampRaf = requestAnimationFrame(tick);
|
|
742
|
+
};
|
|
743
|
+
refractionMaskPeakRampRaf = requestAnimationFrame(tick);
|
|
744
|
+
}
|
|
745
|
+
function stopRefractionRecovery(resetProgress = true) {
|
|
746
|
+
if (refractionRecoveryRaf != null) {
|
|
747
|
+
cancelAnimationFrame(refractionRecoveryRaf);
|
|
748
|
+
refractionRecoveryRaf = null;
|
|
749
|
+
}
|
|
750
|
+
refractionRecovering.value = false;
|
|
751
|
+
refractionRecoveryElapsed.value = 0;
|
|
752
|
+
if (resetProgress) {
|
|
753
|
+
refractionRecoveryProgress.value = 1;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
function startRefractionRecovery() {
|
|
757
|
+
if (props.mode !== "refraction") {
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
if (isMoving.value) {
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
if (refractionRecovering.value) {
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
if (!hasWindow()) {
|
|
767
|
+
refractionRecovering.value = false;
|
|
768
|
+
refractionRecoveryProgress.value = 1;
|
|
769
|
+
refractionRecoveryElapsed.value = 0;
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
stopRefractionRecovery(false);
|
|
773
|
+
refractionRecovering.value = true;
|
|
774
|
+
refractionRecoveryProgress.value = 0;
|
|
775
|
+
refractionRecoveryElapsed.value = 0;
|
|
776
|
+
const blendTotal = refractionRecoveryBlendDurationMs.value;
|
|
777
|
+
const total = refractionRecoveryTotalDurationMs.value;
|
|
778
|
+
let startedAt = 0;
|
|
779
|
+
const tick = (timestamp) => {
|
|
780
|
+
if (!startedAt) {
|
|
781
|
+
startedAt = timestamp;
|
|
782
|
+
}
|
|
783
|
+
const elapsed = timestamp - startedAt;
|
|
784
|
+
refractionRecoveryElapsed.value = elapsed;
|
|
785
|
+
const progress = blendTotal <= 0 ? 1 : smoothstep01(elapsed / blendTotal);
|
|
786
|
+
refractionRecoveryProgress.value = clamp(progress, 0, 1);
|
|
787
|
+
if (elapsed >= total) {
|
|
788
|
+
refractionRecovering.value = false;
|
|
789
|
+
refractionRecoveryProgress.value = 1;
|
|
790
|
+
refractionRecoveryElapsed.value = total;
|
|
791
|
+
refractionRecoveryRaf = null;
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
refractionRecoveryRaf = requestAnimationFrame(tick);
|
|
795
|
+
};
|
|
796
|
+
refractionRecoveryRaf = requestAnimationFrame(tick);
|
|
797
|
+
}
|
|
798
|
+
function startSettleTimer() {
|
|
799
|
+
clearTimeout(settleTimer);
|
|
800
|
+
settling.value = true;
|
|
801
|
+
settleTimer = setTimeout(() => {
|
|
802
|
+
settling.value = false;
|
|
803
|
+
}, settleDelayMs.value);
|
|
804
|
+
}
|
|
805
|
+
function onTransformStart() {
|
|
806
|
+
autoMoving.value = true;
|
|
807
|
+
clearTimeout(settleTimer);
|
|
808
|
+
settling.value = false;
|
|
809
|
+
if (props.mode === "refraction") {
|
|
810
|
+
stopRefractionRecovery(false);
|
|
811
|
+
refractionRecoveryProgress.value = 0;
|
|
812
|
+
refractionRecoveryElapsed.value = 0;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
function onTransformEnd() {
|
|
816
|
+
autoMoving.value = false;
|
|
817
|
+
if (props.mode === "refraction") {
|
|
818
|
+
startRefractionRecovery();
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
startSettleTimer();
|
|
822
|
+
}
|
|
823
|
+
function handleTransitionStart(e) {
|
|
824
|
+
if (e.propertyName === "transform" || e.propertyName === "translate") {
|
|
825
|
+
onTransformStart();
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
function handleTransitionEnd(e) {
|
|
829
|
+
if (e.propertyName === "transform" || e.propertyName === "translate") {
|
|
830
|
+
onTransformEnd();
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
function hasTransformChanged(el) {
|
|
834
|
+
const transform = el.style.transform || el.style.getPropertyValue("transform");
|
|
835
|
+
return transform && transform !== "none" && transform !== "";
|
|
836
|
+
}
|
|
837
|
+
function setupAutoDetect() {
|
|
838
|
+
if (!props.autoDetect || !hasWindow() || !rootRef.value) {
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
const el = rootRef.value;
|
|
842
|
+
const targets = [];
|
|
843
|
+
let current = el;
|
|
844
|
+
while (current) {
|
|
845
|
+
targets.push(current);
|
|
846
|
+
current = current.parentElement;
|
|
847
|
+
}
|
|
848
|
+
observedElements = targets;
|
|
849
|
+
for (const target of targets) {
|
|
850
|
+
target.addEventListener("transitionstart", handleTransitionStart);
|
|
851
|
+
target.addEventListener("transitionend", handleTransitionEnd);
|
|
852
|
+
target.addEventListener("transitioncancel", handleTransitionEnd);
|
|
853
|
+
}
|
|
854
|
+
mutationObserver = new MutationObserver((mutations) => {
|
|
855
|
+
for (const mutation of mutations) {
|
|
856
|
+
if (mutation.type === "attributes" && mutation.attributeName === "style") {
|
|
857
|
+
const target = mutation.target;
|
|
858
|
+
if (hasTransformChanged(target)) {
|
|
859
|
+
onTransformStart();
|
|
860
|
+
} else if (autoMoving.value) {
|
|
861
|
+
onTransformEnd();
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
for (const target of targets) {
|
|
867
|
+
mutationObserver.observe(target, { attributes: true, attributeFilter: ["style"] });
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
function teardownAutoDetect() {
|
|
871
|
+
for (const target of observedElements) {
|
|
872
|
+
target.removeEventListener("transitionstart", handleTransitionStart);
|
|
873
|
+
target.removeEventListener("transitionend", handleTransitionEnd);
|
|
874
|
+
target.removeEventListener("transitioncancel", handleTransitionEnd);
|
|
875
|
+
}
|
|
876
|
+
observedElements = [];
|
|
877
|
+
mutationObserver?.disconnect();
|
|
878
|
+
mutationObserver = null;
|
|
879
|
+
clearTimeout(settleTimer);
|
|
880
|
+
stopRefractionEdgeReveal();
|
|
881
|
+
stopRefractionMaskPeakRamp();
|
|
882
|
+
stopRefractionRecovery();
|
|
883
|
+
}
|
|
884
|
+
watch(() => props.moving, (newVal, oldVal) => {
|
|
885
|
+
if (props.mode === "refraction") {
|
|
886
|
+
if (newVal) {
|
|
887
|
+
stopRefractionRecovery(false);
|
|
888
|
+
refractionRecoveryProgress.value = 0;
|
|
889
|
+
refractionRecoveryElapsed.value = 0;
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
if (oldVal && !newVal) {
|
|
893
|
+
startRefractionRecovery();
|
|
894
|
+
}
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
if (oldVal && !newVal && needsFallback.value) {
|
|
898
|
+
startSettleTimer();
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
watch(isMoving, (moving, prevMoving) => {
|
|
902
|
+
if (props.mode !== "refraction") {
|
|
903
|
+
stopRefractionMaskPeakRamp();
|
|
904
|
+
stopRefractionEdgeReveal();
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
if (moving && !prevMoving) {
|
|
908
|
+
hideRefractionEdge();
|
|
909
|
+
startRefractionMaskPeakRamp();
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
if (!moving) {
|
|
913
|
+
stopRefractionMaskPeakRamp();
|
|
914
|
+
}
|
|
915
|
+
}, { flush: "sync" });
|
|
916
|
+
watch(
|
|
917
|
+
[isMoving, refractionRecovering, () => props.mode],
|
|
918
|
+
([moving, recovering, mode], [prevMoving, prevRecovering, prevMode]) => {
|
|
919
|
+
if (mode !== "refraction") {
|
|
920
|
+
stopRefractionEdgeReveal();
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
if (moving || recovering) {
|
|
924
|
+
hideRefractionEdge();
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
if (prevMode !== "refraction" || prevMoving || prevRecovering) {
|
|
928
|
+
startRefractionEdgeReveal();
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
{ flush: "sync" }
|
|
932
|
+
);
|
|
933
|
+
watch(() => props.mode, (mode) => {
|
|
934
|
+
if (mode !== "refraction") {
|
|
935
|
+
stopRefractionMaskPeakRamp();
|
|
936
|
+
stopRefractionEdgeReveal();
|
|
937
|
+
stopRefractionRecovery();
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
if (isMoving.value) {
|
|
941
|
+
hideRefractionEdge();
|
|
942
|
+
startRefractionMaskPeakRamp();
|
|
943
|
+
stopRefractionRecovery(false);
|
|
944
|
+
refractionRecoveryProgress.value = 0;
|
|
945
|
+
refractionRecoveryElapsed.value = 0;
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
startRefractionEdgeReveal();
|
|
949
|
+
stopRefractionMaskPeakRamp();
|
|
950
|
+
stopRefractionRecovery();
|
|
951
|
+
});
|
|
952
|
+
watch(() => props.autoDetect, (newVal) => {
|
|
953
|
+
teardownAutoDetect();
|
|
954
|
+
if (newVal) {
|
|
955
|
+
setupAutoDetect();
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
onMounted(() => {
|
|
959
|
+
setupAutoDetect();
|
|
960
|
+
});
|
|
961
|
+
onBeforeUnmount(() => {
|
|
962
|
+
teardownAutoDetect();
|
|
963
|
+
});
|
|
964
|
+
return (_ctx, _cache) => {
|
|
965
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
|
|
966
|
+
ref_key: "rootRef",
|
|
967
|
+
ref: rootRef,
|
|
968
|
+
class: normalizeClass(rootClasses.value),
|
|
969
|
+
style: normalizeStyle(cssVars.value)
|
|
970
|
+
}, {
|
|
971
|
+
default: withCtx(() => [
|
|
972
|
+
createVNode(Transition, { name: "tx-surface-layer-fade" }, {
|
|
973
|
+
default: withCtx(() => [
|
|
974
|
+
showLayerGlass.value ? (openBlock(), createBlock(_sfc_main$1, mergeProps({ key: 0 }, glassSurfaceProps.value, { class: "tx-base-surface__layer tx-base-surface__layer--glass" }), null, 16)) : createCommentVNode("", true)
|
|
975
|
+
]),
|
|
976
|
+
_: 1
|
|
977
|
+
}),
|
|
978
|
+
createVNode(Transition, { name: "tx-surface-layer-fade" }, {
|
|
979
|
+
default: withCtx(() => [
|
|
980
|
+
showLayerFilter.value ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true)
|
|
981
|
+
]),
|
|
982
|
+
_: 1
|
|
983
|
+
}),
|
|
984
|
+
createVNode(Transition, { name: "tx-surface-layer-fade" }, {
|
|
985
|
+
default: withCtx(() => [
|
|
986
|
+
showLayerMotionCover.value ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("", true)
|
|
987
|
+
]),
|
|
988
|
+
_: 1
|
|
989
|
+
}),
|
|
990
|
+
createVNode(Transition, { name: "tx-surface-layer-fade" }, {
|
|
991
|
+
default: withCtx(() => [
|
|
992
|
+
showLayerMask.value ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)
|
|
993
|
+
]),
|
|
994
|
+
_: 1
|
|
995
|
+
}),
|
|
996
|
+
createVNode(Transition, { name: "tx-surface-layer-fade" }, {
|
|
997
|
+
default: withCtx(() => [
|
|
998
|
+
showLayerRefractionEdge.value ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
|
|
999
|
+
]),
|
|
1000
|
+
_: 1
|
|
1001
|
+
}),
|
|
1002
|
+
createElementVNode("div", _hoisted_5, [
|
|
1003
|
+
renderSlot(_ctx.$slots, "default")
|
|
1004
|
+
])
|
|
1005
|
+
]),
|
|
1006
|
+
_: 3
|
|
1007
|
+
}, 8, ["class", "style"]);
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
export { _sfc_main as default };
|