@bysages/solid 0.4.4 → 0.5.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 +2 -2
- package/dist/ai-NX47X8sz.mjs +365 -0
- package/dist/ai-prompt-input-CEnnpkgi.mjs +486 -0
- package/dist/{ai-response-CJ-uEAgj.mjs → ai-response-BM_DVIDY.mjs} +25 -27
- package/dist/{chevron-BHQrYKPM.mjs → chevron-DGKPHc2O.mjs} +2 -3
- package/dist/components/accordion/index.d.mts +1 -2
- package/dist/components/accordion/index.mjs +9 -16
- package/dist/components/affix/index.d.mts +1 -3
- package/dist/components/affix/index.mjs +19 -18
- package/dist/components/ai/index.d.mts +95 -2
- package/dist/components/ai/index.mjs +7 -69
- package/dist/components/ai-action/index.d.mts +0 -2
- package/dist/components/ai-action/index.mjs +4 -5
- package/dist/components/ai-attachments/index.d.mts +0 -2
- package/dist/components/ai-attachments/index.mjs +39 -52
- package/dist/components/ai-message/index.d.mts +2 -15
- package/dist/components/ai-message/index.mjs +18 -15
- package/dist/components/ai-prompt-input/index.d.mts +19 -15
- package/dist/components/ai-prompt-input/index.mjs +1 -168
- package/dist/components/ai-reasoning/index.d.mts +0 -2
- package/dist/components/ai-reasoning/index.mjs +8 -13
- package/dist/components/ai-response/index.d.mts +1 -3
- package/dist/components/ai-response/index.mjs +1 -2
- package/dist/components/ai-source/index.d.mts +0 -2
- package/dist/components/ai-source/index.mjs +25 -26
- package/dist/components/ai-suggestion/index.d.mts +0 -2
- package/dist/components/ai-suggestion/index.mjs +3 -4
- package/dist/components/ai-tool/index.d.mts +2 -25
- package/dist/components/ai-tool/index.mjs +75 -40
- package/dist/components/alert/index.d.mts +1 -2
- package/dist/components/alert/index.mjs +38 -33
- package/dist/components/angle-slider/index.d.mts +1 -2
- package/dist/components/angle-slider/index.mjs +6 -9
- package/dist/components/aspect-ratio/index.d.mts +1 -3
- package/dist/components/aspect-ratio/index.mjs +18 -17
- package/dist/components/autocomplete/index.d.mts +1 -2
- package/dist/components/autocomplete/index.mjs +6 -8
- package/dist/components/avatar/index.d.mts +1 -2
- package/dist/components/avatar/index.mjs +6 -7
- package/dist/components/avatar-group/index.d.mts +1 -3
- package/dist/components/avatar-group/index.mjs +15 -14
- package/dist/components/back-top/index.d.mts +1 -3
- package/dist/components/back-top/index.mjs +29 -34
- package/dist/components/badge/index.d.mts +1 -3
- package/dist/components/badge/index.mjs +18 -17
- package/dist/components/banner/index.d.mts +1 -2
- package/dist/components/banner/index.mjs +32 -31
- package/dist/components/bento/index.d.mts +1 -3
- package/dist/components/bento/index.mjs +30 -31
- package/dist/components/block-ui/index.d.mts +1 -3
- package/dist/components/block-ui/index.mjs +30 -33
- package/dist/components/breadcrumb/index.d.mts +1 -2
- package/dist/components/breadcrumb/index.mjs +8 -13
- package/dist/components/browser/index.d.mts +1 -3
- package/dist/components/browser/index.mjs +50 -51
- package/dist/components/button/index.d.mts +1 -3
- package/dist/components/button/index.mjs +31 -30
- package/dist/components/button-group/index.d.mts +1 -3
- package/dist/components/button-group/index.mjs +21 -20
- package/dist/components/calendar/index.d.mts +0 -2
- package/dist/components/calendar/index.mjs +73 -116
- package/dist/components/card/index.d.mts +1 -3
- package/dist/components/card/index.mjs +3 -4
- package/dist/components/carousel/index.d.mts +1 -2
- package/dist/components/carousel/index.mjs +6 -7
- package/dist/components/cascade-select/index.d.mts +1 -3
- package/dist/components/cascade-select/index.mjs +127 -167
- package/dist/components/checkbox/index.d.mts +1 -2
- package/dist/components/checkbox/index.mjs +7 -10
- package/dist/components/checkbox-group/index.d.mts +1 -2
- package/dist/components/checkbox-group/index.mjs +9 -12
- package/dist/components/chip/index.d.mts +1 -3
- package/dist/components/chip/index.mjs +22 -25
- package/dist/components/client-only/index.d.mts +0 -2
- package/dist/components/client-only/index.mjs +2 -3
- package/dist/components/clipboard/index.d.mts +1 -2
- package/dist/components/clipboard/index.mjs +10 -17
- package/dist/components/collapsible/index.d.mts +1 -2
- package/dist/components/collapsible/index.mjs +7 -14
- package/dist/components/collection/index.mjs +1 -2
- package/dist/components/color-picker/index.d.mts +1 -2
- package/dist/components/color-picker/index.mjs +10 -14
- package/dist/components/combobox/index.d.mts +1 -2
- package/dist/components/combobox/index.mjs +9 -14
- package/dist/components/command/index.d.mts +1 -2
- package/dist/components/command/index.mjs +63 -80
- package/dist/components/comment/index.d.mts +1 -3
- package/dist/components/comment/index.mjs +64 -80
- package/dist/components/config-provider/index.d.mts +1 -3
- package/dist/components/config-provider/index.mjs +10 -13
- package/dist/components/container/index.d.mts +1 -3
- package/dist/components/container/index.mjs +18 -17
- package/dist/components/data-view/index.d.mts +1 -3
- package/dist/components/data-view/index.mjs +81 -90
- package/dist/components/date-input/index.d.mts +1 -2
- package/dist/components/date-input/index.mjs +6 -9
- package/dist/components/date-picker/index.d.mts +1 -2
- package/dist/components/date-picker/index.mjs +11 -16
- package/dist/components/deferred-content/index.d.mts +1 -3
- package/dist/components/deferred-content/index.mjs +24 -25
- package/dist/components/descriptions/index.d.mts +1 -2
- package/dist/components/descriptions/index.mjs +40 -39
- package/dist/components/dialog/index.d.mts +11 -2
- package/dist/components/dialog/index.mjs +78 -40
- package/dist/components/dock/index.d.mts +1 -3
- package/dist/components/dock/index.mjs +29 -30
- package/dist/components/download-trigger/index.d.mts +0 -2
- package/dist/components/download-trigger/index.mjs +2 -3
- package/dist/components/drawer/index.d.mts +1 -2
- package/dist/components/drawer/index.mjs +9 -18
- package/dist/components/dynamic-input/index.d.mts +1 -3
- package/dist/components/dynamic-input/index.mjs +73 -77
- package/dist/components/editable/index.d.mts +1 -2
- package/dist/components/editable/index.mjs +7 -10
- package/dist/components/ellipsis/index.d.mts +1 -3
- package/dist/components/ellipsis/index.mjs +21 -20
- package/dist/components/empty/index.d.mts +1 -3
- package/dist/components/empty/index.mjs +3 -4
- package/dist/components/field/index.d.mts +1 -2
- package/dist/components/field/index.mjs +4 -5
- package/dist/components/fieldset/index.d.mts +1 -2
- package/dist/components/fieldset/index.mjs +6 -9
- package/dist/components/file-upload/index.d.mts +1 -2
- package/dist/components/file-upload/index.mjs +6 -7
- package/dist/components/float-button/index.d.mts +1 -2
- package/dist/components/float-button/index.mjs +41 -43
- package/dist/components/floating-panel/index.d.mts +1 -2
- package/dist/components/floating-panel/index.mjs +10 -21
- package/dist/components/focus-trap/index.d.mts +0 -2
- package/dist/components/focus-trap/index.mjs +2 -3
- package/dist/components/form/index.d.mts +0 -2
- package/dist/components/form/index.mjs +42 -58
- package/dist/components/format/index.d.mts +1 -3
- package/dist/components/format/index.mjs +1 -2
- package/dist/components/frame/index.d.mts +1 -2
- package/dist/components/frame/index.mjs +3 -4
- package/dist/components/grid/index.d.mts +1 -3
- package/dist/components/grid/index.mjs +23 -22
- package/dist/components/highlight/index.d.mts +1 -3
- package/dist/components/highlight/index.mjs +2 -3
- package/dist/components/hover-card/index.d.mts +1 -2
- package/dist/components/hover-card/index.mjs +12 -27
- package/dist/components/icon/index.d.mts +1 -3
- package/dist/components/icon/index.mjs +35 -36
- package/dist/components/image/index.d.mts +1 -3
- package/dist/components/image/index.mjs +48 -52
- package/dist/components/image-cropper/index.d.mts +1 -2
- package/dist/components/image-cropper/index.mjs +5 -6
- package/dist/components/image-viewer/index.d.mts +1 -1
- package/dist/components/image-viewer/index.mjs +1 -2
- package/dist/components/input/index.d.mts +1 -3
- package/dist/components/input/index.mjs +1 -2
- package/dist/components/input-group/index.d.mts +1 -2
- package/dist/components/input-group/index.mjs +19 -16
- package/dist/components/json-tree-view/index.d.mts +1 -2
- package/dist/components/json-tree-view/index.mjs +5 -6
- package/dist/components/kbd/index.d.mts +1 -3
- package/dist/components/kbd/index.mjs +12 -11
- package/dist/components/layout/index.d.mts +1 -2
- package/dist/components/layout/index.mjs +92 -84
- package/dist/components/link/index.d.mts +1 -3
- package/dist/components/link/index.mjs +15 -15
- package/dist/components/list/index.d.mts +1 -2
- package/dist/components/list/index.mjs +57 -61
- package/dist/components/listbox/index.d.mts +1 -2
- package/dist/components/listbox/index.mjs +8 -11
- package/dist/components/marquee/index.d.mts +1 -2
- package/dist/components/marquee/index.mjs +7 -8
- package/dist/components/masonry/index.d.mts +1 -3
- package/dist/components/masonry/index.mjs +19 -18
- package/dist/components/media-player/index.d.mts +1 -1
- package/dist/components/media-player/index.mjs +1 -2
- package/dist/components/mentions/index.d.mts +2 -2
- package/dist/components/mentions/index.mjs +1 -3
- package/dist/components/menu/index.d.mts +1 -2
- package/dist/components/menu/index.mjs +8 -17
- package/dist/components/menubar/index.d.mts +1 -2
- package/dist/components/menubar/index.mjs +66 -72
- package/dist/components/meter/index.d.mts +1 -2
- package/dist/components/meter/index.mjs +42 -43
- package/dist/components/navigation-menu/index.d.mts +1 -2
- package/dist/components/navigation-menu/index.mjs +7 -12
- package/dist/components/number-input/index.d.mts +1 -2
- package/dist/components/number-input/index.mjs +7 -10
- package/dist/components/order-list/index.d.mts +1 -3
- package/dist/components/order-list/index.mjs +86 -101
- package/dist/components/page-header/index.d.mts +1 -3
- package/dist/components/page-header/index.mjs +3 -4
- package/dist/components/pagination/index.d.mts +1 -2
- package/dist/components/pagination/index.mjs +31 -42
- package/dist/components/password-input/index.d.mts +1 -2
- package/dist/components/password-input/index.mjs +6 -7
- package/dist/components/pin-input/index.d.mts +1 -2
- package/dist/components/pin-input/index.mjs +6 -9
- package/dist/components/popconfirm/index.d.mts +2 -3
- package/dist/components/popconfirm/index.mjs +15 -23
- package/dist/components/popover/index.d.mts +2 -26
- package/dist/components/popover/index.mjs +10 -21
- package/dist/components/presence/index.d.mts +0 -2
- package/dist/components/presence/index.mjs +2 -3
- package/dist/components/progress/index.d.mts +1 -2
- package/dist/components/progress/index.mjs +14 -26
- package/dist/components/progress-group/index.d.mts +1 -3
- package/dist/components/progress-group/index.mjs +60 -68
- package/dist/components/qr-code/index.d.mts +1 -2
- package/dist/components/qr-code/index.mjs +5 -8
- package/dist/components/radio-group/index.d.mts +1 -2
- package/dist/components/radio-group/index.mjs +6 -9
- package/dist/components/rating-group/index.d.mts +1 -2
- package/dist/components/rating-group/index.mjs +7 -10
- package/dist/components/result/index.d.mts +1 -2
- package/dist/components/result/index.mjs +28 -29
- package/dist/components/scroll-area/index.d.mts +8 -3
- package/dist/components/scroll-area/index.mjs +19 -11
- package/dist/components/segment-group/index.d.mts +1 -2
- package/dist/components/segment-group/index.mjs +5 -8
- package/dist/components/select/index.d.mts +1 -1
- package/dist/components/select/index.mjs +1 -2
- package/dist/components/separator/index.d.mts +1 -3
- package/dist/components/separator/index.mjs +21 -20
- package/dist/components/signature-pad/index.d.mts +1 -2
- package/dist/components/signature-pad/index.mjs +7 -10
- package/dist/components/skeleton/index.d.mts +1 -3
- package/dist/components/skeleton/index.mjs +12 -11
- package/dist/components/slider/index.d.mts +1 -2
- package/dist/components/slider/index.mjs +6 -9
- package/dist/components/spinner/index.d.mts +1 -3
- package/dist/components/spinner/index.mjs +20 -19
- package/dist/components/split-button/index.d.mts +1 -2
- package/dist/components/split-button/index.mjs +92 -94
- package/dist/components/splitter/index.d.mts +1 -2
- package/dist/components/splitter/index.mjs +5 -8
- package/dist/components/spotlight/index.d.mts +1 -3
- package/dist/components/spotlight/index.mjs +22 -23
- package/dist/components/stack/index.d.mts +1 -3
- package/dist/components/stack/index.mjs +24 -23
- package/dist/components/stat/index.d.mts +1 -2
- package/dist/components/stat/index.mjs +15 -14
- package/dist/components/steps/index.d.mts +0 -2
- package/dist/components/steps/index.mjs +10 -17
- package/dist/components/swap/index.d.mts +1 -2
- package/dist/components/swap/index.mjs +5 -6
- package/dist/components/switch/index.d.mts +1 -2
- package/dist/components/switch/index.mjs +6 -9
- package/dist/components/table/index.d.mts +0 -2
- package/dist/components/table/index.mjs +233 -320
- package/dist/components/tabs/index.d.mts +8 -12
- package/dist/components/tabs/index.mjs +83 -34
- package/dist/components/tag/index.d.mts +1 -2
- package/dist/components/tag/index.mjs +46 -70
- package/dist/components/tags-input/index.d.mts +1 -2
- package/dist/components/tags-input/index.mjs +7 -10
- package/dist/components/terminal/index.d.mts +3 -3
- package/dist/components/terminal/index.mjs +61 -56
- package/dist/components/textarea/index.d.mts +1 -3
- package/dist/components/textarea/index.mjs +10 -11
- package/dist/components/timeline/index.d.mts +1 -2
- package/dist/components/timeline/index.mjs +15 -14
- package/dist/components/timer/index.d.mts +1 -2
- package/dist/components/timer/index.mjs +5 -6
- package/dist/components/toast/index.d.mts +0 -2
- package/dist/components/toast/index.mjs +5 -6
- package/dist/components/toc/index.d.mts +1 -1
- package/dist/components/toc/index.mjs +1 -2
- package/dist/components/toggle/index.d.mts +1 -2
- package/dist/components/toggle/index.mjs +5 -6
- package/dist/components/toggle-group/index.d.mts +1 -2
- package/dist/components/toggle-group/index.mjs +11 -16
- package/dist/components/toolbar/index.d.mts +1 -3
- package/dist/components/toolbar/index.mjs +27 -31
- package/dist/components/tooltip/index.d.mts +1 -2
- package/dist/components/tooltip/index.mjs +7 -16
- package/dist/components/tour/index.d.mts +0 -2
- package/dist/components/tour/index.mjs +11 -16
- package/dist/components/transfer/index.d.mts +1 -2
- package/dist/components/transfer/index.mjs +115 -126
- package/dist/components/tree-select/index.d.mts +2 -3
- package/dist/components/tree-select/index.mjs +24 -33
- package/dist/components/tree-view/index.d.mts +10 -4
- package/dist/components/tree-view/index.mjs +32 -23
- package/dist/components/typography/index.d.mts +2 -3
- package/dist/components/typography/index.mjs +4 -4
- package/dist/components/user/index.d.mts +1 -3
- package/dist/components/user/index.mjs +40 -57
- package/dist/components/virtual-list/index.d.mts +1 -3
- package/dist/components/virtual-list/index.mjs +39 -45
- package/dist/components/watermark/index.d.mts +1 -3
- package/dist/components/watermark/index.mjs +15 -22
- package/dist/{element-dGIhOTJ6.mjs → element-liigPBUh.mjs} +1 -2
- package/dist/{family-Cmd8HEyK.mjs → family-B5HtE0on.mjs} +1 -2
- package/dist/generative/index.d.mts +0 -2
- package/dist/generative/index.mjs +28 -53
- package/dist/{icon-DTqmJCd5.mjs → icon-DQqYA2fO.mjs} +11 -17
- package/dist/{id-2ygNzPHF.mjs → id-DGvz-2rQ.mjs} +1 -2
- package/dist/{image-viewer-19s75Hz_.mjs → image-viewer-TEia4PaY.mjs} +73 -101
- package/dist/{index-BU5U5w04.d.mts → index-B4WyTngM.d.mts} +0 -4
- package/dist/index-BRvSfkKs.d.mts +25 -0
- package/dist/{index-DhripUtf.d.mts → index-CTsFsYdA.d.mts} +0 -4
- package/dist/index-CutrHCzU.d.mts +153 -0
- package/dist/{index-wW28BYf1.d.mts → index-CwmZdzxT.d.mts} +0 -8
- package/dist/index-DK7YgaAU.d.mts +37 -0
- package/dist/index-Dms00480.d.mts +115 -0
- package/dist/{index-ID48LCMU.d.mts → index-Dv6mwzIr.d.mts} +3 -7
- package/dist/index.d.mts +13 -13
- package/dist/index.mjs +12 -12
- package/dist/{input-BL3N3L8g.mjs → input-2xfPP-7Z.mjs} +11 -13
- package/dist/{media-player-yF7KVUxM.mjs → media-player-LHnTiSiN.mjs} +248 -259
- package/dist/mentions-CvY9IGzc.mjs +438 -0
- package/dist/{select-DI7pFspF.mjs → select-NaNlrYUT.mjs} +72 -96
- package/dist/{toc-DRHr8_eD.mjs → toc-RnPG3w7q.mjs} +5 -7
- package/dist/{use-component-messages-C4SCVYjD.mjs → use-component-messages-DS9ppb4C.mjs} +1 -2
- package/package.json +13 -13
- package/dist/index-DEArHiFI.d.mts +0 -104
- package/dist/index-DVc1L_zt.d.mts +0 -10435
- package/dist/mentions-DKUG7eHt.mjs +0 -279
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { t as defineFamily } from "./family-
|
|
2
|
-
import { r as iconNode } from "./icon-
|
|
3
|
-
import { t as useElementId } from "./id-
|
|
1
|
+
import { t as defineFamily } from "./family-B5HtE0on.mjs";
|
|
2
|
+
import { r as iconNode } from "./icon-DQqYA2fO.mjs";
|
|
3
|
+
import { t as useElementId } from "./id-DGvz-2rQ.mjs";
|
|
4
4
|
import { Button } from "./components/button/index.mjs";
|
|
5
|
-
import { n as useComponentMessages } from "./use-component-messages-
|
|
5
|
+
import { n as useComponentMessages } from "./use-component-messages-DS9ppb4C.mjs";
|
|
6
6
|
import { ButtonGroup } from "./components/button-group/index.mjs";
|
|
7
7
|
import { Dialog as Dialog$1 } from "./components/dialog/index.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { createImageViewerGestures } from "@bysages/core";
|
|
9
|
+
import { Portal, createComponent, effect, insert, memo, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
|
|
9
10
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
10
|
-
import { Show, createEffect, createSignal, splitProps } from "solid-js";
|
|
11
|
-
import { Portal } from "solid-js/web";
|
|
11
|
+
import { Show, createEffect, createSignal, onCleanup, splitProps } from "solid-js";
|
|
12
12
|
import { Dialog } from "@ark-ui/solid/dialog";
|
|
13
|
-
|
|
14
|
-
var _tmpl$$1 =
|
|
15
|
-
var _tmpl$2$1 =
|
|
16
|
-
var _tmpl$3 =
|
|
13
|
+
// src/components/image-viewer/preview.tsx
|
|
14
|
+
var _tmpl$$1 = /*#__PURE__*/ template(`<span data-part=preview-label>`);
|
|
15
|
+
var _tmpl$2$1 = /*#__PURE__*/ template(`<span data-scope=image-viewer data-part=preview-overlay aria-hidden=true>`);
|
|
16
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<span>`);
|
|
17
17
|
/** The default doorway is the curated preview icon; custom content keeps
|
|
18
18
|
* that icon as its hover and focus affordance. */
|
|
19
19
|
function ImageViewerPreview(props) {
|
|
@@ -22,61 +22,46 @@ function ImageViewerPreview(props) {
|
|
|
22
22
|
const [own, triggerProps, rest] = splitProps(props, ["label", "children"], ["data-part"]);
|
|
23
23
|
const parts = [triggerProps["data-part"], "preview"].filter(Boolean).join(" ");
|
|
24
24
|
const isIcon = () => own.children == null;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
rest,
|
|
28
|
-
{
|
|
25
|
+
return (() => {
|
|
26
|
+
var _el$ = _tmpl$3();
|
|
27
|
+
spread(_el$, mergeProps(rest, {
|
|
29
28
|
"data-scope": "image-viewer",
|
|
30
29
|
"data-part": parts
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
], true);
|
|
39
|
-
insert(_el$, createComponent(Show, {
|
|
40
|
-
get when() {
|
|
41
|
-
return own.children;
|
|
42
|
-
},
|
|
43
|
-
get fallback() {
|
|
44
|
-
return iconNode("eye");
|
|
45
|
-
},
|
|
46
|
-
get children() {
|
|
47
|
-
return [memo(() => {
|
|
30
|
+
}, () => isIcon() ? {
|
|
31
|
+
"data-empty": "true",
|
|
32
|
+
"aria-label": messages().imageViewer.preview
|
|
33
|
+
} : {}), false, true);
|
|
34
|
+
insert(_el$, createComponent(Show, {
|
|
35
|
+
get when() {
|
|
48
36
|
return own.children;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
get children() {
|
|
61
|
-
var _el$4 = _tmpl$$1();
|
|
62
|
-
insert(_el$4, () => {
|
|
37
|
+
},
|
|
38
|
+
get fallback() {
|
|
39
|
+
return iconNode("eye");
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
return [memo(() => own.children), (() => {
|
|
43
|
+
var _el$2 = _tmpl$2$1();
|
|
44
|
+
insert(_el$2, () => iconNode("eye"), null);
|
|
45
|
+
insert(_el$2, createComponent(Show, {
|
|
46
|
+
get when() {
|
|
63
47
|
return own.label;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
48
|
+
},
|
|
49
|
+
get children() {
|
|
50
|
+
var _el$3 = _tmpl$$1();
|
|
51
|
+
insert(_el$3, () => own.label);
|
|
52
|
+
return _el$3;
|
|
53
|
+
}
|
|
54
|
+
}), null);
|
|
55
|
+
return _el$2;
|
|
56
|
+
})()];
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
return _el$;
|
|
60
|
+
})();
|
|
73
61
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var _tmpl$ =
|
|
77
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=image-viewer data-part=toolbar>`);
|
|
78
|
-
const MIN_SCALE = .5;
|
|
79
|
-
const MAX_SCALE = 3;
|
|
62
|
+
// src/components/image-viewer/index.tsx
|
|
63
|
+
var _tmpl$ = /*#__PURE__*/ template(`<img data-scope=image-viewer data-part=viewport>`);
|
|
64
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div data-scope=image-viewer data-part=toolbar>`);
|
|
80
65
|
const SCALE_STEP = .25;
|
|
81
66
|
/** The toolbar's icons, drawn from the house icon set. */
|
|
82
67
|
const TOOL_ICONS = {
|
|
@@ -100,25 +85,20 @@ function ImageViewerImpl(props) {
|
|
|
100
85
|
const id = useElementId("image-viewer");
|
|
101
86
|
const messages = useComponentMessages();
|
|
102
87
|
const [localOpen, setLocalOpen] = createSignal(false);
|
|
103
|
-
const [
|
|
104
|
-
|
|
88
|
+
const [viewport, setViewport] = createSignal(null);
|
|
89
|
+
let gestures;
|
|
105
90
|
const isOpen = () => own.open ?? localOpen();
|
|
106
91
|
const setOpen = (value) => {
|
|
107
92
|
if (own.open === void 0) setLocalOpen(value);
|
|
108
93
|
own.onOpenChange?.(value);
|
|
109
94
|
};
|
|
110
95
|
createEffect(() => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
96
|
+
gestures?.stop();
|
|
97
|
+
gestures = void 0;
|
|
98
|
+
const node = viewport();
|
|
99
|
+
if (node) gestures = createImageViewerGestures(node, { zoomable: own.zoomable ?? true });
|
|
115
100
|
});
|
|
116
|
-
|
|
117
|
-
setScale(Math.min(MAX_SCALE, Math.max(MIN_SCALE, scale() + step)));
|
|
118
|
-
}
|
|
119
|
-
function rotate() {
|
|
120
|
-
setRotation((rotation() + 90) % 360);
|
|
121
|
-
}
|
|
101
|
+
onCleanup(() => gestures?.stop());
|
|
122
102
|
function toolButton(label, icon, onClick) {
|
|
123
103
|
return createComponent(Button, {
|
|
124
104
|
variant: "ghost",
|
|
@@ -147,12 +127,12 @@ function ImageViewerImpl(props) {
|
|
|
147
127
|
"data-scope": "image-viewer",
|
|
148
128
|
"data-part": "trigger"
|
|
149
129
|
}), createComponent(Portal, { get children() {
|
|
150
|
-
return [createComponent(Dialog.Backdrop, { class: "bs-image-viewer-backdrop" }), createComponent(Dialog.Positioner, {
|
|
151
|
-
class: "bs-image-viewer-positioner",
|
|
130
|
+
return [createComponent(Dialog.Backdrop, { "class": "bs-image-viewer-backdrop" }), createComponent(Dialog.Positioner, {
|
|
131
|
+
"class": "bs-image-viewer-positioner",
|
|
152
132
|
get children() {
|
|
153
133
|
return createComponent(Dialog.Content, {
|
|
154
|
-
class: "bs-image-viewer-content",
|
|
155
|
-
get "aria-label"() {
|
|
134
|
+
"class": "bs-image-viewer-content",
|
|
135
|
+
get ["aria-label"]() {
|
|
156
136
|
return own.alt || "Image preview";
|
|
157
137
|
},
|
|
158
138
|
onClick: (event) => {
|
|
@@ -161,20 +141,19 @@ function ImageViewerImpl(props) {
|
|
|
161
141
|
get children() {
|
|
162
142
|
return [(() => {
|
|
163
143
|
var _el$ = _tmpl$();
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
e
|
|
174
|
-
t
|
|
175
|
-
a
|
|
176
|
-
o
|
|
177
|
-
i !== _p$?.i && setStyleProperty(_el$, "--bs-image-viewer-transform", i);
|
|
144
|
+
use((element) => setViewport(element), _el$);
|
|
145
|
+
effect((_p$) => {
|
|
146
|
+
var _v$ = own.src, _v$2 = own.alt ?? "", _v$3 = own.width, _v$4 = own.height;
|
|
147
|
+
_v$ !== _p$.e && setAttribute(_el$, "src", _p$.e = _v$);
|
|
148
|
+
_v$2 !== _p$.t && setAttribute(_el$, "alt", _p$.t = _v$2);
|
|
149
|
+
_v$3 !== _p$.a && setAttribute(_el$, "width", _p$.a = _v$3);
|
|
150
|
+
_v$4 !== _p$.o && setAttribute(_el$, "height", _p$.o = _v$4);
|
|
151
|
+
return _p$;
|
|
152
|
+
}, {
|
|
153
|
+
e: void 0,
|
|
154
|
+
t: void 0,
|
|
155
|
+
a: void 0,
|
|
156
|
+
o: void 0
|
|
178
157
|
});
|
|
179
158
|
return _el$;
|
|
180
159
|
})(), (() => {
|
|
@@ -186,21 +165,15 @@ function ImageViewerImpl(props) {
|
|
|
186
165
|
return own.zoomable ?? true;
|
|
187
166
|
},
|
|
188
167
|
get children() {
|
|
189
|
-
return [memo(() =>
|
|
190
|
-
return toolButton(messages().imageViewer.zoomIn, TOOL_ICONS.zoomIn, () => zoom(SCALE_STEP));
|
|
191
|
-
}), memo(() => {
|
|
192
|
-
return toolButton(messages().imageViewer.zoomOut, TOOL_ICONS.zoomOut, () => zoom(-.25));
|
|
193
|
-
})];
|
|
168
|
+
return [memo(() => toolButton(messages().imageViewer.zoomIn, TOOL_ICONS.zoomIn, () => gestures?.zoomBy(SCALE_STEP))), memo(() => toolButton(messages().imageViewer.zoomOut, TOOL_ICONS.zoomOut, () => gestures?.zoomBy(-.25)))];
|
|
194
169
|
}
|
|
195
170
|
}),
|
|
196
|
-
memo(() =>
|
|
197
|
-
return toolButton(messages().imageViewer.rotate, TOOL_ICONS.rotate, rotate);
|
|
198
|
-
}),
|
|
171
|
+
memo(() => toolButton(messages().imageViewer.rotate, TOOL_ICONS.rotate, () => gestures?.rotate())),
|
|
199
172
|
createComponent(Dialog.CloseTrigger, { asChild: (closeProps) => createComponent(Button, mergeProps(closeProps, {
|
|
200
173
|
variant: "ghost",
|
|
201
174
|
square: true,
|
|
202
175
|
size: "lg",
|
|
203
|
-
get "aria-label"() {
|
|
176
|
+
get ["aria-label"]() {
|
|
204
177
|
return messages().imageViewer.close;
|
|
205
178
|
},
|
|
206
179
|
get children() {
|
|
@@ -224,5 +197,4 @@ const viewerParts = {
|
|
|
224
197
|
Preview: ImageViewerPreview
|
|
225
198
|
};
|
|
226
199
|
const ImageViewer = defineFamily(ImageViewerImpl, viewerParts);
|
|
227
|
-
//#endregion
|
|
228
200
|
export { ImageViewer as t };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { ComponentProps } from "solid-js";
|
|
2
2
|
import { Toc } from "@ark-ui/solid/toc";
|
|
3
|
-
//#region src/components/toc/TocIndicator.d.ts
|
|
4
3
|
/** The active stroke is decoration; hidden so the list reads as links
|
|
5
4
|
* alone. */
|
|
6
5
|
declare function TocIndicator(props: ComponentProps<typeof Toc.Indicator>): import("solid-js").JSX.Element;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/toc/index.d.ts
|
|
9
6
|
/** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
|
|
10
7
|
* beside the scroll, one stroke of primary ink marking where the reader
|
|
11
8
|
* stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
|
|
@@ -31,5 +28,4 @@ declare const Toc$1: typeof TocFacade & Omit<typeof Toc, "Root" | "Indicator" |
|
|
|
31
28
|
Indicator: typeof TocIndicator;
|
|
32
29
|
Content: typeof TocContent;
|
|
33
30
|
};
|
|
34
|
-
//#endregion
|
|
35
31
|
export { TocFacadeProps as n, Toc$1 as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "solid-js";
|
|
2
|
+
import { Popover } from "@ark-ui/solid/popover";
|
|
3
|
+
/** Ark's Popover, dressed in the paper-and-ink system: a paper vessel that
|
|
4
|
+
* dissolves in on elevation, anchored to its trigger by a whisker arrow. The
|
|
5
|
+
* API is Ark's own — Root, Trigger, Anchor, Indicator, Positioner, Content,
|
|
6
|
+
* Title, Description, CloseTrigger, Arrow, ArrowTip. */
|
|
7
|
+
declare function PopoverRoot(props: ComponentProps<typeof Popover.Root>): JSX.Element;
|
|
8
|
+
type PopoverPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
9
|
+
interface PopoverFacadeProps {
|
|
10
|
+
open?: boolean;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
trigger?: string | Element;
|
|
13
|
+
content?: string;
|
|
14
|
+
label: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
placement?: PopoverPlacement;
|
|
18
|
+
children?: JSX.Element;
|
|
19
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
declare function PopoverFacade(props: PopoverFacadeProps): JSX.Element;
|
|
22
|
+
declare const Popover$1: typeof PopoverFacade & Omit<typeof Popover, "Root"> & {
|
|
23
|
+
Root: typeof PopoverRoot;
|
|
24
|
+
};
|
|
25
|
+
export { PopoverFacadeProps as n, Popover$1 as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Dialog } from "./components/dialog/index.mjs";
|
|
2
2
|
import { JSX } from "solid-js";
|
|
3
|
-
//#region src/components/image-viewer/preview.d.ts
|
|
4
3
|
interface ImageViewerPreviewProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "children"> {
|
|
5
4
|
/** Visible beside the affordance over custom content. */
|
|
6
5
|
label?: string;
|
|
@@ -11,8 +10,6 @@ interface ImageViewerPreviewProps extends Omit<JSX.HTMLAttributes<HTMLElement>,
|
|
|
11
10
|
/** The default doorway is the curated preview icon; custom content keeps
|
|
12
11
|
* that icon as its hover and focus affordance. */
|
|
13
12
|
declare function ImageViewerPreview(props: ImageViewerPreviewProps): JSX.Element;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/components/image-viewer/index.d.ts
|
|
16
13
|
/**
|
|
17
14
|
* Opens the full lightbox from a curated icon by default, or from any
|
|
18
15
|
* wrapped button, image or other doorway. Zoom, rotation, Escape and the scrim
|
|
@@ -35,5 +32,4 @@ declare function ImageViewerImpl(props: ImageViewerProps): JSX.Element;
|
|
|
35
32
|
declare const ImageViewer: typeof ImageViewerImpl & (typeof Dialog & {
|
|
36
33
|
Preview: typeof ImageViewerPreview;
|
|
37
34
|
});
|
|
38
|
-
//#endregion
|
|
39
35
|
export { ImageViewerProps as n, ImageViewer as t };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { t as Popover } from "./index-BRvSfkKs.mjs";
|
|
2
|
+
import { Accessor, JSX } from "solid-js";
|
|
3
|
+
type MentionCommitKey = "Enter" | "Tab" | " ";
|
|
4
|
+
type MentionTriggers = string | string[];
|
|
5
|
+
interface UseMentionsOptions {
|
|
6
|
+
/** The candidates offered once a trigger character is typed. */
|
|
7
|
+
items: MentionEntry[];
|
|
8
|
+
/** The character that summons the candidates. */
|
|
9
|
+
trigger?: string;
|
|
10
|
+
/** One or more summoning characters; the token closest to the caret
|
|
11
|
+
* wins when several triggers are active. */
|
|
12
|
+
triggers?: MentionTriggers;
|
|
13
|
+
/** Keys that choose the highlighted candidate. */
|
|
14
|
+
commitKeys?: MentionCommitKey[];
|
|
15
|
+
}
|
|
16
|
+
interface UseMentionsHandlers {
|
|
17
|
+
/** The text the field holds right now — read at keystroke time, never
|
|
18
|
+
* from a controlled prop that lags a render behind the caret. */
|
|
19
|
+
getText: () => string;
|
|
20
|
+
/** Writes the field's next text: a mention inserted at the token. */
|
|
21
|
+
setText: (value: string) => void;
|
|
22
|
+
/** The absolute text offset of the field caret; a rich editor supplies this.
|
|
23
|
+
* A textarea is read from its own selection when omitted. */
|
|
24
|
+
getCaret?: () => number | undefined;
|
|
25
|
+
/** Called before insertion. Return `false` to record the choice without
|
|
26
|
+
* rewriting composer text — useful for slash commands and context chips. */
|
|
27
|
+
select?: (entry: MentionEntry) => boolean | void;
|
|
28
|
+
/** Replaces default insertion so rich editors can commit their own token. */
|
|
29
|
+
commit?: (entry: MentionEntry) => void;
|
|
30
|
+
}
|
|
31
|
+
/** The @-detection machinery behind a mention field: watch the caret,
|
|
32
|
+
* offer the matching candidates, and answer for the keys that drive
|
|
33
|
+
* them. The field element arrives as an accessor because hosts wrap it
|
|
34
|
+
* differently (a bare textarea, a field's own part).
|
|
35
|
+
*
|
|
36
|
+
* `onKeydown` answers whether the vessel consumed the key, so a host
|
|
37
|
+
* with its own Enter semantics — a composer that sends — can yield to
|
|
38
|
+
* the candidates first and act only when the vessel stands down. */
|
|
39
|
+
declare function useMentions(options: Accessor<UseMentionsOptions>, textarea: Accessor<HTMLTextAreaElement | null>, handlers: UseMentionsHandlers): {
|
|
40
|
+
open: Accessor<boolean>;
|
|
41
|
+
matches: Accessor<MentionEntry[]>;
|
|
42
|
+
active: Accessor<number>;
|
|
43
|
+
setActive: import("solid-js").Setter<number>;
|
|
44
|
+
anchorIndex: Accessor<number>;
|
|
45
|
+
caretIndex: Accessor<number>;
|
|
46
|
+
activeTrigger: Accessor<string>;
|
|
47
|
+
insert: (entry: MentionEntry) => void;
|
|
48
|
+
close: () => void;
|
|
49
|
+
onInput: () => void;
|
|
50
|
+
onKeydown: (event: KeyboardEvent) => boolean;
|
|
51
|
+
};
|
|
52
|
+
/** The Anchor's polymorphic wiring is div-typed at the API boundary; the
|
|
53
|
+
* textarea host supplies the concrete element type. */
|
|
54
|
+
type MentionsAnchorProps = JSX.HTMLAttributes<HTMLTextAreaElement>;
|
|
55
|
+
interface MentionEntry {
|
|
56
|
+
/** Stable identity for tests, popups and business handlers. */
|
|
57
|
+
id?: string;
|
|
58
|
+
/** The primary words shown in the popup and inserted by default. */
|
|
59
|
+
label: string;
|
|
60
|
+
/** The semantic value reported by the field. */
|
|
61
|
+
value: string;
|
|
62
|
+
/** One line of supporting copy under the label. */
|
|
63
|
+
description?: string;
|
|
64
|
+
/** A curated core icon name. */
|
|
65
|
+
icon?: string;
|
|
66
|
+
/** Optional section heading; entries with the same heading travel together. */
|
|
67
|
+
group?: string;
|
|
68
|
+
/** The consumer's coarse entry type, such as `file`, `agent` or `command`. */
|
|
69
|
+
kind?: string;
|
|
70
|
+
/** A visible candidate the keyboard and pointer cannot choose. */
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
/** Exact composer text to insert; it bypasses `trigger + label`. */
|
|
73
|
+
insertText?: string;
|
|
74
|
+
/** Extra consumer data carried back through `onSelect`. */
|
|
75
|
+
meta?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
type MentionPlacement = "bottom-start" | "top-start";
|
|
78
|
+
interface MentionsVesselProps {
|
|
79
|
+
open?: boolean;
|
|
80
|
+
matches?: MentionEntry[];
|
|
81
|
+
active?: number;
|
|
82
|
+
/** The live element the vessel points at — the anchor is virtual, a
|
|
83
|
+
* rectangle read off the host's field. */
|
|
84
|
+
anchor?: HTMLElement | null;
|
|
85
|
+
/** Which side of the anchor hosts the candidates. */
|
|
86
|
+
placement?: MentionPlacement;
|
|
87
|
+
/** The host field's rung, so the rows keep the field's register. */
|
|
88
|
+
size?: "sm" | "md" | "lg";
|
|
89
|
+
/** The vessel's stable base id; popup ids derive from it. */
|
|
90
|
+
id?: string;
|
|
91
|
+
onInsert?: (entry: MentionEntry) => void;
|
|
92
|
+
onActiveChange?: (index: number) => void;
|
|
93
|
+
onOpenChange?: (open: boolean) => void;
|
|
94
|
+
/** The host's field, rendered with the popover Anchor's wiring. When
|
|
95
|
+
* absent, the vessel falls back to the `anchor` rectangle. */
|
|
96
|
+
children?: JSX.Element | ((anchorProps: MentionsAnchorProps) => JSX.Element);
|
|
97
|
+
}
|
|
98
|
+
/** The vessel: the candidates themselves as a floating card. A host can
|
|
99
|
+
* render its field through the Anchor; the rectangle fallback keeps the
|
|
100
|
+
* textarea in the host's own anatomy. Shares the detection state with
|
|
101
|
+
* the host through `useMentions`. */
|
|
102
|
+
declare const MentionsVessel: ((props: MentionsVesselProps) => JSX.Element) & {
|
|
103
|
+
Root: (props: MentionsVesselProps) => JSX.Element;
|
|
104
|
+
};
|
|
105
|
+
interface MentionsProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onInput" | "onSelect"> {
|
|
106
|
+
/** The candidates offered once the trigger character is typed. */
|
|
107
|
+
items?: MentionEntry[];
|
|
108
|
+
/** The text held by the field. Supply it to control the field;
|
|
109
|
+
* changes are reported through `onValueChange`. */
|
|
110
|
+
value?: string;
|
|
111
|
+
/** The character that summons the candidates. */
|
|
112
|
+
trigger?: string;
|
|
113
|
+
/** One or more summoning characters, such as `@` and `/`. */
|
|
114
|
+
triggers?: MentionTriggers;
|
|
115
|
+
/** Keep composer text untouched when a candidate is selected. */
|
|
116
|
+
insertOnSelect?: boolean;
|
|
117
|
+
/** Keys that choose the highlighted candidate. */
|
|
118
|
+
commitKeys?: MentionCommitKey[];
|
|
119
|
+
/** Which side of the field hosts the candidates. */
|
|
120
|
+
placement?: MentionPlacement;
|
|
121
|
+
placeholder?: string;
|
|
122
|
+
/** Let the field grow with its text instead of holding `rows`. */
|
|
123
|
+
autoresize?: boolean;
|
|
124
|
+
/** Standing alone, the field styles itself from this flag; inside a
|
|
125
|
+
* `Field.Root` the field's own invalid state takes over. */
|
|
126
|
+
invalid?: boolean;
|
|
127
|
+
/** One rung of the control-height ladder for the resting field. */
|
|
128
|
+
size?: "sm" | "md" | "lg";
|
|
129
|
+
/** The field's text changed. */
|
|
130
|
+
onValueChange?: (value: string) => void;
|
|
131
|
+
/** A candidate was chosen, including when `insertOnSelect` keeps the
|
|
132
|
+
* composer text untouched. */
|
|
133
|
+
onSelect?: (entry: MentionEntry) => void;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @-mentions: a plain textarea that, when the text before the caret ends
|
|
137
|
+
* with a trigger character followed by a token, offers matching
|
|
138
|
+
* candidates in a small anchored vessel. Entries may carry descriptions,
|
|
139
|
+
* icons, groups and consumer metadata. Selecting reports the whole
|
|
140
|
+
* entry; by default it also replaces the token with the trigger that
|
|
141
|
+
* opened it plus the label. Arrows move, Enter inserts, Escape dismisses.
|
|
142
|
+
*
|
|
143
|
+
* The field is the shared `Field.Textarea` — field wiring (label ids,
|
|
144
|
+
* the invalid state, autoresize) rides on it for free — and the vessel
|
|
145
|
+
* anchors to the field as a whole (popover machinery), not to the caret
|
|
146
|
+
* coordinates; caret-precise positioning would need a second positioning
|
|
147
|
+
* system for no practical gain at typical field sizes. Composers that
|
|
148
|
+
* keep their own field anatomy (the AI prompt input) skip this shell and
|
|
149
|
+
* wire `useMentions` plus `MentionsVessel` themselves.
|
|
150
|
+
*/
|
|
151
|
+
declare function MentionsImpl(props: MentionsProps): JSX.Element;
|
|
152
|
+
declare const Mentions: typeof MentionsImpl & typeof Popover;
|
|
153
|
+
export { MentionsVessel as a, MentionTriggers as c, useMentions as d, MentionsProps as i, UseMentionsHandlers as l, MentionPlacement as n, MentionsVesselProps as o, Mentions as r, MentionCommitKey as s, MentionEntry as t, UseMentionsOptions as u };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Accessor, Component, JSX } from "solid-js";
|
|
2
|
-
//#region src/components/media-player/parts.d.ts
|
|
3
2
|
type MediaPartProps = JSX.HTMLAttributes<HTMLElement>;
|
|
4
3
|
type ButtonPartProps = JSX.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
4
|
label?: string;
|
|
@@ -34,8 +33,6 @@ declare function Captions(props: LabeledDivPartProps): JSX.Element;
|
|
|
34
33
|
declare function PipButton(props: ButtonPartProps): JSX.Element;
|
|
35
34
|
/** Fullscreen takes the whole vessel, not just the moving picture. */
|
|
36
35
|
declare function FullscreenButton(props: ButtonPartProps): JSX.Element;
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/components/media-player/use-media-controls.d.ts
|
|
39
36
|
/** One alternative encoding offered to the browser before playback. */
|
|
40
37
|
interface MediaSourceOption {
|
|
41
38
|
src: string;
|
|
@@ -52,8 +49,6 @@ interface MediaTextTrackOption {
|
|
|
52
49
|
/** A compact clock for player chrome: hours only when the media asks
|
|
53
50
|
* for them, stable digits so the time never jitters the controls. */
|
|
54
51
|
declare function formatMediaTime(seconds: number): string;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/components/media-player/shell.d.ts
|
|
57
52
|
type MediaEventName = "onPlay" | "onPause" | "onEnded" | "onTimeupdate" | "onVolumechange" | "onRatechange" | "onError";
|
|
58
53
|
interface MediaPlayerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, MediaEventName | "onPlay" | "onPause"> {
|
|
59
54
|
label?: string;
|
|
@@ -78,8 +73,6 @@ interface MediaPlayerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, Medi
|
|
|
78
73
|
onRatechange?: (event: Event) => void;
|
|
79
74
|
onError?: (event: Event) => void;
|
|
80
75
|
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/components/media-player/index.d.ts
|
|
83
76
|
/** Audio and video share one instrument: the same state, the same keys,
|
|
84
77
|
* and the same control rhythm, while each face keeps its native element's
|
|
85
78
|
* own semantics. The parts — Root, Stage, Media, Controls, PlayButton,
|
|
@@ -120,5 +113,4 @@ declare const Video: Component<MediaPlayerProps> & {
|
|
|
120
113
|
PipButton: typeof PipButton;
|
|
121
114
|
FullscreenButton: typeof FullscreenButton;
|
|
122
115
|
};
|
|
123
|
-
//#endregion
|
|
124
116
|
export { MediaTextTrackOption as a, MediaSourceOption as i, Video as n, formatMediaTime as o, MediaPlayerProps as r, Audio as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
type ToolStatus = "pending" | "running" | "completed" | "error" | "denied";
|
|
3
|
+
type ToolApproval = "required" | "approved" | "denied";
|
|
4
|
+
type ToolValue = string | number | boolean | null | ToolValue[] | {
|
|
5
|
+
[key: string]: ToolValue;
|
|
6
|
+
};
|
|
7
|
+
interface ToolProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** The name the tool was reached by — shown raw on the trigger
|
|
9
|
+
* unless friendlier `label` words are given. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Friendlier trigger words than the raw tool name. */
|
|
12
|
+
label?: JSX.Element;
|
|
13
|
+
/** The state the call reached — pending, running, completed, error,
|
|
14
|
+
* or denied; stamped on the fold and whispered in the status chip. */
|
|
15
|
+
status?: ToolStatus;
|
|
16
|
+
/** The human approval gate, when the call needs one. */
|
|
17
|
+
approval?: ToolApproval;
|
|
18
|
+
/** Custom request display. */
|
|
19
|
+
input?: JSX.Element;
|
|
20
|
+
/** The machine-readable request, formatted automatically. */
|
|
21
|
+
inputValue?: ToolValue;
|
|
22
|
+
/** Custom answer display. */
|
|
23
|
+
output?: JSX.Element;
|
|
24
|
+
/** The machine-readable answer, formatted automatically. */
|
|
25
|
+
outputValue?: ToolValue;
|
|
26
|
+
/** The fold arrives open when set — rides the shared collapsible. */
|
|
27
|
+
defaultOpen?: boolean;
|
|
28
|
+
onApprove?: () => void;
|
|
29
|
+
onDeny?: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** A tool call: the shared collapsible as the vessel — the name it was
|
|
32
|
+
* reached by and the state it reached in on the trigger, its input and
|
|
33
|
+
* output folded inside. */
|
|
34
|
+
declare const Tool: ((props: ToolProps) => JSX.Element) & {
|
|
35
|
+
Root: (props: ToolProps) => JSX.Element;
|
|
36
|
+
};
|
|
37
|
+
export { ToolValue as a, ToolStatus as i, ToolApproval as n, ToolProps as r, Tool as t };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { a as ToolValue } from "./index-DK7YgaAU.mjs";
|
|
2
|
+
import { JSX } from "solid-js";
|
|
3
|
+
import { CustomContentUIPart, DataUIPart, DynamicToolUIPart, FileUIPart, ReasoningFileUIPart, ReasoningUIPart, SourceDocumentUIPart, SourceUrlUIPart, StepStartUIPart, TextUIPart, ToolUIPart, UIDataTypes, UIMessage, UITools } from "ai";
|
|
4
|
+
type AiSdkMessage = UIMessage<unknown, UIDataTypes, UITools>;
|
|
5
|
+
type AiSdkMessagePart<MESSAGE extends AiSdkMessage = AiSdkMessage> = MESSAGE["parts"][number];
|
|
6
|
+
type AiSdkTextPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, TextUIPart>;
|
|
7
|
+
type AiSdkCustomPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, CustomContentUIPart>;
|
|
8
|
+
type AiSdkReasoningPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, ReasoningUIPart>;
|
|
9
|
+
type AiSdkReasoningFilePart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, ReasoningFileUIPart>;
|
|
10
|
+
type AiSdkToolPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, ToolUIPart<UITools> | DynamicToolUIPart>;
|
|
11
|
+
type AiSdkSourceUrlPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, SourceUrlUIPart>;
|
|
12
|
+
type AiSdkSourceDocumentPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, SourceDocumentUIPart>;
|
|
13
|
+
type AiSdkFilePart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, FileUIPart>;
|
|
14
|
+
type AiSdkDataPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, DataUIPart<UIDataTypes>>;
|
|
15
|
+
type AiSdkStepStartPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = Extract<AiSdkMessagePart<MESSAGE>, StepStartUIPart>;
|
|
16
|
+
type AiSdkMediaPart<MESSAGE extends AiSdkMessage = AiSdkMessage> = AiSdkFilePart<MESSAGE> | AiSdkReasoningFilePart<MESSAGE>;
|
|
17
|
+
type AiMediaKind = "image" | "audio" | "video" | "file";
|
|
18
|
+
type AiToolDisplay = {
|
|
19
|
+
name: string;
|
|
20
|
+
status: "pending" | "running" | "completed" | "error" | "denied";
|
|
21
|
+
approval?: "required" | "approved" | "denied";
|
|
22
|
+
input?: ToolValue;
|
|
23
|
+
output?: ToolValue;
|
|
24
|
+
};
|
|
25
|
+
interface AiPartsSlots<MESSAGE extends AiSdkMessage = AiSdkMessage> {
|
|
26
|
+
default?: (props: {
|
|
27
|
+
message: MESSAGE;
|
|
28
|
+
}) => JSX.Element;
|
|
29
|
+
text?: (props: {
|
|
30
|
+
part: AiSdkTextPart<MESSAGE>;
|
|
31
|
+
index: number;
|
|
32
|
+
}) => JSX.Element;
|
|
33
|
+
custom?: (props: {
|
|
34
|
+
part: AiSdkCustomPart<MESSAGE>;
|
|
35
|
+
index: number;
|
|
36
|
+
}) => JSX.Element;
|
|
37
|
+
reasoning?: (props: {
|
|
38
|
+
part: AiSdkReasoningPart<MESSAGE>;
|
|
39
|
+
index: number;
|
|
40
|
+
}) => JSX.Element;
|
|
41
|
+
reasoningFile?: (props: {
|
|
42
|
+
part: AiSdkReasoningFilePart<MESSAGE>;
|
|
43
|
+
index: number;
|
|
44
|
+
}) => JSX.Element;
|
|
45
|
+
tool?: (props: {
|
|
46
|
+
part: AiSdkToolPart<MESSAGE>;
|
|
47
|
+
index: number;
|
|
48
|
+
}) => JSX.Element;
|
|
49
|
+
sourceUrl?: (props: {
|
|
50
|
+
part: AiSdkSourceUrlPart<MESSAGE>;
|
|
51
|
+
index: number;
|
|
52
|
+
}) => JSX.Element;
|
|
53
|
+
sourceDocument?: (props: {
|
|
54
|
+
part: AiSdkSourceDocumentPart<MESSAGE>;
|
|
55
|
+
index: number;
|
|
56
|
+
}) => JSX.Element;
|
|
57
|
+
file?: (props: {
|
|
58
|
+
part: AiSdkFilePart<MESSAGE>;
|
|
59
|
+
index: number;
|
|
60
|
+
}) => JSX.Element;
|
|
61
|
+
data?: (props: {
|
|
62
|
+
part: AiSdkDataPart<MESSAGE>;
|
|
63
|
+
index: number;
|
|
64
|
+
}) => JSX.Element;
|
|
65
|
+
stepStart?: (props: {
|
|
66
|
+
part: AiSdkStepStartPart<MESSAGE>;
|
|
67
|
+
index: number;
|
|
68
|
+
}) => JSX.Element;
|
|
69
|
+
fallback?: (props: {
|
|
70
|
+
part: AiSdkMessagePart<MESSAGE>;
|
|
71
|
+
index: number;
|
|
72
|
+
}) => JSX.Element;
|
|
73
|
+
}
|
|
74
|
+
interface AiPartsProps<MESSAGE extends AiSdkMessage = AiSdkMessage> {
|
|
75
|
+
message: MESSAGE;
|
|
76
|
+
highlighter?: (code: string, lang?: string) => string;
|
|
77
|
+
slots?: AiPartsSlots<MESSAGE>;
|
|
78
|
+
onApprove?: (event: {
|
|
79
|
+
part: AiSdkToolPart<MESSAGE>;
|
|
80
|
+
index: number;
|
|
81
|
+
}) => void;
|
|
82
|
+
onDeny?: (event: {
|
|
83
|
+
part: AiSdkToolPart<MESSAGE>;
|
|
84
|
+
index: number;
|
|
85
|
+
}) => void;
|
|
86
|
+
}
|
|
87
|
+
interface AiMediaProps<MESSAGE extends AiSdkMessage = AiSdkMessage> {
|
|
88
|
+
part?: AiSdkMediaPart<MESSAGE>;
|
|
89
|
+
mediaType?: string;
|
|
90
|
+
url?: string;
|
|
91
|
+
filename?: string;
|
|
92
|
+
alt?: string;
|
|
93
|
+
}
|
|
94
|
+
declare function toolPartDisplay<MESSAGE extends AiSdkMessage = AiSdkMessage>(part: AiSdkToolPart<MESSAGE>): AiToolDisplay;
|
|
95
|
+
declare const AiMedia: ((props: AiMediaProps) => JSX.Element) & {
|
|
96
|
+
Root: (props: AiMediaProps) => JSX.Element;
|
|
97
|
+
};
|
|
98
|
+
declare function AiPartsRenderer<MESSAGE extends AiSdkMessage>(props: AiPartsProps<MESSAGE>): JSX.Element;
|
|
99
|
+
declare const AiParts: typeof AiPartsRenderer & {
|
|
100
|
+
Root: typeof AiPartsRenderer;
|
|
101
|
+
};
|
|
102
|
+
type MessageRole = "user" | "assistant" | "system";
|
|
103
|
+
interface MessageProps<MESSAGE extends AiSdkMessage = AiSdkMessage> extends Omit<JSX.HTMLAttributes<HTMLElement>, "role"> {
|
|
104
|
+
/** Whose stroke this is — the user's words sit in a recessed
|
|
105
|
+
* bubble, the assistant speaks flat on the paper. */
|
|
106
|
+
role?: MessageRole;
|
|
107
|
+
/** The AI SDK message; its id and role become the article identity. */
|
|
108
|
+
message?: MESSAGE;
|
|
109
|
+
}
|
|
110
|
+
/** Whose stroke this is — the user's words sit in a recessed bubble,
|
|
111
|
+
* the assistant speaks flat on the paper. */
|
|
112
|
+
declare const Message: ((props: MessageProps) => JSX.Element) & {
|
|
113
|
+
Root: (props: MessageProps) => JSX.Element;
|
|
114
|
+
};
|
|
115
|
+
export { AiToolDisplay as C, AiSdkToolPart as S, AiSdkReasoningPart as _, AiMediaKind as a, AiSdkStepStartPart as b, AiPartsProps as c, AiSdkDataPart as d, AiSdkFilePart as f, AiSdkReasoningFilePart as g, AiSdkMessagePart as h, AiMedia as i, AiPartsSlots as l, AiSdkMessage as m, MessageProps as n, AiMediaProps as o, AiSdkMediaPart as p, MessageRole as r, AiParts as s, Message as t, AiSdkCustomPart as u, AiSdkSourceDocumentPart as v, toolPartDisplay as w, AiSdkTextPart as x, AiSdkSourceUrlPart as y };
|