@vite-hub/ui 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -18
- package/dist/attachments-BzTwqRTU.js +90 -0
- package/dist/choices-input-ByXJvDn1.d.ts +94 -0
- package/dist/{code-view-J4OsgEdh.js → code-view-D0bqhogi.js} +20 -4
- package/dist/colors-BghReA9C-CjF9gnmy.js +28 -0
- package/dist/comment-composer-Cc8Jvu6u.d.ts +243 -0
- package/dist/comment-composer-jYv2ULNP.js +591 -0
- package/dist/comment-layer-ClH4MLj4.d.ts +165 -0
- package/dist/comment-list-B8hphLfS.d.ts +62 -0
- package/dist/comment-marks.css +234 -0
- package/dist/comment-panel-fcKSKwLC.d.ts +197 -0
- package/dist/comment-person-CLPlW_SS.js +40 -0
- package/dist/comment-pin-CvwgRSDR.d.ts +68 -0
- package/dist/comment-row-Bbm9WwuF.js +39 -0
- package/dist/comment-thread-CoTLrdal.d.ts +368 -0
- package/dist/comment-visibility-DsVuVndP.d.ts +40 -0
- package/dist/{comments-ChNJkV1d.d.ts → comments-Bx2WRsYy.d.ts} +69 -7
- package/dist/{comments-C08J3z4e.js → comments-CkWc2Khc.js} +155 -60
- package/dist/comments-context-C2lOZyQ5.js +38 -0
- package/dist/config-DgxBW013.d.ts +80 -0
- package/dist/config-Dk67emQt.js +63 -0
- package/dist/copy-button-CRN3kmSD.js +253 -0
- package/dist/draw-DzSmD7uo-Dwz8zoH2.js +72976 -0
- package/dist/editor-C_wt4RRV.js +582 -0
- package/dist/error-diagnostics-SXtnk6bz.js +38 -0
- package/dist/{file-tree-C1pv4_AI.js → file-tree-C4OYgbV-.js} +292 -145
- package/dist/{file-tree-Ctb8hZ_g.d.ts → file-tree-DlT9RGhu.d.ts} +51 -15
- package/dist/format-Du58PlsG.js +18 -0
- package/dist/handlers-DMl-Na3x.js +182 -0
- package/dist/headless.d.ts +5 -176
- package/dist/headless.js +5 -3
- package/dist/icon-swap.css +69 -0
- package/dist/{image-preview-VfknBEFu.js → image-preview-C9tdkmEj.js} +8 -5
- package/dist/{index-DcH0QSI5.d.ts → index-BD1e8vx5.d.ts} +8 -0
- package/dist/{code-view-vDM-hph-.d.ts → index-CNY1uNTh.d.ts} +14 -228
- package/dist/index.d.ts +53 -56
- package/dist/index.js +677 -25
- package/dist/markdown-editor-CMbNZOdN.js +2394 -0
- package/dist/markdown-editor-DqdZfIEn.d.ts +195 -0
- package/dist/markdown-editor.d.ts +108 -0
- package/dist/markdown-editor.js +3 -0
- package/dist/message-scroller-Bm1YWTeY.d.ts +175 -0
- package/dist/nuxt-ui-DSQFzq3s.js +38 -0
- package/dist/nuxt.d.ts +84 -2
- package/dist/nuxt.js +237 -35
- package/dist/parts/components/agent-session.d.ts +254 -0
- package/dist/parts/components/agent-session.js +640 -0
- package/dist/{attachment-BBndG9_P.d.ts → parts/components/attachment.d.ts} +13 -14
- package/dist/{attachment-B3dXC7jM.js → parts/components/attachment.js} +6 -4
- package/dist/{avatar-stack.d.ts → parts/components/avatar-stack.d.ts} +1 -1
- package/dist/{avatar-stack-DM6HRnc0.js → parts/components/avatar-stack.js} +2 -5
- package/dist/{bubble-BJH2rfii.d.ts → parts/components/bubble.d.ts} +8 -9
- package/dist/{bubble-BPyFQlW7.js → parts/components/bubble.js} +2 -2
- package/dist/{chat-message-mpDmZbIC.d.ts → parts/components/chat-message.d.ts} +2 -3
- package/dist/{chat-message-BNK9G7xF.js → parts/components/chat-message.js} +4 -4
- package/dist/{chat-session-D6C7VJBR.d.ts → parts/components/chat-session.d.ts} +3 -4
- package/dist/{chat-session-DYEHB1HC.js → parts/components/chat-session.js} +2 -2
- package/dist/{chat-B9HlZWA2.d.ts → parts/components/chat.d.ts} +8 -4
- package/dist/{chat-BoFHlu9V.js → parts/components/chat.js} +42 -9
- package/dist/{highlighted-code-Dzf6o54i.d.ts → parts/components/code-block.d.ts} +16 -24
- package/dist/{code-block-Br-02hn-.js → parts/components/code-block.js} +9 -38
- package/dist/parts/components/code-view.d.ts +270 -0
- package/dist/parts/components/code-view.js +2 -0
- package/dist/parts/components/comment-composer.d.ts +2 -0
- package/dist/parts/components/comment-composer.js +2 -0
- package/dist/parts/components/comment-layer.d.ts +2 -0
- package/dist/parts/components/comment-layer.js +618 -0
- package/dist/parts/components/comment-list.d.ts +2 -0
- package/dist/parts/components/comment-list.js +167 -0
- package/dist/parts/components/comment-panel.d.ts +2 -0
- package/dist/parts/components/comment-panel.js +299 -0
- package/dist/parts/components/comment-pin.d.ts +2 -0
- package/dist/parts/components/comment-pin.js +75 -0
- package/dist/parts/components/comment-thread.d.ts +2 -0
- package/dist/parts/components/comment-thread.js +571 -0
- package/dist/parts/components/comments.d.ts +7 -0
- package/dist/parts/components/comments.js +8 -0
- package/dist/{connection-status-DjGBw6xX.d.ts → parts/components/connection-status.d.ts} +6 -7
- package/dist/{connection-status-CzuWBENf.js → parts/components/connection-status.js} +1 -1
- package/dist/parts/components/copy-button.d.ts +118 -0
- package/dist/parts/components/copy-button.js +2 -0
- package/dist/parts/components/device-frame.d.ts +130 -0
- package/dist/parts/components/device-frame.js +471 -0
- package/dist/parts/components/file-tree.d.ts +2 -0
- package/dist/parts/components/file-tree.js +2 -0
- package/dist/parts/components/filter-search.d.ts +47 -0
- package/dist/parts/components/filter-search.js +58 -0
- package/dist/parts/components/markdown-editor.d.ts +2 -0
- package/dist/parts/components/markdown-editor.js +2 -0
- package/dist/parts/components/markdown-renderer.d.ts +52 -0
- package/dist/parts/components/markdown-renderer.js +23077 -0
- package/dist/{markdown-Dse5ldJe.d.ts → parts/components/markdown.d.ts} +7 -7
- package/dist/parts/components/markdown.js +47 -0
- package/dist/{marker-ea-tvx-J.d.ts → parts/components/marker.d.ts} +5 -6
- package/dist/{marker-Di2ZG_k1.js → parts/components/marker.js} +2 -2
- package/dist/{message-parts-BBFUkluC.d.ts → parts/components/message-parts.d.ts} +2 -3
- package/dist/{message-parts-DQnfioAH.js → parts/components/message-parts.js} +6 -6
- package/dist/{message-CW_paC1k.d.ts → parts/components/message.d.ts} +8 -9
- package/dist/{message-DiyBthIq.js → parts/components/message.js} +2 -2
- package/dist/parts/components/patch-parsers.d.ts +2 -0
- package/dist/parts/components/patch-parsers.js +2 -0
- package/dist/{prompt-input-Cy_Ue6B5.d.ts → parts/components/prompt-input.d.ts} +54 -11
- package/dist/{prompt-input-BbnCb80O.js → parts/components/prompt-input.js} +66 -111
- package/dist/parts/components/relative-time.d.ts +73 -0
- package/dist/parts/components/relative-time.js +2 -0
- package/dist/parts/components/status.d.ts +60 -0
- package/dist/parts/components/status.js +48 -0
- package/dist/{sync-status-refELOZn.d.ts → parts/components/sync-status.d.ts} +5 -6
- package/dist/{sync-status-BpxYdZIJ.js → parts/components/sync-status.js} +1 -1
- package/dist/{tool-list-E7CA52rz.d.ts → parts/components/tool-list.d.ts} +3 -4
- package/dist/{tool-list-BdSr5CT4.js → parts/components/tool-list.js} +7 -38
- package/dist/{trace-run-COeXn46Z.d.ts → parts/components/trace-run.d.ts} +3 -4
- package/dist/{trace-run-BIQ17CED.js → parts/components/trace-run.js} +15 -23
- package/dist/{trace-V7rM3Pyd.d.ts → parts/components/trace.d.ts} +10 -11
- package/dist/{trace-llBCDiSW.js → parts/components/trace.js} +20 -13
- package/dist/parts/composables/attachments.d.ts +32 -0
- package/dist/parts/composables/attachments.js +2 -0
- package/dist/parts/composables/highlighted-code.d.ts +9 -0
- package/dist/{highlighted-code-Ck4zexJX.js → parts/composables/highlighted-code.js} +5 -2
- package/dist/parts/headless/choices-input.d.ts +2 -0
- package/dist/parts/headless/choices-input.js +162 -0
- package/dist/parts/headless/comment-visibility.d.ts +2 -0
- package/dist/parts/headless/comment-visibility.js +128 -0
- package/dist/parts/headless/comments.d.ts +2 -0
- package/dist/parts/headless/comments.js +2 -0
- package/dist/parts/headless/message-scroller.d.ts +2 -0
- package/dist/{message-scroller-CX6NJTdm.js → parts/headless/message-scroller.js} +2 -2
- package/dist/parts/playground/highlight.d.ts +5 -0
- package/dist/parts/playground/highlight.js +23 -0
- package/dist/parts/playground/paths.d.ts +4 -0
- package/dist/parts/playground/paths.js +7 -0
- package/dist/parts/playground/playground-render.d.ts +126 -0
- package/dist/parts/playground/playground-render.js +356 -0
- package/dist/parts/playground/share.d.ts +2 -0
- package/dist/parts/playground/share.js +92 -0
- package/dist/parts/playground/zip.d.ts +6 -0
- package/dist/parts/playground/zip.js +76 -0
- package/dist/parts/workspace/browser-support-notice.d.ts +76 -0
- package/dist/parts/workspace/browser-support-notice.js +105 -0
- package/dist/parts/workspace/codemirror.d.ts +16 -0
- package/dist/parts/workspace/codemirror.js +243 -0
- package/dist/parts/workspace/connect-panel.d.ts +129 -0
- package/dist/parts/workspace/connect-panel.js +285 -0
- package/dist/parts/workspace/connect-store.d.ts +26 -0
- package/dist/parts/workspace/connect-store.js +59 -0
- package/dist/parts/workspace/icons.d.ts +34 -0
- package/dist/parts/workspace/icons.js +46 -0
- package/dist/parts/workspace/playground-container.d.ts +192 -0
- package/dist/parts/workspace/playground-container.js +603 -0
- package/dist/parts/workspace/workspace-boot-status.d.ts +75 -0
- package/dist/parts/workspace/workspace-boot-status.js +207 -0
- package/dist/parts/workspace/workspace-editor.d.ts +43 -0
- package/dist/parts/workspace/workspace-editor.js +54 -0
- package/dist/parts/workspace/workspace-file-tree.d.ts +53 -0
- package/dist/parts/workspace/workspace-file-tree.js +68 -0
- package/dist/parts/workspace/workspace-preview.d.ts +72 -0
- package/dist/parts/workspace/workspace-preview.js +307 -0
- package/dist/parts/workspace/workspace-shell.d.ts +88 -0
- package/dist/parts/workspace/workspace-shell.js +291 -0
- package/dist/parts/workspace/workspace-terminal.d.ts +39 -0
- package/dist/parts/workspace/workspace-terminal.js +130 -0
- package/dist/payload-text-sjkYAwvw.js +32 -0
- package/dist/{pierre-code-view-T7V67hwT.js → pierre-code-view-xgBL6DO7.js} +209 -86
- package/dist/{pierre-dark-DDWDl8g6.js → pierre-dark-CzUmjETS.js} +3 -1
- package/dist/{pierre-light-CWhW4NrH.js → pierre-light-Dn6E0sWv.js} +3 -1
- package/dist/playground.d.ts +4 -0
- package/dist/playground.js +4 -0
- package/dist/relative-time-BVmjOsYG.js +309 -0
- package/dist/rolldown-runtime-C9mWXvCC.js +29 -0
- package/dist/runtime/nuxt-plugin.js +23 -4
- package/dist/sankey-CAYwt82B-D4uDQoMR.js +2887 -0
- package/dist/share-DM4eNy4q.d.ts +37 -0
- package/dist/{slot-part-C7Ocxn3b.js → slot-part-Doic71uh.js} +7 -1
- package/dist/styles.css +2465 -594
- package/dist/temml-BilSAAws.js +12362 -0
- package/dist/theme-focus-ring.css +42 -0
- package/dist/theme.css +376 -0
- package/dist/theme.d.ts +355 -0
- package/dist/theme.js +265 -0
- package/dist/{types-CqDwuJAm.d.ts → types-Dyr6CfBW.d.ts} +1 -1
- package/dist/vue-BDmSCtay.js +30779 -0
- package/dist/vue-DGstVdGn.js +2492 -0
- package/dist/workspace.d.ts +15 -0
- package/dist/workspace.js +12 -0
- package/package.json +136 -150
- package/dist/andromeeda-BASpqCeJ.js +0 -4
- package/dist/attachment.d.ts +0 -2
- package/dist/attachment.js +0 -2
- package/dist/aurora-x-DugsLcii.js +0 -4
- package/dist/avatar-stack.js +0 -2
- package/dist/ayu-dark-BT3qdi3o.js +0 -4
- package/dist/ayu-light-BVZyHoh9.js +0 -4
- package/dist/ayu-mirage-XFwUVZQZ.js +0 -4
- package/dist/bubble.d.ts +0 -2
- package/dist/bubble.js +0 -2
- package/dist/catppuccin-frappe-D20KODDN.js +0 -4
- package/dist/catppuccin-latte-eGLVHIUJ.js +0 -4
- package/dist/catppuccin-macchiato-bQGch4PY.js +0 -4
- package/dist/catppuccin-mocha-Bes8-0Mr.js +0 -4
- package/dist/chat-message.d.ts +0 -2
- package/dist/chat-message.js +0 -2
- package/dist/chat-session.d.ts +0 -2
- package/dist/chat-session.js +0 -2
- package/dist/chat.d.ts +0 -2
- package/dist/chat.js +0 -2
- package/dist/code-block.d.ts +0 -2
- package/dist/code-block.js +0 -3
- package/dist/code-view.d.ts +0 -2
- package/dist/code-view.js +0 -2
- package/dist/comment-layer-CBlxJ8eK.js +0 -1113
- package/dist/comments-Cq5eewsu.d.ts +0 -537
- package/dist/comments.d.ts +0 -2
- package/dist/comments.js +0 -2
- package/dist/config-Bux_AJzm.d.ts +0 -29
- package/dist/config-bHqE4JOs.js +0 -38
- package/dist/connection-status.d.ts +0 -2
- package/dist/connection-status.js +0 -2
- package/dist/dark-plus-BGuiqa1B.js +0 -4
- package/dist/dracula-0CVA2XY5.js +0 -4
- package/dist/dracula-soft-Dk9bpbVU.js +0 -4
- package/dist/error-diagnostics-B4hMpJRL.js +0 -13
- package/dist/everforest-dark-CRjTbhh5.js +0 -4
- package/dist/everforest-light-CEeYFLn8.js +0 -4
- package/dist/file-diff.d.ts +0 -2
- package/dist/file-diff.js +0 -2
- package/dist/file-tree.d.ts +0 -2
- package/dist/file-tree.js +0 -2
- package/dist/file-view.d.ts +0 -2
- package/dist/file-view.js +0 -2
- package/dist/github-dark-BXgKmOw_.js +0 -4
- package/dist/github-dark-default-DzJQXksd.js +0 -4
- package/dist/github-dark-dimmed-B1pEmGtS.js +0 -4
- package/dist/github-dark-high-contrast-BkHIa6jc.js +0 -4
- package/dist/github-light-BKRlUbaB.js +0 -4
- package/dist/github-light-default-BU3eYkzs.js +0 -4
- package/dist/github-light-high-contrast-B3MumDcI.js +0 -4
- package/dist/gruvbox-dark-hard-B0ecF443.js +0 -4
- package/dist/gruvbox-dark-medium-BQnpC39k.js +0 -4
- package/dist/gruvbox-dark-soft-DFZUgESr.js +0 -4
- package/dist/gruvbox-light-hard-CuB_LOJr.js +0 -4
- package/dist/gruvbox-light-medium-idDHgxjs.js +0 -4
- package/dist/gruvbox-light-soft-CfWH49MY.js +0 -4
- package/dist/horizon-bright-Ba6M8QSV.js +0 -4
- package/dist/horizon-h92C5OlZ.js +0 -4
- package/dist/houston-EQnPegWq.js +0 -4
- package/dist/kanagawa-dragon-DgDvwi3B.js +0 -4
- package/dist/kanagawa-lotus-BgoQro20.js +0 -4
- package/dist/kanagawa-wave-DgXEowHs.js +0 -4
- package/dist/laserwave-IxBH_3yW.js +0 -4
- package/dist/light-plus-S8JBx6is.js +0 -4
- package/dist/markdown-BoLBN0qH.js +0 -197
- package/dist/markdown.d.ts +0 -2
- package/dist/markdown.js +0 -2
- package/dist/marker.d.ts +0 -2
- package/dist/marker.js +0 -2
- package/dist/material-theme-D1f3HBq-.js +0 -4
- package/dist/material-theme-darker-ExzYhT0j.js +0 -4
- package/dist/material-theme-lighter-D6gH9nnA.js +0 -4
- package/dist/material-theme-ocean-D1w5BPAa.js +0 -4
- package/dist/material-theme-palenight-CkqWmVpF.js +0 -4
- package/dist/message-parts.d.ts +0 -2
- package/dist/message-parts.js +0 -2
- package/dist/message.d.ts +0 -2
- package/dist/message.js +0 -2
- package/dist/min-dark-npsJH98j.js +0 -4
- package/dist/min-light-DUk1XsVt.js +0 -4
- package/dist/monokai-CfFRWUNl.js +0 -4
- package/dist/multi-file-diff.d.ts +0 -2
- package/dist/multi-file-diff.js +0 -2
- package/dist/night-owl-BS7V-av_.js +0 -4
- package/dist/night-owl-light-CZtRawYE.js +0 -4
- package/dist/nord-BFh54Nqz.js +0 -4
- package/dist/one-dark-pro-zDovGosB.js +0 -4
- package/dist/one-light-gmHK3iK6.js +0 -4
- package/dist/patch-diff.d.ts +0 -2
- package/dist/patch-diff.js +0 -2
- package/dist/plastic-DtdaCjub.js +0 -4
- package/dist/poimandres-Hdda6aHK.js +0 -4
- package/dist/primitive-rail.d.ts +0 -222
- package/dist/primitive-rail.js +0 -348
- package/dist/prompt-input.d.ts +0 -2
- package/dist/prompt-input.js +0 -2
- package/dist/red-VqZFRByZ.js +0 -4
- package/dist/rose-pine-DiTkEueR.js +0 -4
- package/dist/rose-pine-dawn-tfo5y2X0.js +0 -4
- package/dist/rose-pine-moon-C0gON9XN.js +0 -4
- package/dist/runtime-type-DlCscMfw.js +0 -59
- package/dist/slack-dark-v8P_eXr6.js +0 -4
- package/dist/slack-ochin-D8SyEdKz.js +0 -4
- package/dist/snazzy-light-BtkQkvXb.js +0 -4
- package/dist/solarized-dark-B8nAdMfM.js +0 -4
- package/dist/solarized-light-B-3F1INj.js +0 -4
- package/dist/sync-status.d.ts +0 -2
- package/dist/sync-status.js +0 -2
- package/dist/synthwave-84-DcsXCF_c.js +0 -4
- package/dist/tokyo-night-Bvpqduda.js +0 -4
- package/dist/tool-list.d.ts +0 -2
- package/dist/tool-list.js +0 -2
- package/dist/trace-run.d.ts +0 -2
- package/dist/trace-run.js +0 -2
- package/dist/trace.d.ts +0 -2
- package/dist/trace.js +0 -2
- package/dist/unresolved-file.d.ts +0 -2
- package/dist/unresolved-file.js +0 -2
- package/dist/vesper-CfxmMOy3.js +0 -4
- package/dist/vitesse-black-D9-_1mjV.js +0 -4
- package/dist/vitesse-dark-DlSMLlr9.js +0 -4
- package/dist/vitesse-light-KRWWWztf.js +0 -4
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { computed, defineComponent, h, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
2
|
+
//#region src/components/device-frame.ts
|
|
3
|
+
const DEVICE_FRAME_PRESETS = [
|
|
4
|
+
{
|
|
5
|
+
id: "iphone",
|
|
6
|
+
label: "iPhone",
|
|
7
|
+
kind: "phone",
|
|
8
|
+
width: 393,
|
|
9
|
+
height: 852
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "ipad",
|
|
13
|
+
label: "iPad",
|
|
14
|
+
kind: "tablet",
|
|
15
|
+
width: 820,
|
|
16
|
+
height: 1180
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "laptop",
|
|
20
|
+
label: "Laptop",
|
|
21
|
+
kind: "laptop",
|
|
22
|
+
width: 1280,
|
|
23
|
+
height: 800
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "desktop",
|
|
27
|
+
label: "Desktop",
|
|
28
|
+
kind: "desktop",
|
|
29
|
+
width: 1920,
|
|
30
|
+
height: 1080
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
/** The widths Chrome's device mode marks above the page, narrowest first. */
|
|
34
|
+
const DEVICE_FRAME_BREAKPOINTS = [
|
|
35
|
+
{
|
|
36
|
+
label: "Mobile S",
|
|
37
|
+
width: 320
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: "Mobile M",
|
|
41
|
+
width: 375
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: "Mobile L",
|
|
45
|
+
width: 425
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "Tablet",
|
|
49
|
+
width: 768
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "Laptop",
|
|
53
|
+
width: 1024
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "Laptop L",
|
|
57
|
+
width: 1440
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: "4K",
|
|
61
|
+
width: 2560
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
const SIZE_MIN = 240;
|
|
65
|
+
const SIZE_MAX = 3840;
|
|
66
|
+
const ZOOM_MIN = .1;
|
|
67
|
+
const ZOOM_MAX = 4;
|
|
68
|
+
const clampSize = (value) => Math.round(Math.min(SIZE_MAX, Math.max(SIZE_MIN, value)));
|
|
69
|
+
const clampZoom = (value) => Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, value));
|
|
70
|
+
const paths = {
|
|
71
|
+
phone: ["M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z", "M12 18h.01"],
|
|
72
|
+
tablet: ["M6 2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z", "M12 18h.01"],
|
|
73
|
+
laptop: ["M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"],
|
|
74
|
+
desktop: [
|
|
75
|
+
"M4 3h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Z",
|
|
76
|
+
"M8 21h8",
|
|
77
|
+
"M12 17v4"
|
|
78
|
+
],
|
|
79
|
+
custom: [
|
|
80
|
+
"M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Z",
|
|
81
|
+
"M3 9h18",
|
|
82
|
+
"M9 21V9"
|
|
83
|
+
],
|
|
84
|
+
rotate: [
|
|
85
|
+
"M20 9V7a2 2 0 0 0-2-2h-6",
|
|
86
|
+
"m15 2-3 3 3 3",
|
|
87
|
+
"M20 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2"
|
|
88
|
+
],
|
|
89
|
+
chevron: ["m6 9 6 6 6-6"],
|
|
90
|
+
close: ["M18 6 6 18", "m6 6 12 12"]
|
|
91
|
+
};
|
|
92
|
+
function icon(name, className = "vh-device-frame__icon") {
|
|
93
|
+
return h("svg", {
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
class: className,
|
|
96
|
+
fill: "none",
|
|
97
|
+
stroke: "currentColor",
|
|
98
|
+
"stroke-linecap": "round",
|
|
99
|
+
"stroke-linejoin": "round",
|
|
100
|
+
"stroke-width": "1.75",
|
|
101
|
+
viewBox: "0 0 24 24"
|
|
102
|
+
}, (paths[name] ?? []).map((d) => h("path", { d })));
|
|
103
|
+
}
|
|
104
|
+
function readStored(key) {
|
|
105
|
+
if (!key || typeof localStorage === "undefined") return void 0;
|
|
106
|
+
try {
|
|
107
|
+
const value = JSON.parse(localStorage.getItem(key) ?? "null");
|
|
108
|
+
if (!value || typeof value !== "object") return void 0;
|
|
109
|
+
const { on, id, width, height, zoom } = value;
|
|
110
|
+
if (typeof width !== "number" || typeof height !== "number" || typeof id !== "string") return void 0;
|
|
111
|
+
return {
|
|
112
|
+
on: on === true,
|
|
113
|
+
id,
|
|
114
|
+
width: clampSize(width),
|
|
115
|
+
height: clampSize(height),
|
|
116
|
+
zoom: typeof zoom === "number" ? clampZoom(zoom) : null
|
|
117
|
+
};
|
|
118
|
+
} catch {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Shows its content at a device's size: a bar with the device, the size, Rotate, breakpoints and zoom, over a stage that fits the pane. */
|
|
123
|
+
const DeviceFrame = defineComponent({
|
|
124
|
+
name: "DeviceFrame",
|
|
125
|
+
props: {
|
|
126
|
+
/** The size, for `v-model`. Without it the frame keeps its own state. */
|
|
127
|
+
modelValue: {
|
|
128
|
+
default: void 0,
|
|
129
|
+
type: Object
|
|
130
|
+
},
|
|
131
|
+
/** The first size when uncontrolled and nothing is stored. */
|
|
132
|
+
defaultValue: {
|
|
133
|
+
default: void 0,
|
|
134
|
+
type: Object
|
|
135
|
+
},
|
|
136
|
+
/** Keeps the uncontrolled size in local storage under this key. */
|
|
137
|
+
storageKey: {
|
|
138
|
+
default: void 0,
|
|
139
|
+
type: String
|
|
140
|
+
},
|
|
141
|
+
/** The devices the bar offers. Defaults to `DEVICE_FRAME_PRESETS`: iPhone, iPad, Laptop, and Desktop. */
|
|
142
|
+
presets: {
|
|
143
|
+
default: void 0,
|
|
144
|
+
type: Array
|
|
145
|
+
},
|
|
146
|
+
/** The one-click widths. Defaults to `DEVICE_FRAME_BREAKPOINTS`, Chrome's; pass `[]` to hide them. */
|
|
147
|
+
breakpoints: {
|
|
148
|
+
default: void 0,
|
|
149
|
+
type: Array
|
|
150
|
+
},
|
|
151
|
+
/** Shows the content full size without the bar, and keeps the size for later. */
|
|
152
|
+
disabled: {
|
|
153
|
+
default: false,
|
|
154
|
+
type: Boolean
|
|
155
|
+
},
|
|
156
|
+
/** Shows the bar above the page while device mode is on. Pass `false` when the page around the frame has its own device controls. */
|
|
157
|
+
toolbar: {
|
|
158
|
+
default: true,
|
|
159
|
+
type: Boolean
|
|
160
|
+
},
|
|
161
|
+
/** Space in pixels under the page, for a toolbar that floats over the bottom of the frame. */
|
|
162
|
+
insetBottom: {
|
|
163
|
+
default: 16,
|
|
164
|
+
type: Number
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
emits: { "update:modelValue": (_size) => true },
|
|
168
|
+
setup(props, { emit, slots, expose }) {
|
|
169
|
+
const presets = computed(() => props.presets ?? DEVICE_FRAME_PRESETS);
|
|
170
|
+
const breakpoints = computed(() => props.breakpoints ?? DEVICE_FRAME_BREAKPOINTS);
|
|
171
|
+
const first = presets.value[0] ?? DEVICE_FRAME_PRESETS[0];
|
|
172
|
+
const initial = (stored) => ({
|
|
173
|
+
on: false,
|
|
174
|
+
id: first.id,
|
|
175
|
+
width: first.width,
|
|
176
|
+
height: first.height,
|
|
177
|
+
zoom: null,
|
|
178
|
+
...stored ?? props.defaultValue
|
|
179
|
+
});
|
|
180
|
+
const local = ref(initial());
|
|
181
|
+
const size = computed(() => props.modelValue ?? local.value);
|
|
182
|
+
function update(next) {
|
|
183
|
+
const value = {
|
|
184
|
+
...size.value,
|
|
185
|
+
...next
|
|
186
|
+
};
|
|
187
|
+
if (props.modelValue === void 0) {
|
|
188
|
+
local.value = value;
|
|
189
|
+
if (props.storageKey && typeof localStorage !== "undefined") try {
|
|
190
|
+
localStorage.setItem(props.storageKey, JSON.stringify(value));
|
|
191
|
+
} catch {}
|
|
192
|
+
}
|
|
193
|
+
emit("update:modelValue", value);
|
|
194
|
+
}
|
|
195
|
+
const sized = computed(() => !props.disabled && size.value.on);
|
|
196
|
+
const presetOf = (id) => presets.value.find((item) => item.id === id);
|
|
197
|
+
const matching = (width, height) => presets.value.find((item) => item.width === width && item.height === height || item.width === height && item.height === width)?.id ?? "custom";
|
|
198
|
+
const preset = computed(() => presetOf(size.value.id));
|
|
199
|
+
const setSize = (width, height) => update({
|
|
200
|
+
on: true,
|
|
201
|
+
width,
|
|
202
|
+
height,
|
|
203
|
+
id: matching(width, height)
|
|
204
|
+
});
|
|
205
|
+
function pick(id) {
|
|
206
|
+
const next = presetOf(id);
|
|
207
|
+
if (!next) return;
|
|
208
|
+
const current = preset.value;
|
|
209
|
+
update(current && size.value.width === current.height && size.value.width !== current.width ? {
|
|
210
|
+
id,
|
|
211
|
+
width: next.height,
|
|
212
|
+
height: next.width
|
|
213
|
+
} : {
|
|
214
|
+
id,
|
|
215
|
+
width: next.width,
|
|
216
|
+
height: next.height
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const rotate = () => update({
|
|
220
|
+
width: size.value.height,
|
|
221
|
+
height: size.value.width
|
|
222
|
+
});
|
|
223
|
+
const within = computed(() => breakpoints.value.filter((band) => band.width <= size.value.width).at(-1)?.width);
|
|
224
|
+
const stage = ref();
|
|
225
|
+
const room = ref({
|
|
226
|
+
width: 0,
|
|
227
|
+
height: 0
|
|
228
|
+
});
|
|
229
|
+
let observer;
|
|
230
|
+
onMounted(() => {
|
|
231
|
+
local.value = initial(readStored(props.storageKey));
|
|
232
|
+
if (!stage.value || typeof ResizeObserver === "undefined") return;
|
|
233
|
+
observer = new ResizeObserver(([entry]) => {
|
|
234
|
+
if (entry) room.value = {
|
|
235
|
+
width: entry.contentRect.width,
|
|
236
|
+
height: entry.contentRect.height
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
observer.observe(stage.value);
|
|
240
|
+
});
|
|
241
|
+
onBeforeUnmount(() => observer?.disconnect());
|
|
242
|
+
const fit = computed(() => room.value.width && room.value.height ? Math.min(1, room.value.width / size.value.width, room.value.height / size.value.height) : 1);
|
|
243
|
+
const held = ref(null);
|
|
244
|
+
const scale = computed(() => Math.max(ZOOM_MIN, held.value ?? size.value.zoom ?? fit.value));
|
|
245
|
+
let start;
|
|
246
|
+
function grab(event) {
|
|
247
|
+
if (event.currentTarget instanceof Element) event.currentTarget.setPointerCapture(event.pointerId);
|
|
248
|
+
start = {
|
|
249
|
+
x: event.clientX,
|
|
250
|
+
y: event.clientY,
|
|
251
|
+
width: size.value.width,
|
|
252
|
+
height: size.value.height
|
|
253
|
+
};
|
|
254
|
+
held.value = scale.value;
|
|
255
|
+
}
|
|
256
|
+
function drag(event, edges) {
|
|
257
|
+
if (!start) return;
|
|
258
|
+
const s = scale.value;
|
|
259
|
+
setSize(edges.x ? clampSize(start.width + 2 * (event.clientX - start.x) / s) : size.value.width, edges.y ? clampSize(start.height + (event.clientY - start.y) / s) : size.value.height);
|
|
260
|
+
}
|
|
261
|
+
function release() {
|
|
262
|
+
start = void 0;
|
|
263
|
+
held.value = null;
|
|
264
|
+
}
|
|
265
|
+
function nudge(event, edges) {
|
|
266
|
+
const step = event.shiftKey ? 50 : 10;
|
|
267
|
+
const dx = edges.x ? event.key === "ArrowRight" ? step : event.key === "ArrowLeft" ? -step : 0 : 0;
|
|
268
|
+
const dy = edges.y ? event.key === "ArrowDown" ? step : event.key === "ArrowUp" ? -step : 0 : 0;
|
|
269
|
+
if (!dx && !dy) return;
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
setSize(clampSize(size.value.width + dx), clampSize(size.value.height + dy));
|
|
272
|
+
}
|
|
273
|
+
const numberValue = (event) => event.target instanceof HTMLInputElement ? event.target.valueAsNumber : NaN;
|
|
274
|
+
expose({
|
|
275
|
+
rotate,
|
|
276
|
+
fit: () => update({ zoom: null })
|
|
277
|
+
});
|
|
278
|
+
function toolbar() {
|
|
279
|
+
const current = size.value;
|
|
280
|
+
const percent = Math.round(scale.value * 100);
|
|
281
|
+
return h("div", {
|
|
282
|
+
key: "bar",
|
|
283
|
+
class: "vh-device-frame__bar",
|
|
284
|
+
role: "toolbar",
|
|
285
|
+
"aria-label": "Device"
|
|
286
|
+
}, [
|
|
287
|
+
slots["toolbar-start"]?.(),
|
|
288
|
+
h("label", {
|
|
289
|
+
class: "vh-device-frame__select",
|
|
290
|
+
"data-focus-ring": ""
|
|
291
|
+
}, [
|
|
292
|
+
icon(preset.value?.kind ?? "custom"),
|
|
293
|
+
h("span", {
|
|
294
|
+
"aria-hidden": "true",
|
|
295
|
+
class: "vh-device-frame__select-label"
|
|
296
|
+
}, preset.value?.label ?? "Custom"),
|
|
297
|
+
h("select", {
|
|
298
|
+
"aria-label": "Device",
|
|
299
|
+
value: preset.value ? current.id : "custom",
|
|
300
|
+
onChange: (event) => event.target instanceof HTMLSelectElement && pick(event.target.value)
|
|
301
|
+
}, [...presets.value.map((item) => h("option", {
|
|
302
|
+
key: item.id,
|
|
303
|
+
value: item.id
|
|
304
|
+
}, `${item.label} · ${item.width} × ${item.height}`)), preset.value ? null : h("option", {
|
|
305
|
+
value: "custom",
|
|
306
|
+
disabled: true
|
|
307
|
+
}, "Custom")]),
|
|
308
|
+
icon("chevron", "vh-device-frame__chevron")
|
|
309
|
+
]),
|
|
310
|
+
h("input", {
|
|
311
|
+
"aria-label": "Width",
|
|
312
|
+
class: "vh-device-frame__number",
|
|
313
|
+
"data-focus-frame": "",
|
|
314
|
+
inputmode: "numeric",
|
|
315
|
+
max: SIZE_MAX,
|
|
316
|
+
min: SIZE_MIN,
|
|
317
|
+
type: "number",
|
|
318
|
+
value: current.width,
|
|
319
|
+
onChange: (event) => {
|
|
320
|
+
const value = numberValue(event);
|
|
321
|
+
if (Number.isFinite(value)) setSize(clampSize(value), current.height);
|
|
322
|
+
}
|
|
323
|
+
}),
|
|
324
|
+
h("span", {
|
|
325
|
+
"aria-hidden": "true",
|
|
326
|
+
class: "vh-device-frame__times"
|
|
327
|
+
}, "×"),
|
|
328
|
+
h("input", {
|
|
329
|
+
"aria-label": "Height",
|
|
330
|
+
class: "vh-device-frame__number",
|
|
331
|
+
"data-focus-frame": "",
|
|
332
|
+
inputmode: "numeric",
|
|
333
|
+
max: SIZE_MAX,
|
|
334
|
+
min: SIZE_MIN,
|
|
335
|
+
type: "number",
|
|
336
|
+
value: current.height,
|
|
337
|
+
onChange: (event) => {
|
|
338
|
+
const value = numberValue(event);
|
|
339
|
+
if (Number.isFinite(value)) setSize(current.width, clampSize(value));
|
|
340
|
+
}
|
|
341
|
+
}),
|
|
342
|
+
h("button", {
|
|
343
|
+
class: "vh-device-frame__button",
|
|
344
|
+
type: "button",
|
|
345
|
+
onClick: rotate
|
|
346
|
+
}, [icon("rotate"), h("span", "Rotate")]),
|
|
347
|
+
breakpoints.value.length ? h("div", {
|
|
348
|
+
class: "vh-device-frame__bands",
|
|
349
|
+
role: "group",
|
|
350
|
+
"aria-label": "Breakpoints"
|
|
351
|
+
}, breakpoints.value.map((band) => h("button", {
|
|
352
|
+
key: band.width,
|
|
353
|
+
"aria-label": `${band.label}, ${band.width} pixels wide`,
|
|
354
|
+
"aria-pressed": current.width === band.width ? "true" : "false",
|
|
355
|
+
class: "vh-device-frame__band",
|
|
356
|
+
"data-within": within.value === band.width ? "" : void 0,
|
|
357
|
+
title: band.label,
|
|
358
|
+
type: "button",
|
|
359
|
+
onClick: () => setSize(band.width, current.height)
|
|
360
|
+
}, String(band.width)))) : null,
|
|
361
|
+
h("div", { class: "vh-device-frame__end" }, [
|
|
362
|
+
h("label", { class: "vh-device-frame__zoom" }, [h("input", {
|
|
363
|
+
"aria-label": "Zoom, in percent",
|
|
364
|
+
class: "vh-device-frame__number",
|
|
365
|
+
"data-focus-frame": "",
|
|
366
|
+
inputmode: "numeric",
|
|
367
|
+
max: 400,
|
|
368
|
+
min: ZOOM_MIN * 100,
|
|
369
|
+
step: 10,
|
|
370
|
+
type: "number",
|
|
371
|
+
value: percent,
|
|
372
|
+
onChange: (event) => {
|
|
373
|
+
const value = numberValue(event);
|
|
374
|
+
if (Number.isFinite(value) && value > 0) update({ zoom: clampZoom(value / 100) });
|
|
375
|
+
}
|
|
376
|
+
}), h("span", { "aria-hidden": "true" }, "%")]),
|
|
377
|
+
h("button", {
|
|
378
|
+
"aria-pressed": current.zoom === null ? "true" : "false",
|
|
379
|
+
class: "vh-device-frame__button",
|
|
380
|
+
type: "button",
|
|
381
|
+
onClick: () => update({ zoom: null })
|
|
382
|
+
}, "Fit"),
|
|
383
|
+
slots["toolbar-end"]?.(),
|
|
384
|
+
h("button", {
|
|
385
|
+
"aria-label": "Leave device mode",
|
|
386
|
+
class: "vh-device-frame__button vh-device-frame__icon-button",
|
|
387
|
+
title: "Leave device mode",
|
|
388
|
+
type: "button",
|
|
389
|
+
onClick: () => update({ on: false })
|
|
390
|
+
}, [icon("close")])
|
|
391
|
+
])
|
|
392
|
+
]);
|
|
393
|
+
}
|
|
394
|
+
const HANDLES = [
|
|
395
|
+
{
|
|
396
|
+
edge: "x",
|
|
397
|
+
edges: { x: true },
|
|
398
|
+
label: "Drag to change the width"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
edge: "y",
|
|
402
|
+
edges: { y: true },
|
|
403
|
+
label: "Drag to change the height"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
edge: "xy",
|
|
407
|
+
edges: {
|
|
408
|
+
x: true,
|
|
409
|
+
y: true
|
|
410
|
+
},
|
|
411
|
+
label: "Drag to resize"
|
|
412
|
+
}
|
|
413
|
+
];
|
|
414
|
+
watch(() => props.storageKey, () => {
|
|
415
|
+
if (props.modelValue === void 0) local.value = initial(readStored(props.storageKey));
|
|
416
|
+
});
|
|
417
|
+
return () => {
|
|
418
|
+
const on = sized.value;
|
|
419
|
+
const current = size.value;
|
|
420
|
+
const s = scale.value;
|
|
421
|
+
return h("div", {
|
|
422
|
+
class: "vh-device-frame",
|
|
423
|
+
"data-slot": "device-frame",
|
|
424
|
+
"data-on": on ? "" : void 0,
|
|
425
|
+
"data-dragging": held.value === null ? void 0 : ""
|
|
426
|
+
}, [on && props.toolbar ? toolbar() : null, h("div", {
|
|
427
|
+
key: "stage",
|
|
428
|
+
ref: stage,
|
|
429
|
+
class: "vh-device-frame__stage",
|
|
430
|
+
style: on ? { paddingBottom: `${props.insetBottom}px` } : void 0
|
|
431
|
+
}, [h("div", {
|
|
432
|
+
class: "vh-device-frame__footprint",
|
|
433
|
+
style: on ? {
|
|
434
|
+
width: `${current.width * s}px`,
|
|
435
|
+
height: `${current.height * s}px`
|
|
436
|
+
} : void 0
|
|
437
|
+
}, [
|
|
438
|
+
h("div", {
|
|
439
|
+
class: "vh-device-frame__page",
|
|
440
|
+
style: on ? {
|
|
441
|
+
width: `${current.width}px`,
|
|
442
|
+
height: `${current.height}px`,
|
|
443
|
+
transform: `scale(${s})`
|
|
444
|
+
} : void 0
|
|
445
|
+
}, slots.default?.()),
|
|
446
|
+
on && held.value !== null ? h("p", {
|
|
447
|
+
class: "vh-device-frame__readout",
|
|
448
|
+
"aria-live": "polite"
|
|
449
|
+
}, `${current.width} × ${current.height}`) : null,
|
|
450
|
+
...on ? HANDLES.map((handle) => h("div", {
|
|
451
|
+
key: handle.edge,
|
|
452
|
+
"aria-label": handle.label,
|
|
453
|
+
"aria-orientation": handle.edge === "y" ? "horizontal" : "vertical",
|
|
454
|
+
"aria-valuenow": handle.edge === "y" ? current.height : current.width,
|
|
455
|
+
"aria-valuemin": SIZE_MIN,
|
|
456
|
+
"aria-valuemax": SIZE_MAX,
|
|
457
|
+
class: "vh-device-frame__handle",
|
|
458
|
+
"data-edge": handle.edge,
|
|
459
|
+
role: "separator",
|
|
460
|
+
tabindex: 0,
|
|
461
|
+
onKeydown: (event) => nudge(event, handle.edges),
|
|
462
|
+
onLostpointercapture: release,
|
|
463
|
+
onPointerdown: grab,
|
|
464
|
+
onPointermove: (event) => drag(event, handle.edges)
|
|
465
|
+
}, handle.edge === "xy" ? void 0 : [h("span", { class: "vh-device-frame__grip" })])) : []
|
|
466
|
+
])])]);
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
//#endregion
|
|
471
|
+
export { DEVICE_FRAME_BREAKPOINTS, DEVICE_FRAME_PRESETS, DeviceFrame };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { a as ChoicesInputSource } from "../../choices-input-ByXJvDn1.js";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
//#region src/components/filter-search.d.ts
|
|
4
|
+
export type FilterSearchSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
export declare const FilterSearch: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
/** The object that `useChoices()` returns. */
|
|
7
|
+
choices: {
|
|
8
|
+
required: true;
|
|
9
|
+
type: PropType<ChoicesInputSource>;
|
|
10
|
+
};
|
|
11
|
+
/** The accessible name of the input. */
|
|
12
|
+
label: {
|
|
13
|
+
default: string;
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
};
|
|
16
|
+
placeholder: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
default: string;
|
|
21
|
+
type: PropType<FilterSearchSize>;
|
|
22
|
+
};
|
|
23
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
+
/** The object that `useChoices()` returns. */
|
|
27
|
+
choices: {
|
|
28
|
+
required: true;
|
|
29
|
+
type: PropType<ChoicesInputSource>;
|
|
30
|
+
};
|
|
31
|
+
/** The accessible name of the input. */
|
|
32
|
+
label: {
|
|
33
|
+
default: string;
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
};
|
|
36
|
+
placeholder: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
};
|
|
39
|
+
size: {
|
|
40
|
+
default: string;
|
|
41
|
+
type: PropType<FilterSearchSize>;
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{}>, {
|
|
44
|
+
label: string;
|
|
45
|
+
size: FilterSearchSize;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
//#endregion
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { r as useUIComponent } from "../../nuxt-ui-DSQFzq3s.js";
|
|
2
|
+
import { ChoicesInput, ChoicesInputClear, ChoicesInputError, ChoicesInputField, ChoicesInputStatus } from "../headless/choices-input.js";
|
|
3
|
+
import { defineComponent, h } from "vue";
|
|
4
|
+
//#region src/components/filter-search.ts
|
|
5
|
+
const FilterSearch = defineComponent({
|
|
6
|
+
name: "FilterSearch",
|
|
7
|
+
props: {
|
|
8
|
+
/** The object that `useChoices()` returns. */
|
|
9
|
+
choices: {
|
|
10
|
+
required: true,
|
|
11
|
+
type: Object
|
|
12
|
+
},
|
|
13
|
+
/** The accessible name of the input. */
|
|
14
|
+
label: {
|
|
15
|
+
default: "Search",
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
placeholder: { type: String },
|
|
19
|
+
size: {
|
|
20
|
+
default: "md",
|
|
21
|
+
type: String
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(props, { slots }) {
|
|
25
|
+
const UButton = useUIComponent("UButton");
|
|
26
|
+
const UIcon = useUIComponent("UIcon");
|
|
27
|
+
const UInput = useUIComponent("UInput");
|
|
28
|
+
return () => h(ChoicesInput, {
|
|
29
|
+
choices: props.choices,
|
|
30
|
+
class: "vh-filter-search"
|
|
31
|
+
}, () => [
|
|
32
|
+
h(ChoicesInputField, {
|
|
33
|
+
as: UInput,
|
|
34
|
+
class: "w-full",
|
|
35
|
+
label: props.label,
|
|
36
|
+
placeholder: props.placeholder,
|
|
37
|
+
size: props.size
|
|
38
|
+
}, {
|
|
39
|
+
leading: slots.leading,
|
|
40
|
+
trailing: () => [props.choices.status.value === "thinking" ? h(UIcon, {
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
class: "animate-spin",
|
|
43
|
+
name: "i-lucide-loader-circle"
|
|
44
|
+
}) : props.choices.text.value !== "" ? h(ChoicesInputClear, {
|
|
45
|
+
as: UButton,
|
|
46
|
+
color: "neutral",
|
|
47
|
+
icon: "i-lucide-x",
|
|
48
|
+
size: "xs",
|
|
49
|
+
variant: "link"
|
|
50
|
+
}) : null, slots.trailing?.()]
|
|
51
|
+
}),
|
|
52
|
+
h("span", { "data-slot": "visually-hidden" }, [h(ChoicesInputStatus)]),
|
|
53
|
+
h(ChoicesInputError, { class: "vh-filter-search-error" }, { default: ({ error }) => slots.error?.({ error }) ?? error?.message })
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { FilterSearch };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
import { MarkdownDocumentProps, MarkdownProps } from "@comark/vue";
|
|
3
|
+
//#region src/components/markdown-renderer.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The part of `Markdown` that parses and renders: Comark, the comark-ui preset, and their plugins. `Markdown` loads it
|
|
6
|
+
* with the first Markdown that renders, and passes its own props and attributes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MarkdownRenderer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
|
+
components: {
|
|
10
|
+
type: PropType<MarkdownProps["components"]>;
|
|
11
|
+
};
|
|
12
|
+
options: {
|
|
13
|
+
type: PropType<MarkdownProps["options"]>;
|
|
14
|
+
};
|
|
15
|
+
plugins: {
|
|
16
|
+
type: PropType<MarkdownProps["plugins"]>;
|
|
17
|
+
};
|
|
18
|
+
streaming: {
|
|
19
|
+
default: boolean;
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
};
|
|
22
|
+
value: {
|
|
23
|
+
default: string;
|
|
24
|
+
type: PropType<string | NonNullable<MarkdownDocumentProps["value"]>>;
|
|
25
|
+
};
|
|
26
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
components: {
|
|
30
|
+
type: PropType<MarkdownProps["components"]>;
|
|
31
|
+
};
|
|
32
|
+
options: {
|
|
33
|
+
type: PropType<MarkdownProps["options"]>;
|
|
34
|
+
};
|
|
35
|
+
plugins: {
|
|
36
|
+
type: PropType<MarkdownProps["plugins"]>;
|
|
37
|
+
};
|
|
38
|
+
streaming: {
|
|
39
|
+
default: boolean;
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
};
|
|
42
|
+
value: {
|
|
43
|
+
default: string;
|
|
44
|
+
type: PropType<string | NonNullable<MarkdownDocumentProps["value"]>>;
|
|
45
|
+
};
|
|
46
|
+
}>> & Readonly<{}>, {
|
|
47
|
+
value: string | NonNullable<import("comark").MarkdownDocument<Record<string, any>, Record<string, any>> | {
|
|
48
|
+
nodes: import("comark").MarkdownDocument["nodes"];
|
|
49
|
+
} | undefined>;
|
|
50
|
+
streaming: boolean;
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
52
|
+
//#endregion
|