@vite-hub/ui 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -76
- package/dist/andromeeda-DaUPZ4_A.js +147 -0
- package/dist/announce-B0DLwflT.js +31 -0
- package/dist/{attachments-BzTwqRTU.js → attachments-DgwoQZKY.js} +3 -5
- package/dist/aurora-x-B5RPZ9i5.js +162 -0
- package/dist/{avatar-stack-DPRFuezh.d.ts → avatar-stack-C0IKwj6g.d.ts} +1 -3
- package/dist/ayu-dark-DXTaGA7I.js +137 -0
- package/dist/ayu-light-BCYi80Fe.js +137 -0
- package/dist/ayu-mirage-CgbXz-N5.js +137 -0
- package/dist/catppuccin-frappe-MV2xzv44.js +266 -0
- package/dist/catppuccin-latte-CL6jjlVD.js +266 -0
- package/dist/catppuccin-macchiato-Bp6oZJVK.js +266 -0
- package/dist/catppuccin-mocha-DOHrQ4dw.js +266 -0
- package/dist/{choices-input-ByXJvDn1.d.ts → choices-input-BUf-QqGj.d.ts} +0 -2
- package/dist/{code-view-DsU-xzic.js → code-view-Cg4nyTNA.js} +6 -8
- package/dist/{colors-BghReA9C-CjF9gnmy.js → colors-BghReA9C-DEq4bhEP.js} +1 -2
- package/dist/{comment-attachments-C4yNbcx5.js → comment-attachments-CMpYOJod.js} +1 -2
- package/dist/{comment-composer-fINL5bxo.d.ts → comment-composer-BI6CNJyO.d.ts} +3 -5
- package/dist/{comment-composer-jYv2ULNP.js → comment-composer-CzU7DdfD.js} +260 -16
- package/dist/{comment-layer-C_sbPIR5.d.ts → comment-layer-DyVstrs-.d.ts} +5 -7
- package/dist/{comment-list-BcSaLngS.d.ts → comment-list-CSK5o-Ua.d.ts} +3 -5
- package/dist/comment-marks.css +18 -22
- package/dist/{comment-panel-CfvdRUMX.d.ts → comment-panel-CEvOI3gk.d.ts} +3 -5
- package/dist/{comment-person-CLPlW_SS.js → comment-person-D_IyIjXo.js} +1 -2
- package/dist/{comment-pin-DHOdRvUw.d.ts → comment-pin-C5UeLPTa.d.ts} +1 -3
- package/dist/{comment-row-Bn3nr8l5.js → comment-row-DPMWI5Z0.js} +3 -4
- package/dist/{comment-selection-bar-CyVBNYl9.d.ts → comment-selection-bar-CVuS-FNL.d.ts} +0 -2
- package/dist/comment-send-DPzV9B8S.js +275 -0
- package/dist/comment-send-MmxFsOQf.d.ts +23 -0
- package/dist/comment-send.css +267 -0
- package/dist/comment-thread-CbPtoi8-.js +796 -0
- package/dist/{comment-thread-DKJjmWN0.d.ts → comment-thread-DGm1cGJt.d.ts} +4 -8
- package/dist/{comment-visibility-DsVuVndP.d.ts → comment-visibility-CYctacNx.d.ts} +0 -2
- package/dist/{comments-D0d26ghV.js → comments-C0OdHh_F.js} +5 -8
- package/dist/{comments-D8hulVPy.d.ts → comments-DrE9DU-E.d.ts} +1 -3
- package/dist/{comments-context-C2lOZyQ5.js → comments-context-CrjhleVA.js} +4 -5
- package/dist/{config-Dk67emQt.js → config-DztmAYYn.js} +9 -3
- package/dist/{config-DgxBW013.d.ts → config-xL4EBeXw.d.ts} +11 -4
- package/dist/dark-plus-CXEBSjk4.js +148 -0
- package/dist/dracula-Bvyz6eCo.js +165 -0
- package/dist/dracula-soft-a9indxAQ.js +115 -0
- package/dist/{draw-DzSmD7uo-Dwz8zoH2.js → draw-DzSmD7uo-Cb7s9kxJ.js} +359 -708
- package/dist/drop-field-CNZgwFVO.js +162 -0
- package/dist/{editor-C_wt4RRV.js → editor-CGiEVOnB.js} +44 -6
- package/dist/effects-g4QucvgO.js +2955 -0
- package/dist/{error-diagnostics-SXtnk6bz.js → error-diagnostics-BlgA9rI2.js} +1 -2
- package/dist/everforest-dark-9sVAxG7I.js +99 -0
- package/dist/everforest-light-BocTn_Hd.js +99 -0
- package/dist/{file-tree-C4OYgbV-.js → file-tree-CRFIdtzw.js} +58 -116
- package/dist/{file-tree-DlT9RGhu.d.ts → file-tree-DOtkeBaq.d.ts} +0 -14
- package/dist/{format-orwcdZL_.js → format-Bc9m7-r0.js} +1 -2
- package/dist/{getSingularPatch-Dsb8EgxR.js → getSingularPatch-C7LmmBrW.js} +375 -79
- package/dist/github-dark-BO9SXswM.js +142 -0
- package/dist/github-dark-default-XB_RHfBI.js +90 -0
- package/dist/github-dark-dimmed-BoGxaWUQ.js +137 -0
- package/dist/github-dark-high-contrast-B3X6t2fG.js +137 -0
- package/dist/github-light-D7VHHlUH.js +142 -0
- package/dist/github-light-default-BuDsGtcR.js +137 -0
- package/dist/github-light-high-contrast-GodZiAwh.js +137 -0
- package/dist/gruvbox-dark-hard-CU4LuKJc.js +140 -0
- package/dist/gruvbox-dark-medium-DjAsuXuH.js +140 -0
- package/dist/gruvbox-dark-soft-D3Zttj6R.js +140 -0
- package/dist/gruvbox-light-hard-4M_9onwE.js +140 -0
- package/dist/gruvbox-light-medium-D9QwS4kQ.js +140 -0
- package/dist/gruvbox-light-soft-DhYcfQql.js +140 -0
- package/dist/{handlers-DMl-Na3x.js → handlers-CnbkvXjX.js} +1 -2
- package/dist/headless.d.ts +4 -4
- package/dist/headless.js +1 -1
- package/dist/highlights-C2AbEdDI.js +2630 -0
- package/dist/hold-to-delete-BSMrpE-i.d.ts +49 -0
- package/dist/hold-to-delete-Cludb56v.js +433 -0
- package/dist/horizon-bright-B9u59onx.js +97 -0
- package/dist/horizon-tItY9ATR.js +97 -0
- package/dist/houston-BqKrKNQv.js +207 -0
- package/dist/icon-XZaCUZTG.d.ts +29 -0
- package/dist/{image-preview-C9tdkmEj.js → image-preview-DrLXrHpp.js} +3 -4
- package/dist/{index-CNY1uNTh.d.ts → index-B2cbt3py.d.ts} +3945 -2445
- package/dist/{index-BYRFQfCd.d.ts → index-B_PSX-5h.d.ts} +5 -11
- package/dist/index.d.ts +35 -32
- package/dist/index.js +71 -73
- package/dist/install-Ba9mkkqI.js +16 -0
- package/dist/kanagawa-dragon-BH1K3aMw.js +159 -0
- package/dist/kanagawa-lotus-C-4JB2io.js +159 -0
- package/dist/kanagawa-wave-DTQqNe5k.js +159 -0
- package/dist/laserwave-BkV0uIaG.js +84 -0
- package/dist/light-plus-CxYgEz7U.js +149 -0
- package/dist/list-DUTAo0uC.js +270 -0
- package/dist/loader-CYMEjzwc.js +79 -0
- package/dist/{markdown-editor-CMbNZOdN.js → markdown-editor-3gY9MLvy.js} +237 -38
- package/dist/{markdown-editor-wQF0yD5o.d.ts → markdown-editor-B7gD60tp.d.ts} +0 -6
- package/dist/markdown-editor.d.ts +1 -5
- package/dist/markdown-editor.js +2 -2
- package/dist/markdown-renderer-DFS1vf1h.js +26578 -0
- package/dist/material-theme-Xdm37UUJ.js +105 -0
- package/dist/material-theme-darker-Blaz0cgN.js +105 -0
- package/dist/material-theme-lighter-BddVxBVA.js +105 -0
- package/dist/material-theme-ocean-C4qhfFHi.js +105 -0
- package/dist/material-theme-palenight-ChHDqoiA.js +105 -0
- package/dist/{message-scroller-jrYN9dG9.d.ts → message-scroller-a6qaYHno.d.ts} +2 -4
- package/dist/min-dark-DpGSNjaW.js +125 -0
- package/dist/min-light-BMfJUsU2.js +122 -0
- package/dist/monokai-DW19E-zg.js +162 -0
- package/dist/motion/core.d.ts +4 -0
- package/dist/motion/core.js +11 -0
- package/dist/motion-core-DNl7TR1T.d.ts +402 -0
- package/dist/motion.d.ts +14 -0
- package/dist/motion.js +13 -0
- package/dist/night-owl-B7Of8ee9.js +188 -0
- package/dist/night-owl-light-Vu9tTNpS.js +189 -0
- package/dist/nord-CDzJumeN.js +128 -0
- package/dist/nuxt-ui-7ByUrymx.js +43 -0
- package/dist/nuxt.d.ts +1 -7
- package/dist/nuxt.js +16 -11
- package/dist/one-dark-pro-hS_sNo5p.js +124 -0
- package/dist/one-light-CD4ItzSC.js +153 -0
- package/dist/opt-out-D66l60sg.js +205 -0
- package/dist/parts/components/agent-session.d.ts +1 -3
- package/dist/parts/components/agent-session.js +3 -4
- package/dist/parts/components/attachment.d.ts +2 -4
- package/dist/parts/components/attachment.js +3 -4
- package/dist/parts/components/avatar-stack.d.ts +1 -1
- package/dist/parts/components/avatar-stack.js +4 -4
- package/dist/parts/components/bubble.d.ts +2 -4
- package/dist/parts/components/bubble.js +2 -3
- package/dist/parts/components/chat-message.d.ts +1 -3
- package/dist/parts/components/chat-message.js +1 -2
- package/dist/parts/components/chat-session.d.ts +2 -4
- package/dist/parts/components/chat-session.js +1 -2
- package/dist/parts/components/chat.d.ts +1 -3
- package/dist/parts/components/chat.js +4 -5
- package/dist/parts/components/code-block.d.ts +2 -4
- package/dist/parts/components/code-block.js +3 -4
- package/dist/parts/components/code-view.d.ts +1 -3
- package/dist/parts/components/code-view.js +1 -2
- package/dist/parts/components/comment-composer.d.ts +1 -1
- package/dist/parts/components/comment-composer.js +1 -2
- package/dist/parts/components/comment-layer.d.ts +1 -1
- package/dist/parts/components/comment-layer.js +28 -11
- package/dist/parts/components/comment-list.d.ts +1 -1
- package/dist/parts/components/comment-list.js +13 -9
- package/dist/parts/components/comment-panel.d.ts +1 -1
- package/dist/parts/components/comment-panel.js +27 -14
- package/dist/parts/components/comment-pin.d.ts +1 -1
- package/dist/parts/components/comment-pin.js +2 -3
- package/dist/parts/components/comment-selection-bar.d.ts +1 -1
- package/dist/parts/components/comment-selection-bar.js +4 -4
- package/dist/parts/components/comment-send.d.ts +2 -0
- package/dist/parts/components/comment-send.js +1 -0
- package/dist/parts/components/comment-thread.d.ts +1 -1
- package/dist/parts/components/comment-thread.js +2 -597
- package/dist/parts/components/comments.d.ts +9 -8
- package/dist/parts/components/comments.js +7 -6
- package/dist/parts/components/connection-status.d.ts +1 -3
- package/dist/parts/components/connection-status.js +1 -2
- package/dist/parts/components/copy-button.d.ts +14 -6
- package/dist/parts/components/copy-button.js +225 -1
- package/dist/parts/components/device-frame.d.ts +3 -5
- package/dist/parts/components/device-frame.js +1 -2
- package/dist/parts/components/drop-field.d.ts +67 -0
- package/dist/parts/components/drop-field.js +76 -0
- package/dist/parts/components/file-tree.d.ts +1 -1
- package/dist/parts/components/file-tree.js +1 -2
- package/dist/parts/components/filter-search.d.ts +2 -4
- package/dist/parts/components/filter-search.js +2 -3
- package/dist/parts/components/hold-to-delete.d.ts +80 -0
- package/dist/parts/components/hold-to-delete.js +75 -0
- package/dist/parts/components/markdown-editor.d.ts +1 -1
- package/dist/parts/components/markdown-editor.js +1 -2
- package/dist/parts/components/markdown-renderer.d.ts +1 -3
- package/dist/parts/components/markdown-renderer.js +1 -23077
- package/dist/parts/components/markdown.d.ts +1 -3
- package/dist/parts/components/markdown.js +2 -3
- package/dist/parts/components/marker.d.ts +2 -4
- package/dist/parts/components/marker.js +2 -3
- package/dist/parts/components/message-parts.d.ts +1 -3
- package/dist/parts/components/message-parts.js +14 -7
- package/dist/parts/components/message.d.ts +1 -3
- package/dist/parts/components/message.js +2 -3
- package/dist/parts/components/motion-list.d.ts +40 -0
- package/dist/parts/components/motion-list.js +41 -0
- package/dist/parts/components/motion.d.ts +122 -0
- package/dist/parts/components/motion.js +171 -0
- package/dist/parts/components/patch-parsers.d.ts +1 -1
- package/dist/parts/components/patch-parsers.js +1 -2
- package/dist/parts/components/progress.d.ts +39 -0
- package/dist/parts/components/progress.js +53 -0
- package/dist/parts/components/prompt-input.d.ts +5 -7
- package/dist/parts/components/prompt-input.js +5 -6
- package/dist/parts/components/relative-time.d.ts +1 -3
- package/dist/parts/components/relative-time.js +1 -2
- package/dist/parts/components/status.d.ts +1 -3
- package/dist/parts/components/status.js +1 -2
- package/dist/parts/components/sync-status.d.ts +1 -3
- package/dist/parts/components/sync-status.js +3 -3
- package/dist/parts/components/tool-list.d.ts +2 -4
- package/dist/parts/components/tool-list.js +2 -3
- package/dist/parts/components/trace-run.d.ts +2 -4
- package/dist/parts/components/trace-run.js +4 -5
- package/dist/parts/components/trace.d.ts +2 -4
- package/dist/parts/components/trace.js +2 -3
- package/dist/parts/composables/attachments.d.ts +1 -3
- package/dist/parts/composables/attachments.js +1 -2
- package/dist/parts/composables/highlighted-code.d.ts +1 -3
- package/dist/parts/composables/highlighted-code.js +1 -2
- package/dist/parts/headless/choices-input.d.ts +1 -1
- package/dist/parts/headless/choices-input.js +3 -4
- package/dist/parts/headless/comment-visibility.d.ts +1 -1
- package/dist/parts/headless/comment-visibility.js +1 -2
- package/dist/parts/headless/comments.d.ts +1 -1
- package/dist/parts/headless/comments.js +1 -2
- package/dist/parts/headless/message-scroller.d.ts +1 -1
- package/dist/parts/headless/message-scroller.js +2 -3
- package/dist/parts/playground/paths.d.ts +1 -3
- package/dist/parts/playground/paths.js +1 -2
- package/dist/parts/playground/share.d.ts +34 -2
- package/dist/parts/playground/share.js +1 -2
- package/dist/parts/playground/zip.d.ts +1 -3
- package/dist/parts/playground/zip.js +2 -3
- package/dist/parts/workspace/browser-support-notice.d.ts +2 -4
- package/dist/parts/workspace/browser-support-notice.js +13 -6
- package/dist/parts/workspace/codemirror.d.ts +10 -3
- package/dist/parts/workspace/codemirror.js +40 -8
- package/dist/parts/workspace/connect-panel.d.ts +2 -4
- package/dist/parts/workspace/connect-panel.js +2 -3
- package/dist/parts/workspace/connect-store.d.ts +1 -3
- package/dist/parts/workspace/connect-store.js +1 -2
- package/dist/parts/workspace/file-icons.d.ts +14 -0
- package/dist/parts/workspace/file-icons.js +81 -0
- package/dist/parts/workspace/icons.d.ts +2 -2
- package/dist/parts/workspace/icons.js +2 -2
- package/dist/parts/workspace/runners/render.d.ts +24 -0
- package/dist/parts/workspace/runners/render.js +123 -0
- package/dist/parts/workspace/runners/web-container.d.ts +27 -0
- package/dist/parts/workspace/runners/web-container.js +185 -0
- package/dist/parts/workspace/workspace-bar.d.ts +49 -0
- package/dist/parts/workspace/workspace-bar.js +50 -0
- package/dist/parts/workspace/workspace-boot-status.d.ts +1 -2
- package/dist/parts/workspace/workspace-boot-status.js +2 -3
- package/dist/parts/workspace/workspace-editor-head.d.ts +45 -0
- package/dist/parts/workspace/workspace-editor-head.js +65 -0
- package/dist/parts/workspace/workspace-editor.d.ts +18 -3
- package/dist/parts/workspace/workspace-editor.js +30 -5
- package/dist/parts/workspace/workspace-examples.d.ts +72 -0
- package/dist/parts/workspace/workspace-examples.js +71 -0
- package/dist/parts/workspace/workspace-file-link.d.ts +33 -0
- package/dist/parts/workspace/workspace-file-link.js +38 -0
- package/dist/parts/workspace/workspace-file-tree.d.ts +9 -11
- package/dist/parts/workspace/workspace-file-tree.js +28 -22
- package/dist/parts/workspace/workspace-guide.d.ts +50 -0
- package/dist/parts/workspace/workspace-guide.js +90 -0
- package/dist/parts/workspace/workspace-issues.d.ts +44 -0
- package/dist/parts/workspace/workspace-issues.js +48 -0
- package/dist/parts/workspace/workspace-preview.d.ts +1 -3
- package/dist/parts/workspace/workspace-preview.js +2 -3
- package/dist/parts/workspace/workspace-shell.d.ts +2 -88
- package/dist/parts/workspace/workspace-shell.js +132 -80
- package/dist/parts/workspace/workspace-sidebar.d.ts +73 -0
- package/dist/parts/workspace/workspace-sidebar.js +131 -0
- package/dist/parts/workspace/workspace-start.d.ts +45 -0
- package/dist/parts/workspace/workspace-start.js +59 -0
- package/dist/parts/workspace/workspace-status.d.ts +67 -0
- package/dist/parts/workspace/workspace-status.js +73 -0
- package/dist/parts/workspace/workspace-steps.d.ts +2 -0
- package/dist/parts/workspace/workspace-steps.js +127 -0
- package/dist/parts/workspace/workspace-task.d.ts +18 -0
- package/dist/parts/workspace/workspace-task.js +19 -0
- package/dist/parts/workspace/workspace-terminal.d.ts +1 -3
- package/dist/parts/workspace/workspace-terminal.js +1 -2
- package/dist/parts/workspace/workspace.d.ts +249 -0
- package/dist/parts/workspace/workspace.js +664 -0
- package/dist/{payload-text-sjkYAwvw.js → payload-text-DQNRbJY5.js} +1 -2
- package/dist/{pierre-code-view-NE35tkmR.js → pierre-code-view-C49BVDrc.js} +11333 -6718
- package/dist/pierre-dark-BtKHt2e4.js +166 -0
- package/dist/pierre-dark-CXW3KeKO.js +5 -0
- package/dist/pierre-dark-protanopia-deuteranopia-CS0Gs25Q.js +166 -0
- package/dist/pierre-dark-protanopia-deuteranopia-DajNv_A3.js +3 -0
- package/dist/pierre-dark-soft-BUFoeBEf.js +3 -0
- package/dist/pierre-dark-soft-D__0FtYP.js +166 -0
- package/dist/pierre-dark-tritanopia-C6fHROmA.js +166 -0
- package/dist/pierre-dark-tritanopia-oa3gpgIR.js +3 -0
- package/dist/pierre-dark-vibrant-COXpyAHb.js +166 -0
- package/dist/pierre-dark-vibrant-CYRHyDoW.js +3 -0
- package/dist/pierre-light-BD28C_vh.js +166 -0
- package/dist/pierre-light-BN0rL1e5.js +5 -0
- package/dist/pierre-light-protanopia-deuteranopia-CYsDHJt0.js +3 -0
- package/dist/pierre-light-protanopia-deuteranopia-CwWH1xGL.js +166 -0
- package/dist/pierre-light-soft-BkKY4pMj.js +166 -0
- package/dist/pierre-light-soft-F2QIpNbb.js +3 -0
- package/dist/pierre-light-tritanopia-BbKKIkua.js +3 -0
- package/dist/pierre-light-tritanopia-Mpubahl7.js +166 -0
- package/dist/pierre-light-vibrant-CdV9Besm.js +3 -0
- package/dist/pierre-light-vibrant-x11J3_aO.js +166 -0
- package/dist/plastic-BQnXkmvK.js +137 -0
- package/dist/playground.d.ts +1 -1
- package/dist/poimandres-DEfG-8RI.js +124 -0
- package/dist/progress-DL9k-ERG.js +265 -0
- package/dist/red-BfKrAjYG.js +169 -0
- package/dist/registry-DAIjCjWd.js +77 -0
- package/dist/{relative-time-BVmjOsYG.js → relative-time-DJnw45tr.js} +5 -8
- package/dist/ring-BN4d8vtw.js +173 -0
- package/dist/{rolldown-runtime-C9mWXvCC.js → rolldown-runtime-CahUhzF3.js} +2 -3
- package/dist/rose-pine-D0rhGGFg.js +136 -0
- package/dist/rose-pine-dawn-7jVaYUiD.js +136 -0
- package/dist/rose-pine-moon-CFyS0Mvu.js +136 -0
- package/dist/runtime/nuxt-plugin.d.ts +0 -2
- package/dist/runtime/nuxt-plugin.js +3 -4
- package/dist/{sankey-CAYwt82B-D4uDQoMR.js → sankey-CAYwt82B-BAAk7WkJ.js} +147 -151
- package/dist/shiki-CbfEu_Az.js +607 -0
- package/dist/slack-dark-Bv-KFSBD.js +87 -0
- package/dist/slack-ochin-Dg2BAv1D.js +107 -0
- package/dist/{slot-part-Doic71uh.js → slot-part-BWHvQ3mK.js} +1 -2
- package/dist/snazzy-light-sYDdR9rx.js +93 -0
- package/dist/solarized-dark-COt2tTmN.js +160 -0
- package/dist/solarized-light-BJrwFarZ.js +160 -0
- package/dist/stream-tokenizer-ByC3l0HQ.js +263 -0
- package/dist/styles.css +590 -573
- package/dist/synthwave-84-NUDBykTM.js +410 -0
- package/dist/{temml-BilSAAws.js → temml-m3ad3bfq.js} +2 -3
- package/dist/text-BWzZFnGY.js +822 -0
- package/dist/theme.d.ts +44 -3
- package/dist/theme.js +23 -9
- package/dist/themes-DKugPHlg.js +323 -0
- package/dist/tokyo-night-DD3B2QcO.js +153 -0
- package/dist/travel-CwVhU_GS.js +180 -0
- package/dist/tween-Dv3IIIQG.js +61 -0
- package/dist/{types-Dj7vp0lZ.d.ts → types-Ceh7h7NT.d.ts} +1 -3
- package/dist/vesper-oVQYrv8Y.js +99 -0
- package/dist/visual-copy-CHHBfJ6O.js +14 -0
- package/dist/vite.d.ts +1 -3
- package/dist/vite.js +13 -3
- package/dist/vitesse-black-D84DQZAP.js +196 -0
- package/dist/vitesse-dark-CMZ6olk_.js +196 -0
- package/dist/vitesse-light-D9d8hLOY.js +196 -0
- package/dist/{vue-DGstVdGn.js → vue-BlknIGIm.js} +43 -34
- package/dist/{vue-BDmSCtay.js → vue-kCdzBu0N.js} +4 -7
- package/dist/workspace-shell-ChCwWPyv.d.ts +110 -0
- package/dist/workspace-steps-BKByX9DW.d.ts +70 -0
- package/dist/workspace.d.ts +16 -5
- package/dist/workspace.js +16 -3
- package/package.json +66 -55
- package/dist/copy-button-CRN3kmSD.js +0 -253
- package/dist/icon-swap.css +0 -69
- package/dist/nuxt-ui-DSQFzq3s.js +0 -38
- package/dist/parts/playground/highlight.d.ts +0 -5
- package/dist/parts/playground/highlight.js +0 -23
- package/dist/parts/playground/playground-render.d.ts +0 -126
- package/dist/parts/playground/playground-render.js +0 -356
- package/dist/parts/workspace/playground-container.d.ts +0 -192
- package/dist/parts/workspace/playground-container.js +0 -603
- package/dist/pierre-dark-CzUmjETS.js +0 -6
- package/dist/pierre-dark-protanopia-deuteranopia-C35UMuvO.js +0 -4
- package/dist/pierre-dark-soft-Bb-4-biO.js +0 -4
- package/dist/pierre-dark-tritanopia-CIJISGWF.js +0 -4
- package/dist/pierre-dark-vibrant-8oZzB3gw.js +0 -4
- package/dist/pierre-light-Dn6E0sWv.js +0 -6
- package/dist/pierre-light-protanopia-deuteranopia-u0U7N4Hn.js +0 -4
- package/dist/pierre-light-soft-BCU6fuhO.js +0 -4
- package/dist/pierre-light-tritanopia-3c8Yx3co.js +0 -4
- package/dist/pierre-light-vibrant-Cwh332o_.js +0 -4
- package/dist/share-DM4eNy4q.d.ts +0 -37
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type HoldToDeleteState = "idle" | "holding" | "leaving" | "undo" | "committing";
|
|
2
|
+
interface HoldToDeleteOptions {
|
|
3
|
+
/** The real delete. It runs once, when the Undo window has passed. A rejection brings the item back. */
|
|
4
|
+
commit: () => void | Promise<void>;
|
|
5
|
+
/** The hold is complete: hide the item now. The delete is not done yet. */
|
|
6
|
+
onDelete?: () => void;
|
|
7
|
+
/** Undo, or a commit that failed: show the item again. */
|
|
8
|
+
onUndo?: () => void;
|
|
9
|
+
/** The commit failed. The item is back. */
|
|
10
|
+
onError?: (error: unknown) => void;
|
|
11
|
+
/** Every change of state, such as for a Vue wrapper. */
|
|
12
|
+
onState?: (state: HoldToDeleteState) => void;
|
|
13
|
+
/** The item that leaves toward the trash, such as the row of the button. */
|
|
14
|
+
item?: () => Element | null | undefined;
|
|
15
|
+
/** The label before the hold. Defaults to "Hold to delete". An empty label shows only the trash can. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** The label of the Undo window. Defaults to "Undo". */
|
|
18
|
+
undoLabel?: string;
|
|
19
|
+
/** How long Undo stays, in milliseconds. Defaults to 5000. */
|
|
20
|
+
undoFor?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The plain path for assistive technology: a click that is not a hold, such as from a screen reader, asks this first.
|
|
23
|
+
* Defaults to `window.confirm()`.
|
|
24
|
+
*/
|
|
25
|
+
confirm?: () => boolean | Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
interface HoldToDelete {
|
|
28
|
+
readonly state: HoldToDeleteState;
|
|
29
|
+
/** Brings the item back during the Undo window. */
|
|
30
|
+
undo(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Stops the helper and restores the button. When the item already left and Undo shows, the delete commits now: the
|
|
33
|
+
* person deleted it and did not undo. A hold that is not complete is cancelled.
|
|
34
|
+
*/
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Hold to delete of docs/design/motion.md: "Something is deleted and the delete can be undone". It draws into `button`:
|
|
39
|
+
* a fill that grows while the button is held and empties when it is let go early, and a trash can whose lid lifts with
|
|
40
|
+
* it. A complete hold calls `onDelete`, the letters of the label jump into the can, the item leaves toward it, and the
|
|
41
|
+
* button turns into Undo for `undoFor` ms. The real delete, `commit`, runs only when that window has passed.
|
|
42
|
+
*
|
|
43
|
+
* A pointer or Space or Enter held on the button holds it. A click that is not a hold, such as from a screen reader,
|
|
44
|
+
* asks `confirm` and then deletes with the same Undo. Leaving the page or `destroy()` during the Undo window commits.
|
|
45
|
+
* Under reduced motion the fill still shows the hold, but the lid, the letters, and the item do not travel: the label
|
|
46
|
+
* cross-fades. Inside `data-motion="none"` the label changes at once.
|
|
47
|
+
*/
|
|
48
|
+
declare function createHoldToDelete(button: HTMLElement, options: HoldToDeleteOptions): HoldToDelete;
|
|
49
|
+
export { createHoldToDelete as i, HoldToDeleteOptions as n, HoldToDeleteState as r, HoldToDelete as t };
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { t as announce } from "./announce-B0DLwflT.js";
|
|
2
|
+
import { i as playTween, t as cubicBezier } from "./tween-Dv3IIIQG.js";
|
|
3
|
+
import { t as visualCopy } from "./visual-copy-CHHBfJ6O.js";
|
|
4
|
+
import { a as onEachFrame, i as getMotionSlowFactor, l as onReducedMotionChange, r as createSpring, t as isMotionOff, u as prefersReducedMotion } from "./opt-out-D66l60sg.js";
|
|
5
|
+
import { u as writeMotionStyle } from "./registry-DAIjCjWd.js";
|
|
6
|
+
// src/motion/hold-to-delete.ts
|
|
7
|
+
const svgNs = "http://www.w3.org/2000/svg";
|
|
8
|
+
const fillSeconds = 1.1;
|
|
9
|
+
const emptySeconds = .35;
|
|
10
|
+
const lidHold = -24;
|
|
11
|
+
const lidOpen = -78;
|
|
12
|
+
const widthSpring = {
|
|
13
|
+
stiffness: 380,
|
|
14
|
+
damping: 32
|
|
15
|
+
};
|
|
16
|
+
const lidOpenEasing = cubicBezier(.3, 1.5, .5, 1);
|
|
17
|
+
const riseEasing = cubicBezier(.2, .7, .4, 1);
|
|
18
|
+
const fallEasing = cubicBezier(.6, 0, .9, .5);
|
|
19
|
+
const easeIn = cubicBezier(.42, 0, 1, 1);
|
|
20
|
+
const leaveEasing = cubicBezier(.5, 0, .75, 0);
|
|
21
|
+
const leavingAttribute = "data-motion-leaving";
|
|
22
|
+
function svg(tag, attributes) {
|
|
23
|
+
const element = document.createElementNS(svgNs, tag);
|
|
24
|
+
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value);
|
|
25
|
+
return element;
|
|
26
|
+
}
|
|
27
|
+
function trashCan() {
|
|
28
|
+
const can = svg("svg", {
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
"data-part": "can",
|
|
31
|
+
fill: "none",
|
|
32
|
+
height: "16",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
"stroke-linecap": "round",
|
|
35
|
+
"stroke-linejoin": "round",
|
|
36
|
+
"stroke-width": "2",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
width: "16"
|
|
39
|
+
});
|
|
40
|
+
const lid = svg("g", { "data-part": "lid" });
|
|
41
|
+
lid.append(svg("path", { d: "M3 6h18" }), svg("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }));
|
|
42
|
+
can.append(lid, svg("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }));
|
|
43
|
+
Object.assign(can.style, {
|
|
44
|
+
flex: "none",
|
|
45
|
+
overflow: "visible"
|
|
46
|
+
});
|
|
47
|
+
Object.assign(lid.style, {
|
|
48
|
+
transformBox: "fill-box",
|
|
49
|
+
transformOrigin: "0% 100%"
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
can,
|
|
53
|
+
lid
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const center = (rect) => ({
|
|
57
|
+
x: rect.left + rect.width / 2,
|
|
58
|
+
y: rect.top + rect.height / 2
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Hold to delete of docs/design/motion.md: "Something is deleted and the delete can be undone". It draws into `button`:
|
|
62
|
+
* a fill that grows while the button is held and empties when it is let go early, and a trash can whose lid lifts with
|
|
63
|
+
* it. A complete hold calls `onDelete`, the letters of the label jump into the can, the item leaves toward it, and the
|
|
64
|
+
* button turns into Undo for `undoFor` ms. The real delete, `commit`, runs only when that window has passed.
|
|
65
|
+
*
|
|
66
|
+
* A pointer or Space or Enter held on the button holds it. A click that is not a hold, such as from a screen reader,
|
|
67
|
+
* asks `confirm` and then deletes with the same Undo. Leaving the page or `destroy()` during the Undo window commits.
|
|
68
|
+
* Under reduced motion the fill still shows the hold, but the lid, the letters, and the item do not travel: the label
|
|
69
|
+
* cross-fades. Inside `data-motion="none"` the label changes at once.
|
|
70
|
+
*/
|
|
71
|
+
function createHoldToDelete(button, options) {
|
|
72
|
+
const label = options.label ?? "Hold to delete";
|
|
73
|
+
const undoLabel = options.undoLabel ?? "Undo";
|
|
74
|
+
const undoFor = options.undoFor ?? 5e3;
|
|
75
|
+
const fill = document.createElement("span");
|
|
76
|
+
fill.dataset.part = "fill";
|
|
77
|
+
fill.setAttribute("aria-hidden", "true");
|
|
78
|
+
Object.assign(fill.style, {
|
|
79
|
+
background: "var(--vh-hold-fill, color-mix(in oklch, var(--vh-error, var(--ui-error, currentColor)) 14%, transparent))",
|
|
80
|
+
borderRadius: "inherit",
|
|
81
|
+
clipPath: "inset(0 calc((1 - var(--vh-hold, 0)) * 100%) 0 0 round 6px)",
|
|
82
|
+
inset: "-1px",
|
|
83
|
+
pointerEvents: "none",
|
|
84
|
+
position: "absolute"
|
|
85
|
+
});
|
|
86
|
+
const content = document.createElement("span");
|
|
87
|
+
content.dataset.part = "label";
|
|
88
|
+
Object.assign(content.style, {
|
|
89
|
+
alignItems: "center",
|
|
90
|
+
display: "inline-flex",
|
|
91
|
+
gap: "inherit",
|
|
92
|
+
position: "relative"
|
|
93
|
+
});
|
|
94
|
+
const { can, lid } = trashCan();
|
|
95
|
+
const text = document.createElement("span");
|
|
96
|
+
text.dataset.part = "text";
|
|
97
|
+
Object.assign(text.style, { whiteSpace: "pre" });
|
|
98
|
+
content.append(can, text);
|
|
99
|
+
if (getComputedStyle(button).position === "static") button.style.position = "relative";
|
|
100
|
+
button.style.userSelect = "none";
|
|
101
|
+
button.style.setProperty("-webkit-user-select", "none");
|
|
102
|
+
button.style.whiteSpace = "nowrap";
|
|
103
|
+
button.dataset.slot ??= "hold-to-delete";
|
|
104
|
+
button.replaceChildren(fill, content);
|
|
105
|
+
let state = "idle";
|
|
106
|
+
let hold = 0;
|
|
107
|
+
let direction = 0;
|
|
108
|
+
let stopHold;
|
|
109
|
+
let stopTweens = [];
|
|
110
|
+
let undoTimer;
|
|
111
|
+
let pressStart;
|
|
112
|
+
let holdKey;
|
|
113
|
+
let destroyed = false;
|
|
114
|
+
const still = () => prefersReducedMotion() || isMotionOff(button);
|
|
115
|
+
const width = createSpring(0, (value) => {
|
|
116
|
+
button.style.width = width.active ? `${value.toFixed(2)}px` : "";
|
|
117
|
+
}, widthSpring);
|
|
118
|
+
function setState(next) {
|
|
119
|
+
state = next;
|
|
120
|
+
button.dataset.state = next;
|
|
121
|
+
options.onState?.(next);
|
|
122
|
+
}
|
|
123
|
+
function natural() {
|
|
124
|
+
const current = button.style.width;
|
|
125
|
+
button.style.width = "";
|
|
126
|
+
const value = button.getBoundingClientRect().width;
|
|
127
|
+
button.style.width = current;
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
function setText(value, animate) {
|
|
131
|
+
const from = button.getBoundingClientRect().width;
|
|
132
|
+
text.replaceChildren(...[...value].map((letter) => {
|
|
133
|
+
const span = document.createElement("span");
|
|
134
|
+
span.textContent = letter;
|
|
135
|
+
span.style.display = "inline-block";
|
|
136
|
+
return span;
|
|
137
|
+
}));
|
|
138
|
+
text.hidden = value === "";
|
|
139
|
+
if (!animate || isMotionOff(button)) return;
|
|
140
|
+
const to = natural();
|
|
141
|
+
if (prefersReducedMotion()) {
|
|
142
|
+
const fade = playTween(.15, (p) => text.style.opacity = p < 1 ? p.toFixed(3) : "");
|
|
143
|
+
stopTweens.push(fade.stop);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
width.set(from);
|
|
147
|
+
button.style.width = `${from}px`;
|
|
148
|
+
width.to(to);
|
|
149
|
+
[...text.children].forEach((letter, index) => {
|
|
150
|
+
if (!(letter instanceof HTMLElement)) return;
|
|
151
|
+
writeMotionStyle(letter, {
|
|
152
|
+
opacity: "0",
|
|
153
|
+
filter: "blur(6px)"
|
|
154
|
+
});
|
|
155
|
+
const tween = playTween(.24, (p) => writeMotionStyle(letter, p < 1 ? {
|
|
156
|
+
opacity: p.toFixed(3),
|
|
157
|
+
filter: `blur(${(6 * (1 - p)).toFixed(2)}px)`
|
|
158
|
+
} : {
|
|
159
|
+
opacity: null,
|
|
160
|
+
filter: null
|
|
161
|
+
}), (t) => t, .04 + index * .028);
|
|
162
|
+
stopTweens.push(tween.stop);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function paint() {
|
|
166
|
+
button.style.setProperty("--vh-hold", hold.toFixed(4));
|
|
167
|
+
const box = button.getBoundingClientRect();
|
|
168
|
+
const edge = box.left + box.width * hold;
|
|
169
|
+
for (const letter of text.children) {
|
|
170
|
+
if (!(letter instanceof HTMLElement)) continue;
|
|
171
|
+
const rect = letter.getBoundingClientRect();
|
|
172
|
+
letter.style.color = rect.left + rect.width / 2 < edge ? "var(--vh-error, var(--ui-error, currentColor))" : "";
|
|
173
|
+
}
|
|
174
|
+
can.style.color = hold > 0 ? `color-mix(in oklch, var(--vh-error, var(--ui-error, currentColor)) ${Math.min(100, hold * 600).toFixed(1)}%, currentColor)` : "";
|
|
175
|
+
writeMotionStyle(lid, { rotate: !still() && hold > 0 ? `${(lidHold * hold).toFixed(2)}deg` : null });
|
|
176
|
+
}
|
|
177
|
+
function run(next) {
|
|
178
|
+
if (state !== "idle" && state !== "holding") return;
|
|
179
|
+
direction = next;
|
|
180
|
+
if (next > 0) setState("holding");
|
|
181
|
+
if (stopHold) return;
|
|
182
|
+
stopHold = onEachFrame((seconds) => {
|
|
183
|
+
hold = Math.max(0, Math.min(1, hold + seconds * direction / (direction > 0 ? fillSeconds : emptySeconds)));
|
|
184
|
+
paint();
|
|
185
|
+
if (hold >= 1 && direction > 0) {
|
|
186
|
+
stopHold = void 0;
|
|
187
|
+
complete();
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
if (hold <= 0 && direction < 0) {
|
|
191
|
+
stopHold = void 0;
|
|
192
|
+
setState("idle");
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
return true;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function itemLeaves() {
|
|
199
|
+
const item = options.item?.();
|
|
200
|
+
if (!(item instanceof HTMLElement) || still()) return Promise.resolve();
|
|
201
|
+
item.setAttribute(leavingAttribute, "");
|
|
202
|
+
const rect = item.getBoundingClientRect();
|
|
203
|
+
const ghost = visualCopy(item);
|
|
204
|
+
ghost.removeAttribute(leavingAttribute);
|
|
205
|
+
Object.assign(ghost.style, {
|
|
206
|
+
boxSizing: "border-box",
|
|
207
|
+
height: `${rect.height}px`,
|
|
208
|
+
left: `${rect.left}px`,
|
|
209
|
+
margin: "0",
|
|
210
|
+
pointerEvents: "none",
|
|
211
|
+
position: "fixed",
|
|
212
|
+
top: `${rect.top}px`,
|
|
213
|
+
width: `${rect.width}px`,
|
|
214
|
+
zIndex: "2147483646"
|
|
215
|
+
});
|
|
216
|
+
writeMotionStyle(ghost, {
|
|
217
|
+
translate: null,
|
|
218
|
+
scale: null,
|
|
219
|
+
opacity: null,
|
|
220
|
+
filter: null
|
|
221
|
+
});
|
|
222
|
+
document.body.append(ghost);
|
|
223
|
+
const from = center(rect);
|
|
224
|
+
const to = center(can.getBoundingClientRect());
|
|
225
|
+
const tween = playTween(.32, (p) => {
|
|
226
|
+
writeMotionStyle(ghost, {
|
|
227
|
+
translate: `${((to.x - from.x) * p).toFixed(2)}px ${((to.y - from.y) * p).toFixed(2)}px`,
|
|
228
|
+
scale: (1 - .8 * p).toFixed(4),
|
|
229
|
+
opacity: (1 - p).toFixed(3),
|
|
230
|
+
filter: p > 0 ? `blur(${(3 * p).toFixed(2)}px)` : null
|
|
231
|
+
});
|
|
232
|
+
}, leaveEasing);
|
|
233
|
+
stopTweens.push(tween.stop);
|
|
234
|
+
return tween.done.finally(() => {
|
|
235
|
+
ghost.remove();
|
|
236
|
+
item.removeAttribute(leavingAttribute);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function lettersLeave() {
|
|
240
|
+
const target = can.getBoundingClientRect();
|
|
241
|
+
const tx = target.left + target.width / 2;
|
|
242
|
+
const ty = target.top + target.height * .35;
|
|
243
|
+
return Promise.all([...text.children].map((letter, index) => {
|
|
244
|
+
if (!(letter instanceof HTMLElement)) return void 0;
|
|
245
|
+
letter.style.color = "var(--vh-error, var(--ui-error, currentColor))";
|
|
246
|
+
const rect = letter.getBoundingClientRect();
|
|
247
|
+
const dx = tx - (rect.left + rect.width / 2);
|
|
248
|
+
const dy = ty - (rect.top + rect.height / 2);
|
|
249
|
+
const lift = -12 - Math.min(18, Math.abs(dx) * .14);
|
|
250
|
+
const turn = -15 - index * 4;
|
|
251
|
+
const tween = playTween(.46 + index * .01, (p) => {
|
|
252
|
+
if (p <= .55) {
|
|
253
|
+
const e = riseEasing(p / .55);
|
|
254
|
+
writeMotionStyle(letter, {
|
|
255
|
+
translate: `${(dx * .5 * e).toFixed(2)}px ${(lift * e).toFixed(2)}px`,
|
|
256
|
+
rotate: `${(turn * e).toFixed(2)}deg`
|
|
257
|
+
});
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const e = fallEasing((p - .55) / .45);
|
|
261
|
+
writeMotionStyle(letter, {
|
|
262
|
+
translate: `${(dx * .5 + dx * .5 * e).toFixed(2)}px ${(lift + (dy - lift) * e).toFixed(2)}px`,
|
|
263
|
+
rotate: `${(turn + (-70 - turn) * e).toFixed(2)}deg`,
|
|
264
|
+
scale: (1 - .7 * e).toFixed(4),
|
|
265
|
+
opacity: (1 - e).toFixed(3)
|
|
266
|
+
});
|
|
267
|
+
}, (t) => t, .14 + index * .042);
|
|
268
|
+
stopTweens.push(tween.stop);
|
|
269
|
+
return tween.done;
|
|
270
|
+
}));
|
|
271
|
+
}
|
|
272
|
+
async function complete() {
|
|
273
|
+
setState("leaving");
|
|
274
|
+
const leaving = itemLeaves();
|
|
275
|
+
options.onDelete?.();
|
|
276
|
+
if (state !== "leaving") return;
|
|
277
|
+
if (still()) return toUndo();
|
|
278
|
+
const open = playTween(.22, (p) => writeMotionStyle(lid, { rotate: `${(lidHold + -54 * p).toFixed(2)}deg` }), lidOpenEasing);
|
|
279
|
+
stopTweens.push(open.stop);
|
|
280
|
+
await Promise.all([lettersLeave(), leaving]);
|
|
281
|
+
if (state !== "leaving") return;
|
|
282
|
+
const shut = playTween(.3, (p) => {
|
|
283
|
+
const angle = p <= .65 ? lidOpen + 83 * (p / .65) : 5 - 5 * ((p - .65) / .35);
|
|
284
|
+
writeMotionStyle(lid, { rotate: p < 1 ? `${angle.toFixed(2)}deg` : null });
|
|
285
|
+
}, easeIn);
|
|
286
|
+
stopTweens.push(shut.stop);
|
|
287
|
+
await new Promise((resolve) => setTimeout(resolve, 340 * getMotionSlowFactor()));
|
|
288
|
+
if (state === "leaving") toUndo();
|
|
289
|
+
}
|
|
290
|
+
function toUndo() {
|
|
291
|
+
if (destroyed) return;
|
|
292
|
+
setState("undo");
|
|
293
|
+
const reset = () => {
|
|
294
|
+
hold = 0;
|
|
295
|
+
button.style.setProperty("--vh-hold", "0");
|
|
296
|
+
fill.style.opacity = "";
|
|
297
|
+
can.style.color = "";
|
|
298
|
+
};
|
|
299
|
+
if (still()) reset();
|
|
300
|
+
else {
|
|
301
|
+
const fade = playTween(.26, (p) => fill.style.opacity = (1 - p).toFixed(3));
|
|
302
|
+
stopTweens.push(fade.stop);
|
|
303
|
+
fade.done.then((done) => done && reset());
|
|
304
|
+
}
|
|
305
|
+
for (const letter of text.children) if (letter instanceof HTMLElement) letter.style.color = "";
|
|
306
|
+
setText(undoLabel, true);
|
|
307
|
+
announce(button, `Deleted. ${undoLabel} is available.`);
|
|
308
|
+
undoTimer = setTimeout(() => void commit(), undoFor * getMotionSlowFactor());
|
|
309
|
+
}
|
|
310
|
+
function clear() {
|
|
311
|
+
stopHold?.();
|
|
312
|
+
stopHold = void 0;
|
|
313
|
+
for (const stop of stopTweens) stop();
|
|
314
|
+
stopTweens = [];
|
|
315
|
+
clearTimeout(undoTimer);
|
|
316
|
+
undoTimer = void 0;
|
|
317
|
+
hold = 0;
|
|
318
|
+
direction = 0;
|
|
319
|
+
fill.style.opacity = "";
|
|
320
|
+
can.style.color = "";
|
|
321
|
+
text.style.opacity = "";
|
|
322
|
+
button.style.setProperty("--vh-hold", "0");
|
|
323
|
+
writeMotionStyle(lid, { rotate: null });
|
|
324
|
+
for (const letter of text.children) if (letter instanceof HTMLElement) letter.style.color = "";
|
|
325
|
+
}
|
|
326
|
+
function toIdle(animate) {
|
|
327
|
+
clear();
|
|
328
|
+
setState("idle");
|
|
329
|
+
setText(label, animate);
|
|
330
|
+
}
|
|
331
|
+
async function commit() {
|
|
332
|
+
if (state !== "undo" && state !== "leaving") return;
|
|
333
|
+
clearTimeout(undoTimer);
|
|
334
|
+
setState("committing");
|
|
335
|
+
try {
|
|
336
|
+
await options.commit();
|
|
337
|
+
if (!destroyed) toIdle(false);
|
|
338
|
+
} catch (error) {
|
|
339
|
+
if (!destroyed) toIdle(true);
|
|
340
|
+
options.onUndo?.();
|
|
341
|
+
options.onError?.(error);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function undo() {
|
|
345
|
+
if (state !== "undo" && state !== "leaving") return;
|
|
346
|
+
toIdle(true);
|
|
347
|
+
options.onUndo?.();
|
|
348
|
+
}
|
|
349
|
+
const release = () => {
|
|
350
|
+
if (state === "holding") run(-1);
|
|
351
|
+
setTimeout(() => pressStart = void 0);
|
|
352
|
+
};
|
|
353
|
+
const onPointerDown = (event) => {
|
|
354
|
+
if (event.button !== 0) return;
|
|
355
|
+
pressStart = state;
|
|
356
|
+
if (state === "idle" || state === "holding") run(1);
|
|
357
|
+
};
|
|
358
|
+
const onKeyDown = (event) => {
|
|
359
|
+
if (event.key !== " " && event.key !== "Enter") return;
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
if (event.repeat) return;
|
|
362
|
+
pressStart = state;
|
|
363
|
+
if (state === "undo" || state === "leaving") return undo();
|
|
364
|
+
if (state === "idle" || state === "holding") {
|
|
365
|
+
holdKey = event.key;
|
|
366
|
+
run(1);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
const releaseKey = () => {
|
|
370
|
+
if (holdKey === void 0) return;
|
|
371
|
+
holdKey = void 0;
|
|
372
|
+
release();
|
|
373
|
+
};
|
|
374
|
+
const onKeyUp = (event) => {
|
|
375
|
+
if (event.key === holdKey) releaseKey();
|
|
376
|
+
};
|
|
377
|
+
const onClick = async () => {
|
|
378
|
+
const started = pressStart;
|
|
379
|
+
if (state === "undo" || state === "leaving") {
|
|
380
|
+
if (started === void 0 || started === "undo" || started === "leaving") undo();
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (started !== void 0 || state !== "idle") return;
|
|
384
|
+
if (await (options.confirm ?? (() => window.confirm(`${label || "Delete"}?`)))() && !destroyed && state === "idle") {
|
|
385
|
+
clear();
|
|
386
|
+
complete();
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
const onPageHide = () => {
|
|
390
|
+
if (state === "undo" || state === "leaving") commit();
|
|
391
|
+
};
|
|
392
|
+
const stopWatchingMotion = onReducedMotionChange((reduced) => {
|
|
393
|
+
if (!reduced || state !== "leaving") return;
|
|
394
|
+
clear();
|
|
395
|
+
toUndo();
|
|
396
|
+
});
|
|
397
|
+
button.addEventListener("pointerdown", onPointerDown);
|
|
398
|
+
button.addEventListener("pointerup", release);
|
|
399
|
+
button.addEventListener("pointerleave", release);
|
|
400
|
+
button.addEventListener("pointercancel", release);
|
|
401
|
+
button.addEventListener("keydown", onKeyDown);
|
|
402
|
+
button.addEventListener("keyup", onKeyUp);
|
|
403
|
+
button.addEventListener("blur", releaseKey);
|
|
404
|
+
button.addEventListener("click", onClick);
|
|
405
|
+
window.addEventListener("pagehide", onPageHide);
|
|
406
|
+
setText(label, false);
|
|
407
|
+
setState("idle");
|
|
408
|
+
return {
|
|
409
|
+
get state() {
|
|
410
|
+
return state;
|
|
411
|
+
},
|
|
412
|
+
undo,
|
|
413
|
+
destroy() {
|
|
414
|
+
if (destroyed) return;
|
|
415
|
+
if (state === "undo" || state === "leaving") commit();
|
|
416
|
+
destroyed = true;
|
|
417
|
+
clear();
|
|
418
|
+
width.stop();
|
|
419
|
+
button.style.width = "";
|
|
420
|
+
button.removeEventListener("pointerdown", onPointerDown);
|
|
421
|
+
button.removeEventListener("pointerup", release);
|
|
422
|
+
button.removeEventListener("pointerleave", release);
|
|
423
|
+
button.removeEventListener("pointercancel", release);
|
|
424
|
+
button.removeEventListener("keydown", onKeyDown);
|
|
425
|
+
button.removeEventListener("keyup", onKeyUp);
|
|
426
|
+
button.removeEventListener("blur", releaseKey);
|
|
427
|
+
button.removeEventListener("click", onClick);
|
|
428
|
+
window.removeEventListener("pagehide", onPageHide);
|
|
429
|
+
stopWatchingMotion();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
export { createHoldToDelete as t };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/@pierre+highlights@0.5.2/node_modules/@pierre/highlights/dist/themes/horizon-bright.js
|
|
2
|
+
var horizon_bright_default = {
|
|
3
|
+
"name": "Horizon Bright",
|
|
4
|
+
"appearance": "light",
|
|
5
|
+
"style": {
|
|
6
|
+
"background": "#FDF0ED",
|
|
7
|
+
"text": "#06060C",
|
|
8
|
+
"editor.background": "#FDF0ED",
|
|
9
|
+
"editor.active_line.background": "#F9CBBE4D",
|
|
10
|
+
"players": [],
|
|
11
|
+
"error": "#F43E5C",
|
|
12
|
+
"warning": "#1EB980B3",
|
|
13
|
+
"hint": "#969696ff",
|
|
14
|
+
"created": "#1EB980B3",
|
|
15
|
+
"deleted": "#F43E5C",
|
|
16
|
+
"modified": "#AF5427",
|
|
17
|
+
"terminal.ansi.black": "#000000f2",
|
|
18
|
+
"terminal.ansi.red": "#E95678",
|
|
19
|
+
"terminal.ansi.green": "#29D398",
|
|
20
|
+
"terminal.ansi.yellow": "#FAB795",
|
|
21
|
+
"terminal.ansi.blue": "#26BBD9",
|
|
22
|
+
"terminal.ansi.magenta": "#EE64AC",
|
|
23
|
+
"terminal.ansi.cyan": "#59E1E3",
|
|
24
|
+
"terminal.ansi.white": "#21201cff",
|
|
25
|
+
"terminal.ansi.bright_black": "#000000e6",
|
|
26
|
+
"terminal.ansi.bright_red": "#EC6A88",
|
|
27
|
+
"terminal.ansi.bright_green": "#3FDAA4",
|
|
28
|
+
"terminal.ansi.bright_yellow": "#FBC3A7",
|
|
29
|
+
"terminal.ansi.bright_blue": "#3FC4DE",
|
|
30
|
+
"terminal.ansi.bright_magenta": "#F075B5",
|
|
31
|
+
"terminal.ansi.bright_cyan": "#6BE4E6",
|
|
32
|
+
"terminal.ansi.bright_white": "#63635eff",
|
|
33
|
+
"syntax": {
|
|
34
|
+
"attribute": { "color": "#DC3318" },
|
|
35
|
+
"comment": {
|
|
36
|
+
"color": "#33333380",
|
|
37
|
+
"font_style": "italic"
|
|
38
|
+
},
|
|
39
|
+
"comment.doc": {
|
|
40
|
+
"color": "#33333380",
|
|
41
|
+
"font_style": "italic"
|
|
42
|
+
},
|
|
43
|
+
"constant": { "color": "#DC3318" },
|
|
44
|
+
"constructor": { "color": "#DA103F" },
|
|
45
|
+
"emphasis": {
|
|
46
|
+
"color": "#1D8991",
|
|
47
|
+
"font_style": "italic"
|
|
48
|
+
},
|
|
49
|
+
"emphasis.strong": {
|
|
50
|
+
"color": "#8A31B9",
|
|
51
|
+
"font_weight": 700
|
|
52
|
+
},
|
|
53
|
+
"function": { "color": "#1D8991" },
|
|
54
|
+
"keyword": { "color": "#8A31B9" },
|
|
55
|
+
"label": { "color": "#F77D26" },
|
|
56
|
+
"link_text": { "color": "#F6661E" },
|
|
57
|
+
"link_uri": { "color": "#F6661E" },
|
|
58
|
+
"number": { "color": "#DC3318" },
|
|
59
|
+
"operator": { "color": "#333333" },
|
|
60
|
+
"property": { "color": "#DA103F" },
|
|
61
|
+
"punctuation": { "color": "#333333" },
|
|
62
|
+
"punctuation.bracket": { "color": "#333333" },
|
|
63
|
+
"punctuation.delimiter": { "color": "#333333" },
|
|
64
|
+
"punctuation.list_marker": { "color": "#333333" },
|
|
65
|
+
"punctuation.special": { "color": "#333333" },
|
|
66
|
+
"tag": { "color": "#DA103F" },
|
|
67
|
+
"title": { "color": "#F77D26" },
|
|
68
|
+
"type": { "color": "#F77D26" },
|
|
69
|
+
"variable": { "color": "#DA103F" },
|
|
70
|
+
"variable.special": {
|
|
71
|
+
"color": "#F77D26",
|
|
72
|
+
"font_style": "italic"
|
|
73
|
+
},
|
|
74
|
+
"boolean": { "color": "#DC3318" },
|
|
75
|
+
"embedded": { "color": "#06060C" },
|
|
76
|
+
"namespace": { "color": "#F77D26" },
|
|
77
|
+
"predictive": { "color": "#33333380" },
|
|
78
|
+
"preproc": { "color": "#8A31B9" },
|
|
79
|
+
"primary": { "color": "#06060C" },
|
|
80
|
+
"selector": { "color": "#DA103F" },
|
|
81
|
+
"string": { "color": "#F6661E" },
|
|
82
|
+
"enum": { "color": "#F77D26" },
|
|
83
|
+
"hint": { "color": "#969696ff" },
|
|
84
|
+
"variant": { "color": "#DA103F" },
|
|
85
|
+
"diff.minus": { "color": "#F43E5C" },
|
|
86
|
+
"diff.plus": { "color": "#1EB980B3" },
|
|
87
|
+
"selector.class": { "color": "#DC3318" },
|
|
88
|
+
"selector.id": { "color": "#1D8991" },
|
|
89
|
+
"string.escape": { "color": "#1D8991" },
|
|
90
|
+
"string.regex": { "color": "#DC3318" },
|
|
91
|
+
"text.literal": { "color": "#DC3318" },
|
|
92
|
+
"selector.pseudo": { "color": "#F6661E" },
|
|
93
|
+
"string.special.symbol": { "color": "#DC3318" }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
export { horizon_bright_default as default };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/@pierre+highlights@0.5.2/node_modules/@pierre/highlights/dist/themes/horizon.js
|
|
2
|
+
var horizon_default = {
|
|
3
|
+
"name": "Horizon",
|
|
4
|
+
"appearance": "dark",
|
|
5
|
+
"style": {
|
|
6
|
+
"background": "#1C1E26",
|
|
7
|
+
"text": "#D5D8DA",
|
|
8
|
+
"editor.background": "#1C1E26",
|
|
9
|
+
"editor.active_line.background": "#2E303E4D",
|
|
10
|
+
"players": [],
|
|
11
|
+
"error": "#F43E5C",
|
|
12
|
+
"warning": "#27D797B3",
|
|
13
|
+
"hint": "#969696ff",
|
|
14
|
+
"created": "#27D797B3",
|
|
15
|
+
"deleted": "#F43E5C",
|
|
16
|
+
"modified": "#FAB38E",
|
|
17
|
+
"terminal.ansi.black": "#000000f2",
|
|
18
|
+
"terminal.ansi.red": "#E95678",
|
|
19
|
+
"terminal.ansi.green": "#29D398",
|
|
20
|
+
"terminal.ansi.yellow": "#FAB795",
|
|
21
|
+
"terminal.ansi.blue": "#26BBD9",
|
|
22
|
+
"terminal.ansi.magenta": "#EE64AC",
|
|
23
|
+
"terminal.ansi.cyan": "#59E1E3",
|
|
24
|
+
"terminal.ansi.white": "#eeeeecff",
|
|
25
|
+
"terminal.ansi.bright_black": "#000000e6",
|
|
26
|
+
"terminal.ansi.bright_red": "#EC6A88",
|
|
27
|
+
"terminal.ansi.bright_green": "#3FDAA4",
|
|
28
|
+
"terminal.ansi.bright_yellow": "#FBC3A7",
|
|
29
|
+
"terminal.ansi.bright_blue": "#3FC4DE",
|
|
30
|
+
"terminal.ansi.bright_magenta": "#F075B5",
|
|
31
|
+
"terminal.ansi.bright_cyan": "#6BE4E6",
|
|
32
|
+
"terminal.ansi.bright_white": "#b5b3adff",
|
|
33
|
+
"syntax": {
|
|
34
|
+
"attribute": { "color": "#F09483E6" },
|
|
35
|
+
"comment": {
|
|
36
|
+
"color": "#BBBBBB4D",
|
|
37
|
+
"font_style": "italic"
|
|
38
|
+
},
|
|
39
|
+
"comment.doc": {
|
|
40
|
+
"color": "#BBBBBB4D",
|
|
41
|
+
"font_style": "italic"
|
|
42
|
+
},
|
|
43
|
+
"constant": { "color": "#F09483E6" },
|
|
44
|
+
"constructor": { "color": "#E95678E6" },
|
|
45
|
+
"emphasis": {
|
|
46
|
+
"color": "#25B0BCE6",
|
|
47
|
+
"font_style": "italic"
|
|
48
|
+
},
|
|
49
|
+
"emphasis.strong": {
|
|
50
|
+
"color": "#B877DBE6",
|
|
51
|
+
"font_weight": 700
|
|
52
|
+
},
|
|
53
|
+
"function": { "color": "#25B0BCE6" },
|
|
54
|
+
"keyword": { "color": "#B877DBE6" },
|
|
55
|
+
"label": { "color": "#FAC29AE6" },
|
|
56
|
+
"link_text": { "color": "#FAB795E6" },
|
|
57
|
+
"link_uri": { "color": "#FAB795E6" },
|
|
58
|
+
"number": { "color": "#F09483E6" },
|
|
59
|
+
"operator": { "color": "#BBBBBB" },
|
|
60
|
+
"property": { "color": "#E95678E6" },
|
|
61
|
+
"punctuation": { "color": "#BBBBBB" },
|
|
62
|
+
"punctuation.bracket": { "color": "#BBBBBB" },
|
|
63
|
+
"punctuation.delimiter": { "color": "#BBBBBB" },
|
|
64
|
+
"punctuation.list_marker": { "color": "#BBBBBB" },
|
|
65
|
+
"punctuation.special": { "color": "#BBBBBB" },
|
|
66
|
+
"tag": { "color": "#E95678E6" },
|
|
67
|
+
"title": { "color": "#FAC29AE6" },
|
|
68
|
+
"type": { "color": "#FAC29AE6" },
|
|
69
|
+
"variable": { "color": "#E95678E6" },
|
|
70
|
+
"variable.special": {
|
|
71
|
+
"color": "#FAC29AE6",
|
|
72
|
+
"font_style": "italic"
|
|
73
|
+
},
|
|
74
|
+
"boolean": { "color": "#F09483E6" },
|
|
75
|
+
"embedded": { "color": "#D5D8DA" },
|
|
76
|
+
"namespace": { "color": "#FAC29AE6" },
|
|
77
|
+
"predictive": { "color": "#BBBBBB4D" },
|
|
78
|
+
"preproc": { "color": "#B877DBE6" },
|
|
79
|
+
"primary": { "color": "#D5D8DA" },
|
|
80
|
+
"selector": { "color": "#E95678E6" },
|
|
81
|
+
"string": { "color": "#FAB795E6" },
|
|
82
|
+
"enum": { "color": "#FAC29AE6" },
|
|
83
|
+
"hint": { "color": "#969696ff" },
|
|
84
|
+
"variant": { "color": "#E95678E6" },
|
|
85
|
+
"diff.minus": { "color": "#F43E5C" },
|
|
86
|
+
"diff.plus": { "color": "#27D797B3" },
|
|
87
|
+
"selector.class": { "color": "#F09483E6" },
|
|
88
|
+
"selector.id": { "color": "#25B0BCE6" },
|
|
89
|
+
"string.escape": { "color": "#25B0BCE6" },
|
|
90
|
+
"string.regex": { "color": "#F09483E6" },
|
|
91
|
+
"text.literal": { "color": "#F09483E6" },
|
|
92
|
+
"selector.pseudo": { "color": "#FAB795E6" },
|
|
93
|
+
"string.special.symbol": { "color": "#F09483E6" }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
export { horizon_default as default };
|