@bysages/solid 0.3.0 → 0.4.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/dist/{ai-response-ClGGptX3.mjs → ai-response-D2uINBIi.mjs} +17 -7
- package/dist/chevron-BHQrYKPM.mjs +8 -0
- package/dist/components/accordion/index.d.mts +22 -2
- package/dist/components/accordion/index.mjs +68 -2
- package/dist/components/affix/index.d.mts +3 -1
- package/dist/components/affix/index.mjs +5 -4
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +14 -16
- package/dist/components/ai-action/index.d.mts +3 -1
- package/dist/components/ai-action/index.mjs +3 -2
- package/dist/components/ai-attachments/index.d.mts +8 -4
- package/dist/components/ai-attachments/index.mjs +41 -37
- package/dist/components/ai-message/index.d.mts +3 -1
- package/dist/components/ai-message/index.mjs +3 -2
- package/dist/components/ai-prompt-input/index.d.mts +3 -1
- package/dist/components/ai-prompt-input/index.mjs +59 -46
- package/dist/components/ai-reasoning/index.d.mts +3 -1
- package/dist/components/ai-reasoning/index.mjs +4 -3
- 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 +5 -4
- package/dist/components/ai-suggestion/index.d.mts +3 -1
- package/dist/components/ai-suggestion/index.mjs +3 -2
- package/dist/components/ai-tool/index.d.mts +3 -1
- package/dist/components/ai-tool/index.mjs +4 -3
- package/dist/components/alert/index.mjs +31 -34
- package/dist/components/angle-slider/index.d.mts +1 -1
- package/dist/components/angle-slider/index.mjs +13 -5
- package/dist/components/aspect-ratio/index.d.mts +3 -1
- package/dist/components/aspect-ratio/index.mjs +3 -2
- package/dist/components/autocomplete/index.d.mts +4 -1
- package/dist/components/autocomplete/index.mjs +15 -2
- package/dist/components/avatar/index.d.mts +1 -1
- package/dist/components/avatar/index.mjs +10 -1
- package/dist/components/avatar-group/index.d.mts +3 -1
- package/dist/components/avatar-group/index.mjs +3 -2
- package/dist/components/back-top/index.d.mts +3 -1
- package/dist/components/back-top/index.mjs +9 -5
- package/dist/components/badge/index.d.mts +3 -1
- package/dist/components/badge/index.mjs +3 -2
- package/dist/components/banner/index.mjs +9 -3
- package/dist/components/block-ui/index.d.mts +3 -1
- package/dist/components/block-ui/index.mjs +3 -2
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/index.d.mts +3 -1
- package/dist/components/button/index.mjs +3 -2
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +29 -21
- package/dist/components/carousel/index.d.mts +5 -1
- package/dist/components/carousel/index.mjs +13 -1
- package/dist/components/cascade-select/index.d.mts +3 -1
- package/dist/components/cascade-select/index.mjs +82 -74
- package/dist/components/checkbox/index.d.mts +1 -1
- package/dist/components/checkbox/index.mjs +13 -5
- package/dist/components/checkbox-group/index.d.mts +4 -9
- package/dist/components/checkbox-group/index.mjs +65 -68
- package/dist/components/chip/index.d.mts +3 -1
- package/dist/components/chip/index.mjs +3 -2
- 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 +13 -5
- package/dist/components/collapsible/index.d.mts +15 -1
- package/dist/components/collapsible/index.mjs +39 -2
- package/dist/components/color-picker/index.d.mts +13 -2
- package/dist/components/color-picker/index.mjs +95 -8
- package/dist/components/combobox/index.d.mts +24 -1
- package/dist/components/combobox/index.mjs +129 -8
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +24 -4
- package/dist/components/comment/index.d.mts +3 -1
- package/dist/components/comment/index.mjs +3 -2
- package/dist/components/config-provider/index.d.mts +7 -2
- package/dist/components/config-provider/index.mjs +6 -3
- package/dist/components/container/index.d.mts +3 -1
- package/dist/components/container/index.mjs +3 -2
- package/dist/components/data-view/index.d.mts +3 -1
- package/dist/components/data-view/index.mjs +13 -8
- package/dist/components/date-input/index.d.mts +1 -1
- package/dist/components/date-input/index.mjs +13 -5
- package/dist/components/date-picker/index.d.mts +1 -1
- package/dist/components/date-picker/index.mjs +13 -5
- package/dist/components/deferred-content/index.d.mts +3 -1
- package/dist/components/deferred-content/index.mjs +3 -2
- package/dist/components/descriptions/index.d.mts +7 -0
- package/dist/components/descriptions/index.mjs +21 -2
- package/dist/components/dialog/index.d.mts +17 -1
- package/dist/components/dialog/index.mjs +84 -2
- 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 +83 -2
- package/dist/components/dynamic-input/index.d.mts +3 -1
- package/dist/components/dynamic-input/index.mjs +15 -7
- package/dist/components/editable/index.d.mts +1 -1
- package/dist/components/editable/index.mjs +13 -5
- package/dist/components/ellipsis/index.d.mts +3 -1
- package/dist/components/ellipsis/index.mjs +3 -2
- package/dist/components/field/index.d.mts +5 -1
- package/dist/components/field/index.mjs +13 -1
- package/dist/components/fieldset/index.d.mts +5 -1
- package/dist/components/fieldset/index.mjs +13 -1
- package/dist/components/file-upload/index.d.mts +1 -1
- package/dist/components/file-upload/index.mjs +24 -6
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/floating-panel/index.d.mts +5 -1
- package/dist/components/floating-panel/index.mjs +13 -1
- 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 +10 -4
- 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 +3 -2
- package/dist/components/highlight/index.d.mts +3 -1
- package/dist/components/highlight/index.mjs +2 -1
- package/dist/components/hover-card/index.d.mts +19 -1
- package/dist/components/hover-card/index.mjs +91 -2
- package/dist/components/icon/index.d.mts +8 -7
- package/dist/components/icon/index.mjs +4 -3
- package/dist/components/image/index.d.mts +8 -2
- package/dist/components/image/index.mjs +40 -33
- package/dist/components/image-cropper/index.d.mts +5 -1
- package/dist/components/image-cropper/index.mjs +13 -1
- package/dist/components/image-viewer/index.d.mts +2 -19
- package/dist/components/image-viewer/index.mjs +3 -151
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +5 -1
- package/dist/components/json-tree-view/index.mjs +22 -2
- package/dist/components/kbd/index.d.mts +3 -1
- package/dist/components/kbd/index.mjs +3 -2
- package/dist/components/layout/index.mjs +8 -4
- package/dist/components/link/index.d.mts +3 -1
- package/dist/components/link/index.mjs +3 -2
- package/dist/components/list/index.d.mts +2 -1
- package/dist/components/list/index.mjs +35 -26
- package/dist/components/listbox/index.d.mts +1 -1
- package/dist/components/listbox/index.mjs +13 -5
- package/dist/components/marquee/index.d.mts +5 -1
- package/dist/components/marquee/index.mjs +13 -1
- package/dist/components/masonry/index.d.mts +3 -1
- package/dist/components/masonry/index.mjs +3 -2
- 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 +62 -5
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +31 -9
- package/dist/components/navigation-menu/index.d.mts +5 -1
- package/dist/components/navigation-menu/index.mjs +13 -1
- package/dist/components/number-input/index.d.mts +1 -1
- package/dist/components/number-input/index.mjs +13 -5
- package/dist/components/order-list/index.d.mts +3 -1
- package/dist/components/order-list/index.mjs +79 -67
- package/dist/components/pagination/index.d.mts +1 -1
- package/dist/components/pagination/index.mjs +13 -5
- package/dist/components/password-input/index.d.mts +1 -1
- package/dist/components/password-input/index.mjs +13 -5
- package/dist/components/pin-input/index.d.mts +1 -1
- package/dist/components/pin-input/index.mjs +13 -5
- package/dist/components/popconfirm/index.d.mts +3 -1
- package/dist/components/popconfirm/index.mjs +16 -8
- package/dist/components/popover/index.d.mts +19 -1
- package/dist/components/popover/index.mjs +91 -2
- 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 +13 -5
- package/dist/components/progress-group/index.d.mts +3 -1
- package/dist/components/progress-group/index.mjs +4 -3
- package/dist/components/qr-code/index.d.mts +5 -1
- package/dist/components/qr-code/index.mjs +13 -1
- package/dist/components/radio-group/index.d.mts +1 -1
- package/dist/components/radio-group/index.mjs +13 -5
- package/dist/components/rating-group/index.d.mts +2 -2
- package/dist/components/rating-group/index.mjs +13 -5
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +5 -3
- package/dist/components/scroll-area/index.d.mts +5 -1
- package/dist/components/scroll-area/index.mjs +13 -1
- package/dist/components/segment-group/index.d.mts +1 -1
- package/dist/components/segment-group/index.mjs +11 -6
- 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 +3 -2
- package/dist/components/signature-pad/index.d.mts +5 -1
- package/dist/components/signature-pad/index.mjs +13 -1
- package/dist/components/skeleton/index.d.mts +3 -1
- package/dist/components/skeleton/index.mjs +3 -2
- package/dist/components/slider/index.d.mts +1 -1
- package/dist/components/slider/index.mjs +13 -5
- package/dist/components/spinner/index.d.mts +3 -1
- package/dist/components/spinner/index.mjs +6 -3
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +19 -4
- package/dist/components/splitter/index.d.mts +5 -1
- package/dist/components/splitter/index.mjs +13 -1
- package/dist/components/spotlight/index.d.mts +3 -1
- package/dist/components/spotlight/index.mjs +3 -2
- package/dist/components/stack/index.d.mts +3 -1
- package/dist/components/stack/index.mjs +6 -5
- package/dist/components/steps/index.d.mts +25 -3
- package/dist/components/steps/index.mjs +73 -8
- package/dist/components/swap/index.d.mts +5 -1
- package/dist/components/swap/index.mjs +13 -1
- package/dist/components/switch/index.d.mts +1 -1
- package/dist/components/switch/index.mjs +13 -5
- package/dist/components/table/index.d.mts +3 -1
- package/dist/components/table/index.mjs +194 -164
- package/dist/components/tabs/index.d.mts +20 -2
- package/dist/components/tabs/index.mjs +59 -3
- package/dist/components/tags-input/index.d.mts +1 -1
- package/dist/components/tags-input/index.mjs +13 -5
- package/dist/components/terminal/index.d.mts +3 -1
- package/dist/components/terminal/index.mjs +6 -3
- package/dist/components/textarea/index.d.mts +3 -1
- package/dist/components/textarea/index.mjs +3 -2
- package/dist/components/timer/index.d.mts +5 -1
- package/dist/components/timer/index.mjs +13 -1
- package/dist/components/toast/index.d.mts +8 -2
- package/dist/components/toast/index.mjs +14 -2
- package/dist/components/toc/index.d.mts +5 -1
- package/dist/components/toc/index.mjs +1 -9
- package/dist/components/toggle/index.d.mts +5 -1
- package/dist/components/toggle/index.mjs +13 -1
- package/dist/components/toggle-group/index.d.mts +1 -1
- package/dist/components/toggle-group/index.mjs +13 -5
- package/dist/components/toolbar/index.d.mts +3 -1
- package/dist/components/toolbar/index.mjs +3 -2
- package/dist/components/tooltip/index.d.mts +16 -1
- package/dist/components/tooltip/index.mjs +55 -2
- package/dist/components/tour/index.d.mts +16 -3
- package/dist/components/tour/index.mjs +74 -9
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +68 -54
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +45 -35
- package/dist/components/tree-view/index.d.mts +1 -1
- package/dist/components/tree-view/index.mjs +26 -5
- package/dist/components/user/index.d.mts +3 -1
- package/dist/components/user/index.mjs +8 -2
- package/dist/components/virtual-list/index.d.mts +3 -1
- package/dist/components/virtual-list/index.mjs +14 -9
- package/dist/components/watermark/index.d.mts +3 -1
- package/dist/components/watermark/index.mjs +4 -3
- 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-B9A5lXsk.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-DhripUtf.d.mts +39 -0
- package/dist/{index-YPUiqD3n.d.mts → index-ID48LCMU.d.mts} +28 -2
- package/dist/{index-IfofF-SW.d.mts → index-nFXK_8hJ.d.mts} +53 -23
- package/dist/index-wW28BYf1.d.mts +124 -0
- package/dist/index.d.mts +22 -21
- package/dist/index.mjs +14 -13
- package/dist/{input-DoFQ7RXh.mjs → input-CPAJdwDb.mjs} +3 -2
- package/dist/media-player-BC8D_d29.mjs +796 -0
- package/dist/{mentions-f5Js_2W7.mjs → mentions-CeG5u8Qm.mjs} +67 -51
- package/dist/select-7YjMSBGx.mjs +292 -0
- package/dist/toc-DYKaKQ_X.mjs +31 -0
- package/dist/use-component-messages-C4SCVYjD.mjs +17 -0
- package/package.json +3 -3
- package/dist/chevron-D5RzcayK.mjs +0 -9
- package/dist/select-CHaXbzLX.mjs +0 -115
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "./family-Cmd8HEyK.mjs";
|
|
2
|
+
import { n as iconHtml } from "./icon-DTqmJCd5.mjs";
|
|
3
|
+
import { n as useComponentMessages } from "./use-component-messages-C4SCVYjD.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
5
|
import { ref, spread, template } from "@solidjs/web";
|
|
3
6
|
import { createEffect, createMemo, onMount, splitProps } from "solid-js";
|
|
4
7
|
import { renderHtml } from "@tanstack/markdown/html";
|
|
5
8
|
//#region src/components/ai-response/code-copy.ts
|
|
6
|
-
/** The two
|
|
9
|
+
/** The two icons a copy affordance needs: the stamp and its
|
|
7
10
|
* confirmation. Inline SVG keeps the enhancement framework-agnostic —
|
|
8
11
|
* it lives beside the renderer's generated code HTML. */
|
|
9
|
-
const COPY_CODE_ICON =
|
|
10
|
-
|
|
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
|
+
});
|
|
11
20
|
/** How long the confirmation stays before the stamp returns. */
|
|
12
21
|
const REVERT_MS = 1500;
|
|
13
22
|
/** Make sure every fenced block under `host` carries its copy stamp.
|
|
@@ -103,7 +112,7 @@ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
|
103
112
|
/** Markdown set on the paper. Rendering goes through
|
|
104
113
|
* `@tanstack/markdown`, whose defaults leave raw HTML and executable
|
|
105
114
|
* links inert — streaming-safe by construction. */
|
|
106
|
-
function Response(props) {
|
|
115
|
+
const Response = withSelfRoot(function Response(props) {
|
|
107
116
|
injectComponentStyle("ai");
|
|
108
117
|
const [own, rest] = splitProps(props, [
|
|
109
118
|
"content",
|
|
@@ -111,15 +120,16 @@ function Response(props) {
|
|
|
111
120
|
"copyLabel",
|
|
112
121
|
"copiedLabel"
|
|
113
122
|
]);
|
|
123
|
+
const messages = useComponentMessages();
|
|
114
124
|
const html = createMemo(() => renderHtml(own.content, own.highlighter ? { highlighter: own.highlighter } : void 0));
|
|
115
125
|
let root;
|
|
116
126
|
onMount(() => createEffect(() => {
|
|
117
127
|
html();
|
|
118
|
-
if (root) decorateCodeCopy(root, own.copyLabel ??
|
|
128
|
+
if (root) decorateCodeCopy(root, own.copyLabel ?? messages().ai.copyCode);
|
|
119
129
|
if (root) wrapResponseTables(root);
|
|
120
130
|
}));
|
|
121
131
|
const onClick = (event) => {
|
|
122
|
-
clickCodeCopy(event, own.copyLabel ??
|
|
132
|
+
clickCodeCopy(event, own.copyLabel ?? messages().ai.copyCode, own.copiedLabel ?? messages().ai.copied);
|
|
123
133
|
};
|
|
124
134
|
var _el$ = _tmpl$();
|
|
125
135
|
ref(() => {
|
|
@@ -134,6 +144,6 @@ function Response(props) {
|
|
|
134
144
|
}
|
|
135
145
|
}], false);
|
|
136
146
|
return _el$;
|
|
137
|
-
}
|
|
147
|
+
});
|
|
138
148
|
//#endregion
|
|
139
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 { 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";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
5
|
+
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
2
6
|
import { Accordion as Accordion$1 } from "@ark-ui/solid/accordion";
|
|
3
|
-
|
|
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,3 +1,4 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { spread, template } from "@solidjs/web";
|
|
3
4
|
import { splitProps } from "solid-js";
|
|
@@ -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 ?? "0px",
|
|
24
|
-
bottom: own.offsetBottom ?? "0px"
|
|
24
|
+
"--bs-affix-top": own.offsetTop ?? "0px",
|
|
25
|
+
"--bs-affix-bottom": own.offsetBottom ?? "0px"
|
|
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-nFXK_8hJ.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,8 +1,10 @@
|
|
|
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";
|
|
4
|
+
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
3
5
|
import { AiPromptInput as PromptInput } from "../ai-prompt-input/index.mjs";
|
|
4
6
|
import { AiReasoning as Reasoning } from "../ai-reasoning/index.mjs";
|
|
5
|
-
import { t as Response } from "../../ai-response-
|
|
7
|
+
import { t as Response } from "../../ai-response-D2uINBIi.mjs";
|
|
6
8
|
import { AiSource as Source, AiSources as Sources } from "../ai-source/index.mjs";
|
|
7
9
|
import { AiSuggestion as Suggestion } from "../ai-suggestion/index.mjs";
|
|
8
10
|
import { AiTool as Tool } from "../ai-tool/index.mjs";
|
|
@@ -10,17 +12,13 @@ import { injectComponentStyle } from "@bysages/core";
|
|
|
10
12
|
import { spread, template } from "@solidjs/web";
|
|
11
13
|
//#region src/components/ai/index.tsx
|
|
12
14
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
13
|
-
/** A conversation column: Root is the log, Message carries a role, and
|
|
14
|
-
* the speaking parts — Response, Reasoning, Tool, Sources — part the
|
|
15
|
-
* stream. The interactive folds are the shared Collapsible wearing a
|
|
16
|
-
* `data-ai` marker, so the machine work is never ours. Parts stay
|
|
17
|
-
* agnostic of any client; consumers map their message format (e.g. the
|
|
18
|
-
* `UIMessage` parts re-exported here) onto these primitives. */
|
|
19
15
|
function part(name, extra = {}) {
|
|
20
16
|
function Component(props) {
|
|
17
|
+
const messages = useComponentMessages();
|
|
18
|
+
const partExtra = typeof extra === "function" ? extra(messages()) : extra;
|
|
21
19
|
var _el$ = _tmpl$();
|
|
22
20
|
spread(_el$, [
|
|
23
|
-
|
|
21
|
+
partExtra,
|
|
24
22
|
props,
|
|
25
23
|
{
|
|
26
24
|
"data-scope": "ai",
|
|
@@ -35,20 +33,20 @@ function part(name, extra = {}) {
|
|
|
35
33
|
}
|
|
36
34
|
/** The log itself: the column every stroke lands in, a landmark to
|
|
37
35
|
* screen readers. */
|
|
38
|
-
const AiConversation = part("Conversation", {
|
|
36
|
+
const AiConversation = part("Conversation", (messages) => ({
|
|
39
37
|
role: "log",
|
|
40
|
-
"aria-label":
|
|
41
|
-
});
|
|
38
|
+
"aria-label": messages.ai.conversation
|
|
39
|
+
}));
|
|
42
40
|
/** The bubble's inner measure — content that belongs to neither side
|
|
43
41
|
* specifically. */
|
|
44
|
-
const AiContent = part("Content");
|
|
42
|
+
const AiContent = withSelfRoot(part("Content"));
|
|
45
43
|
/** The quiet row under a message — copy, retry, feedback. */
|
|
46
|
-
const AiActions = part("Actions");
|
|
44
|
+
const AiActions = withSelfRoot(part("Actions"));
|
|
47
45
|
/** The while-it-works whisper for the in-flight turns. */
|
|
48
|
-
const AiLoader = part("Loader", {
|
|
46
|
+
const AiLoader = withSelfRoot(part("Loader", (messages) => ({
|
|
49
47
|
role: "status",
|
|
50
|
-
"aria-label":
|
|
51
|
-
});
|
|
48
|
+
"aria-label": messages.ai.loading
|
|
49
|
+
})));
|
|
52
50
|
/** The whole family under one handle — `Ai.Conversation`,
|
|
53
51
|
* `Ai.MessageContent`, and the rest. */
|
|
54
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,3 +1,4 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { Button } from "../button/index.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
4
|
import { createComponent, mergeProps } from "@solidjs/web";
|
|
@@ -6,7 +7,7 @@ import { splitProps } from "solid-js";
|
|
|
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,20 +1,23 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
3
|
+
import { n as useComponentMessages, t as formatComponentMessage } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
5
|
import { delegateEvents, effect, insert, memo, setAttribute, spread, template } from "@solidjs/web";
|
|
3
6
|
import { splitProps } from "solid-js";
|
|
4
7
|
//#region src/components/ai-attachments/index.tsx
|
|
5
|
-
var _tmpl$ = /* @__PURE__ */ template(`<
|
|
6
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _tmpl$5 = /* @__PURE__ */ template(`<span>`);
|
|
10
|
-
function imageGlyph() {
|
|
11
|
-
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");
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function fileIcon() {
|
|
14
|
+
return iconNode("file");
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function removeIcon() {
|
|
17
|
+
return iconNode("x", {
|
|
18
|
+
width: "12",
|
|
19
|
+
height: "12"
|
|
20
|
+
});
|
|
18
21
|
}
|
|
19
22
|
const IMAGE_EXTS = [
|
|
20
23
|
"png",
|
|
@@ -43,10 +46,10 @@ const humanSize = (bytes) => {
|
|
|
43
46
|
} while (value >= 1024 && unit < units.length - 1);
|
|
44
47
|
return `${value.toFixed(1)} ${units[unit]}`;
|
|
45
48
|
};
|
|
46
|
-
/** One file riding the prompt: its
|
|
49
|
+
/** One file riding the prompt: its icon by extension, its name and
|
|
47
50
|
* human size, and a quiet way to take it back off. Uploading reads as
|
|
48
51
|
* a dashed ghost, error as danger ink. */
|
|
49
|
-
function Attachment(props) {
|
|
52
|
+
const Attachment = withSelfRoot(function Attachment(props) {
|
|
50
53
|
injectComponentStyle("ai");
|
|
51
54
|
const [own, rest] = splitProps(props, [
|
|
52
55
|
"name",
|
|
@@ -54,57 +57,58 @@ function Attachment(props) {
|
|
|
54
57
|
"status",
|
|
55
58
|
"onRemove"
|
|
56
59
|
]);
|
|
57
|
-
|
|
58
|
-
var _el$
|
|
59
|
-
var _el$
|
|
60
|
-
|
|
60
|
+
const messages = useComponentMessages();
|
|
61
|
+
var _el$ = _tmpl$();
|
|
62
|
+
var _el$2 = _el$.firstChild;
|
|
63
|
+
var _el$3 = _el$2.nextSibling;
|
|
64
|
+
spread(_el$, [rest, {
|
|
61
65
|
"data-scope": "ai",
|
|
62
66
|
"data-part": "attachment",
|
|
63
67
|
get "data-status"() {
|
|
64
68
|
return own.status ?? "ready";
|
|
65
69
|
}
|
|
66
70
|
}], true);
|
|
67
|
-
insert(_el
|
|
71
|
+
insert(_el$, (() => {
|
|
68
72
|
var _c$ = memo(() => {
|
|
69
73
|
return !!isImage(own.name);
|
|
70
74
|
});
|
|
71
75
|
return () => {
|
|
72
|
-
return _c$() ?
|
|
76
|
+
return _c$() ? imageIcon() : fileIcon();
|
|
73
77
|
};
|
|
74
|
-
})(), _el$
|
|
75
|
-
insert(_el$
|
|
78
|
+
})(), _el$2);
|
|
79
|
+
insert(_el$2, () => {
|
|
76
80
|
return own.name;
|
|
77
81
|
});
|
|
78
|
-
insert(_el
|
|
82
|
+
insert(_el$, (() => {
|
|
79
83
|
var _c$2 = memo(() => {
|
|
80
84
|
return own.size !== void 0;
|
|
81
85
|
});
|
|
82
86
|
return () => {
|
|
83
87
|
return _c$2() ? (() => {
|
|
84
|
-
var _el$
|
|
85
|
-
insert(_el$
|
|
88
|
+
var _el$4 = _tmpl$2();
|
|
89
|
+
insert(_el$4, () => {
|
|
86
90
|
return humanSize(own.size);
|
|
87
91
|
});
|
|
88
|
-
return _el$
|
|
92
|
+
return _el$4;
|
|
89
93
|
})() : null;
|
|
90
94
|
};
|
|
91
|
-
})(), _el$
|
|
92
|
-
_el$
|
|
93
|
-
insert(_el$
|
|
94
|
-
effect(() =>
|
|
95
|
-
setAttribute(_el$
|
|
95
|
+
})(), _el$3);
|
|
96
|
+
_el$3._$$click = () => own.onRemove?.();
|
|
97
|
+
insert(_el$3, removeIcon);
|
|
98
|
+
effect(() => formatComponentMessage(messages().ai.removeAttachment, { name: own.name }), (_v$) => {
|
|
99
|
+
setAttribute(_el$3, "aria-label", _v$);
|
|
96
100
|
});
|
|
97
|
-
return _el
|
|
98
|
-
}
|
|
101
|
+
return _el$;
|
|
102
|
+
});
|
|
99
103
|
/** The row the files ride in — a wrapping line of chips. */
|
|
100
|
-
function Attachments(props) {
|
|
101
|
-
var _el$
|
|
102
|
-
spread(_el$
|
|
104
|
+
const Attachments = withSelfRoot(function Attachments(props) {
|
|
105
|
+
var _el$5 = _tmpl$2();
|
|
106
|
+
spread(_el$5, [props, {
|
|
103
107
|
"data-scope": "ai",
|
|
104
108
|
"data-part": "attachments"
|
|
105
109
|
}], false);
|
|
106
|
-
return _el$
|
|
107
|
-
}
|
|
110
|
+
return _el$5;
|
|
111
|
+
});
|
|
108
112
|
delegateEvents(["click"]);
|
|
109
113
|
//#endregion
|
|
110
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,3 +1,4 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { spread, template } from "@solidjs/web";
|
|
3
4
|
import { splitProps } from "solid-js";
|
|
@@ -5,7 +6,7 @@ import { splitProps } from "solid-js";
|
|
|
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 };
|