@vite-hub/ui 0.6.1 → 0.7.0
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 +105 -45
- package/dist/AttachmentTitle-BWw0ck0T.js +110 -0
- package/dist/BubbleContent-B1a4e3vE.js +45 -0
- package/dist/Chat-BZxkf3Tt.js +112 -0
- package/dist/ChatMessage-Blr5F-zi.js +94 -0
- package/dist/CodeBlockContent-BjXJm8lO.js +92 -0
- package/dist/CodeBlockTitle-DYrYpc1U.js +99 -0
- package/dist/CommentRow-ViZ7r8nr.js +86 -0
- package/dist/CopyButton-Dtg_Oc9_.js +115 -0
- package/dist/Markdown-_w7feFzl.js +70 -0
- package/dist/MarkdownCodeBlock-B4j7x0H6.js +127 -0
- package/dist/MarkdownImage-CJN3myt4.js +111 -0
- package/dist/MessageHeader-CJ9eBHSS.js +61 -0
- package/dist/MessageParts-FVyYZNsn.js +57 -0
- package/dist/MessageScrollerViewport-BaTlWLki.js +142 -0
- package/dist/MorphText-CYTndbyp.js +36 -0
- package/dist/RollNumber-Bo2tzfAp.js +49 -0
- package/dist/TraceTitle-Cp0y7RRD.js +133 -0
- package/dist/agent-session-BwZSMi4S.d.ts +312 -0
- package/dist/agent-session-DhlTKCQG.js +875 -0
- package/dist/{announce-B0DLwflT.js → announce-CJNXaYbT.js} +1 -3
- package/dist/appendItems-hQ4aBd9Q.js +4047 -0
- package/dist/attachment-BllgHx9Q.d.ts +124 -0
- package/dist/attachment-DQMJNfj0.js +35 -0
- package/dist/avatar-stack-Bj1xUkzY.d.ts +4 -0
- package/dist/avatar-stack-nQErr0qn.js +72 -0
- package/dist/bubble-D3M2_InY.js +32 -0
- package/dist/bubble-DmplVxLr.d.ts +64 -0
- package/dist/chat-DWdyMSuj.d.ts +13 -0
- package/dist/chat-message-QLHnX_ED.d.ts +11 -0
- package/dist/chat-session-BOj5L3Ey.d.ts +29 -0
- package/dist/chat-session-hjZRL6jY.js +43 -0
- package/dist/choices-input-DqgXl5a-.d.ts +97 -0
- package/dist/{vue-d2Td6uu2.js → client-BG-oCUtv-5i4sRwXP.js} +4156 -4156
- package/dist/code-block-Bp8y-XJp.d.ts +182 -0
- package/dist/code-block-CMERLfew.js +14 -0
- package/dist/code-view-26RY6dX8.js +137 -0
- package/dist/code-view-D8yYdFUc.d.ts +184 -0
- package/dist/{comment-composer-X7vJKh5b.js → comment-composer-BUt6vbnr.js} +175 -37
- package/dist/{comment-composer-DmDM3XYP.d.ts → comment-composer-CIsbz-78.d.ts} +7 -7
- package/dist/{comment-layer-KnnVfdRV.d.ts → comment-layer-BlVNORgj.d.ts} +17 -8
- package/dist/comment-layer-Ck2H24oJ.js +1206 -0
- package/dist/{comment-panel-DoLDOw3E.d.ts → comment-panel-Djx-KxVa.d.ts} +28 -21
- package/dist/comment-selection-bar-CbOEI98x.d.ts +33 -0
- package/dist/comment-selection-bar-CxPkJxVl.js +145 -0
- package/dist/comment-send.css +2 -2
- package/dist/{comment-thread-jqPx6aJ8.js → comment-thread-C_Q4UDaV.js} +74 -49
- package/dist/{comment-thread-DPV2kqA4.d.ts → comment-thread-X6gYMNay.d.ts} +11 -10
- package/dist/comments-B1itauwb.d.ts +52 -0
- package/dist/{comments-9MDSNm-9.js → comments-BaSrroRV.js} +32 -4
- package/dist/comments-BtD28xEn.js +390 -0
- package/dist/{comments-OWjNidkP.d.ts → comments-ZfV6IZs8.d.ts} +9 -2
- package/dist/components-CM5mZe0a.js +269 -0
- package/dist/{config-LRonN53j.js → config-CFwvNt4Y.js} +11 -30
- package/dist/{config-COSdO-ay.d.ts → config-JmsTI7gs.d.ts} +20 -33
- package/dist/connection-status-BVSH2ZVo.js +72 -0
- package/dist/connection-status-g62BTn44.d.ts +37 -0
- package/dist/copy-button-CRiXUFsl.d.ts +17 -0
- package/dist/device-frame-BW6IjB6P.d.ts +78 -0
- package/dist/device-frame-DDWoyB-G.js +515 -0
- package/dist/diffs-BTKaVnsb.d.ts +272 -0
- package/dist/diffs.d.ts +3 -0
- package/dist/{pierre-code-view-C49BVDrc.js → diffs.js} +147 -4223
- package/dist/drop-field-C0bXv1J-.d.ts +35 -0
- package/dist/drop-field-DKpYQ3tO.js +77 -0
- package/dist/editor-BsOTjnnN.d.ts +540 -0
- package/dist/{markdown-editor-D1irG9Xl.js → editor-DJPUs1nt.js} +833 -106
- package/dist/editor.d.ts +2 -0
- package/dist/editor.js +3 -0
- package/dist/element-BpjNQvZ0.js +6 -0
- package/dist/{file-tree-CRFIdtzw.js → file-tree-B4JKbp4r.js} +19 -18
- package/dist/{file-tree-DOtkeBaq.d.ts → file-tree-BdnKA6UA.d.ts} +33 -8
- package/dist/file-tree-DDSIafDn.d.ts +22 -0
- package/dist/file-tree-DS5shGSL.js +46 -0
- package/dist/file-tree.d.ts +2 -0
- package/dist/file-tree.js +1 -0
- package/dist/files-cuVXzWlx.js +30 -0
- package/dist/filter-search-C9e6sGij.d.ts +28 -0
- package/dist/filter-search-COZsoRiR.js +73 -0
- package/dist/formatCSSVariablePrefix-DLS1Ed1_.js +5 -0
- package/dist/headless-2IcUWHMq.d.ts +51 -0
- package/dist/headless.d.ts +7 -4
- package/dist/headless.js +5 -3
- package/dist/highlight.d.ts +2 -0
- package/dist/highlight.js +1 -0
- package/dist/{highlights-C2AbEdDI.js → highlights-8Al0-h-v.js} +3 -2
- package/dist/{hold-to-delete-BSMrpE-i.d.ts → hold-to-delete-CQc1JaG_.d.ts} +7 -0
- package/dist/{hold-to-delete-Cludb56v.js → hold-to-delete-CcQbfiQx.js} +111 -20
- package/dist/hold-to-delete-cOPqQ9FJ.js +85 -0
- package/dist/hold-to-delete-ksBE7wxc.d.ts +58 -0
- package/dist/index-9Z6Gwtnf.d.ts +77 -0
- package/dist/{index-B2cbt3py.d.ts → index-D3-uYBqH.d.ts} +1 -1
- package/dist/index.d.ts +165 -52
- package/dist/index.js +127 -671
- package/dist/markdown-BLALLOc0.d.ts +45 -0
- package/dist/{markdown-renderer-DMyYKeil.js → markdown-DDyOdYq_.js} +125 -127
- package/dist/{parts/components/markdown-renderer.d.ts → markdown-DkDxdpMU.d.ts} +10 -7
- package/dist/markdown-editor.d.ts +51 -98
- package/dist/markdown-editor.js +70 -3
- package/dist/markdown.d.ts +2 -0
- package/dist/markdown.js +1 -0
- package/dist/marker-CvcWZ3Zp.d.ts +59 -0
- package/dist/marker-DNL6QR3L.js +63 -0
- package/dist/message-BwivYIEl.js +13 -0
- package/dist/message-DEq4K5cQ.d.ts +72 -0
- package/dist/message-parts-B1BZFVKe.d.ts +3 -0
- package/dist/message-parts-CG3gNWn8.d.ts +11 -0
- package/dist/message-parts.d.ts +2 -0
- package/dist/message-parts.js +1 -0
- package/dist/message-scroller-D7AvM31v.d.ts +41 -0
- package/dist/motion/core.d.ts +4 -4
- package/dist/motion/core.js +5 -11
- package/dist/motion-BH6ShUam.d.ts +12 -0
- package/dist/{effects-C1zYpSpg.js → motion-core-BdTfxAhY.js} +1779 -55
- package/dist/{motion-core-Dh20n5Se.d.ts → motion-core-BfIefToe.d.ts} +30 -73
- package/dist/motion-dPwxx3Wk.js +76 -0
- package/dist/{install-C4LwcJda.js → motion-itHFtXwA.js} +1 -1
- package/dist/motion-list-BBbz93WT.js +49 -0
- package/dist/motion.d.ts +5 -14
- package/dist/motion.js +6 -13
- package/dist/nuxt-ui-CPdiTwwD.js +22 -0
- package/dist/nuxt.d.ts +9 -5
- package/dist/nuxt.js +28 -32
- package/dist/parts/components/agent-session.d.ts +2 -295
- package/dist/parts/components/agent-session.js +1 -659
- package/dist/parts/components/attachment.d.ts +2 -85
- package/dist/parts/components/attachment.js +3 -72
- package/dist/parts/components/avatar-stack.d.ts +3 -2
- package/dist/parts/components/avatar-stack.js +1 -60
- package/dist/parts/components/bubble.d.ts +2 -69
- package/dist/parts/components/bubble.js +3 -52
- package/dist/parts/components/chat-message.d.ts +3 -25
- package/dist/parts/components/chat-message.js +1 -50
- package/dist/parts/components/chat-session.d.ts +2 -26
- package/dist/parts/components/chat-session.js +1 -37
- package/dist/parts/components/chat.d.ts +3 -52
- package/dist/parts/components/chat.js +1 -105
- package/dist/parts/components/code-block.d.ts +2 -102
- package/dist/parts/components/code-block.js +4 -109
- package/dist/parts/components/code-view.d.ts +3 -268
- package/dist/parts/components/code-view.js +1 -1
- package/dist/parts/components/comment-composer.d.ts +1 -1
- package/dist/parts/components/comment-composer.js +1 -1
- package/dist/parts/components/comment-layer.d.ts +1 -1
- package/dist/parts/components/comment-layer.js +1 -634
- package/dist/parts/components/comment-panel.d.ts +2 -2
- package/dist/parts/components/comment-panel.js +22 -16
- package/dist/parts/components/comment-selection-bar.d.ts +2 -2
- package/dist/parts/components/comment-selection-bar.js +1 -116
- package/dist/parts/components/comment-thread.d.ts +1 -1
- package/dist/parts/components/comment-thread.js +1 -3
- package/dist/parts/components/comments.d.ts +8 -9
- package/dist/parts/components/comments.js +6 -9
- package/dist/parts/components/connection-status.d.ts +2 -36
- package/dist/parts/components/connection-status.js +1 -64
- package/dist/parts/components/copy-button.d.ts +3 -126
- package/dist/parts/components/copy-button.js +3 -226
- package/dist/parts/components/device-frame.d.ts +2 -128
- package/dist/parts/components/device-frame.js +1 -470
- package/dist/parts/components/drop-field.d.ts +2 -67
- package/dist/parts/components/drop-field.js +1 -76
- package/dist/parts/components/file-tree.d.ts +3 -2
- package/dist/parts/components/file-tree.js +3 -1
- package/dist/parts/components/filter-search.d.ts +2 -45
- package/dist/parts/components/filter-search.js +1 -57
- package/dist/parts/components/hold-to-delete.d.ts +2 -80
- package/dist/parts/components/hold-to-delete.js +1 -75
- package/dist/parts/components/markdown.d.ts +3 -45
- package/dist/parts/components/markdown.js +1 -46
- package/dist/parts/components/marker.d.ts +2 -32
- package/dist/parts/components/marker.js +1 -22
- package/dist/parts/components/message-parts.d.ts +3 -25
- package/dist/parts/components/message-parts.js +1 -45
- package/dist/parts/components/message.d.ts +2 -32
- package/dist/parts/components/message.js +3 -22
- package/dist/parts/components/motion-list.d.ts +2 -40
- package/dist/parts/components/motion-list.js +1 -41
- package/dist/parts/components/motion.d.ts +5 -118
- package/dist/parts/components/motion.js +4 -171
- package/dist/parts/components/patch-parsers.d.ts +1 -1
- package/dist/parts/components/progress.d.ts +2 -39
- package/dist/parts/components/progress.js +1 -53
- package/dist/parts/components/prompt-input.d.ts +2 -134
- package/dist/parts/components/prompt-input.js +1 -253
- package/dist/parts/components/relative-time.d.ts +2 -71
- package/dist/parts/components/relative-time.js +1 -1
- package/dist/parts/components/status.d.ts +2 -58
- package/dist/parts/components/status.js +1 -47
- package/dist/parts/components/sync-status.d.ts +2 -22
- package/dist/parts/components/sync-status.js +1 -48
- package/dist/parts/components/tool-list.d.ts +2 -28
- package/dist/parts/components/tool-list.js +1 -118
- package/dist/parts/components/trace-run.d.ts +2 -25
- package/dist/parts/components/trace-run.js +1 -89
- package/dist/parts/components/trace.d.ts +2 -59
- package/dist/parts/components/trace.js +1 -76
- package/dist/parts/composables/attachments.js +75 -1
- package/dist/parts/headless/choices-input.d.ts +2 -2
- package/dist/parts/headless/choices-input.js +49 -37
- package/dist/parts/headless/comments.d.ts +1 -1
- package/dist/parts/headless/comments.js +1 -1
- package/dist/parts/headless/message-scroller.d.ts +2 -2
- package/dist/parts/headless/message-scroller.js +211 -309
- package/dist/parts/headless/relative-time.d.ts +2 -0
- package/dist/parts/headless/relative-time.js +1 -0
- package/dist/parts/workspace/browser-support-notice.js +6 -5
- package/dist/parts/workspace/connect-panel.js +1 -1
- package/dist/parts/workspace/runners/web-container.js +2 -2
- package/dist/parts/workspace/workspace-bar.d.ts +1 -1
- package/dist/parts/workspace/workspace-bar.js +1 -1
- package/dist/parts/workspace/workspace-boot-status.d.ts +1 -1
- package/dist/parts/workspace/workspace-boot-status.js +1 -206
- package/dist/parts/workspace/workspace-editor-head.d.ts +1 -1
- package/dist/parts/workspace/workspace-editor-head.js +1 -1
- package/dist/parts/workspace/workspace-editor.d.ts +2 -2
- package/dist/parts/workspace/workspace-examples.js +1 -1
- package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
- package/dist/parts/workspace/workspace-file-tree.js +3 -2
- package/dist/parts/workspace/workspace-guide.js +1 -1
- package/dist/parts/workspace/workspace-preview.d.ts +1 -1
- package/dist/parts/workspace/workspace-preview.js +14 -12
- package/dist/parts/workspace/workspace-shell.d.ts +1 -1
- package/dist/parts/workspace/workspace-shell.js +11 -11
- package/dist/parts/workspace/workspace-sidebar.d.ts +2 -2
- package/dist/parts/workspace/workspace-sidebar.js +2 -2
- package/dist/parts/workspace/workspace-start.js +1 -1
- package/dist/parts/workspace/workspace-steps.js +1 -1
- package/dist/parts/workspace/workspace.d.ts +3 -3
- package/dist/parts/workspace/workspace.js +5 -5
- package/dist/press-BuEC-XvZ.d.ts +83 -0
- package/dist/progress-Ch0fA-bf.d.ts +8 -0
- package/dist/progress-D_9sG648.js +47 -0
- package/dist/prompt-input-CRXEJBAK.js +412 -0
- package/dist/prompt-input-j4OFTF5p.d.ts +116 -0
- package/dist/relative-time-BnJfjeEm.js +131 -0
- package/dist/relative-time-BuP-Gvzn.d.ts +43 -0
- package/dist/{relative-time-DJnw45tr.js → relative-time-Dz2DR4eb.js} +64 -114
- package/dist/relative-time-grHFu1kY.d.ts +11 -0
- package/dist/{ring-GaJsg32c.js → ring-DoL9jivj.js} +1 -2
- package/dist/runtime/nuxt-plugin.js +2 -5
- package/dist/{shiki-CbfEu_Az.js → shiki-CxzM_xNo.js} +3 -2
- package/dist/stand-ins-CuKM1UH1.js +339 -0
- package/dist/status-B2Yhrwv8.js +67 -0
- package/dist/status-ySiRa-8O.d.ts +38 -0
- package/dist/{stream-tokenizer-ByC3l0HQ.js → stream-tokenizer-BsjV6wxW.js} +1 -1
- package/dist/styles.css +4343 -3403
- package/dist/sync-status-BRroyOre.js +59 -0
- package/dist/sync-status-D4KdGO6y.d.ts +35 -0
- package/dist/theme.css +3 -0
- package/dist/theme.d.ts +14 -0
- package/dist/theme.js +19 -8
- package/dist/{themes-DKugPHlg.js → themes-B0_ioVT0.js} +1 -1
- package/dist/tool-list-DDaCqpR6.js +209 -0
- package/dist/tool-list-DMRPM0Yi.d.ts +50 -0
- package/dist/trace-KCBvOsw_.d.ts +113 -0
- package/dist/trace-run-Dk962P5a.d.ts +49 -0
- package/dist/trace-run-nh6FIsl6.js +202 -0
- package/dist/{opt-out-D66l60sg.js → tween-lVMRCUEv.js} +60 -1
- package/dist/types-BF_U0tgp.d.ts +74 -0
- package/dist/types-CTk3aNb5.d.ts +15 -0
- package/dist/types-D0a3i4Fw.d.ts +21 -0
- package/dist/types-DTecvcsZ.d.ts +35 -0
- package/dist/types-D_BWab7g.d.ts +75 -0
- package/dist/types-RHaQ4gj1.d.ts +27 -0
- package/dist/ui-components-CKQAPI-W.js +7 -0
- package/dist/unwrapDefault-CExq-4rm.js +5 -0
- package/dist/use-copy-DK1SSZkh.js +66 -0
- package/dist/utils-hi9-xROt.js +37 -0
- package/dist/vite.d.ts +0 -1
- package/dist/vite.js +8 -14
- package/dist/{vue-vUGpdMct.js → vue-DdYvDVOr.js} +1 -1
- package/dist/workspace-boot-status-CyGlJS06.js +216 -0
- package/dist/{workspace-shell-ChCwWPyv.d.ts → workspace-shell-B4A7CINd.d.ts} +1 -1
- package/dist/workspace.d.ts +1 -1
- package/dist/workspace.js +1 -2
- package/package.json +48 -14
- package/dist/attachments-DgwoQZKY.js +0 -88
- package/dist/avatar-stack-C0IKwj6g.d.ts +0 -57
- package/dist/choices-input-BUf-QqGj.d.ts +0 -92
- package/dist/code-view-Cg4nyTNA.js +0 -172
- package/dist/comment-attachments-DAzUbRmJ.js +0 -23
- package/dist/comment-list-ncwaCSVX.d.ts +0 -60
- package/dist/comment-person-D_IyIjXo.js +0 -39
- package/dist/comment-pin-hBJFiSYW.d.ts +0 -66
- package/dist/comment-row-DPMWI5Z0.js +0 -38
- package/dist/comment-selection-bar-CVuS-FNL.d.ts +0 -40
- package/dist/comment-send-CUkL3TbZ.js +0 -275
- package/dist/comment-send-MmxFsOQf.d.ts +0 -23
- package/dist/comment-status-nsCdrRk_.js +0 -20
- package/dist/drop-field-CNZgwFVO.js +0 -162
- package/dist/editor-Dmk3k6f6.js +0 -620
- package/dist/format-CPipR1FP.js +0 -19
- package/dist/handlers-CnbkvXjX.js +0 -181
- package/dist/icon-XZaCUZTG.d.ts +0 -29
- package/dist/image-preview-BKVUtfwQ.js +0 -104
- package/dist/index-B_PSX-5h.d.ts +0 -69
- package/dist/list-DUTAo0uC.js +0 -270
- package/dist/markdown-editor-B7gD60tp.d.ts +0 -189
- package/dist/message-scroller-BZqS63IX.d.ts +0 -173
- package/dist/nuxt-ui-7ByUrymx.js +0 -43
- package/dist/parts/components/comment-list.d.ts +0 -2
- package/dist/parts/components/comment-list.js +0 -173
- package/dist/parts/components/comment-pin.d.ts +0 -2
- package/dist/parts/components/comment-pin.js +0 -74
- package/dist/parts/components/comment-send.d.ts +0 -2
- package/dist/parts/components/comment-send.js +0 -1
- package/dist/parts/components/markdown-editor.d.ts +0 -2
- package/dist/parts/components/markdown-editor.js +0 -1
- package/dist/parts/components/markdown-renderer.js +0 -1
- package/dist/payload-text-DQNRbJY5.js +0 -31
- package/dist/progress-DL9k-ERG.js +0 -265
- package/dist/registry-DAIjCjWd.js +0 -77
- package/dist/slot-part-BWHvQ3mK.js +0 -25
- package/dist/text-gacox6bp.js +0 -822
- package/dist/travel-BliEidau.js +0 -180
- package/dist/tween-Dv3IIIQG.js +0 -61
- package/dist/types-Ceh7h7NT.d.ts +0 -31
- package/dist/visual-copy-CHHBfJ6O.js +0 -14
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as MotionEffect, s as MotionRoot } from "./press-BuEC-XvZ.js";
|
|
1
2
|
type ReducedMotionListener = (reduced: boolean) => void;
|
|
2
3
|
/**
|
|
3
4
|
* True when the person asked for less motion. It follows the system setting live. Under it, nothing travels,
|
|
@@ -11,77 +12,6 @@ declare function onReducedMotionChange(listener: ReducedMotionListener): () => v
|
|
|
11
12
|
* follows the system setting again.
|
|
12
13
|
*/
|
|
13
14
|
declare function forceReducedMotion(reduced: boolean | undefined): void;
|
|
14
|
-
/** The attributes whose change the motion layer reports to the `state` hook of an effect. */
|
|
15
|
-
declare const motionStateAttributes: readonly ["aria-checked", "aria-selected", "aria-pressed", "aria-expanded", "aria-valuenow", "aria-valuetext", "data-state", "data-checked", "data-open", "open", "data-leaving"];
|
|
16
|
-
type MotionStateAttribute = (typeof motionStateAttributes)[number];
|
|
17
|
-
type MotionRoot = Document | ShadowRoot | Element;
|
|
18
|
-
interface MotionStateChange {
|
|
19
|
-
attribute: MotionStateAttribute;
|
|
20
|
-
oldValue: string | null;
|
|
21
|
-
value: string | null;
|
|
22
|
-
}
|
|
23
|
-
/** The children or the text of an element changed, such as Vue writing the new label of a button. */
|
|
24
|
-
interface MotionContentChange {
|
|
25
|
-
/** The nodes that the change added, in order. */
|
|
26
|
-
added: Node[];
|
|
27
|
-
/** The nodes that the change removed, in order. */
|
|
28
|
-
removed: Node[];
|
|
29
|
-
/** The text before the change, when the change replaced all of it. */
|
|
30
|
-
oldText: string | undefined;
|
|
31
|
-
}
|
|
32
|
-
/** What a press does next. The motion layer calls it until the pointer or the key goes up. */
|
|
33
|
-
interface MotionPress {
|
|
34
|
-
/** The pointer moved while it was down, such as on a resize handle. Not called for a key press. */
|
|
35
|
-
move?(event: PointerEvent): void;
|
|
36
|
-
/** The pointer or the key went up. Also called on cancellation if there is no `cancel` hook. */
|
|
37
|
-
release(): void;
|
|
38
|
-
/** The pointer left, the press was interrupted, or reduced motion turned on. */
|
|
39
|
-
cancel?(): void;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* One effect of the motion layer, for one interaction. The layer finds the element of the interaction by `selector`,
|
|
43
|
-
* walks the composed path so it also finds elements in shadow DOM, and skips everything inside `[data-motion="none"]`.
|
|
44
|
-
*
|
|
45
|
-
* An effect writes only the separate CSS properties `scale`, `translate`, and `rotate`, and `filter` or `opacity` where
|
|
46
|
-
* it needs them, through `writeMotionStyle`, so it adds to a component's own `transform`. It clears what it wrote when
|
|
47
|
-
* its spring settles.
|
|
48
|
-
*/
|
|
49
|
-
interface MotionEffect {
|
|
50
|
-
/** A unique name, such as "press". Defining an effect with a name that exists replaces it. */
|
|
51
|
-
name: string;
|
|
52
|
-
/** The elements of the interaction, such as `[role=tab]`. The innermost element on the event path wins. */
|
|
53
|
-
selector: string;
|
|
54
|
-
/** Starts tracking state in an installed root and returns its cleanup. */
|
|
55
|
-
watch?(root: MotionRoot): () => void;
|
|
56
|
-
/**
|
|
57
|
-
* A pointer went down on the element (main button only), or Space or Enter went down while it had focus. Return a
|
|
58
|
-
* `MotionPress` to hear the rest of the press. Not called under reduced motion.
|
|
59
|
-
*/
|
|
60
|
-
press?(element: HTMLElement, event: PointerEvent | KeyboardEvent): MotionPress | void;
|
|
61
|
-
/** One of `motionStateAttributes` changed on the element. Also called under reduced motion: keep the meaning. */
|
|
62
|
-
state?(element: HTMLElement, change: MotionStateChange): void;
|
|
63
|
-
/** The element was added to the page, such as a tooltip. Also called under reduced motion: keep the meaning. */
|
|
64
|
-
enter?(element: HTMLElement): void;
|
|
65
|
-
/**
|
|
66
|
-
* The children or the text of the element changed, such as the label or the icon of a button. Also called under
|
|
67
|
-
* reduced motion, and for the changes that effects make themselves: tell them apart by `added`.
|
|
68
|
-
*/
|
|
69
|
-
content?(element: HTMLElement | SVGElement, change: MotionContentChange): void;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Adds an effect to the motion layer. Every installed layer runs it from the next interaction on. Returns a function
|
|
73
|
-
* that removes it. When another copy of the module is the shared layer, the effect goes to that copy.
|
|
74
|
-
*/
|
|
75
|
-
declare function defineMotionEffect(effect: MotionEffect): () => void;
|
|
76
|
-
/** The effects of the motion layer, in the order they were defined. */
|
|
77
|
-
declare function listMotionEffects(): MotionEffect[];
|
|
78
|
-
/**
|
|
79
|
-
* The CSS properties that the motion layer may write. `clip-path` hides the part of a tooltip that is still behind its
|
|
80
|
-
* trigger. `width` is only for a panel that opens beside the page, as a sidebar does.
|
|
81
|
-
*/
|
|
82
|
-
type MotionStyleProperty = "scale" | "translate" | "rotate" | "filter" | "opacity" | "clip-path" | "width";
|
|
83
|
-
/** Writes motion properties inline. An empty string or `null` removes the property, so the stylesheet applies again. */
|
|
84
|
-
declare function writeMotionStyle(element: HTMLElement | SVGElement, values: Partial<Record<MotionStyleProperty, string | null>>): void;
|
|
85
15
|
declare function isMotionOff(element: Element): boolean;
|
|
86
16
|
/** What `installMotion` of `@vite-hub/ui/motion/core` runs. */
|
|
87
17
|
interface InstallMotionOptions {
|
|
@@ -141,7 +71,6 @@ declare const buttonIcon: MotionEffect;
|
|
|
141
71
|
*/
|
|
142
72
|
declare const leave: MotionEffect;
|
|
143
73
|
declare const panel: MotionEffect;
|
|
144
|
-
declare const press: MotionEffect;
|
|
145
74
|
declare const select: MotionEffect;
|
|
146
75
|
/**
|
|
147
76
|
* Drag a value (docs/design/motion.md): a slider thumb from Nuxt UI `USlider`, Reka, ui-sdk and kit, or a plain
|
|
@@ -245,6 +174,34 @@ declare function createSpring(initial: number, onFrame: SpringFrame, preset?: Sp
|
|
|
245
174
|
* Give it an element of its own with no padding, such as the label `<span>` of a button.
|
|
246
175
|
*/
|
|
247
176
|
declare function morphText(element: HTMLElement, text: string): void;
|
|
177
|
+
/** How the old icon leaves: it blurs out, or, for an arrow, it leaves in the direction that it points. */
|
|
178
|
+
type IconExit = "blur" | "left" | "right" | "up" | "down";
|
|
179
|
+
/**
|
|
180
|
+
* How the new icon comes in: it blurs in, it draws its stroke (a spinner, a check), or it slides in, moving in the
|
|
181
|
+
* direction given, as an arrow that comes back.
|
|
182
|
+
*/
|
|
183
|
+
type IconEnter = "blur" | "draw" | "left" | "right" | "up" | "down";
|
|
184
|
+
interface SwapIconOptions {
|
|
185
|
+
/** Default: `"blur"`. */
|
|
186
|
+
exit?: IconExit;
|
|
187
|
+
/** Default: `"draw"` for a spinning icon (`animate-spin`), else `"blur"`. */
|
|
188
|
+
enter?: IconEnter;
|
|
189
|
+
/**
|
|
190
|
+
* Called for each old icon when it has left, in place of `icon.remove()`, for a container whose children a framework
|
|
191
|
+
* renders. Vue removes the icon from its own list.
|
|
192
|
+
*/
|
|
193
|
+
onRemove?: (icon: Element) => void;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Swaps the icon in `container` for `icon`, as rule 5 of docs/design/motion.md asks: the old icon blurs out, or leaves in
|
|
197
|
+
* the direction it points, while the new one comes in, and a spinner or a check draws its stroke. `icon` may already be
|
|
198
|
+
* a child of `container`, as when a framework renders it; else the helper appends it. Every other icon in the container
|
|
199
|
+
* leaves, and is removed when it is gone.
|
|
200
|
+
*
|
|
201
|
+
* Call it again at any time: an icon that is still coming in leaves from where it is. Under reduced motion the icons
|
|
202
|
+
* crossfade in 150ms. Inside `data-motion="none"` the old icons go at once.
|
|
203
|
+
*/
|
|
204
|
+
declare function swapIcon(container: HTMLElement, icon: Element, options?: SwapIconOptions): void;
|
|
248
205
|
/**
|
|
249
206
|
* Rolls the number in `element` to `value`, as rule 6 of docs/design/motion.md asks: only the digits that change roll,
|
|
250
207
|
* up when the number grows and down when it shrinks. The width of the element follows with a spring. `format` turns the
|
|
@@ -400,4 +357,4 @@ interface DropField {
|
|
|
400
357
|
* the dots stay still; `data-over` still marks the field, so its colors change.
|
|
401
358
|
*/
|
|
402
359
|
declare function createDropField(field: HTMLElement, options?: DropFieldOptions): DropField;
|
|
403
|
-
export {
|
|
360
|
+
export { prefersReducedMotion as $, getMotionSlowFactor as A, leave as B, swapIcon as C, SpringPreset as D, SpringFrame as E, toast as F, disclosure as G, label as H, switchKnob as I, InstallMotionOptions as J, check as K, slider as L, springs as M, appear as N, SpringTarget as O, tooltip as P, onReducedMotionChange as Q, select as R, SwapIconOptions as S, Spring as T, jelly as U, buttonIcon as V, divider as W, isMotionOff as X, installMotion as Y, forceReducedMotion as Z, shake as _, ProgressOptions as a, IconEnter as b, MotionList as c, MotionListPlay as d, createMotionList as f, travel as g, TravelOptions as h, Progress as i, setMotionSlowFactor as j, createSpring as k, MotionListOptions as l, TravelBox as m, DropFieldOptions as n, ProgressPhase as o, Travel as p, motionEffects as q, createDropField as r, createProgress as s, DropField as t, MotionListOrigin as u, ring as v, morphText as w, IconExit as x, rollNumber as y, panel as z };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { t as ring } from "./ring-DoL9jivj.js";
|
|
2
|
+
import { x as swapIcon } from "./motion-core-BdTfxAhY.js";
|
|
3
|
+
import { Fragment, createCommentVNode, createElementBlock, defineComponent, mergeProps, nextTick, openBlock, ref, renderList, renderSlot, useTemplateRef, watch } from "vue";
|
|
4
|
+
// registry/motion/SwapIcon.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
const _hoisted_1 = ["data-icon-key", "data-spin"];
|
|
6
|
+
// registry/motion/SwapIcon.vue
|
|
7
|
+
var SwapIcon_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "SwapIcon",
|
|
9
|
+
props: {
|
|
10
|
+
name: {},
|
|
11
|
+
exit: {},
|
|
12
|
+
enter: {},
|
|
13
|
+
spin: { type: Boolean }
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const container = useTemplateRef("container");
|
|
18
|
+
let next = 0;
|
|
19
|
+
const icons = ref([{
|
|
20
|
+
key: next++,
|
|
21
|
+
name: props.name,
|
|
22
|
+
spin: props.spin
|
|
23
|
+
}]);
|
|
24
|
+
watch(() => [props.name, props.spin], async ([name, spin]) => {
|
|
25
|
+
const key = next++;
|
|
26
|
+
icons.value = [...icons.value, {
|
|
27
|
+
key,
|
|
28
|
+
name,
|
|
29
|
+
spin
|
|
30
|
+
}];
|
|
31
|
+
await nextTick();
|
|
32
|
+
const element = container.value?.querySelector(`[data-icon-key="${key}"]`);
|
|
33
|
+
if (!container.value || !element) return;
|
|
34
|
+
swapIcon(container.value, element, {
|
|
35
|
+
exit: props.exit,
|
|
36
|
+
enter: props.enter,
|
|
37
|
+
onRemove: (old) => {
|
|
38
|
+
const gone = Number(old.getAttribute("data-icon-key"));
|
|
39
|
+
icons.value = icons.value.filter((icon) => icon.key !== gone);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
return openBlock(), createElementBlock("span", {
|
|
45
|
+
ref_key: "container",
|
|
46
|
+
ref: container,
|
|
47
|
+
"data-slot": "swap-icon",
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
style: {
|
|
50
|
+
"display": "inline-flex",
|
|
51
|
+
"flex-shrink": "0"
|
|
52
|
+
}
|
|
53
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(icons.value, (icon) => {
|
|
54
|
+
return openBlock(), createElementBlock("span", {
|
|
55
|
+
key: icon.key,
|
|
56
|
+
"data-slot": "swap-icon-item",
|
|
57
|
+
"data-icon-key": icon.key,
|
|
58
|
+
"data-spin": icon.spin ? "" : void 0,
|
|
59
|
+
style: { "display": "inline-flex" }
|
|
60
|
+
}, [createCommentVNode(" `name` on a slot is the name of the slot, so the props go in as one object. "), renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, {
|
|
61
|
+
name: icon.name,
|
|
62
|
+
spin: icon.spin
|
|
63
|
+
}))], 8, _hoisted_1);
|
|
64
|
+
}), 128))], 512);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
// src/components/motion.ts
|
|
69
|
+
/**
|
|
70
|
+
* `v-ring="done"` rings the element once each time `done` becomes true, for a finished action such as saved or copied.
|
|
71
|
+
* `createViteHubUI()` registers it as `v-ring`.
|
|
72
|
+
*/
|
|
73
|
+
const vRing = { updated(element, binding) {
|
|
74
|
+
if (binding.value && !binding.oldValue) ring(element);
|
|
75
|
+
} };
|
|
76
|
+
export { SwapIcon_default as n, vRing as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as installMotion$1, s as motionEffects } from "./motion-core-BdTfxAhY.js";
|
|
2
2
|
// src/motion/install.ts
|
|
3
3
|
/**
|
|
4
4
|
* Starts the motion layer with every built-in effect: press, toggle, select, drag, and appear motion for every element
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { r as createMotionList } from "./motion-core-BdTfxAhY.js";
|
|
2
|
+
import { t as elementOf } from "./element-BpjNQvZ0.js";
|
|
3
|
+
import { Fragment, createElementVNode, defineComponent, h, mergeProps, onBeforeUnmount, onBeforeUpdate, onUpdated, renderSlot, useSlots } from "vue";
|
|
4
|
+
// registry/motion/MotionList.vue
|
|
5
|
+
var MotionList_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
__name: "MotionList",
|
|
8
|
+
props: {
|
|
9
|
+
origin: { type: Function },
|
|
10
|
+
target: { type: Function }
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const slots = useSlots();
|
|
14
|
+
let root;
|
|
15
|
+
let list;
|
|
16
|
+
function setRoot(value) {
|
|
17
|
+
const next = elementOf(value);
|
|
18
|
+
if (next === root) return;
|
|
19
|
+
list?.destroy();
|
|
20
|
+
root = next;
|
|
21
|
+
list = next ? createMotionList(next) : void 0;
|
|
22
|
+
}
|
|
23
|
+
onBeforeUpdate(() => list?.measure());
|
|
24
|
+
onUpdated(() => list?.play({
|
|
25
|
+
origin: __props.origin,
|
|
26
|
+
target: __props.target?.()
|
|
27
|
+
}));
|
|
28
|
+
onBeforeUnmount(() => {
|
|
29
|
+
list?.destroy();
|
|
30
|
+
list = void 0;
|
|
31
|
+
root = void 0;
|
|
32
|
+
});
|
|
33
|
+
const items = () => h(Fragment, slots.default?.());
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return renderSlot(_ctx.$slots, "render", {
|
|
36
|
+
props: {
|
|
37
|
+
..._ctx.$attrs,
|
|
38
|
+
"data-slot": "motion-list",
|
|
39
|
+
ref: setRoot
|
|
40
|
+
},
|
|
41
|
+
children: items()
|
|
42
|
+
}, () => [createElementVNode("div", mergeProps(_ctx.$attrs, {
|
|
43
|
+
ref: setRoot,
|
|
44
|
+
"data-slot": "motion-list"
|
|
45
|
+
}), [renderSlot(_ctx.$slots, "default")], 16)]);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export { MotionList_default as t };
|
package/dist/motion.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { i as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* by its role, in `root`: the document by default, a shadow root, or an element and everything in it. `createViteHubUI()`
|
|
7
|
-
* and the Nuxt module call it for the document. A surface with its own bundle, such as the page pill, takes
|
|
8
|
-
* `installMotion` from `@vite-hub/ui/motion/core` instead and lists the effects it runs, so the others stay out of its
|
|
9
|
-
* bundle.
|
|
10
|
-
*
|
|
11
|
-
* It is safe to call more than once. Returns a function that stops this install. On the server it does nothing.
|
|
12
|
-
*/
|
|
13
|
-
export declare function installMotion(root?: MotionRoot): () => void;
|
|
14
|
-
export { type DropField, type DropFieldOptions, type HoldToDelete, type HoldToDeleteOptions, type HoldToDeleteState, type IconEnter, type IconExit, type InstallMotionOptions, type MotionContentChange, type MotionEffect, type MotionList, type MotionListOptions, type MotionListOrigin, type MotionListPlay, type MotionPress, type MotionRoot, type MotionStateAttribute, type MotionStateChange, type MotionStyleProperty, type Progress, type ProgressOptions, type ProgressPhase, type Spring, type SpringFrame, type SpringPreset, type SpringTarget, type SwapIconOptions, type Travel, type TravelBox, type TravelOptions, appear as appearEffect, buttonIcon as buttonIconEffect, check as checkEffect, createDropField, createHoldToDelete, createMotionList, createProgress, createSpring, defineMotionEffect, disclosure as disclosureEffect, divider as dividerEffect, forceReducedMotion, getMotionSlowFactor, isMotionOff, jelly as jellyEffect, label as labelEffect, leave as leaveEffect, listMotionEffects, morphText, motionEffects, motionStateAttributes, onReducedMotionChange, panel as panelEffect, prefersReducedMotion, press as pressEffect, ring, rollNumber, select as selectEffect, setMotionSlowFactor, shake, slider as sliderEffect, springs, swapIcon, switchKnob as switchEffect, toast as toastEffect, tooltip as tooltipEffect, travel, writeMotionStyle };
|
|
1
|
+
import { i as createHoldToDelete, n as HoldToDeleteOptions, r as HoldToDeleteState, t as HoldToDelete } from "./hold-to-delete-CQc1JaG_.js";
|
|
2
|
+
import { $ as prefersReducedMotion, A as getMotionSlowFactor, B as leave, C as swapIcon, D as SpringPreset, E as SpringFrame, F as toast, G as disclosure, H as label, I as switchKnob, J as InstallMotionOptions, K as check, L as slider, M as springs, N as appear, O as SpringTarget, P as tooltip, Q as onReducedMotionChange, R as select, S as SwapIconOptions, T as Spring, U as jelly, V as buttonIcon, W as divider, X as isMotionOff, Z as forceReducedMotion, _ as shake, a as ProgressOptions, b as IconEnter, c as MotionList, d as MotionListPlay, f as createMotionList, g as travel, h as TravelOptions, i as Progress, j as setMotionSlowFactor, k as createSpring, l as MotionListOptions, m as TravelBox, n as DropFieldOptions, o as ProgressPhase, p as Travel, q as motionEffects, r as createDropField, s as createProgress, t as DropField, u as MotionListOrigin, v as ring, w as morphText, x as IconExit, y as rollNumber, z as panel } from "./motion-core-BfIefToe.js";
|
|
3
|
+
import { a as MotionEffect, c as MotionStateAttribute, d as defineMotionEffect, f as listMotionEffects, i as MotionContentChange, l as MotionStateChange, m as writeMotionStyle, n as press, o as MotionPress, p as motionStateAttributes, r as setMotionPressMode, s as MotionRoot, t as MotionPressMode, u as MotionStyleProperty } from "./press-BuEC-XvZ.js";
|
|
4
|
+
import { t as installMotion } from "./motion-BH6ShUam.js";
|
|
5
|
+
export { type DropField, type DropFieldOptions, type HoldToDelete, type HoldToDeleteOptions, type HoldToDeleteState, type IconEnter, type IconExit, type InstallMotionOptions, type MotionContentChange, type MotionEffect, type MotionList, type MotionListOptions, type MotionListOrigin, type MotionListPlay, type MotionPress, type MotionPressMode, type MotionRoot, type MotionStateAttribute, type MotionStateChange, type MotionStyleProperty, type Progress, type ProgressOptions, type ProgressPhase, type Spring, type SpringFrame, type SpringPreset, type SpringTarget, type SwapIconOptions, type Travel, type TravelBox, type TravelOptions, appear as appearEffect, buttonIcon as buttonIconEffect, check as checkEffect, createDropField, createHoldToDelete, createMotionList, createProgress, createSpring, defineMotionEffect, disclosure as disclosureEffect, divider as dividerEffect, forceReducedMotion, getMotionSlowFactor, installMotion, isMotionOff, jelly as jellyEffect, label as labelEffect, leave as leaveEffect, listMotionEffects, morphText, motionEffects, motionStateAttributes, onReducedMotionChange, panel as panelEffect, prefersReducedMotion, press as pressEffect, ring, rollNumber, select as selectEffect, setMotionPressMode, setMotionSlowFactor, shake, slider as sliderEffect, springs, swapIcon, switchKnob as switchEffect, toast as toastEffect, tooltip as tooltipEffect, travel, writeMotionStyle };
|
package/dist/motion.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createDropField } from "./
|
|
3
|
-
import { t as createHoldToDelete } from "./hold-to-delete-
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
|
|
7
|
-
import { a as listMotionEffects, n as defineMotionEffect, s as motionStateAttributes, u as writeMotionStyle } from "./registry-DAIjCjWd.js";
|
|
8
|
-
import { a as rollNumber, i as morphText, l as swapIcon } from "./text-gacox6bp.js";
|
|
9
|
-
import { t as ring } from "./ring-GaJsg32c.js";
|
|
10
|
-
import { n as shake, t as travel } from "./travel-BliEidau.js";
|
|
11
|
-
import { t as installMotion } from "./install-C4LwcJda.js";
|
|
12
|
-
import "./motion/core.js";
|
|
13
|
-
export { appear as appearEffect, buttonIcon as buttonIconEffect, check as checkEffect, createDropField, createHoldToDelete, createMotionList, createProgress, createSpring, defineMotionEffect, disclosure as disclosureEffect, divider as dividerEffect, forceReducedMotion, getMotionSlowFactor, installMotion, isMotionOff, jelly as jellyEffect, label as labelEffect, leave as leaveEffect, listMotionEffects, morphText, motionEffects, motionStateAttributes, onReducedMotionChange, panel as panelEffect, prefersReducedMotion, press as pressEffect, ring, rollNumber, select as selectEffect, setMotionSlowFactor, shake, slider as sliderEffect, springs, swapIcon, switchKnob as switchEffect, toast as toastEffect, tooltip as tooltipEffect, travel, writeMotionStyle };
|
|
1
|
+
import { c as createSpring, d as setMotionSlowFactor, f as springs, h as prefersReducedMotion, l as getMotionSlowFactor, m as onReducedMotionChange, o as isMotionOff, p as forceReducedMotion } from "./tween-lVMRCUEv.js";
|
|
2
|
+
import { C as disclosure, E as divider, S as jelly, _ as leave, a as shake, b as morphText, c as appear, d as switchKnob, f as slider, g as panel, h as setMotionPressMode, i as travel, l as tooltip, m as press, n as createProgress, o as rollNumber, p as select, r as createMotionList, s as motionEffects, t as createDropField, u as toast, v as buttonIcon, w as check, x as swapIcon, y as label } from "./motion-core-BdTfxAhY.js";
|
|
3
|
+
import { f as writeMotionStyle, i as defineMotionEffect, l as motionStateAttributes, s as listMotionEffects, t as createHoldToDelete } from "./hold-to-delete-CcQbfiQx.js";
|
|
4
|
+
import { t as ring } from "./ring-DoL9jivj.js";
|
|
5
|
+
import { t as installMotion } from "./motion-itHFtXwA.js";
|
|
6
|
+
export { appear as appearEffect, buttonIcon as buttonIconEffect, check as checkEffect, createDropField, createHoldToDelete, createMotionList, createProgress, createSpring, defineMotionEffect, disclosure as disclosureEffect, divider as dividerEffect, forceReducedMotion, getMotionSlowFactor, installMotion, isMotionOff, jelly as jellyEffect, label as labelEffect, leave as leaveEffect, listMotionEffects, morphText, motionEffects, motionStateAttributes, onReducedMotionChange, panel as panelEffect, prefersReducedMotion, press as pressEffect, ring, rollNumber, select as selectEffect, setMotionPressMode, setMotionSlowFactor, shake, slider as sliderEffect, springs, swapIcon, switchKnob as switchEffect, toast as toastEffect, tooltip as tooltipEffect, travel, writeMotionStyle };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { n as useUIComponentOverride } from "./ui-components-CKQAPI-W.js";
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
// src/internal/nuxt-ui.ts
|
|
4
|
+
function uiSdk(name) {
|
|
5
|
+
return defineAsyncComponent({
|
|
6
|
+
loader: () => import("./components-CM5mZe0a.js").then((n) => n.t).then((parts) => parts.uiSdkComponents[name]),
|
|
7
|
+
suspensible: false
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
const defaults = /* @__PURE__ */ new Map();
|
|
11
|
+
/**
|
|
12
|
+
* The component that a part renders for `name`: the one given to `createViteHubUI({ components })`, else one that the
|
|
13
|
+
* app registered globally under that name, else the ui-sdk one from `uiSdkComponents`. Call it in `setup()`.
|
|
14
|
+
*/
|
|
15
|
+
function useUIComponent(name) {
|
|
16
|
+
const own = useUIComponentOverride(name);
|
|
17
|
+
if (own) return own;
|
|
18
|
+
const component = defaults.get(name) ?? uiSdk(name);
|
|
19
|
+
defaults.set(name, component);
|
|
20
|
+
return component;
|
|
21
|
+
}
|
|
22
|
+
export { useUIComponent as t };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as ViteHubUIOptions, t as ViteHubUIIconOptions } from "./config-JmsTI7gs.js";
|
|
2
2
|
/** Name of an icon in the ViteHub set, such as `kv` for `i-vitehub-kv`. */
|
|
3
|
-
type ViteHubIconName = "agent" | "auth" | "blob" | "browser" | "bundle" | "cache" | "channels" | "choices" | "cli" | "cms" | "codemods" | "comments" | "compare" | "connections" | "console" | "content" | "database" | "development" | "device" | "docs" | "email" | "env" | "forge" | "forms" | "gateways" | "guides" | "hosts" | "i18n" | "kv" | "logs" | "markdown-template" | "mcp" | "presets" | "queue" | "rate-limit" | "realtime" | "reference" | "runtime" | "sandbox" | "schedule" | "shell" | "skills" | "source" | "start" | "sync" | "ui" | "usage" | "web-container" | "webhooks" | "workflow" | "workspace";
|
|
3
|
+
type ViteHubIconName = "agent" | "auth" | "blob" | "browser" | "bundle" | "cache" | "channels" | "choices" | "cli" | "cms" | "codemods" | "comments" | "compare" | "connections" | "console" | "content" | "database" | "development" | "device" | "docs" | "email" | "env" | "forge" | "forms" | "gateways" | "guides" | "hosts" | "i18n" | "kv" | "logs" | "markdown-template" | "mcp" | "presets" | "queue" | "rate-limit" | "realtime" | "reference" | "runtime" | "sandbox" | "schedule" | "shell" | "site" | "skills" | "source" | "start" | "sync" | "ui" | "usage" | "web-container" | "webhooks" | "workflow" | "workspace";
|
|
4
4
|
/** The ViteHub icon set in the Iconify JSON format, as `@iconify-json/*` packages export it. */
|
|
5
5
|
interface ViteHubIconSet {
|
|
6
6
|
prefix: "vitehub";
|
|
@@ -53,6 +53,9 @@ type ViteAliasOptions = readonly {
|
|
|
53
53
|
/** The parts of a Nuxt instance that `addViteHubUIRuntime()` uses. */
|
|
54
54
|
export interface ViteHubUIRuntimeNuxt {
|
|
55
55
|
options: {
|
|
56
|
+
build: {
|
|
57
|
+
transpile: Array<string | RegExp | ((context: never) => unknown)>;
|
|
58
|
+
};
|
|
56
59
|
plugins: Array<string | {
|
|
57
60
|
src: string;
|
|
58
61
|
}>;
|
|
@@ -65,10 +68,11 @@ export interface ViteHubUIRuntimeNuxt {
|
|
|
65
68
|
hook: (name: "icon:clientBundleIcons", callback: (icons: Set<string>) => void) => unknown;
|
|
66
69
|
}
|
|
67
70
|
/**
|
|
68
|
-
* Adds what the styled parts need at runtime in a Nuxt app: the plugin that gives them
|
|
71
|
+
* Adds what the styled parts need at runtime in a Nuxt app: the plugin that gives them their icon names, their
|
|
69
72
|
* icons in the `@nuxt/icon` client bundle, because `@nuxt/icon` does not scan dependencies, and Shiki's WebAssembly as a
|
|
70
|
-
* module the server build can bundle. The
|
|
71
|
-
*
|
|
73
|
+
* module the server build can bundle. The plugin imports `#app`, which only Nuxt's bundler resolves, so the package is
|
|
74
|
+
* transpiled: Node cannot load the plugin from `node_modules` during server rendering. The module calls it, and so does
|
|
75
|
+
* `vite-hub/nuxt` when the app installed this package. It is safe to call twice.
|
|
72
76
|
*/
|
|
73
77
|
export declare function addViteHubUIRuntime(nuxt: ViteHubUIRuntimeNuxt): void;
|
|
74
78
|
/**
|
package/dist/nuxt.js
CHANGED
|
@@ -5,7 +5,7 @@ const icons = {
|
|
|
5
5
|
"prefix": "vitehub",
|
|
6
6
|
"info": {
|
|
7
7
|
"name": "ViteHub",
|
|
8
|
-
"total":
|
|
8
|
+
"total": 52,
|
|
9
9
|
"author": {
|
|
10
10
|
"name": "ViteHub",
|
|
11
11
|
"url": "https://github.com/vite-hub/vitehub/tree/main/packages/icons"
|
|
@@ -61,6 +61,7 @@ const icons = {
|
|
|
61
61
|
"sandbox": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 8V5a2 2 0 0 1 2-2h3M16 3h3a2 2 0 0 1 2 2v3M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3\"/><g data-motion=\"\"><rect x=\"8\" y=\"8\" width=\"8\" height=\"8\" rx=\"1.5\"/></g></g>" },
|
|
62
62
|
"schedule": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M3 10h18M8 3v4M16 3v4\"/><g data-motion=\"\"><rect x=\"7\" y=\"13.5\" width=\"3.5\" height=\"3.5\" rx=\"1\"/></g></g>" },
|
|
63
63
|
"shell": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"m7 9.5 3 2.5-3 2.5\"/><g data-motion=\"\"><path d=\"M12.5 15h4.5\"/></g></g>" },
|
|
64
|
+
"site": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M11 5a8 8 0 1 0 8 8M3 13h16M11 5a12 12 0 0 0 0 16 12 12 0 0 0 0-16\"/><rect x=\"15.5\" y=\"6\" width=\"5.5\" height=\"4.5\" rx=\"1\"/><g data-motion=\"\"><path d=\"M17 6V4.75a1.25 1.25 0 0 1 2.5 0V6\"/></g></g>" },
|
|
64
65
|
"skills": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 19V5a2 2 0 0 1 2-2h12v14H7a2 2 0 0 0 0 4h12\"/><g data-motion=\"\"><path d=\"M10 3v6.5l2-1.5 2 1.5V3\"/></g></g>" },
|
|
65
66
|
"source": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5\"/><g data-motion=\"\"><path d=\"M12 3v11.5M8 10.5l4 4 4-4\"/></g></g>" },
|
|
66
67
|
"start": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 21V3.5\"/><g data-motion=\"\"><path d=\"M5 4h13l-3 4.5 3 4.5H5\"/></g></g>" },
|
|
@@ -68,7 +69,7 @@ const icons = {
|
|
|
68
69
|
"ui": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"3.5\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"13.5\" y=\"3.5\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"3.5\" y=\"13.5\" width=\"7\" height=\"7\" rx=\"1.5\"/><g data-motion=\"\"><rect x=\"13.5\" y=\"13.5\" width=\"7\" height=\"7\" rx=\"1.5\"/></g></g>" },
|
|
69
70
|
"usage": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 20.5h18\"/><g data-motion=\"\"><rect x=\"5\" y=\"11\" width=\"3\" height=\"6\" rx=\"0.5\"/><rect x=\"10.5\" y=\"5\" width=\"3\" height=\"12\" rx=\"0.5\"/><rect x=\"16\" y=\"8\" width=\"3\" height=\"9\" rx=\"0.5\"/></g></g>" },
|
|
70
71
|
"web-container": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M3 8.5h18\"/><g data-motion=\"\"><path d=\"m12 11 3.5 2v3.5L12 18.5l-3.5-2V13zM8.5 13l3.5 2 3.5-2M12 15v3.5\"/></g></g>" },
|
|
71
|
-
"webhooks": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
72
|
+
"webhooks": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M17.4 16.48h-5.39c-.99 0-1.76.85-2.23 1.71A3.6 3.6 0 0 1 3 16.5c.01-.63.18-1.26.51-1.8\"/><path d=\"M6.6 16.5l2.82-5.2c.48-.87.09-1.96-.45-2.79a3.6 3.6 0 1 1 6.2-3.65\"/><g data-motion=\"\"><path d=\"M12 6.6l2.82 5.16C15.29 12.63 16.41 12.9 17.4 12.9a3.6 3.6 0 0 1 0 7.2\"/></g></g>" },
|
|
72
73
|
"workflow": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"3\" width=\"6\" height=\"6\" rx=\"1.5\"/><rect x=\"3\" y=\"15\" width=\"6\" height=\"6\" rx=\"1.5\"/><path d=\"M9 6h2.5a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9M12.5 12H15\"/><g data-motion=\"\"><rect x=\"15\" y=\"9\" width=\"6\" height=\"6\" rx=\"1.5\"/></g></g>" },
|
|
73
74
|
"workspace": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/><g data-motion=\"\"><path d=\"M3 11h18\"/></g></g>" }
|
|
74
75
|
},
|
|
@@ -126,7 +127,21 @@ const partFamilies = {
|
|
|
126
127
|
marker: [
|
|
127
128
|
"Marker",
|
|
128
129
|
"MarkerContent",
|
|
129
|
-
"MarkerIcon"
|
|
130
|
+
"MarkerIcon",
|
|
131
|
+
"MarkerSeparator"
|
|
132
|
+
],
|
|
133
|
+
status: [
|
|
134
|
+
"Status",
|
|
135
|
+
"StatusIndicator",
|
|
136
|
+
"StatusLabel"
|
|
137
|
+
],
|
|
138
|
+
"prompt-input": [
|
|
139
|
+
"PromptInput",
|
|
140
|
+
"PromptInputAttach",
|
|
141
|
+
"PromptInputAttachments",
|
|
142
|
+
"PromptInputSubmit",
|
|
143
|
+
"PromptInputTextarea",
|
|
144
|
+
"PromptInputToolbar"
|
|
130
145
|
],
|
|
131
146
|
message: [
|
|
132
147
|
"Message",
|
|
@@ -155,12 +170,12 @@ const partFamilies = {
|
|
|
155
170
|
const componentNames = [
|
|
156
171
|
"Chat",
|
|
157
172
|
"ChatMessage",
|
|
158
|
-
"PromptInput",
|
|
159
173
|
"CodeView",
|
|
160
174
|
"FileView",
|
|
161
175
|
"FileDiff",
|
|
162
176
|
"FileTree",
|
|
163
177
|
"DeviceFrame",
|
|
178
|
+
"DeviceFrameToolbar",
|
|
164
179
|
"Markdown",
|
|
165
180
|
"MessageParts",
|
|
166
181
|
"MultiFileDiff",
|
|
@@ -171,6 +186,7 @@ const componentNames = [
|
|
|
171
186
|
"AgentSessionDetailsSection",
|
|
172
187
|
"AgentSessionTimeline",
|
|
173
188
|
"AgentSessionWorkGroup",
|
|
189
|
+
"AgentSessionTitle",
|
|
174
190
|
"FilterSearch",
|
|
175
191
|
"ToolList",
|
|
176
192
|
"TraceRun",
|
|
@@ -180,7 +196,6 @@ const componentNames = [
|
|
|
180
196
|
"RollNumber",
|
|
181
197
|
"SwapIcon",
|
|
182
198
|
"RelativeTime",
|
|
183
|
-
"Status",
|
|
184
199
|
"MotionList",
|
|
185
200
|
"Progress",
|
|
186
201
|
"DropField",
|
|
@@ -192,7 +207,9 @@ const componentNames = [
|
|
|
192
207
|
...partFamilies.comments,
|
|
193
208
|
...partFamilies["connection-status"],
|
|
194
209
|
...partFamilies.marker,
|
|
210
|
+
...partFamilies.status,
|
|
195
211
|
...partFamilies.message,
|
|
212
|
+
...partFamilies["prompt-input"],
|
|
196
213
|
...partFamilies["sync-status"],
|
|
197
214
|
...partFamilies.trace
|
|
198
215
|
];
|
|
@@ -204,7 +221,6 @@ const viteHubUIIcons = [
|
|
|
204
221
|
"lucide:arrow-up",
|
|
205
222
|
"lucide:arrow-up-right",
|
|
206
223
|
"lucide:bold",
|
|
207
|
-
"lucide:brain",
|
|
208
224
|
"lucide:check",
|
|
209
225
|
"lucide:chevron-down",
|
|
210
226
|
"lucide:chevron-left",
|
|
@@ -212,12 +228,8 @@ const viteHubUIIcons = [
|
|
|
212
228
|
"lucide:chevron-up",
|
|
213
229
|
"lucide:chevrons-left",
|
|
214
230
|
"lucide:chevrons-right",
|
|
215
|
-
"lucide:circle",
|
|
216
231
|
"lucide:circle-alert",
|
|
217
232
|
"lucide:circle-check",
|
|
218
|
-
"lucide:circle-dashed",
|
|
219
|
-
"lucide:circle-minus",
|
|
220
|
-
"lucide:circle-x",
|
|
221
233
|
"lucide:code",
|
|
222
234
|
"lucide:copy",
|
|
223
235
|
"lucide:database",
|
|
@@ -227,74 +239,61 @@ const viteHubUIIcons = [
|
|
|
227
239
|
"lucide:eye",
|
|
228
240
|
"lucide:eye-off",
|
|
229
241
|
"lucide:file",
|
|
230
|
-
"lucide:file-pen-line",
|
|
231
|
-
"lucide:file-text",
|
|
232
|
-
"lucide:files",
|
|
233
242
|
"lucide:folder",
|
|
234
243
|
"lucide:folder-open",
|
|
235
|
-
"lucide:globe",
|
|
236
244
|
"lucide:grip-vertical",
|
|
237
245
|
"lucide:hash",
|
|
238
246
|
"lucide:heading-1",
|
|
239
247
|
"lucide:heading-2",
|
|
240
248
|
"lucide:heading-3",
|
|
241
249
|
"lucide:image",
|
|
242
|
-
"lucide:inbox",
|
|
243
250
|
"lucide:info",
|
|
244
251
|
"lucide:italic",
|
|
245
252
|
"lucide:lightbulb",
|
|
246
253
|
"lucide:link",
|
|
247
254
|
"lucide:list",
|
|
248
|
-
"lucide:list-checks",
|
|
249
255
|
"lucide:list-ordered",
|
|
250
256
|
"lucide:loader-circle",
|
|
251
|
-
"lucide:maximize-2",
|
|
252
257
|
"lucide:menu",
|
|
253
258
|
"lucide:message-circle",
|
|
254
|
-
"lucide:minimize-2",
|
|
255
259
|
"lucide:minus",
|
|
256
260
|
"lucide:monitor",
|
|
257
261
|
"lucide:moon",
|
|
258
262
|
"lucide:panel-left",
|
|
259
263
|
"lucide:panel-left-close",
|
|
260
264
|
"lucide:panel-left-open",
|
|
261
|
-
"lucide:panel-right",
|
|
262
265
|
"lucide:pencil",
|
|
263
266
|
"lucide:play",
|
|
264
|
-
"lucide:plug",
|
|
265
267
|
"lucide:plus",
|
|
266
268
|
"lucide:quote",
|
|
267
269
|
"lucide:refresh-cw",
|
|
268
270
|
"lucide:rotate-ccw",
|
|
269
271
|
"lucide:search",
|
|
270
|
-
"lucide:send",
|
|
271
|
-
"lucide:sparkles",
|
|
272
272
|
"lucide:square",
|
|
273
273
|
"lucide:square-code",
|
|
274
|
-
"lucide:square-menu",
|
|
275
274
|
"lucide:square-pen",
|
|
276
275
|
"lucide:star",
|
|
277
276
|
"lucide:strikethrough",
|
|
278
277
|
"lucide:sun",
|
|
279
|
-
"lucide:terminal",
|
|
280
278
|
"lucide:text-wrap",
|
|
281
279
|
"lucide:trash-2",
|
|
282
280
|
"lucide:triangle-alert",
|
|
283
281
|
"lucide:type",
|
|
284
282
|
"lucide:upload",
|
|
285
|
-
"lucide:wrench",
|
|
286
283
|
"lucide:x"
|
|
287
284
|
];
|
|
288
285
|
// src/nuxt.ts
|
|
289
286
|
/**
|
|
290
|
-
* Adds what the styled parts need at runtime in a Nuxt app: the plugin that gives them
|
|
287
|
+
* Adds what the styled parts need at runtime in a Nuxt app: the plugin that gives them their icon names, their
|
|
291
288
|
* icons in the `@nuxt/icon` client bundle, because `@nuxt/icon` does not scan dependencies, and Shiki's WebAssembly as a
|
|
292
|
-
* module the server build can bundle. The
|
|
293
|
-
*
|
|
289
|
+
* module the server build can bundle. The plugin imports `#app`, which only Nuxt's bundler resolves, so the package is
|
|
290
|
+
* transpiled: Node cannot load the plugin from `node_modules` during server rendering. The module calls it, and so does
|
|
291
|
+
* `vite-hub/nuxt` when the app installed this package. It is safe to call twice.
|
|
294
292
|
*/
|
|
295
293
|
function addViteHubUIRuntime(nuxt) {
|
|
296
294
|
const plugin = createResolver(import.meta.url).resolve("./runtime/nuxt-plugin.js");
|
|
297
295
|
if (!nuxt.options.plugins.some((entry) => (typeof entry === "string" ? entry : entry.src) === plugin)) nuxt.options.plugins.push(plugin);
|
|
296
|
+
if (!nuxt.options.build.transpile.includes("@vite-hub/ui")) nuxt.options.build.transpile.push("@vite-hub/ui");
|
|
298
297
|
nuxt.hook("icon:clientBundleIcons", (icons) => {
|
|
299
298
|
for (const icon of viteHubUIIcons) icons.add(icon);
|
|
300
299
|
});
|
|
@@ -355,10 +354,7 @@ const viteHubUINuxtModule = defineNuxtModule({
|
|
|
355
354
|
name: "@vite-hub/ui"
|
|
356
355
|
},
|
|
357
356
|
defaults: {},
|
|
358
|
-
moduleDependencies:
|
|
359
|
-
"@nuxt/ui": {},
|
|
360
|
-
...viteHubUIIconDependencies
|
|
361
|
-
},
|
|
357
|
+
moduleDependencies: viteHubUIIconDependencies,
|
|
362
358
|
async setup({ prefix = "", ...options }, nuxt) {
|
|
363
359
|
const resolver = createResolver(import.meta.url);
|
|
364
360
|
nuxt.options.css.push(resolver.resolve("./styles.css"));
|