@vite-hub/ui 0.6.1 → 0.8.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 +106 -46
- package/dist/AttachmentTitle-BWw0ck0T.js +110 -0
- package/dist/BubbleContent-B1a4e3vE.js +45 -0
- package/dist/Chat-CuSthJVg.js +112 -0
- package/dist/ChatMessage-CFQs0v4N.js +94 -0
- package/dist/CodeBlockContent-BjXJm8lO.js +92 -0
- package/dist/CodeBlockTitle-DIu8Ef3V.js +99 -0
- package/dist/CommentRow-XY3FNp30.js +86 -0
- package/dist/CopyButton-Bs6DT-Z8.js +188 -0
- package/dist/Markdown-Da5t-931.js +70 -0
- package/dist/MarkdownCodeBlock-BWDLOWPO.js +127 -0
- package/dist/MarkdownImage-CJN3myt4.js +111 -0
- package/dist/MessageHeader-CJ9eBHSS.js +61 -0
- package/dist/MessageParts-CyJLG34y.js +57 -0
- package/dist/MessageScrollerViewport-BaTlWLki.js +142 -0
- package/dist/MorphText-B6MWdeIv.js +36 -0
- package/dist/RollNumber-CnF52zJM.js +49 -0
- package/dist/SwapIcon-CUIq1TU5.js +67 -0
- package/dist/TraceTitle-Cp0y7RRD.js +133 -0
- package/dist/agent-session-2j2gbGpp.js +875 -0
- package/dist/agent-session-BwZSMi4S.d.ts +312 -0
- 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-CoLlsmwJ.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-cxUzvwdj.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-BqOEVWPh.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-DmDM3XYP.d.ts → comment-composer-CsVOvG9j.d.ts} +6 -6
- package/dist/{comment-composer-X7vJKh5b.js → comment-composer-D_mcH3Ts.js} +175 -37
- package/dist/{comment-layer-KnnVfdRV.d.ts → comment-layer-C3xmg-0_.d.ts} +14 -5
- package/dist/comment-layer-Ci6ipGi2.js +1206 -0
- package/dist/{comment-panel-DoLDOw3E.d.ts → comment-panel-DxN21VoY.d.ts} +24 -17
- package/dist/comment-selection-bar-B_bchB2O.d.ts +33 -0
- package/dist/comment-selection-bar-DZAtiRZ9.js +144 -0
- package/dist/{comment-thread-DPV2kqA4.d.ts → comment-thread-BmsqcjVQ.d.ts} +9 -8
- package/dist/{comment-thread-jqPx6aJ8.js → comment-thread-BzOZVqF2.js} +74 -49
- package/dist/comments-BU8cTt5o.d.ts +50 -0
- package/dist/{comments-9MDSNm-9.js → comments-BaSrroRV.js} +32 -4
- package/dist/{comments-OWjNidkP.d.ts → comments-ZfV6IZs8.d.ts} +9 -2
- package/dist/components-B_2Q0dJ3.js +269 -0
- package/dist/{config-LRonN53j.js → config-BDQYUjjp.js} +10 -29
- 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-DeIvKoJs.js +77 -0
- package/dist/editor-BsOTjnnN.d.ts +540 -0
- package/dist/{markdown-editor-D1irG9Xl.js → editor-hXea1i46.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-D1Vy40w5.js} +138 -20
- package/dist/hold-to-delete-DazElJT2.js +85 -0
- package/dist/hold-to-delete-ksBE7wxc.d.ts +58 -0
- package/dist/index-CffOzibW.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 +126 -670
- package/dist/markdown-BLALLOc0.d.ts +45 -0
- package/dist/{parts/components/markdown-renderer.d.ts → markdown-DkDxdpMU.d.ts} +10 -7
- package/dist/{markdown-renderer-DMyYKeil.js → markdown-_0HhbsOo.js} +125 -127
- 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/{install-C4LwcJda.js → motion-BhARaNBB.js} +1 -1
- package/dist/{effects-C1zYpSpg.js → motion-core-JZZiPKEk.js} +1829 -120
- package/dist/{motion-core-Dh20n5Se.d.ts → motion-core-gfsTPLbh.d.ts} +35 -74
- package/dist/motion-list-9vD1hSS0.js +49 -0
- package/dist/motion.d.ts +5 -14
- package/dist/motion.js +6 -13
- package/dist/nuxt-ui-D3Qda35W.js +22 -0
- package/dist/nuxt.d.ts +9 -5
- package/dist/nuxt.js +28 -33
- 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 +5 -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 +1 -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 +5 -163
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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-8P8RLYMy.js +47 -0
- package/dist/progress-Ch0fA-bf.d.ts +8 -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-B0nZBnU0.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 +4348 -3410
- package/dist/sync-status-B29eG_n-.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-1W-LlKk9.js} +65 -2
- package/dist/types-CMU8Vmew.d.ts +71 -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/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-BdA18K5-.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 +46 -15
- package/dist/announce-B0DLwflT.js +0 -31
- 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-send.css +0 -267
- 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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { App, ComputedRef, Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* A date as a reader would see it. `datetime` is the ISO date (or the UTC instant, with a time), `label` what the page
|
|
4
|
+
* shows, `tip` the tooltip's text, and `mode` whether `label` is relative words or a date.
|
|
5
|
+
*/
|
|
6
|
+
type TimeDescription = {
|
|
7
|
+
datetime: string;
|
|
8
|
+
mode: "relative" | "absolute";
|
|
9
|
+
label: string;
|
|
10
|
+
tip: string;
|
|
11
|
+
};
|
|
12
|
+
/** A moment: milliseconds, a `Date`, or an ISO string. A date alone, such as `2026-10-12`, is a calendar day. */
|
|
13
|
+
type RelativeTimeValue = number | string | Date;
|
|
14
|
+
/** How long the words are: `long` ("3 weeks ago"), `short` ("3 wk. ago"), or `narrow` ("3w ago"). */
|
|
15
|
+
type RelativeTimeFormat = "long" | "short" | "narrow";
|
|
16
|
+
/** What `useRelativeTime()` reads on every render. */
|
|
17
|
+
interface RelativeTimeOptions {
|
|
18
|
+
at: RelativeTimeValue;
|
|
19
|
+
/** How far from now the label becomes a date, as a number and a unit (`s`, `m`, `h`, `d`, `w`, `mo`, `y`), or `none`. */
|
|
20
|
+
threshold: string;
|
|
21
|
+
format: RelativeTimeFormat;
|
|
22
|
+
/** A BCP 47 tag for the words and the date. */
|
|
23
|
+
locale: string;
|
|
24
|
+
}
|
|
25
|
+
/** The words of a `RelativeTime`, and its tooltip text once the reader's zone is known. */
|
|
26
|
+
interface RelativeTimeState {
|
|
27
|
+
time: ComputedRef<TimeDescription | undefined>;
|
|
28
|
+
tip: ComputedRef<string | undefined>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gives every `RelativeTime` below the clock that it counts from, in milliseconds. The server and the browser must
|
|
32
|
+
* start from the same value, so the first render in the browser matches the HTML. The `vite-hub/ui/nuxt` module gives
|
|
33
|
+
* one: the request time from the payload, then the browser clock every 30 s while the tab is visible. Call it in
|
|
34
|
+
* `setup()`, or pass the `app` to call it from a plugin.
|
|
35
|
+
*/
|
|
36
|
+
declare function provideRelativeNow(now: Readonly<Ref<number>>, app?: App): void;
|
|
37
|
+
/**
|
|
38
|
+
* The words of a moment that stay current: "5 minutes ago" while it is less than `threshold` away, then "Oct 12", or
|
|
39
|
+
* "Oct 12, 2025" in another year. Until it mounts, a date is the UTC one, so the server and the first render in the
|
|
40
|
+
* browser agree. Without a provided clock, it shows the date alone until the browser clock is known.
|
|
41
|
+
*/
|
|
42
|
+
declare function useRelativeTime(options: () => RelativeTimeOptions): RelativeTimeState;
|
|
43
|
+
export { provideRelativeNow as a, RelativeTimeValue as i, RelativeTimeOptions as n, useRelativeTime as o, RelativeTimeState as r, RelativeTimeFormat as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { t as uiErrorDiagnostics } from "./error-diagnostics-BlgA9rI2.js";
|
|
2
|
-
import {
|
|
3
|
-
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, provide, ref, shallowRef } from "vue";
|
|
2
|
+
import { computed, inject, onBeforeUnmount, onMounted, provide, ref, shallowRef } from "vue";
|
|
4
3
|
// src/internal/describe-time.ts
|
|
5
4
|
/**
|
|
6
5
|
* Describes a date or an instant against `now`: "3 days ago" with the full date as its tip while it's closer than
|
|
@@ -58,7 +57,7 @@ function describeTime(at, options = {}) {
|
|
|
58
57
|
return Date.UTC(p.year, p.month - 1, p.day, p.hour, p.minute, p.second) - Math.floor(moment / 1e3) * 1e3;
|
|
59
58
|
};
|
|
60
59
|
const read = (value) => {
|
|
61
|
-
const match = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d
|
|
60
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?\s*(Z|[+-]\d{2}:?\d{2})?)?$/i.exec(value);
|
|
62
61
|
if (!match) return void 0;
|
|
63
62
|
const [year, month, day, hour, minute, second] = [
|
|
64
63
|
1,
|
|
@@ -68,7 +67,7 @@ function describeTime(at, options = {}) {
|
|
|
68
67
|
5,
|
|
69
68
|
6
|
|
70
69
|
].map((index) => Number(match[index] ?? 0));
|
|
71
|
-
const stamp = Date.UTC(year, month - 1, day, hour, minute, second, Number((match[7] ?? "").padEnd(3, "0")));
|
|
70
|
+
const stamp = Date.UTC(year, month - 1, day, hour, minute, second, Number((match[7] ?? "").slice(0, 3).padEnd(3, "0")));
|
|
72
71
|
const check = new Date(stamp);
|
|
73
72
|
if (check.getUTCFullYear() !== year || check.getUTCMonth() !== month - 1 || check.getUTCDate() !== day || hour > 23 || minute > 59 || second > 59) return void 0;
|
|
74
73
|
if (match[4] === void 0) return {
|
|
@@ -178,7 +177,7 @@ function holdSharedNow() {
|
|
|
178
177
|
function releaseSharedNow() {
|
|
179
178
|
if (--holders === 0) stopShared?.();
|
|
180
179
|
}
|
|
181
|
-
// src/
|
|
180
|
+
// src/headless/relative-time.ts
|
|
182
181
|
/**
|
|
183
182
|
* Gives every `RelativeTime` below the clock that it counts from, in milliseconds. The server and the browser must
|
|
184
183
|
* start from the same value, so the first render in the browser matches the HTML. The `vite-hub/ui/nuxt` module gives
|
|
@@ -191,116 +190,67 @@ function provideRelativeNow(now, app) {
|
|
|
191
190
|
}
|
|
192
191
|
const NOW_WINDOW = 6e4;
|
|
193
192
|
/**
|
|
194
|
-
*
|
|
195
|
-
* "Oct 12, 2025" in another year.
|
|
196
|
-
*
|
|
193
|
+
* The words of a moment that stay current: "5 minutes ago" while it is less than `threshold` away, then "Oct 12", or
|
|
194
|
+
* "Oct 12, 2025" in another year. Until it mounts, a date is the UTC one, so the server and the first render in the
|
|
195
|
+
* browser agree. Without a provided clock, it shows the date alone until the browser clock is known.
|
|
197
196
|
*/
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
/** A BCP 47 tag for the words and the date. */
|
|
220
|
-
locale: {
|
|
221
|
-
default: "en",
|
|
222
|
-
type: String
|
|
223
|
-
},
|
|
224
|
-
tooltip: {
|
|
225
|
-
default: true,
|
|
226
|
-
type: Boolean
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
setup(props, { attrs }) {
|
|
230
|
-
const UTooltip = useTooltipComponent();
|
|
231
|
-
const provided = inject(relativeNowKey, void 0);
|
|
232
|
-
const fallback = shallowRef();
|
|
233
|
-
const mounted = ref(false);
|
|
234
|
-
onMounted(() => {
|
|
235
|
-
if (!provided) fallback.value = holdSharedNow();
|
|
236
|
-
mounted.value = true;
|
|
237
|
-
});
|
|
238
|
-
onBeforeUnmount(() => {
|
|
239
|
-
if (fallback.value) releaseSharedNow();
|
|
240
|
-
});
|
|
241
|
-
const now = computed(() => provided?.value ?? fallback.value?.value);
|
|
242
|
-
const describe = (timeZone) => {
|
|
243
|
-
const at = now.value;
|
|
244
|
-
if (at === void 0) return void 0;
|
|
245
|
-
const options = {
|
|
246
|
-
locale: props.locale,
|
|
247
|
-
style: props.format,
|
|
248
|
-
threshold: props.threshold,
|
|
249
|
-
timeZone
|
|
250
|
-
};
|
|
251
|
-
const time = describeTime(props.at, {
|
|
252
|
-
...options,
|
|
253
|
-
now: at
|
|
254
|
-
});
|
|
255
|
-
if (!time?.datetime.includes("T")) return time;
|
|
256
|
-
const instant = Date.parse(time.datetime);
|
|
257
|
-
return Math.abs(instant - at) < NOW_WINDOW ? describeTime(props.at, {
|
|
258
|
-
...options,
|
|
259
|
-
now: instant
|
|
260
|
-
}) : time;
|
|
197
|
+
function useRelativeTime(options) {
|
|
198
|
+
const provided = inject(relativeNowKey, void 0);
|
|
199
|
+
const fallback = shallowRef();
|
|
200
|
+
const mounted = ref(false);
|
|
201
|
+
onMounted(() => {
|
|
202
|
+
if (!provided) fallback.value = holdSharedNow();
|
|
203
|
+
mounted.value = true;
|
|
204
|
+
});
|
|
205
|
+
onBeforeUnmount(() => {
|
|
206
|
+
if (fallback.value) releaseSharedNow();
|
|
207
|
+
});
|
|
208
|
+
const now = computed(() => provided?.value ?? fallback.value?.value);
|
|
209
|
+
const describe = (timeZone) => {
|
|
210
|
+
const at = now.value;
|
|
211
|
+
if (at === void 0) return void 0;
|
|
212
|
+
const { at: value, format, locale, threshold } = options();
|
|
213
|
+
const settings = {
|
|
214
|
+
locale,
|
|
215
|
+
style: format,
|
|
216
|
+
threshold,
|
|
217
|
+
timeZone
|
|
261
218
|
};
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
locale: props.locale,
|
|
266
|
-
now: props.at,
|
|
267
|
-
threshold: "none",
|
|
268
|
-
timeZone: "UTC"
|
|
269
|
-
});
|
|
270
|
-
if (!time) return void 0;
|
|
271
|
-
const label = new Intl.DateTimeFormat(props.locale, {
|
|
272
|
-
day: "numeric",
|
|
273
|
-
month: "short",
|
|
274
|
-
timeZone: "UTC",
|
|
275
|
-
year: "numeric"
|
|
276
|
-
}).format(Date.parse(time.datetime));
|
|
277
|
-
return {
|
|
278
|
-
...time,
|
|
279
|
-
label,
|
|
280
|
-
mode: "absolute"
|
|
281
|
-
};
|
|
219
|
+
const time = describeTime(value, {
|
|
220
|
+
...settings,
|
|
221
|
+
now: at
|
|
282
222
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
223
|
+
if (!time?.datetime.includes("T")) return time;
|
|
224
|
+
const instant = Date.parse(time.datetime);
|
|
225
|
+
return Math.abs(instant - at) < NOW_WINDOW ? describeTime(value, {
|
|
226
|
+
...settings,
|
|
227
|
+
now: instant
|
|
228
|
+
}) : time;
|
|
229
|
+
};
|
|
230
|
+
const date = computed(() => {
|
|
231
|
+
const { at, locale } = options();
|
|
232
|
+
const time = describeTime(at, {
|
|
233
|
+
locale,
|
|
234
|
+
now: 0,
|
|
235
|
+
threshold: "none",
|
|
236
|
+
timeZone: "UTC"
|
|
237
|
+
});
|
|
238
|
+
if (!time) return void 0;
|
|
239
|
+
const label = new Intl.DateTimeFormat(locale, {
|
|
240
|
+
day: "numeric",
|
|
241
|
+
month: "short",
|
|
242
|
+
timeZone: "UTC",
|
|
243
|
+
year: "numeric"
|
|
244
|
+
}).format(Date.parse(time.datetime));
|
|
245
|
+
return {
|
|
246
|
+
...time,
|
|
247
|
+
label,
|
|
248
|
+
mode: "absolute"
|
|
303
249
|
};
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
time: computed(() => describe(mounted.value ? void 0 : "UTC") ?? date.value),
|
|
253
|
+
tip: computed(() => mounted.value ? describe()?.tip : void 0)
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
export { useRelativeTime as n, startRelativeClock as r, provideRelativeNow as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { i as RelativeTimeValue, t as RelativeTimeFormat } from "./relative-time-BuP-Gvzn.js";
|
|
2
|
+
interface RelativeTimeProps {
|
|
3
|
+
at: RelativeTimeValue;
|
|
4
|
+
threshold?: string;
|
|
5
|
+
format?: RelativeTimeFormat;
|
|
6
|
+
locale?: string;
|
|
7
|
+
plain?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const __VLS_export: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<RelativeTimeProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<RelativeTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export { RelativeTimeProps as n, _default as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as tween, r as easeOut } from "./tween-Dv3IIIQG.js";
|
|
1
|
+
import { a as tween, c as createSpring, h as prefersReducedMotion, o as isMotionOff, r as easeOut } from "./tween-1W-LlKk9.js";
|
|
3
2
|
// src/motion/helpers/frame.ts
|
|
4
3
|
const ownNodes = /* @__PURE__ */ new WeakSet();
|
|
5
4
|
function own(node) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { defineAsyncComponent } from "vue";
|
|
1
|
+
import { r as startRelativeClock, t as provideRelativeNow } from "../relative-time-Dz2DR4eb.js";
|
|
2
|
+
import { t as createViteHubUI } from "../config-BDQYUjjp.js";
|
|
4
3
|
import { defineNuxtPlugin, useAppConfig, useRuntimeConfig, useState } from "#app";
|
|
5
4
|
// src/runtime/nuxt-plugin.ts
|
|
6
5
|
const viteHubUIPlugin = defineNuxtPlugin((nuxtApp) => {
|
|
7
6
|
const options = useRuntimeConfig().public.viteHubUI;
|
|
8
|
-
const UIcon = defineAsyncComponent(() => import("@nuxt/ui/components/Icon.vue"));
|
|
9
7
|
const appConfig = useAppConfig();
|
|
10
8
|
const icons = () => ({
|
|
11
9
|
...iconsIn(appConfig, "ui"),
|
|
@@ -13,7 +11,6 @@ const viteHubUIPlugin = defineNuxtPlugin((nuxtApp) => {
|
|
|
13
11
|
});
|
|
14
12
|
nuxtApp.vueApp.use(createViteHubUI({
|
|
15
13
|
...options,
|
|
16
|
-
components: { UIcon },
|
|
17
14
|
icons
|
|
18
15
|
}));
|
|
19
16
|
const now = useState("vite-hub-ui:now", () => Date.now());
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
1
|
+
import { a as RegisteredCustomLanguages, i as AttachedLanguages, n as debounce, o as ResolvedLanguages, s as ResolvingLanguages } from "./utils-hi9-xROt.js";
|
|
2
|
+
import { o as lineChangesOf, s as moveLineEntries, t as appendItems, v as createDiffsThemeResolver, y as isWorkerContext } from "./appendItems-hQ4aBd9Q.js";
|
|
3
|
+
import { n as DiffsHighlighter, r as DiffsEditorTokenizer, t as BaseStreamTokenizer } from "./stream-tokenizer-BsjV6wxW.js";
|
|
3
4
|
import { EncodedTokenMetadata, INITIAL } from "shiki/textmate";
|
|
4
5
|
import { createCssVariablesTheme, createHighlighterCore } from "shiki/core";
|
|
5
6
|
// ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.js
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { t as uiComponentsKey } from "./ui-components-CKQAPI-W.js";
|
|
2
|
+
import { defineComponent, getCurrentInstance, h, inject } from "vue";
|
|
3
|
+
import { Button } from "@ui-sdk/vue/button";
|
|
4
|
+
// src/internal/icon-shapes.ts
|
|
5
|
+
/** The stroke of every Lucide icon. An icon drawn from shapes without it sets it on its `<svg>`. */
|
|
6
|
+
const lucideStroke = {
|
|
7
|
+
fill: "none",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
"stroke-linecap": "round",
|
|
10
|
+
"stroke-linejoin": "round",
|
|
11
|
+
"stroke-width": "2"
|
|
12
|
+
};
|
|
13
|
+
// src/ui-sdk/icons.ts
|
|
14
|
+
const uiSdkIcons = {
|
|
15
|
+
"i-lucide-arrow-down": [["path", { "d": "M12 5v14m7-7l-7 7l-7-7" }]],
|
|
16
|
+
"i-lucide-arrow-left": [["path", { "d": "m12 19l-7-7l7-7m7 7H5" }]],
|
|
17
|
+
"i-lucide-arrow-right": [["path", { "d": "M5 12h14m-7-7l7 7l-7 7" }]],
|
|
18
|
+
"i-lucide-arrow-up": [["path", { "d": "m5 12l7-7l7 7m-7 7V5" }]],
|
|
19
|
+
"i-lucide-arrow-up-right": [["path", { "d": "M7 7h10v10M7 17L17 7" }]],
|
|
20
|
+
"i-lucide-bold": [["path", { "d": "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" }]],
|
|
21
|
+
"i-lucide-check": [["path", { "d": "M20 6L9 17l-5-5" }]],
|
|
22
|
+
"i-lucide-chevron-down": [["path", { "d": "m6 9l6 6l6-6" }]],
|
|
23
|
+
"i-lucide-chevron-left": [["path", { "d": "m15 18l-6-6l6-6" }]],
|
|
24
|
+
"i-lucide-chevron-right": [["path", { "d": "m9 18l6-6l-6-6" }]],
|
|
25
|
+
"i-lucide-chevron-up": [["path", { "d": "m18 15l-6-6l-6 6" }]],
|
|
26
|
+
"i-lucide-chevrons-left": [["path", { "d": "m11 17l-5-5l5-5m7 10l-5-5l5-5" }]],
|
|
27
|
+
"i-lucide-chevrons-right": [["path", { "d": "m6 17l5-5l-5-5m7 10l5-5l-5-5" }]],
|
|
28
|
+
"i-lucide-circle-alert": [["circle", {
|
|
29
|
+
"cx": "12",
|
|
30
|
+
"cy": "12",
|
|
31
|
+
"r": "10"
|
|
32
|
+
}], ["path", { "d": "M12 8v4m0 4h.01" }]],
|
|
33
|
+
"i-lucide-circle-check": [["circle", {
|
|
34
|
+
"cx": "12",
|
|
35
|
+
"cy": "12",
|
|
36
|
+
"r": "10"
|
|
37
|
+
}], ["path", { "d": "m16 9l-5.5 5.5L8 12" }]],
|
|
38
|
+
"i-lucide-code": [["path", { "d": "m16 18l6-6l-6-6M8 6l-6 6l6 6" }]],
|
|
39
|
+
"i-lucide-copy": [["rect", {
|
|
40
|
+
"width": "14",
|
|
41
|
+
"height": "14",
|
|
42
|
+
"x": "8",
|
|
43
|
+
"y": "8",
|
|
44
|
+
"rx": "2",
|
|
45
|
+
"ry": "2"
|
|
46
|
+
}], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]],
|
|
47
|
+
"i-lucide-database": [
|
|
48
|
+
["ellipse", {
|
|
49
|
+
"cx": "12",
|
|
50
|
+
"cy": "5",
|
|
51
|
+
"rx": "9",
|
|
52
|
+
"ry": "3"
|
|
53
|
+
}],
|
|
54
|
+
["path", { "d": "M3 5v14a9 3 0 0 0 18 0V5" }],
|
|
55
|
+
["path", { "d": "M3 12a9 3 0 0 0 18 0" }]
|
|
56
|
+
],
|
|
57
|
+
"i-lucide-download": [["path", { "d": "M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10l5 5l5-5" }]],
|
|
58
|
+
"i-lucide-ellipsis": [
|
|
59
|
+
["circle", {
|
|
60
|
+
"cx": "12",
|
|
61
|
+
"cy": "12",
|
|
62
|
+
"r": "1"
|
|
63
|
+
}],
|
|
64
|
+
["circle", {
|
|
65
|
+
"cx": "19",
|
|
66
|
+
"cy": "12",
|
|
67
|
+
"r": "1"
|
|
68
|
+
}],
|
|
69
|
+
["circle", {
|
|
70
|
+
"cx": "5",
|
|
71
|
+
"cy": "12",
|
|
72
|
+
"r": "1"
|
|
73
|
+
}]
|
|
74
|
+
],
|
|
75
|
+
"i-lucide-external-link": [["path", { "d": "M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]],
|
|
76
|
+
"i-lucide-eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0" }], ["circle", {
|
|
77
|
+
"cx": "12",
|
|
78
|
+
"cy": "12",
|
|
79
|
+
"r": "3"
|
|
80
|
+
}]],
|
|
81
|
+
"i-lucide-eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20" }]],
|
|
82
|
+
"i-lucide-file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]],
|
|
83
|
+
"i-lucide-folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]],
|
|
84
|
+
"i-lucide-folder-open": [["path", { "d": "m6 14l1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }]],
|
|
85
|
+
"i-lucide-grip-vertical": [
|
|
86
|
+
["circle", {
|
|
87
|
+
"cx": "9",
|
|
88
|
+
"cy": "12",
|
|
89
|
+
"r": "1"
|
|
90
|
+
}],
|
|
91
|
+
["circle", {
|
|
92
|
+
"cx": "9",
|
|
93
|
+
"cy": "5",
|
|
94
|
+
"r": "1"
|
|
95
|
+
}],
|
|
96
|
+
["circle", {
|
|
97
|
+
"cx": "9",
|
|
98
|
+
"cy": "19",
|
|
99
|
+
"r": "1"
|
|
100
|
+
}],
|
|
101
|
+
["circle", {
|
|
102
|
+
"cx": "15",
|
|
103
|
+
"cy": "12",
|
|
104
|
+
"r": "1"
|
|
105
|
+
}],
|
|
106
|
+
["circle", {
|
|
107
|
+
"cx": "15",
|
|
108
|
+
"cy": "5",
|
|
109
|
+
"r": "1"
|
|
110
|
+
}],
|
|
111
|
+
["circle", {
|
|
112
|
+
"cx": "15",
|
|
113
|
+
"cy": "19",
|
|
114
|
+
"r": "1"
|
|
115
|
+
}]
|
|
116
|
+
],
|
|
117
|
+
"i-lucide-hash": [["path", { "d": "M4 9h16M4 15h16M10 3L8 21m8-18l-2 18" }]],
|
|
118
|
+
"i-lucide-heading-1": [["path", { "d": "M4 12h8m-8 6V6m8 12V6m5 6l3-2v8" }]],
|
|
119
|
+
"i-lucide-heading-2": [["path", { "d": "M4 12h8m-8 6V6m8 12V6m9 12h-4c0-4 4-3 4-6c0-1.5-2-2.5-4-1" }]],
|
|
120
|
+
"i-lucide-heading-3": [["path", { "d": "M4 12h8m-8 6V6m8 12V6m5.5 4.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2m-2 3.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" }]],
|
|
121
|
+
"i-lucide-image": [
|
|
122
|
+
["rect", {
|
|
123
|
+
"width": "18",
|
|
124
|
+
"height": "18",
|
|
125
|
+
"x": "3",
|
|
126
|
+
"y": "3",
|
|
127
|
+
"rx": "2",
|
|
128
|
+
"ry": "2"
|
|
129
|
+
}],
|
|
130
|
+
["circle", {
|
|
131
|
+
"cx": "9",
|
|
132
|
+
"cy": "9",
|
|
133
|
+
"r": "2"
|
|
134
|
+
}],
|
|
135
|
+
["path", { "d": "m21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]
|
|
136
|
+
],
|
|
137
|
+
"i-lucide-info": [["circle", {
|
|
138
|
+
"cx": "12",
|
|
139
|
+
"cy": "12",
|
|
140
|
+
"r": "10"
|
|
141
|
+
}], ["path", { "d": "M12 16v-4m0-4h.01" }]],
|
|
142
|
+
"i-lucide-italic": [["path", { "d": "M19 4h-9m4 16H5M15 4L9 20" }]],
|
|
143
|
+
"i-lucide-lightbulb": [["path", { "d": "M15 14c.2-1 .7-1.7 1.5-2.5c1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5c.7.7 1.3 1.5 1.5 2.5m0 4h6m-5 4h4" }]],
|
|
144
|
+
"i-lucide-link": [["path", { "d": "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }], ["path", { "d": "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" }]],
|
|
145
|
+
"i-lucide-list": [["path", { "d": "M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13" }]],
|
|
146
|
+
"i-lucide-list-ordered": [["path", { "d": "M11 5h10m-10 7h10m-10 7h10M4 4h1v5M4 9h2m.5 11H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" }]],
|
|
147
|
+
"i-lucide-loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]],
|
|
148
|
+
"i-lucide-menu": [["path", { "d": "M4 5h16M4 12h16M4 19h16" }]],
|
|
149
|
+
"i-lucide-message-circle": [["path", { "d": "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719" }]],
|
|
150
|
+
"i-lucide-minus": [["path", { "d": "M5 12h14" }]],
|
|
151
|
+
"i-lucide-monitor": [["rect", {
|
|
152
|
+
"width": "20",
|
|
153
|
+
"height": "14",
|
|
154
|
+
"x": "2",
|
|
155
|
+
"y": "3",
|
|
156
|
+
"rx": "2"
|
|
157
|
+
}], ["path", { "d": "M8 21h8m-4-4v4" }]],
|
|
158
|
+
"i-lucide-moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]],
|
|
159
|
+
"i-lucide-panel-left": [["rect", {
|
|
160
|
+
"width": "18",
|
|
161
|
+
"height": "18",
|
|
162
|
+
"x": "3",
|
|
163
|
+
"y": "3",
|
|
164
|
+
"rx": "2"
|
|
165
|
+
}], ["path", { "d": "M9 3v18" }]],
|
|
166
|
+
"i-lucide-panel-left-close": [["rect", {
|
|
167
|
+
"width": "18",
|
|
168
|
+
"height": "18",
|
|
169
|
+
"x": "3",
|
|
170
|
+
"y": "3",
|
|
171
|
+
"rx": "2"
|
|
172
|
+
}], ["path", { "d": "M9 3v18m7-6l-3-3l3-3" }]],
|
|
173
|
+
"i-lucide-panel-left-open": [["rect", {
|
|
174
|
+
"width": "18",
|
|
175
|
+
"height": "18",
|
|
176
|
+
"x": "3",
|
|
177
|
+
"y": "3",
|
|
178
|
+
"rx": "2"
|
|
179
|
+
}], ["path", { "d": "M9 3v18m5-12l3 3l-3 3" }]],
|
|
180
|
+
"i-lucide-pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4" }]],
|
|
181
|
+
"i-lucide-play": [["path", { "d": "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }]],
|
|
182
|
+
"i-lucide-plus": [["path", { "d": "M5 12h14m-7-7v14" }]],
|
|
183
|
+
"i-lucide-quote": [["path", { "d": "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1a6 6 0 0 0 6-6V5a2 2 0 0 0-2-2zM5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1a6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z" }]],
|
|
184
|
+
"i-lucide-refresh-cw": [
|
|
185
|
+
["path", { "d": "M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8" }],
|
|
186
|
+
["path", { "d": "M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16" }],
|
|
187
|
+
["path", { "d": "M8 16H3v5" }]
|
|
188
|
+
],
|
|
189
|
+
"i-lucide-rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]],
|
|
190
|
+
"i-lucide-search": [["path", { "d": "m21 21l-4.34-4.34" }], ["circle", {
|
|
191
|
+
"cx": "11",
|
|
192
|
+
"cy": "11",
|
|
193
|
+
"r": "8"
|
|
194
|
+
}]],
|
|
195
|
+
"i-lucide-square": [["rect", {
|
|
196
|
+
"width": "18",
|
|
197
|
+
"height": "18",
|
|
198
|
+
"x": "3",
|
|
199
|
+
"y": "3",
|
|
200
|
+
"rx": "2"
|
|
201
|
+
}]],
|
|
202
|
+
"i-lucide-square-code": [["path", { "d": "m10 9l-3 3l3 3m4 0l3-3l-3-3" }], ["rect", {
|
|
203
|
+
"width": "18",
|
|
204
|
+
"height": "18",
|
|
205
|
+
"x": "3",
|
|
206
|
+
"y": "3",
|
|
207
|
+
"rx": "2"
|
|
208
|
+
}]],
|
|
209
|
+
"i-lucide-square-pen": [["path", { "d": "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }], ["path", { "d": "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" }]],
|
|
210
|
+
"i-lucide-star": [["path", { "d": "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.12 2.12 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16z" }]],
|
|
211
|
+
"i-lucide-strikethrough": [["path", { "d": "M16 4H9a3 3 0 0 0-2.83 4M14 12a4 4 0 0 1 0 8H6m-2-8h16" }]],
|
|
212
|
+
"i-lucide-sun": [["circle", {
|
|
213
|
+
"cx": "12",
|
|
214
|
+
"cy": "12",
|
|
215
|
+
"r": "4"
|
|
216
|
+
}], ["path", { "d": "M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41" }]],
|
|
217
|
+
"i-lucide-text-wrap": [["path", { "d": "m16 16l-3 3l3 3" }], ["path", { "d": "M3 12h14.5a1 1 0 0 1 0 7H13M3 19h6M3 5h18" }]],
|
|
218
|
+
"i-lucide-trash-2": [["path", { "d": "M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]],
|
|
219
|
+
"i-lucide-triangle-alert": [["path", { "d": "m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01" }]],
|
|
220
|
+
"i-lucide-type": [["path", { "d": "M12 4v16M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M9 20h6" }]],
|
|
221
|
+
"i-lucide-upload": [["path", { "d": "M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]],
|
|
222
|
+
"i-lucide-x": [["path", { "d": "M18 6L6 18M6 6l12 12" }]]
|
|
223
|
+
};
|
|
224
|
+
// src/ui-sdk/stand-ins.ts
|
|
225
|
+
/** Draws the Lucide icons that the parts use, from shapes in the bundle. Another name draws an empty icon. */
|
|
226
|
+
const UIcon = defineComponent({
|
|
227
|
+
name: "UIcon",
|
|
228
|
+
inheritAttrs: false,
|
|
229
|
+
props: { name: {
|
|
230
|
+
default: "",
|
|
231
|
+
type: String
|
|
232
|
+
} },
|
|
233
|
+
setup(props, { attrs }) {
|
|
234
|
+
return () => h("svg", {
|
|
235
|
+
...lucideStroke,
|
|
236
|
+
"aria-hidden": "true",
|
|
237
|
+
...attrs,
|
|
238
|
+
height: "1em",
|
|
239
|
+
viewBox: "0 0 24 24",
|
|
240
|
+
width: "1em"
|
|
241
|
+
}, uiSdkIcons[props.name]?.map(([tag, shape]) => h(tag, shape)));
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
/** Reads an attribute that has to be a string. Attributes reach a component untyped. */
|
|
245
|
+
const text = (value) => typeof value === "string" ? value : void 0;
|
|
246
|
+
const Button$1 = Button;
|
|
247
|
+
function buttonVariant(color, variant) {
|
|
248
|
+
if (variant === "ghost" || variant === "link") return variant;
|
|
249
|
+
if (color === "error") return "destructive";
|
|
250
|
+
if (variant === "soft" || variant === "subtle") return "soft";
|
|
251
|
+
return variant === "solid" ? "solid" : void 0;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Nuxt UI's `UButton` as the parts use it. A part that names its button, such as `data-slot="copy-button"`, finds the
|
|
255
|
+
* name in `data-part`, because `data-slot="button"` is what the kit styles.
|
|
256
|
+
*/
|
|
257
|
+
const UButton = defineComponent({
|
|
258
|
+
name: "UButton",
|
|
259
|
+
inheritAttrs: false,
|
|
260
|
+
props: {
|
|
261
|
+
color: {
|
|
262
|
+
default: "primary",
|
|
263
|
+
type: String
|
|
264
|
+
},
|
|
265
|
+
disabled: {
|
|
266
|
+
default: false,
|
|
267
|
+
type: Boolean
|
|
268
|
+
},
|
|
269
|
+
external: {
|
|
270
|
+
default: void 0,
|
|
271
|
+
type: Boolean
|
|
272
|
+
},
|
|
273
|
+
icon: { type: String },
|
|
274
|
+
label: { type: String },
|
|
275
|
+
loading: {
|
|
276
|
+
default: false,
|
|
277
|
+
type: Boolean
|
|
278
|
+
},
|
|
279
|
+
size: {
|
|
280
|
+
default: "md",
|
|
281
|
+
type: String
|
|
282
|
+
},
|
|
283
|
+
square: {
|
|
284
|
+
default: false,
|
|
285
|
+
type: Boolean
|
|
286
|
+
},
|
|
287
|
+
to: { type: String },
|
|
288
|
+
trailingIcon: { type: String },
|
|
289
|
+
type: {
|
|
290
|
+
default: "button",
|
|
291
|
+
type: String
|
|
292
|
+
},
|
|
293
|
+
ui: { type: Object },
|
|
294
|
+
variant: {
|
|
295
|
+
default: "solid",
|
|
296
|
+
type: String
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
setup(props, { attrs, slots }) {
|
|
300
|
+
const UIcon = useStandIn("UIcon");
|
|
301
|
+
return () => {
|
|
302
|
+
const shared = {
|
|
303
|
+
...attrs,
|
|
304
|
+
"aria-busy": props.loading ? "true" : text(attrs["aria-busy"]),
|
|
305
|
+
"data-part": text(attrs["data-slot"]),
|
|
306
|
+
"data-size": props.size,
|
|
307
|
+
"data-slot": "button",
|
|
308
|
+
"data-variant": buttonVariant(props.color, props.variant)
|
|
309
|
+
};
|
|
310
|
+
const leading = props.loading ? "i-lucide-loader-circle" : props.icon;
|
|
311
|
+
const content = () => [
|
|
312
|
+
slots.leading ? slots.leading({}) : leading ? h(UIcon, {
|
|
313
|
+
"data-slot": props.loading ? "spinner" : void 0,
|
|
314
|
+
name: leading
|
|
315
|
+
}) : null,
|
|
316
|
+
slots.default ? slots.default() : props.label ? h("span", props.label) : null,
|
|
317
|
+
props.trailingIcon ? h(UIcon, { name: props.trailingIcon }) : null
|
|
318
|
+
];
|
|
319
|
+
if (props.to) return h("a", {
|
|
320
|
+
...shared,
|
|
321
|
+
href: props.to
|
|
322
|
+
}, content());
|
|
323
|
+
return h(Button$1, {
|
|
324
|
+
...shared,
|
|
325
|
+
disabled: props.disabled || props.loading,
|
|
326
|
+
type: props.type
|
|
327
|
+
}, content);
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
const standIns = {
|
|
332
|
+
UButton,
|
|
333
|
+
UIcon
|
|
334
|
+
};
|
|
335
|
+
/** The component that the editor parts render for `name`: the one given to `createViteHubUI({ components })` or registered globally, else the ui-sdk one. */
|
|
336
|
+
function useStandIn(name) {
|
|
337
|
+
return inject(uiComponentsKey, void 0)?.[name] ?? getCurrentInstance()?.appContext.components[name] ?? standIns[name];
|
|
338
|
+
}
|
|
339
|
+
export { useStandIn as i, UIcon as n, text as r, UButton as t };
|