@bysages/solid 0.3.1 → 0.4.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/dist/{ai-response-slzE03wh.mjs → ai-response-CJ-uEAgj.mjs} +14 -6
- package/dist/chevron-BHQrYKPM.mjs +8 -0
- package/dist/components/accordion/index.d.mts +22 -2
- package/dist/components/accordion/index.mjs +69 -3
- package/dist/components/affix/index.d.mts +3 -1
- package/dist/components/affix/index.mjs +6 -5
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +7 -6
- package/dist/components/ai-action/index.d.mts +3 -1
- package/dist/components/ai-action/index.mjs +4 -3
- package/dist/components/ai-attachments/index.d.mts +8 -4
- package/dist/components/ai-attachments/index.mjs +39 -37
- package/dist/components/ai-message/index.d.mts +3 -1
- package/dist/components/ai-message/index.mjs +4 -3
- package/dist/components/ai-prompt-input/index.d.mts +3 -1
- package/dist/components/ai-prompt-input/index.mjs +48 -44
- package/dist/components/ai-reasoning/index.d.mts +3 -1
- package/dist/components/ai-reasoning/index.mjs +5 -4
- package/dist/components/ai-response/index.d.mts +3 -1
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +6 -2
- package/dist/components/ai-source/index.mjs +6 -5
- package/dist/components/ai-suggestion/index.d.mts +3 -1
- package/dist/components/ai-suggestion/index.mjs +4 -3
- package/dist/components/ai-tool/index.d.mts +3 -1
- package/dist/components/ai-tool/index.mjs +5 -4
- package/dist/components/alert/index.mjs +32 -35
- package/dist/components/angle-slider/index.d.mts +1 -1
- package/dist/components/angle-slider/index.mjs +14 -6
- package/dist/components/aspect-ratio/index.d.mts +3 -1
- package/dist/components/aspect-ratio/index.mjs +4 -3
- package/dist/components/autocomplete/index.d.mts +4 -1
- package/dist/components/autocomplete/index.mjs +19 -4
- package/dist/components/avatar/index.d.mts +1 -1
- package/dist/components/avatar/index.mjs +11 -2
- package/dist/components/avatar-group/index.d.mts +3 -1
- package/dist/components/avatar-group/index.mjs +4 -3
- package/dist/components/back-top/index.d.mts +3 -1
- package/dist/components/back-top/index.mjs +10 -6
- package/dist/components/badge/index.d.mts +3 -1
- package/dist/components/badge/index.mjs +4 -3
- package/dist/components/banner/index.mjs +7 -3
- package/dist/components/bento/index.mjs +1 -1
- package/dist/components/block-ui/index.d.mts +3 -1
- package/dist/components/block-ui/index.mjs +4 -3
- package/dist/components/breadcrumb/index.mjs +1 -1
- package/dist/components/browser/index.mjs +1 -1
- package/dist/components/button/index.d.mts +3 -1
- package/dist/components/button/index.mjs +4 -3
- package/dist/components/button-group/index.mjs +1 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +30 -22
- package/dist/components/card/index.mjs +1 -1
- package/dist/components/carousel/index.d.mts +5 -1
- package/dist/components/carousel/index.mjs +14 -2
- package/dist/components/cascade-select/index.d.mts +3 -1
- package/dist/components/cascade-select/index.mjs +74 -73
- package/dist/components/checkbox/index.d.mts +1 -1
- package/dist/components/checkbox/index.mjs +14 -6
- package/dist/components/checkbox-group/index.d.mts +4 -9
- package/dist/components/checkbox-group/index.mjs +66 -69
- package/dist/components/chip/index.d.mts +3 -1
- package/dist/components/chip/index.mjs +4 -3
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +8 -1
- package/dist/components/clipboard/index.d.mts +1 -1
- package/dist/components/clipboard/index.mjs +14 -6
- package/dist/components/collapsible/index.d.mts +15 -1
- package/dist/components/collapsible/index.mjs +40 -3
- package/dist/components/color-picker/index.d.mts +13 -2
- package/dist/components/color-picker/index.mjs +96 -9
- package/dist/components/combobox/index.d.mts +24 -1
- package/dist/components/combobox/index.mjs +130 -9
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +14 -2
- package/dist/components/comment/index.d.mts +3 -1
- package/dist/components/comment/index.mjs +4 -3
- package/dist/components/config-provider/index.d.mts +3 -1
- package/dist/components/config-provider/index.mjs +3 -2
- package/dist/components/container/index.d.mts +3 -1
- package/dist/components/container/index.mjs +4 -3
- package/dist/components/data-view/index.d.mts +3 -1
- package/dist/components/data-view/index.mjs +6 -7
- package/dist/components/date-input/index.d.mts +1 -1
- package/dist/components/date-input/index.mjs +14 -6
- package/dist/components/date-picker/index.d.mts +1 -1
- package/dist/components/date-picker/index.mjs +14 -6
- package/dist/components/deferred-content/index.d.mts +3 -1
- package/dist/components/deferred-content/index.mjs +4 -3
- package/dist/components/descriptions/index.d.mts +7 -0
- package/dist/components/descriptions/index.mjs +22 -3
- package/dist/components/dialog/index.d.mts +17 -1
- package/dist/components/dialog/index.mjs +85 -3
- package/dist/components/dock/index.mjs +1 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +8 -1
- package/dist/components/drawer/index.d.mts +17 -1
- package/dist/components/drawer/index.mjs +84 -3
- package/dist/components/dynamic-input/index.d.mts +3 -1
- package/dist/components/dynamic-input/index.mjs +11 -7
- package/dist/components/editable/index.d.mts +1 -1
- package/dist/components/editable/index.mjs +14 -6
- package/dist/components/ellipsis/index.d.mts +3 -1
- package/dist/components/ellipsis/index.mjs +4 -3
- package/dist/components/empty/index.mjs +1 -1
- package/dist/components/field/index.d.mts +5 -1
- package/dist/components/field/index.mjs +14 -2
- package/dist/components/fieldset/index.d.mts +5 -1
- package/dist/components/fieldset/index.mjs +14 -2
- package/dist/components/file-upload/index.d.mts +1 -7
- package/dist/components/file-upload/index.mjs +14 -6
- package/dist/components/float-button/index.mjs +1 -1
- package/dist/components/floating-panel/index.d.mts +5 -1
- package/dist/components/floating-panel/index.mjs +14 -2
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +8 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +11 -5
- package/dist/components/frame/index.d.mts +6 -1
- package/dist/components/frame/index.mjs +10 -1
- package/dist/components/grid/index.d.mts +3 -1
- package/dist/components/grid/index.mjs +4 -3
- package/dist/components/highlight/index.d.mts +3 -1
- package/dist/components/highlight/index.mjs +3 -2
- package/dist/components/hover-card/index.d.mts +19 -1
- package/dist/components/hover-card/index.mjs +92 -3
- package/dist/components/icon/index.d.mts +8 -7
- package/dist/components/icon/index.mjs +5 -4
- package/dist/components/image/index.d.mts +4 -2
- package/dist/components/image/index.mjs +35 -34
- package/dist/components/image-cropper/index.d.mts +5 -1
- package/dist/components/image-cropper/index.mjs +14 -2
- package/dist/components/image-viewer/index.d.mts +2 -23
- package/dist/components/image-viewer/index.mjs +3 -159
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/input-group/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +5 -4
- package/dist/components/json-tree-view/index.mjs +16 -19
- package/dist/components/kbd/index.d.mts +3 -1
- package/dist/components/kbd/index.mjs +4 -3
- package/dist/components/layout/index.mjs +1 -1
- package/dist/components/link/index.d.mts +3 -1
- package/dist/components/link/index.mjs +4 -3
- package/dist/components/list/index.mjs +1 -1
- package/dist/components/listbox/index.d.mts +1 -1
- package/dist/components/listbox/index.mjs +14 -6
- package/dist/components/marquee/index.d.mts +5 -1
- package/dist/components/marquee/index.mjs +14 -2
- package/dist/components/masonry/index.d.mts +3 -1
- package/dist/components/masonry/index.mjs +4 -3
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +2 -2
- package/dist/components/menu/index.d.mts +21 -1
- package/dist/components/menu/index.mjs +63 -6
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +31 -10
- package/dist/components/meter/index.mjs +1 -1
- package/dist/components/navigation-menu/index.d.mts +5 -1
- package/dist/components/navigation-menu/index.mjs +14 -2
- package/dist/components/number-input/index.d.mts +1 -1
- package/dist/components/number-input/index.mjs +14 -6
- package/dist/components/order-list/index.d.mts +3 -1
- package/dist/components/order-list/index.mjs +68 -64
- package/dist/components/page-header/index.mjs +1 -1
- package/dist/components/pagination/index.d.mts +1 -1
- package/dist/components/pagination/index.mjs +14 -6
- package/dist/components/password-input/index.d.mts +1 -1
- package/dist/components/password-input/index.mjs +14 -6
- package/dist/components/pin-input/index.d.mts +1 -1
- package/dist/components/pin-input/index.mjs +14 -6
- package/dist/components/popconfirm/index.d.mts +3 -1
- package/dist/components/popconfirm/index.mjs +17 -9
- package/dist/components/popover/index.d.mts +19 -1
- package/dist/components/popover/index.mjs +92 -3
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +9 -1
- package/dist/components/progress/index.d.mts +1 -1
- package/dist/components/progress/index.mjs +14 -6
- package/dist/components/progress-group/index.d.mts +3 -1
- package/dist/components/progress-group/index.mjs +5 -4
- package/dist/components/qr-code/index.d.mts +5 -1
- package/dist/components/qr-code/index.mjs +14 -2
- package/dist/components/radio-group/index.d.mts +1 -1
- package/dist/components/radio-group/index.mjs +14 -6
- package/dist/components/rating-group/index.d.mts +2 -2
- package/dist/components/rating-group/index.mjs +14 -6
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +6 -4
- package/dist/components/scroll-area/index.d.mts +5 -1
- package/dist/components/scroll-area/index.mjs +14 -2
- package/dist/components/segment-group/index.d.mts +1 -1
- package/dist/components/segment-group/index.mjs +12 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +3 -1
- package/dist/components/separator/index.mjs +4 -3
- package/dist/components/signature-pad/index.d.mts +5 -1
- package/dist/components/signature-pad/index.mjs +14 -2
- package/dist/components/skeleton/index.d.mts +3 -1
- package/dist/components/skeleton/index.mjs +4 -3
- package/dist/components/slider/index.d.mts +1 -1
- package/dist/components/slider/index.mjs +14 -6
- package/dist/components/spinner/index.d.mts +3 -1
- package/dist/components/spinner/index.mjs +4 -3
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +15 -4
- package/dist/components/splitter/index.d.mts +5 -1
- package/dist/components/splitter/index.mjs +14 -2
- package/dist/components/spotlight/index.d.mts +3 -1
- package/dist/components/spotlight/index.mjs +4 -3
- package/dist/components/stack/index.d.mts +3 -1
- package/dist/components/stack/index.mjs +7 -6
- package/dist/components/stat/index.mjs +1 -1
- package/dist/components/steps/index.d.mts +20 -3
- package/dist/components/steps/index.mjs +67 -8
- package/dist/components/swap/index.d.mts +5 -1
- package/dist/components/swap/index.mjs +14 -2
- package/dist/components/switch/index.d.mts +1 -1
- package/dist/components/switch/index.mjs +14 -6
- package/dist/components/table/index.d.mts +3 -1
- package/dist/components/table/index.mjs +191 -153
- package/dist/components/tabs/index.d.mts +20 -2
- package/dist/components/tabs/index.mjs +60 -4
- package/dist/components/tags-input/index.d.mts +1 -1
- package/dist/components/tags-input/index.mjs +14 -6
- package/dist/components/terminal/index.d.mts +3 -1
- package/dist/components/terminal/index.mjs +4 -3
- package/dist/components/textarea/index.d.mts +3 -1
- package/dist/components/textarea/index.mjs +4 -3
- package/dist/components/timeline/index.mjs +1 -1
- package/dist/components/timer/index.d.mts +5 -1
- package/dist/components/timer/index.mjs +14 -2
- package/dist/components/toast/index.d.mts +8 -2
- package/dist/components/toast/index.mjs +15 -3
- package/dist/components/toc/index.d.mts +11 -2
- package/dist/components/toc/index.mjs +1 -1
- package/dist/components/toggle/index.d.mts +5 -1
- package/dist/components/toggle/index.mjs +14 -2
- package/dist/components/toggle-group/index.d.mts +1 -1
- package/dist/components/toggle-group/index.mjs +14 -6
- package/dist/components/toolbar/index.d.mts +3 -1
- package/dist/components/toolbar/index.mjs +4 -3
- package/dist/components/tooltip/index.d.mts +16 -1
- package/dist/components/tooltip/index.mjs +56 -3
- package/dist/components/tour/index.d.mts +16 -3
- package/dist/components/tour/index.mjs +75 -10
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +55 -51
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +38 -31
- package/dist/components/tree-view/index.d.mts +1 -8
- package/dist/components/tree-view/index.mjs +17 -22
- package/dist/components/typography/index.mjs +1 -1
- package/dist/components/user/index.d.mts +3 -1
- package/dist/components/user/index.mjs +9 -3
- package/dist/components/virtual-list/index.d.mts +3 -1
- package/dist/components/virtual-list/index.mjs +14 -10
- package/dist/components/watermark/index.d.mts +3 -1
- package/dist/components/watermark/index.mjs +5 -4
- package/dist/element-dGIhOTJ6.mjs +16 -0
- package/dist/family-Cmd8HEyK.mjs +11 -0
- package/dist/icon-DTqmJCd5.mjs +48 -0
- package/dist/id-2ygNzPHF.mjs +12 -0
- package/dist/image-viewer-19s75Hz_.mjs +228 -0
- package/dist/{index-B1xiJ5ki.d.mts → index-B1-quIrl.d.mts} +6 -2
- package/dist/{index-DDX7x8aT.d.mts → index-DEArHiFI.d.mts} +16 -7
- package/dist/{index-IfofF-SW.d.mts → index-DVc1L_zt.d.mts} +191 -112
- package/dist/index-DhripUtf.d.mts +39 -0
- package/dist/{index-YPUiqD3n.d.mts → index-ID48LCMU.d.mts} +28 -2
- package/dist/index-wW28BYf1.d.mts +124 -0
- package/dist/index.d.mts +23 -22
- package/dist/index.mjs +13 -12
- package/dist/{input-DoFQ7RXh.mjs → input-BL3N3L8g.mjs} +4 -3
- package/dist/media-player-yF7KVUxM.mjs +796 -0
- package/dist/{mentions-f5Js_2W7.mjs → mentions-DKUG7eHt.mjs} +68 -52
- package/dist/select-DI7pFspF.mjs +292 -0
- package/dist/{toc-CZmYEaQR.mjs → toc-CqvGOp34.mjs} +13 -3
- package/package.json +10 -82
- package/dist/chevron-D5RzcayK.mjs +0 -9
- package/dist/index-DdsnfV4f.d.mts +0 -16
- package/dist/select-CX6OuQlU.mjs +0 -123
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "./family-Cmd8HEyK.mjs";
|
|
2
|
+
import { n as iconHtml } from "./icon-DTqmJCd5.mjs";
|
|
1
3
|
import { n as useComponentMessages } from "./use-component-messages-C4SCVYjD.mjs";
|
|
2
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
3
4
|
import { ref, spread, template } from "@solidjs/web";
|
|
5
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
6
|
import { createEffect, createMemo, onMount, splitProps } from "solid-js";
|
|
5
7
|
import { renderHtml } from "@tanstack/markdown/html";
|
|
6
8
|
//#region src/components/ai-response/code-copy.ts
|
|
7
|
-
/** The two
|
|
9
|
+
/** The two icons a copy affordance needs: the stamp and its
|
|
8
10
|
* confirmation. Inline SVG keeps the enhancement framework-agnostic —
|
|
9
11
|
* it lives beside the renderer's generated code HTML. */
|
|
10
|
-
const COPY_CODE_ICON =
|
|
11
|
-
|
|
12
|
+
const COPY_CODE_ICON = iconHtml("copy", {
|
|
13
|
+
width: "14",
|
|
14
|
+
height: "14"
|
|
15
|
+
});
|
|
16
|
+
const COPIED_CODE_ICON = iconHtml("check", {
|
|
17
|
+
width: "14",
|
|
18
|
+
height: "14"
|
|
19
|
+
});
|
|
12
20
|
/** How long the confirmation stays before the stamp returns. */
|
|
13
21
|
const REVERT_MS = 1500;
|
|
14
22
|
/** Make sure every fenced block under `host` carries its copy stamp.
|
|
@@ -104,7 +112,7 @@ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
|
104
112
|
/** Markdown set on the paper. Rendering goes through
|
|
105
113
|
* `@tanstack/markdown`, whose defaults leave raw HTML and executable
|
|
106
114
|
* links inert — streaming-safe by construction. */
|
|
107
|
-
function Response(props) {
|
|
115
|
+
const Response = withSelfRoot(function Response(props) {
|
|
108
116
|
injectComponentStyle("ai");
|
|
109
117
|
const [own, rest] = splitProps(props, [
|
|
110
118
|
"content",
|
|
@@ -136,6 +144,6 @@ function Response(props) {
|
|
|
136
144
|
}
|
|
137
145
|
}], false);
|
|
138
146
|
return _el$;
|
|
139
|
-
}
|
|
147
|
+
});
|
|
140
148
|
//#endregion
|
|
141
149
|
export { Response as t };
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { Accordion as Accordion$1 } from "@ark-ui/solid/accordion";
|
|
1
|
+
import { Accordion as Accordion$1, AccordionRootProps } from "@ark-ui/solid/accordion";
|
|
2
2
|
//#region src/components/accordion/index.d.ts
|
|
3
3
|
/** Ark's Accordion, dressed in the paper-and-ink system: a ruled sheet
|
|
4
4
|
* folded by quiet rows, unfolding with a spring-chevoned dissolve. The
|
|
5
5
|
* API is Ark's own — Root, Item, ItemTrigger, ItemContent, ItemIndicator. */
|
|
6
|
-
|
|
6
|
+
declare function AccordionRoot(props: AccordionRootProps): import("solid-js").JSX.Element;
|
|
7
|
+
export type AccordionItem = {
|
|
8
|
+
value: string;
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
};
|
|
12
|
+
export interface AccordionFacadeProps {
|
|
13
|
+
value?: string[];
|
|
14
|
+
defaultValue?: string[];
|
|
15
|
+
items: AccordionItem[];
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
collapsible?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
orientation?: "horizontal" | "vertical";
|
|
20
|
+
onValueChange?: (value: string[]) => void;
|
|
21
|
+
}
|
|
22
|
+
declare function AccordionFacade(props: AccordionFacadeProps): import("solid-js").JSX.Element;
|
|
23
|
+
type AccordionParts = Omit<typeof Accordion$1, "Root"> & {
|
|
24
|
+
Root: typeof AccordionRoot;
|
|
25
|
+
};
|
|
26
|
+
export declare const Accordion: typeof AccordionFacade & AccordionParts;
|
|
7
27
|
//#endregion
|
|
@@ -1,10 +1,76 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
3
|
+
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
4
|
+
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
2
5
|
import { Accordion as Accordion$1 } from "@ark-ui/solid/accordion";
|
|
3
|
-
|
|
6
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
7
|
+
import { For } from "solid-js";
|
|
8
|
+
//#region src/components/accordion/index.tsx
|
|
9
|
+
var _tmpl$ = /* @__PURE__ */ template(`<p>`);
|
|
4
10
|
/** Ark's Accordion, dressed in the paper-and-ink system: a ruled sheet
|
|
5
11
|
* folded by quiet rows, unfolding with a spring-chevoned dissolve. The
|
|
6
12
|
* API is Ark's own — Root, Item, ItemTrigger, ItemContent, ItemIndicator. */
|
|
7
|
-
|
|
13
|
+
function AccordionRoot(props) {
|
|
14
|
+
const id = useElementId("accordion", () => props.id);
|
|
15
|
+
return createComponent(Accordion$1.Root, mergeProps(props, { get id() {
|
|
16
|
+
return id();
|
|
17
|
+
} }));
|
|
18
|
+
}
|
|
19
|
+
function AccordionFacade(props) {
|
|
20
|
+
injectComponentStyle("accordion");
|
|
21
|
+
return createComponent(AccordionRoot, mergeProps({
|
|
22
|
+
get disabled() {
|
|
23
|
+
return props.disabled;
|
|
24
|
+
},
|
|
25
|
+
get multiple() {
|
|
26
|
+
return props.multiple;
|
|
27
|
+
},
|
|
28
|
+
get collapsible() {
|
|
29
|
+
return props.collapsible;
|
|
30
|
+
},
|
|
31
|
+
get orientation() {
|
|
32
|
+
return props.orientation ?? "vertical";
|
|
33
|
+
},
|
|
34
|
+
get defaultValue() {
|
|
35
|
+
return props.defaultValue;
|
|
36
|
+
}
|
|
37
|
+
}, () => {
|
|
38
|
+
return props.value === void 0 ? {} : { value: props.value };
|
|
39
|
+
}, {
|
|
40
|
+
onValueChange: (details) => props.onValueChange?.(details.value),
|
|
41
|
+
get children() {
|
|
42
|
+
return createComponent(For, {
|
|
43
|
+
get each() {
|
|
44
|
+
return props.items;
|
|
45
|
+
},
|
|
46
|
+
children: (item) => createComponent(Accordion$1.Item, {
|
|
47
|
+
get value() {
|
|
48
|
+
return item.value;
|
|
49
|
+
},
|
|
50
|
+
get children() {
|
|
51
|
+
return [createComponent(Accordion$1.ItemTrigger, { get children() {
|
|
52
|
+
return [memo(() => {
|
|
53
|
+
return item.title;
|
|
54
|
+
}), createComponent(Accordion$1.ItemIndicator, { get children() {
|
|
55
|
+
return iconNode("chevron-down");
|
|
56
|
+
} })];
|
|
57
|
+
} }), createComponent(Accordion$1.ItemContent, { get children() {
|
|
58
|
+
var _el$ = _tmpl$();
|
|
59
|
+
insert(_el$, () => {
|
|
60
|
+
return item.content;
|
|
61
|
+
});
|
|
62
|
+
return _el$;
|
|
63
|
+
} })];
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
const Accordion = defineFamily(AccordionFacade, {
|
|
71
|
+
...Accordion$1,
|
|
72
|
+
Root: AccordionRoot
|
|
73
|
+
});
|
|
8
74
|
injectComponentStyle("accordion");
|
|
9
75
|
//#endregion
|
|
10
76
|
export { Accordion };
|
|
@@ -16,5 +16,7 @@ export interface AffixProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
* `overflow: hidden` clips the pin. Both offsets may be given: the
|
|
17
17
|
* content then holds its place inside that band.
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
19
|
+
export declare const Affix: ((props: AffixProps) => JSX.Element) & {
|
|
20
|
+
Root: (props: AffixProps) => JSX.Element;
|
|
21
|
+
};
|
|
20
22
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
2
2
|
import { spread, template } from "@solidjs/web";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
3
4
|
import { splitProps } from "solid-js";
|
|
4
5
|
//#region src/components/affix/index.tsx
|
|
5
6
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
@@ -12,7 +13,7 @@ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
|
12
13
|
* `overflow: hidden` clips the pin. Both offsets may be given: the
|
|
13
14
|
* content then holds its place inside that band.
|
|
14
15
|
*/
|
|
15
|
-
function Affix(props) {
|
|
16
|
+
const Affix = withSelfRoot(function Affix(props) {
|
|
16
17
|
injectComponentStyle("affix");
|
|
17
18
|
const [own, rest] = splitProps(props, ["offsetTop", "offsetBottom"]);
|
|
18
19
|
var _el$ = _tmpl$();
|
|
@@ -20,14 +21,14 @@ function Affix(props) {
|
|
|
20
21
|
get style() {
|
|
21
22
|
return {
|
|
22
23
|
...rest.style,
|
|
23
|
-
top: own.offsetTop
|
|
24
|
-
bottom: own.offsetBottom
|
|
24
|
+
"--bs-affix-top": own.offsetTop,
|
|
25
|
+
"--bs-affix-bottom": own.offsetBottom
|
|
25
26
|
};
|
|
26
27
|
},
|
|
27
28
|
"data-scope": "affix",
|
|
28
29
|
"data-part": "root"
|
|
29
30
|
}], false);
|
|
30
31
|
return _el$;
|
|
31
|
-
}
|
|
32
|
+
});
|
|
32
33
|
//#endregion
|
|
33
34
|
export { Affix };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AiLoader, c as ReasoningUIPart, d as StepStartUIPart, f as TextUIPart, h as UIMessagePart, i as AiConversation, l as SourceDocumentUIPart, m as UIMessage, n as AiActions, o as DataUIPart, p as ToolUIPart, r as AiContent, s as FileUIPart, t as Ai, u as SourceUrlUIPart } from "../../index-
|
|
1
|
+
import { a as AiLoader, c as ReasoningUIPart, d as StepStartUIPart, f as TextUIPart, h as UIMessagePart, i as AiConversation, l as SourceDocumentUIPart, m as UIMessage, n as AiActions, o as DataUIPart, p as ToolUIPart, r as AiContent, s as FileUIPart, t as Ai, u as SourceUrlUIPart } from "../../index-DVc1L_zt.mjs";
|
|
2
2
|
export { Ai, AiActions, AiContent, AiConversation, AiLoader, type DataUIPart, type FileUIPart, type ReasoningUIPart, type SourceDocumentUIPart, type SourceUrlUIPart, type StepStartUIPart, type TextUIPart, type ToolUIPart, type UIMessage, type UIMessagePart };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { Action } from "../ai-action/index.mjs";
|
|
2
3
|
import { AiMessage as Message } from "../ai-message/index.mjs";
|
|
3
4
|
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
4
5
|
import { AiPromptInput as PromptInput } from "../ai-prompt-input/index.mjs";
|
|
5
6
|
import { AiReasoning as Reasoning } from "../ai-reasoning/index.mjs";
|
|
6
|
-
import { t as Response } from "../../ai-response-
|
|
7
|
+
import { t as Response } from "../../ai-response-CJ-uEAgj.mjs";
|
|
7
8
|
import { AiSource as Source, AiSources as Sources } from "../ai-source/index.mjs";
|
|
8
9
|
import { AiSuggestion as Suggestion } from "../ai-suggestion/index.mjs";
|
|
9
10
|
import { AiTool as Tool } from "../ai-tool/index.mjs";
|
|
10
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
11
11
|
import { spread, template } from "@solidjs/web";
|
|
12
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
12
13
|
//#region src/components/ai/index.tsx
|
|
13
14
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
14
15
|
function part(name, extra = {}) {
|
|
@@ -38,14 +39,14 @@ const AiConversation = part("Conversation", (messages) => ({
|
|
|
38
39
|
}));
|
|
39
40
|
/** The bubble's inner measure — content that belongs to neither side
|
|
40
41
|
* specifically. */
|
|
41
|
-
const AiContent = part("Content");
|
|
42
|
+
const AiContent = withSelfRoot(part("Content"));
|
|
42
43
|
/** The quiet row under a message — copy, retry, feedback. */
|
|
43
|
-
const AiActions = part("Actions");
|
|
44
|
+
const AiActions = withSelfRoot(part("Actions"));
|
|
44
45
|
/** The while-it-works whisper for the in-flight turns. */
|
|
45
|
-
const AiLoader = part("Loader", (messages) => ({
|
|
46
|
+
const AiLoader = withSelfRoot(part("Loader", (messages) => ({
|
|
46
47
|
role: "status",
|
|
47
48
|
"aria-label": messages.ai.loading
|
|
48
|
-
}));
|
|
49
|
+
})));
|
|
49
50
|
/** The whole family under one handle — `Ai.Conversation`,
|
|
50
51
|
* `Ai.MessageContent`, and the rest. */
|
|
51
52
|
const Ai = Object.assign(AiConversation, {
|
|
@@ -8,6 +8,8 @@ export interface ActionProps extends JSX.HTMLAttributes<HTMLButtonElement> {
|
|
|
8
8
|
/** A quiet icon button — copy, retry, thumbs. The label names it to
|
|
9
9
|
* assistive tech and as the hover title. The control itself is the
|
|
10
10
|
* shared Button in its ghost register. */
|
|
11
|
-
export declare
|
|
11
|
+
export declare const Action: ((props: ActionProps) => JSX.Element) & {
|
|
12
|
+
Root: (props: ActionProps) => JSX.Element;
|
|
13
|
+
};
|
|
12
14
|
//#endregion
|
|
13
15
|
export { Action as AiAction };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { Button } from "../button/index.mjs";
|
|
2
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
3
3
|
import { createComponent, mergeProps } from "@solidjs/web";
|
|
4
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
5
|
import { splitProps } from "solid-js";
|
|
5
6
|
//#region src/components/ai-action/index.tsx
|
|
6
7
|
/** A quiet icon button — copy, retry, thumbs. The label names it to
|
|
7
8
|
* assistive tech and as the hover title. The control itself is the
|
|
8
9
|
* shared Button in its ghost register. */
|
|
9
|
-
function Action(props) {
|
|
10
|
+
const Action = withSelfRoot(function Action(props) {
|
|
10
11
|
injectComponentStyle("ai");
|
|
11
12
|
const [own, rest] = splitProps(props, ["label", "children"]);
|
|
12
13
|
return createComponent(Button, mergeProps({
|
|
@@ -22,6 +23,6 @@ function Action(props) {
|
|
|
22
23
|
}, rest, { get children() {
|
|
23
24
|
return own.children;
|
|
24
25
|
} }));
|
|
25
|
-
}
|
|
26
|
+
});
|
|
26
27
|
//#endregion
|
|
27
28
|
export { Action, Action as AiAction };
|
|
@@ -2,7 +2,7 @@ import { JSX } from "solid-js";
|
|
|
2
2
|
//#region src/components/ai-attachments/index.d.ts
|
|
3
3
|
export type AttachmentStatus = "uploading" | "ready" | "error";
|
|
4
4
|
export interface AttachmentProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
-
/** The file's name — it picks the
|
|
5
|
+
/** The file's name — it picks the icon by extension. */
|
|
6
6
|
name: string;
|
|
7
7
|
/** The file's size in bytes, when known — rendered human. */
|
|
8
8
|
size?: number;
|
|
@@ -10,11 +10,15 @@ export interface AttachmentProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
|
10
10
|
status?: AttachmentStatus;
|
|
11
11
|
onRemove?: () => void;
|
|
12
12
|
}
|
|
13
|
-
/** One file riding the prompt: its
|
|
13
|
+
/** One file riding the prompt: its icon by extension, its name and
|
|
14
14
|
* human size, and a quiet way to take it back off. Uploading reads as
|
|
15
15
|
* a dashed ghost, error as danger ink. */
|
|
16
|
-
export declare
|
|
16
|
+
export declare const Attachment: ((props: AttachmentProps) => JSX.Element) & {
|
|
17
|
+
Root: (props: AttachmentProps) => JSX.Element;
|
|
18
|
+
};
|
|
17
19
|
/** The row the files ride in — a wrapping line of chips. */
|
|
18
|
-
export declare
|
|
20
|
+
export declare const Attachments: ((props: JSX.HTMLAttributes<HTMLSpanElement>) => JSX.Element) & {
|
|
21
|
+
Root: (props: JSX.HTMLAttributes<HTMLSpanElement>) => JSX.Element;
|
|
22
|
+
};
|
|
19
23
|
//#endregion
|
|
20
24
|
export { Attachment as AiAttachment, Attachments as AiAttachments };
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
1
3
|
import { n as useComponentMessages, t as formatComponentMessage } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
2
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
3
4
|
import { delegateEvents, effect, insert, memo, setAttribute, spread, template } from "@solidjs/web";
|
|
5
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
6
|
import { splitProps } from "solid-js";
|
|
5
7
|
//#region src/components/ai-attachments/index.tsx
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template(`<
|
|
7
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _tmpl$5 = /* @__PURE__ */ template(`<span>`);
|
|
11
|
-
function imageGlyph() {
|
|
12
|
-
return _tmpl$();
|
|
8
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span><span></span><button type=button data-remove>`);
|
|
9
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span>`);
|
|
10
|
+
function imageIcon() {
|
|
11
|
+
return iconNode("image");
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
13
|
+
function fileIcon() {
|
|
14
|
+
return iconNode("file");
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
16
|
+
function removeIcon() {
|
|
17
|
+
return iconNode("x", {
|
|
18
|
+
width: "12",
|
|
19
|
+
height: "12"
|
|
20
|
+
});
|
|
19
21
|
}
|
|
20
22
|
const IMAGE_EXTS = [
|
|
21
23
|
"png",
|
|
@@ -44,10 +46,10 @@ const humanSize = (bytes) => {
|
|
|
44
46
|
} while (value >= 1024 && unit < units.length - 1);
|
|
45
47
|
return `${value.toFixed(1)} ${units[unit]}`;
|
|
46
48
|
};
|
|
47
|
-
/** One file riding the prompt: its
|
|
49
|
+
/** One file riding the prompt: its icon by extension, its name and
|
|
48
50
|
* human size, and a quiet way to take it back off. Uploading reads as
|
|
49
51
|
* a dashed ghost, error as danger ink. */
|
|
50
|
-
function Attachment(props) {
|
|
52
|
+
const Attachment = withSelfRoot(function Attachment(props) {
|
|
51
53
|
injectComponentStyle("ai");
|
|
52
54
|
const [own, rest] = splitProps(props, [
|
|
53
55
|
"name",
|
|
@@ -56,57 +58,57 @@ function Attachment(props) {
|
|
|
56
58
|
"onRemove"
|
|
57
59
|
]);
|
|
58
60
|
const messages = useComponentMessages();
|
|
59
|
-
var _el$
|
|
60
|
-
var _el$
|
|
61
|
-
var _el$
|
|
62
|
-
spread(_el
|
|
61
|
+
var _el$ = _tmpl$();
|
|
62
|
+
var _el$2 = _el$.firstChild;
|
|
63
|
+
var _el$3 = _el$2.nextSibling;
|
|
64
|
+
spread(_el$, [rest, {
|
|
63
65
|
"data-scope": "ai",
|
|
64
66
|
"data-part": "attachment",
|
|
65
67
|
get "data-status"() {
|
|
66
68
|
return own.status ?? "ready";
|
|
67
69
|
}
|
|
68
70
|
}], true);
|
|
69
|
-
insert(_el
|
|
71
|
+
insert(_el$, (() => {
|
|
70
72
|
var _c$ = memo(() => {
|
|
71
73
|
return !!isImage(own.name);
|
|
72
74
|
});
|
|
73
75
|
return () => {
|
|
74
|
-
return _c$() ?
|
|
76
|
+
return _c$() ? imageIcon() : fileIcon();
|
|
75
77
|
};
|
|
76
|
-
})(), _el$
|
|
77
|
-
insert(_el$
|
|
78
|
+
})(), _el$2);
|
|
79
|
+
insert(_el$2, () => {
|
|
78
80
|
return own.name;
|
|
79
81
|
});
|
|
80
|
-
insert(_el
|
|
82
|
+
insert(_el$, (() => {
|
|
81
83
|
var _c$2 = memo(() => {
|
|
82
84
|
return own.size !== void 0;
|
|
83
85
|
});
|
|
84
86
|
return () => {
|
|
85
87
|
return _c$2() ? (() => {
|
|
86
|
-
var _el$
|
|
87
|
-
insert(_el$
|
|
88
|
+
var _el$4 = _tmpl$2();
|
|
89
|
+
insert(_el$4, () => {
|
|
88
90
|
return humanSize(own.size);
|
|
89
91
|
});
|
|
90
|
-
return _el$
|
|
92
|
+
return _el$4;
|
|
91
93
|
})() : null;
|
|
92
94
|
};
|
|
93
|
-
})(), _el$
|
|
94
|
-
_el$
|
|
95
|
-
insert(_el$
|
|
95
|
+
})(), _el$3);
|
|
96
|
+
_el$3._$$click = () => own.onRemove?.();
|
|
97
|
+
insert(_el$3, removeIcon);
|
|
96
98
|
effect(() => formatComponentMessage(messages().ai.removeAttachment, { name: own.name }), (_v$) => {
|
|
97
|
-
setAttribute(_el$
|
|
99
|
+
setAttribute(_el$3, "aria-label", _v$);
|
|
98
100
|
});
|
|
99
|
-
return _el
|
|
100
|
-
}
|
|
101
|
+
return _el$;
|
|
102
|
+
});
|
|
101
103
|
/** The row the files ride in — a wrapping line of chips. */
|
|
102
|
-
function Attachments(props) {
|
|
103
|
-
var _el$
|
|
104
|
-
spread(_el$
|
|
104
|
+
const Attachments = withSelfRoot(function Attachments(props) {
|
|
105
|
+
var _el$5 = _tmpl$2();
|
|
106
|
+
spread(_el$5, [props, {
|
|
105
107
|
"data-scope": "ai",
|
|
106
108
|
"data-part": "attachments"
|
|
107
109
|
}], false);
|
|
108
|
-
return _el$
|
|
109
|
-
}
|
|
110
|
+
return _el$5;
|
|
111
|
+
});
|
|
110
112
|
delegateEvents(["click"]);
|
|
111
113
|
//#endregion
|
|
112
114
|
export { Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments };
|
|
@@ -8,6 +8,8 @@ export interface MessageProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "rol
|
|
|
8
8
|
}
|
|
9
9
|
/** Whose stroke this is — the user's words sit in a recessed bubble,
|
|
10
10
|
* the assistant speaks flat on the paper. */
|
|
11
|
-
export declare
|
|
11
|
+
export declare const Message: ((props: MessageProps) => JSX.Element) & {
|
|
12
|
+
Root: (props: MessageProps) => JSX.Element;
|
|
13
|
+
};
|
|
12
14
|
//#endregion
|
|
13
15
|
export { Message as AiMessage };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
2
2
|
import { spread, template } from "@solidjs/web";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
3
4
|
import { splitProps } from "solid-js";
|
|
4
5
|
//#region src/components/ai-message/index.tsx
|
|
5
6
|
var _tmpl$ = /* @__PURE__ */ template(`<article>`);
|
|
6
7
|
/** Whose stroke this is — the user's words sit in a recessed bubble,
|
|
7
8
|
* the assistant speaks flat on the paper. */
|
|
8
|
-
function Message(props) {
|
|
9
|
+
const Message = withSelfRoot(function Message(props) {
|
|
9
10
|
injectComponentStyle("ai");
|
|
10
11
|
const [own, rest] = splitProps(props, ["role"]);
|
|
11
12
|
var _el$ = _tmpl$();
|
|
@@ -17,6 +18,6 @@ function Message(props) {
|
|
|
17
18
|
}
|
|
18
19
|
}], false);
|
|
19
20
|
return _el$;
|
|
20
|
-
}
|
|
21
|
+
});
|
|
21
22
|
//#endregion
|
|
22
23
|
export { Message as AiMessage, Message };
|
|
@@ -40,6 +40,8 @@ export interface PromptInputProps extends Omit<JSX.HTMLAttributes<HTMLFormElemen
|
|
|
40
40
|
* and take the text on `onSubmit`. Enter sends; Shift+Enter breaks the
|
|
41
41
|
* line. While `busy` the seal becomes a stop seal and Enter holds its
|
|
42
42
|
* breath. */
|
|
43
|
-
export declare
|
|
43
|
+
export declare const PromptInput: ((props: PromptInputProps) => JSX.Element) & {
|
|
44
|
+
Root: (props: PromptInputProps) => JSX.Element;
|
|
45
|
+
};
|
|
44
46
|
//#endregion
|
|
45
47
|
export { PromptInput as AiPromptInput };
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
1
3
|
import { Button } from "../button/index.mjs";
|
|
2
4
|
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
3
5
|
import { Field } from "../field/index.mjs";
|
|
4
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
5
6
|
import { claimElement, createComponent, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
7
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
6
8
|
import { Show, splitProps } from "solid-js";
|
|
7
9
|
//#region src/components/ai-prompt-input/index.tsx
|
|
8
|
-
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true
|
|
9
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<
|
|
10
|
-
var _tmpl$3 = /* @__PURE__ */ template(`<div data-scope=ai
|
|
11
|
-
var _tmpl$4 = /* @__PURE__ */ template(`<div data-scope=ai data-part=prompt-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true><rect x=4.5 y=4.5 width=7 height=7 fill=currentColor>`);
|
|
11
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=ai>`);
|
|
12
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div data-scope=ai data-part=prompt-footer><div data-scope=ai data-part=prompt-end><!><!>`);
|
|
13
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<form><div data-scope=ai data-part=prompt-main><!><!><!></div><!>`);
|
|
14
|
+
function arrowUpIcon() {
|
|
15
|
+
return iconNode("arrow-up", {
|
|
16
|
+
width: "14",
|
|
17
|
+
height: "14"
|
|
18
|
+
});
|
|
15
19
|
}
|
|
16
|
-
function
|
|
17
|
-
return _tmpl$
|
|
20
|
+
function stopIcon() {
|
|
21
|
+
return _tmpl$();
|
|
18
22
|
}
|
|
19
23
|
/** The prompt vessel: the shared field textarea — self-growing on the
|
|
20
24
|
* machine's autoresize — with the submit seal riding its last line.
|
|
@@ -28,7 +32,7 @@ function stopGlyph() {
|
|
|
28
32
|
* and take the text on `onSubmit`. Enter sends; Shift+Enter breaks the
|
|
29
33
|
* line. While `busy` the seal becomes a stop seal and Enter holds its
|
|
30
34
|
* breath. */
|
|
31
|
-
function PromptInput(props) {
|
|
35
|
+
const PromptInput = withSelfRoot(function PromptInput(props) {
|
|
32
36
|
injectComponentStyle("ai");
|
|
33
37
|
const [own, rest] = splitProps(props, [
|
|
34
38
|
"value",
|
|
@@ -52,10 +56,10 @@ function PromptInput(props) {
|
|
|
52
56
|
own.onValueChange?.("");
|
|
53
57
|
};
|
|
54
58
|
const row = (part, content) => content != null ? (() => {
|
|
55
|
-
var _el$
|
|
56
|
-
setAttribute(_el$
|
|
57
|
-
insert(_el$
|
|
58
|
-
return _el$
|
|
59
|
+
var _el$2 = _tmpl$2();
|
|
60
|
+
setAttribute(_el$2, "data-part", part);
|
|
61
|
+
insert(_el$2, content);
|
|
62
|
+
return _el$2;
|
|
59
63
|
})() : null;
|
|
60
64
|
const seal = () => own.busy ? createComponent(Button, {
|
|
61
65
|
variant: "solid",
|
|
@@ -70,7 +74,7 @@ function PromptInput(props) {
|
|
|
70
74
|
},
|
|
71
75
|
onClick: () => own.onStop?.(),
|
|
72
76
|
get children() {
|
|
73
|
-
return
|
|
77
|
+
return stopIcon();
|
|
74
78
|
}
|
|
75
79
|
}) : createComponent(Button, {
|
|
76
80
|
variant: "solid",
|
|
@@ -84,18 +88,18 @@ function PromptInput(props) {
|
|
|
84
88
|
return own.disabled || !(own.value ?? "").trim();
|
|
85
89
|
},
|
|
86
90
|
get children() {
|
|
87
|
-
return
|
|
91
|
+
return arrowUpIcon();
|
|
88
92
|
}
|
|
89
93
|
});
|
|
90
94
|
const trailing = () => own.footer != null ? own.trailing : own.trailing ?? seal();
|
|
91
|
-
var _el$
|
|
95
|
+
var _el$3 = _tmpl$4();
|
|
96
|
+
var _el$4 = _el$3.firstChild;
|
|
92
97
|
var _el$5 = _el$4.firstChild;
|
|
93
|
-
var _el$6 = _el$5.
|
|
98
|
+
var _el$6 = _el$5.nextSibling;
|
|
94
99
|
var _el$7 = _el$6.nextSibling;
|
|
95
|
-
var _el$
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
spread(_el$4, [rest, {
|
|
100
|
+
var _el$12 = _el$4.nextSibling;
|
|
101
|
+
claimElement(_el$3);
|
|
102
|
+
spread(_el$3, [rest, {
|
|
99
103
|
"data-scope": "ai",
|
|
100
104
|
"data-part": "prompt",
|
|
101
105
|
onSubmit: (event) => {
|
|
@@ -103,13 +107,13 @@ function PromptInput(props) {
|
|
|
103
107
|
send();
|
|
104
108
|
}
|
|
105
109
|
}], true);
|
|
106
|
-
insert(_el$
|
|
110
|
+
insert(_el$3, () => {
|
|
107
111
|
return row("prompt-header", own.header);
|
|
108
|
-
}, _el$
|
|
109
|
-
insert(_el$
|
|
112
|
+
}, _el$4);
|
|
113
|
+
insert(_el$4, () => {
|
|
110
114
|
return row("prompt-leading", own.leading);
|
|
111
|
-
}, _el$
|
|
112
|
-
insert(_el$
|
|
115
|
+
}, _el$5);
|
|
116
|
+
insert(_el$4, createComponent(Field.Root, { get children() {
|
|
113
117
|
return createComponent(Field.Textarea, {
|
|
114
118
|
autoresize: true,
|
|
115
119
|
rows: 1,
|
|
@@ -133,30 +137,30 @@ function PromptInput(props) {
|
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
});
|
|
136
|
-
} }), _el$
|
|
137
|
-
insert(_el$
|
|
140
|
+
} }), _el$6);
|
|
141
|
+
insert(_el$4, () => {
|
|
138
142
|
return row("prompt-trailing", trailing());
|
|
139
|
-
}, _el$
|
|
140
|
-
insert(_el$
|
|
143
|
+
}, _el$7);
|
|
144
|
+
insert(_el$3, createComponent(Show, {
|
|
141
145
|
get when() {
|
|
142
146
|
return own.footer != null;
|
|
143
147
|
},
|
|
144
148
|
get children() {
|
|
145
|
-
var _el$
|
|
149
|
+
var _el$8 = _tmpl$3();
|
|
150
|
+
var _el$9 = _el$8.firstChild;
|
|
146
151
|
var _el$10 = _el$9.firstChild;
|
|
147
|
-
var _el$11 = _el$10.
|
|
148
|
-
|
|
149
|
-
insert(_el$9, () => {
|
|
152
|
+
var _el$11 = _el$10.nextSibling;
|
|
153
|
+
insert(_el$8, () => {
|
|
150
154
|
return own.footer;
|
|
151
|
-
}, _el$
|
|
152
|
-
insert(_el$
|
|
155
|
+
}, _el$9);
|
|
156
|
+
insert(_el$9, () => {
|
|
153
157
|
return own.footerEnd;
|
|
154
|
-
}, _el$
|
|
155
|
-
insert(_el$
|
|
156
|
-
return _el$
|
|
158
|
+
}, _el$10);
|
|
159
|
+
insert(_el$9, seal, _el$11);
|
|
160
|
+
return _el$8;
|
|
157
161
|
}
|
|
158
|
-
}), _el$
|
|
159
|
-
return _el$
|
|
160
|
-
}
|
|
162
|
+
}), _el$12);
|
|
163
|
+
return _el$3;
|
|
164
|
+
});
|
|
161
165
|
//#endregion
|
|
162
166
|
export { PromptInput as AiPromptInput, PromptInput };
|