@k2b/ui 0.16.0 → 0.18.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/browser/chat/ChatComposer.js +261 -274
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatPrimitives.js +9 -6
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/content/FileView.js +62 -36
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/MarkdownView.js +9 -3
- package/dist/browser/content/MarkdownView.js.map +1 -1
- package/dist/browser/content/VideoPlayer.js +279 -0
- package/dist/browser/content/VideoPlayer.js.map +1 -0
- package/dist/browser/content/file-view-preview.js +2 -2
- package/dist/browser/content/file-view-preview.js.map +1 -1
- package/dist/browser/content/index.js +2 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/markdown-links.js +178 -0
- package/dist/browser/content/markdown-links.js.map +1 -0
- package/dist/browser/inputs/FileDropTarget.js +129 -0
- package/dist/browser/inputs/FileDropTarget.js.map +1 -0
- package/dist/browser/inputs/FileInputs.js +37 -11
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/file-drop.js +338 -0
- package/dist/browser/inputs/file-drop.js.map +1 -0
- package/dist/browser/inputs/index.js +1 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/markdown/MarkdownEditor.js +72 -78
- package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/browser/intl/messages.js +97 -4
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +210 -44
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Navigation.js +278 -170
- package/dist/browser/layout/Navigation.js.map +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/navigation-model.js +3 -1
- package/dist/browser/layout/navigation-model.js.map +1 -1
- package/dist/browser/surfaces/NoticeCard.js +47 -44
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +59 -48
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +9 -6
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/content/FileView.js +30 -6
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/MarkdownView.js +9 -3
- package/dist/ssr/content/MarkdownView.js.map +1 -1
- package/dist/ssr/content/VideoPlayer.js +208 -0
- package/dist/ssr/content/VideoPlayer.js.map +1 -0
- package/dist/ssr/content/file-view-preview.js +2 -2
- package/dist/ssr/content/file-view-preview.js.map +1 -1
- package/dist/ssr/content/index.js +2 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/markdown-links.js +178 -0
- package/dist/ssr/content/markdown-links.js.map +1 -0
- package/dist/ssr/inputs/FileDropTarget.js +103 -0
- package/dist/ssr/inputs/FileDropTarget.js.map +1 -0
- package/dist/ssr/inputs/FileInputs.js +32 -10
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/file-drop.js +338 -0
- package/dist/ssr/inputs/file-drop.js.map +1 -0
- package/dist/ssr/inputs/index.js +1 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/markdown/MarkdownEditor.js +14 -2
- package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/ssr/intl/messages.js +97 -4
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +173 -27
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +175 -102
- package/dist/ssr/layout/Navigation.js.map +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/navigation-model.js +3 -1
- package/dist/ssr/layout/navigation-model.js.map +1 -1
- package/dist/ssr/surfaces/NoticeCard.js +17 -12
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/chat/ChatPrimitives.d.ts +1 -1
- package/dist/types/content/VideoPlayer.d.ts +41 -0
- package/dist/types/content/index.d.ts +2 -0
- package/dist/types/content/markdown-links.d.ts +66 -0
- package/dist/types/inputs/FileDropTarget.d.ts +23 -0
- package/dist/types/inputs/FileInputs.d.ts +2 -0
- package/dist/types/inputs/file-drop.d.ts +80 -0
- package/dist/types/inputs/index.d.ts +2 -0
- package/dist/types/intl/messages.d.ts +47 -0
- package/dist/types/layout/AppWorkspace.d.ts +21 -0
- package/dist/types/layout/index.d.ts +2 -2
- package/dist/types/layout/navigation-model.d.ts +29 -0
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/** A status icon at a row's end, such as "running". `label` names it for screen readers and as its tooltip. */
|
|
2
|
+
|
|
1
3
|
/** Serializable presentation. Functions stay with the controller's owning island. */
|
|
2
4
|
|
|
3
5
|
export function findNavigationItem(items, id) {
|
|
4
6
|
for (const item of items) {
|
|
5
7
|
if (item.disabled) continue;
|
|
6
8
|
if (item.id === id) return item;
|
|
7
|
-
const found = findNavigationItem(item.children ?? [], id) ?? findNavigationItem(item.actions ?? [], id);
|
|
9
|
+
const found = findNavigationItem(item.children ?? [], id) ?? findNavigationItem(item.inlineActions ?? [], id) ?? findNavigationItem(item.actions ?? [], id);
|
|
8
10
|
if (found) return found;
|
|
9
11
|
}
|
|
10
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["layout/navigation-model.ts"],"sourcesContent":["import type { LinkNavigateEvent, NavigationScrollMode } from \"@k2b/ssr/nav\";\nimport type { Accessor } from \"solid-js\";\n\ntype NavigationEntry = {\n id: string;\n label: string;\n icon?: string;\n badge?: string | number;\n description?: string;\n active?: boolean;\n disabled?: boolean;\n color?: string;\n children?: readonly NavigationItem[];\n /** Initial disclosure state; subsequent toggles remain local to the renderer. */\n defaultExpanded?: boolean;\n /** Owner-held disclosure state. The renderer shows it and reports toggles through `onExpandedChange`. */\n expanded?: boolean;\n actions?: readonly NavigationItem[];\n};\n\n/** Serializable presentation. Functions stay with the controller's owning island. */\nexport type NavigationItem = NavigationEntry &\n (\n | { href: string; action?: string; navigation?: \"document\" | \"enhanced\"; scroll?: NavigationScrollMode }\n | { action: string; href?: never; navigation?: never; scroll?: never }\n | {
|
|
1
|
+
{"version":3,"names":[],"sources":["layout/navigation-model.ts"],"sourcesContent":["import type { LinkNavigateEvent, NavigationScrollMode } from \"@k2b/ssr/nav\";\nimport type { Accessor } from \"solid-js\";\nimport type { IntentTone } from \"../semantics\";\n\n/** A status icon at a row's end, such as \"running\". `label` names it for screen readers and as its tooltip. */\nexport type NavigationStatus = { icon: string; label: string; tone?: IntentTone };\n\ntype NavigationEntry = {\n id: string;\n label: string;\n icon?: string;\n /** Names a meaningful icon for screen readers, such as \"Homepage\"; without it the icon is decorative. */\n iconLabel?: string;\n badge?: string | number;\n description?: string;\n /**\n * Status icon in a fixed-size slot at the row's end. Set `null` on a row whose status comes and goes: the empty slot\n * keeps its place, so a status change never rewraps the label or moves the rows below.\n */\n status?: NavigationStatus | null;\n active?: boolean;\n disabled?: boolean;\n color?: string;\n children?: readonly NavigationItem[];\n /** Initial disclosure state; subsequent toggles remain local to the renderer. */\n defaultExpanded?: boolean;\n /** Owner-held disclosure state. The renderer shows it and reports toggles through `onExpandedChange`. */\n expanded?: boolean;\n actions?: readonly NavigationItem[];\n /**\n * Square icon buttons in the row, before the `actions` menu. They run an `action`; a destination belongs in a row,\n * where its link keeps modified clicks and new tabs.\n */\n inlineActions?: readonly { id: string; label: string; icon: string; action: string; disabled?: boolean }[];\n};\n\n/** Serializable presentation. Functions stay with the controller's owning island. */\nexport type NavigationItem = NavigationEntry &\n (\n | { href: string; action?: string; navigation?: \"document\" | \"enhanced\"; scroll?: NavigationScrollMode; section?: never }\n | { action: string; href?: never; navigation?: never; scroll?: never; section?: never }\n | {\n href?: never;\n action?: never;\n navigation?: never;\n scroll?: never;\n children: readonly NavigationItem[];\n /** Shows the group as a plain heading over its rows, always open and not indented, instead of a disclosure. */\n section?: boolean;\n }\n );\n\nexport type NavigationOptions = {\n items: Accessor<readonly NavigationItem[]>;\n onAction?: (action: string) => void | Promise<void>;\n onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;\n /** Receives disclosure toggles of items that carry `expanded`; the owner decides the next state. */\n onExpandedChange?: (id: string, expanded: boolean) => void;\n};\n\nexport function findNavigationItem(items: readonly NavigationItem[], id: string): NavigationItem | undefined {\n for (const item of items) {\n if (item.disabled) continue;\n if (item.id === id) return item;\n const found =\n findNavigationItem(item.children ?? [], id) ??\n findNavigationItem(item.inlineActions ?? [], id) ??\n findNavigationItem(item.actions ?? [], id);\n if (found) return found;\n }\n}\n\n/** One live source for renderers; no router, registry, fetching or persisted state. */\nexport function createNavigation(options: NavigationOptions) {\n return {\n items: options.items,\n onNavigate: options.onNavigate,\n onExpandedChange: options.onExpandedChange,\n async activate(id: string) {\n const item = findNavigationItem(options.items(), id);\n if (item?.action) await options.onAction?.(item.action);\n },\n };\n}\n\nexport type NavigationController = ReturnType<typeof createNavigation>;\n"],"mappings":"AAIA;;AAgCA;;AAwBA,OAAO,SAAS,kBAAkB,CAAC,KAAgC,EAAE,EAAU,EAA8B;EAC3G,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;IACxB,IAAI,IAAI,CAAC,QAAQ,EAAE;IACnB,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,IAAI;IAC/B,MAAM,KAAK,GACT,kBAAkB,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC,IAC3C,kBAAkB,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,EAAE,EAAE,CAAC,IAChD,kBAAkB,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,CAAC;IAC5C,IAAI,KAAK,EAAE,OAAO,KAAK;EACzB;AACF;;AAEA;AACA,OAAO,SAAS,gBAAgB,CAAC,OAA0B,EAAE;EAC3D,OAAO;IACL,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;IAC1C,MAAM,QAAQ,CAAC,EAAU,EAAE;MACzB,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;MACpD,IAAI,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;IACzD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { template as _$template } from "solid-js/web";
|
|
2
2
|
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
3
|
+
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
4
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
3
5
|
import { className as _$className } from "solid-js/web";
|
|
4
6
|
import { effect as _$effect } from "solid-js/web";
|
|
5
7
|
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
6
|
-
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
7
|
-
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
8
8
|
import { insert as _$insert } from "solid-js/web";
|
|
9
9
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
10
10
|
import { spread as _$spread } from "solid-js/web";
|
|
11
11
|
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
12
12
|
import { memo as _$memo } from "solid-js/web";
|
|
13
|
-
var _tmpl$ = /*#__PURE__*/_$template(`<
|
|
14
|
-
_tmpl$2 = /*#__PURE__*/_$template(`<div
|
|
15
|
-
_tmpl$3 = /*#__PURE__*/_$template(`<
|
|
16
|
-
_tmpl$4 = /*#__PURE__*/_$template(`<
|
|
17
|
-
_tmpl$5 = /*#__PURE__*/_$template(`<
|
|
18
|
-
import { For, Show, splitProps } from "solid-js";
|
|
13
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<div>`),
|
|
14
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<article><div><!$><!/><!$><!/><!$><!/>`),
|
|
15
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<div><p></p><!$><!/>`),
|
|
16
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<span>`),
|
|
17
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<p>`);
|
|
18
|
+
import { children, For, Show, splitProps } from "solid-js";
|
|
19
19
|
export const NOTICE_CARD_CLASSES = {
|
|
20
20
|
root: "k2b-notice-card",
|
|
21
21
|
content: "k2b-notice-card__content",
|
|
@@ -27,15 +27,18 @@ export const NOTICE_CARD_CLASSES = {
|
|
|
27
27
|
};
|
|
28
28
|
function NoticeCardComponent(props) {
|
|
29
29
|
const [local, articleProps] = splitProps(props, ["tone", "title", "detail", "meta", "children", "class", "bodyClass"]);
|
|
30
|
+
// Children that render nothing, such as a Show whose condition is false, add no body and no gap.
|
|
31
|
+
const body = children(() => local.children);
|
|
32
|
+
const hasBody = () => body.toArray().some(node => node != null && node !== false && node !== "");
|
|
30
33
|
return (() => {
|
|
31
|
-
var _el$ = _$getNextElement(_tmpl$),
|
|
34
|
+
var _el$ = _$getNextElement(_tmpl$2),
|
|
32
35
|
_el$2 = _el$.firstChild,
|
|
33
|
-
_el$
|
|
34
|
-
[_el$
|
|
35
|
-
_el$
|
|
36
|
-
[_el$
|
|
37
|
-
_el$
|
|
38
|
-
[_el$
|
|
36
|
+
_el$4 = _el$2.firstChild,
|
|
37
|
+
[_el$5, _co$] = _$getNextMarker(_el$4.nextSibling),
|
|
38
|
+
_el$6 = _el$5.nextSibling,
|
|
39
|
+
[_el$7, _co$2] = _$getNextMarker(_el$6.nextSibling),
|
|
40
|
+
_el$8 = _el$7.nextSibling,
|
|
41
|
+
[_el$9, _co$3] = _$getNextMarker(_el$8.nextSibling);
|
|
39
42
|
_$spread(_el$, _$mergeProps(articleProps, {
|
|
40
43
|
get ["class"]() {
|
|
41
44
|
return `${NOTICE_CARD_CLASSES.root} ${local.class ?? ""}`;
|
|
@@ -49,57 +52,57 @@ function NoticeCardComponent(props) {
|
|
|
49
52
|
return local.title;
|
|
50
53
|
},
|
|
51
54
|
children: title => (() => {
|
|
52
|
-
var _el$
|
|
53
|
-
_el$
|
|
54
|
-
_el$
|
|
55
|
-
[_el$
|
|
56
|
-
_$insert(_el$
|
|
57
|
-
_$insert(_el$
|
|
55
|
+
var _el$0 = _$getNextElement(_tmpl$3),
|
|
56
|
+
_el$1 = _el$0.firstChild,
|
|
57
|
+
_el$10 = _el$1.nextSibling,
|
|
58
|
+
[_el$11, _co$4] = _$getNextMarker(_el$10.nextSibling);
|
|
59
|
+
_$insert(_el$1, title);
|
|
60
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
58
61
|
get when() {
|
|
59
62
|
return local.meta;
|
|
60
63
|
},
|
|
61
64
|
children: meta => (() => {
|
|
62
|
-
var _el$
|
|
63
|
-
_$insert(_el$
|
|
64
|
-
_$effect(() => _$className(_el$
|
|
65
|
-
return _el$
|
|
65
|
+
var _el$12 = _$getNextElement(_tmpl$4);
|
|
66
|
+
_$insert(_el$12, meta);
|
|
67
|
+
_$effect(() => _$className(_el$12, NOTICE_CARD_CLASSES.meta));
|
|
68
|
+
return _el$12;
|
|
66
69
|
})()
|
|
67
|
-
}), _el$
|
|
70
|
+
}), _el$11, _co$4);
|
|
68
71
|
_$effect(_p$ => {
|
|
69
72
|
var _v$ = NOTICE_CARD_CLASSES.head,
|
|
70
73
|
_v$2 = NOTICE_CARD_CLASSES.title;
|
|
71
|
-
_v$ !== _p$.e && _$className(_el$
|
|
72
|
-
_v$2 !== _p$.t && _$className(_el$
|
|
74
|
+
_v$ !== _p$.e && _$className(_el$0, _p$.e = _v$);
|
|
75
|
+
_v$2 !== _p$.t && _$className(_el$1, _p$.t = _v$2);
|
|
73
76
|
return _p$;
|
|
74
77
|
}, {
|
|
75
78
|
e: undefined,
|
|
76
79
|
t: undefined
|
|
77
80
|
});
|
|
78
|
-
return _el$
|
|
81
|
+
return _el$0;
|
|
79
82
|
})()
|
|
80
|
-
}), _el$
|
|
83
|
+
}), _el$5, _co$);
|
|
81
84
|
_$insert(_el$2, _$createComponent(Show, {
|
|
82
85
|
get when() {
|
|
83
86
|
return local.detail;
|
|
84
87
|
},
|
|
85
88
|
children: detail => (() => {
|
|
86
|
-
var _el$
|
|
87
|
-
_$insert(_el$
|
|
88
|
-
_$effect(() => _$className(_el$
|
|
89
|
-
return _el$
|
|
89
|
+
var _el$13 = _$getNextElement(_tmpl$5);
|
|
90
|
+
_$insert(_el$13, detail);
|
|
91
|
+
_$effect(() => _$className(_el$13, NOTICE_CARD_CLASSES.description));
|
|
92
|
+
return _el$13;
|
|
90
93
|
})()
|
|
91
|
-
}), _el$
|
|
94
|
+
}), _el$7, _co$2);
|
|
92
95
|
_$insert(_el$2, _$createComponent(Show, {
|
|
93
96
|
get when() {
|
|
94
|
-
return
|
|
97
|
+
return hasBody();
|
|
95
98
|
},
|
|
96
|
-
children
|
|
97
|
-
var _el$
|
|
98
|
-
_$insert(_el$
|
|
99
|
-
_$effect(() => _$className(_el$
|
|
100
|
-
return _el$
|
|
101
|
-
}
|
|
102
|
-
}), _el$
|
|
99
|
+
get children() {
|
|
100
|
+
var _el$3 = _$getNextElement(_tmpl$);
|
|
101
|
+
_$insert(_el$3, body);
|
|
102
|
+
_$effect(() => _$className(_el$3, `${NOTICE_CARD_CLASSES.body} ${local.bodyClass ?? ""}`));
|
|
103
|
+
return _el$3;
|
|
104
|
+
}
|
|
105
|
+
}), _el$9, _co$3);
|
|
103
106
|
_$effect(() => _$className(_el$2, NOTICE_CARD_CLASSES.content));
|
|
104
107
|
_$runHydrationEvents();
|
|
105
108
|
return _el$;
|
|
@@ -112,7 +115,7 @@ function NoticeGrid(props) {
|
|
|
112
115
|
return props.items.length > 0;
|
|
113
116
|
},
|
|
114
117
|
get children() {
|
|
115
|
-
var _el$14 = _$getNextElement(_tmpl$
|
|
118
|
+
var _el$14 = _$getNextElement(_tmpl$);
|
|
116
119
|
_$insert(_el$14, _$createComponent(For, {
|
|
117
120
|
get each() {
|
|
118
121
|
return props.items;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/NoticeCard.tsx"],"sourcesContent":["import { For, type JSX, Show, splitProps } from \"solid-js\";\nimport type { IntentTone } from \"../semantics\";\n\nexport type NoticeTone = Extract<IntentTone, \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\">;\n\ntype NoticeCardContentProps =\n | { title: JSX.Element; detail?: JSX.Element; meta?: JSX.Element; children?: JSX.Element }\n | { title?: never; detail?: never; meta?: never; children: JSX.Element };\n\nexport type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"title\"> &\n NoticeCardContentProps & {\n tone?: NoticeTone;\n class?: string;\n bodyClass?: string;\n };\n\nexport const NOTICE_CARD_CLASSES = {\n root: \"k2b-notice-card\",\n content: \"k2b-notice-card__content\",\n head: \"k2b-notice-card__head\",\n title: \"k2b-notice-card__title\",\n meta: \"k2b-notice-card__meta\",\n description: \"k2b-notice-card__description\",\n body: \"k2b-notice-card__body\",\n} as const;\n\nfunction NoticeCardComponent(props: NoticeCardProps): JSX.Element {\n const [local, articleProps] = splitProps(props, [\"tone\", \"title\", \"detail\", \"meta\", \"children\", \"class\", \"bodyClass\"]);\n return (\n <article {...articleProps} class={`${NOTICE_CARD_CLASSES.root} ${local.class ?? \"\"}`} data-tone={local.tone ?? \"neutral\"}>\n <div class={NOTICE_CARD_CLASSES.content}>\n <Show when={local.title}>\n {(title) => (\n <div class={NOTICE_CARD_CLASSES.head}>\n <p class={NOTICE_CARD_CLASSES.title}>{title()}</p>\n <Show when={local.meta}>{(meta) => <span class={NOTICE_CARD_CLASSES.meta}>{meta()}</span>}</Show>\n </div>\n )}\n </Show>\n <Show when={local.detail}>{(detail) => <p class={NOTICE_CARD_CLASSES.description}>{detail()}</p>}</Show>\n <Show when={
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/NoticeCard.tsx"],"sourcesContent":["import { children, For, type JSX, Show, splitProps } from \"solid-js\";\nimport type { IntentTone } from \"../semantics\";\n\nexport type NoticeTone = Extract<IntentTone, \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\">;\n\ntype NoticeCardContentProps =\n | { title: JSX.Element; detail?: JSX.Element; meta?: JSX.Element; children?: JSX.Element }\n | { title?: never; detail?: never; meta?: never; children: JSX.Element };\n\nexport type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"title\"> &\n NoticeCardContentProps & {\n tone?: NoticeTone;\n class?: string;\n bodyClass?: string;\n };\n\nexport const NOTICE_CARD_CLASSES = {\n root: \"k2b-notice-card\",\n content: \"k2b-notice-card__content\",\n head: \"k2b-notice-card__head\",\n title: \"k2b-notice-card__title\",\n meta: \"k2b-notice-card__meta\",\n description: \"k2b-notice-card__description\",\n body: \"k2b-notice-card__body\",\n} as const;\n\nfunction NoticeCardComponent(props: NoticeCardProps): JSX.Element {\n const [local, articleProps] = splitProps(props, [\"tone\", \"title\", \"detail\", \"meta\", \"children\", \"class\", \"bodyClass\"]);\n // Children that render nothing, such as a Show whose condition is false, add no body and no gap.\n const body = children(() => local.children);\n const hasBody = () => body.toArray().some((node) => node != null && node !== false && node !== \"\");\n return (\n <article {...articleProps} class={`${NOTICE_CARD_CLASSES.root} ${local.class ?? \"\"}`} data-tone={local.tone ?? \"neutral\"}>\n <div class={NOTICE_CARD_CLASSES.content}>\n <Show when={local.title}>\n {(title) => (\n <div class={NOTICE_CARD_CLASSES.head}>\n <p class={NOTICE_CARD_CLASSES.title}>{title()}</p>\n <Show when={local.meta}>{(meta) => <span class={NOTICE_CARD_CLASSES.meta}>{meta()}</span>}</Show>\n </div>\n )}\n </Show>\n <Show when={local.detail}>{(detail) => <p class={NOTICE_CARD_CLASSES.description}>{detail()}</p>}</Show>\n <Show when={hasBody()}>\n <div class={`${NOTICE_CARD_CLASSES.body} ${local.bodyClass ?? \"\"}`}>{body()}</div>\n </Show>\n </div>\n </article>\n );\n}\n\nexport type NoticeGridProps<T> = {\n items: readonly T[];\n children: (item: T) => JSX.Element;\n class?: string;\n};\n\nfunction NoticeGrid<T>(props: NoticeGridProps<T>): JSX.Element {\n const columns = () => (props.items.length <= 1 ? \"one\" : props.items.length === 2 ? \"two\" : \"three\");\n return (\n <Show when={props.items.length > 0}>\n <div class={`k2b-notice-grid ${props.class ?? \"\"}`} data-columns={columns()}>\n <For each={props.items}>{(item) => props.children(item)}</For>\n </div>\n </Show>\n );\n}\n\nexport const NoticeCard = Object.assign(NoticeCardComponent, { Grid: NoticeGrid });\nexport default NoticeCard;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -12,26 +12,26 @@ var _tmpl$ = ["<span><strong", ">", "</strong></span>"],
|
|
|
12
12
|
_tmpl$5 = ["<div class=\"k2b-chat-composer-accessory\"><div", " class=\"k2b-chat-composer__commands\" role=\"listbox\"", ">", "", "", "", "</div></div>"],
|
|
13
13
|
_tmpl$6 = ["<div class=\"k2b-chat-composer-slot\"><div style=\"", "\"", ">", "</div>", "</div>"],
|
|
14
14
|
_tmpl$7 = ["<div class=\"k2b-chat-composer__attachments\" role=\"list\"", " tabindex=\"0\">", "</div>"],
|
|
15
|
-
_tmpl$8 = ["<div class=\"k2b-chat-
|
|
16
|
-
_tmpl$9 = ["<div class=\"k2b-chat-
|
|
17
|
-
_tmpl$0 = ["<div class=\"k2b-chat-
|
|
18
|
-
_tmpl$1 = ["<
|
|
19
|
-
_tmpl$10 = ["<button
|
|
20
|
-
_tmpl$11 = ["<
|
|
21
|
-
_tmpl$12 = ["<
|
|
22
|
-
_tmpl$13 = ["<
|
|
23
|
-
_tmpl$14 = ["<
|
|
24
|
-
_tmpl$15 = ["<
|
|
25
|
-
_tmpl$16 = ["<
|
|
26
|
-
_tmpl$17 = ["<
|
|
27
|
-
_tmpl$18 =
|
|
28
|
-
_tmpl$19 = "<
|
|
29
|
-
_tmpl$20 = ["<
|
|
30
|
-
_tmpl$21 = ["<div class=\"k2b-chat-
|
|
31
|
-
_tmpl$22 = ["<div class=\"k2b-chat-composer__submit\">", "", "", "", "</div>"];
|
|
15
|
+
_tmpl$8 = ["<div class=\"k2b-chat-composer__highlight\" aria-hidden=\"true\">", "\n</div>"],
|
|
16
|
+
_tmpl$9 = ["<div class=\"k2b-chat-composer__error\" role=\"alert\"><i class=\"ti ti-alert-circle\" aria-hidden=\"true\"></i>", "</div>"],
|
|
17
|
+
_tmpl$0 = ["<div class=\"k2b-chat-composer-shell\">", "<section class=\"", "\"", " role=\"group\"", ">", "<div class=\"k2b-chat-composer__input\" role=\"group\"", ">", "<textarea class=\"", "\" rows=\"1\"", "", "></textarea></div>", "<footer class=\"k2b-chat-composer__footer\">", "</footer>", "</section></div>"],
|
|
18
|
+
_tmpl$1 = ["<button id=\"", "\" type=\"button\" role=\"option\" tabindex=\"-1\"", "><i", " aria-hidden=\"true\"></i><strong>", "</strong><small>", "</small></button>"],
|
|
19
|
+
_tmpl$10 = ["<button type=\"button\" class=\"k2b-chat-composer__attachment-remove\"", "", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i></button>"],
|
|
20
|
+
_tmpl$11 = ["<div class=\"k2b-chat-composer__attachment\" role=\"listitem\"><div class=\"", "\">", "", "</div>", "</div>"],
|
|
21
|
+
_tmpl$12 = ["<img", ">"],
|
|
22
|
+
_tmpl$13 = ["<div class=\"k2b-chat-composer__attachment-identity\">", "", "</div>"],
|
|
23
|
+
_tmpl$14 = ["<i", " aria-hidden=\"true\"></i>"],
|
|
24
|
+
_tmpl$15 = ["<a class=\"k2b-chat-composer__attachment-link\"", " target=\"_blank\" rel=\"noopener noreferrer\"", ">", "", "</a>"],
|
|
25
|
+
_tmpl$16 = ["<button type=\"button\" class=\"k2b-chat-composer__attachment-action\"", ">", "", "</button>"],
|
|
26
|
+
_tmpl$17 = ["<span class=\"", "\">", "</span>"],
|
|
27
|
+
_tmpl$18 = "<i class=\"ti ti-plus\" aria-hidden=\"true\"></i>",
|
|
28
|
+
_tmpl$19 = ["<input class=\"k2b-sr-only\" type=\"file\" tabindex=\"-1\" aria-hidden=\"true\"", "", ">"],
|
|
29
|
+
_tmpl$20 = ["<div class=\"k2b-chat-composer__tools\">", "", "", "", "", "</div>"],
|
|
30
|
+
_tmpl$21 = ["<div class=\"k2b-chat-composer__submit\">", "", "", "", "</div>"];
|
|
32
31
|
import { children, createEffect, createMemo, createSignal, createUniqueId, For, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
33
32
|
import { Dropdown } from "../actions/Dropdown";
|
|
34
33
|
import { Tooltip } from "../feedback/Tooltip";
|
|
34
|
+
import { FileDropTarget } from "../inputs/FileDropTarget";
|
|
35
35
|
import { SelectChip } from "../inputs/SelectChip";
|
|
36
36
|
import { useUiMessages } from "../intl/messages";
|
|
37
37
|
import { ChatContextUsage as ContextUsage } from "./ChatPrimitives";
|
|
@@ -47,7 +47,6 @@ export function ChatComposer(props) {
|
|
|
47
47
|
const messages = useUiMessages();
|
|
48
48
|
const commandListId = `k2b-chat-commands-${createUniqueId().replace(/[^A-Za-z0-9_-]/g, "-")}`;
|
|
49
49
|
const [selectedCommandIndex, setSelectedCommandIndex] = createSignal(0);
|
|
50
|
-
const [dragActive, setDragActive] = createSignal(false);
|
|
51
50
|
const [addingFiles, setAddingFiles] = createSignal(false);
|
|
52
51
|
const [submitting, setSubmitting] = createSignal(false);
|
|
53
52
|
let composerRef;
|
|
@@ -381,7 +380,7 @@ export function ChatComposer(props) {
|
|
|
381
380
|
void submit();
|
|
382
381
|
}
|
|
383
382
|
};
|
|
384
|
-
return _$ssr(_tmpl$
|
|
383
|
+
return _$ssr(_tmpl$0, _$escape(_$createComponent(Show, {
|
|
385
384
|
get when() {
|
|
386
385
|
return commandsOpen() || hasAccessory();
|
|
387
386
|
},
|
|
@@ -395,7 +394,7 @@ export function ChatComposer(props) {
|
|
|
395
394
|
get each() {
|
|
396
395
|
return commandMatches();
|
|
397
396
|
},
|
|
398
|
-
children: (command, index) => _$ssr(_tmpl$
|
|
397
|
+
children: (command, index) => _$ssr(_tmpl$1, `${_$escape(commandListId, true)}-${_$escape(index(), true)}`, _$ssrAttribute("aria-selected", _$escape(index(), true) === _$escape(selectedCommandIndex(), true), false) + _$ssrAttribute("aria-disabled", _$escape(command.disabled, true), false) + _$ssrAttribute("data-active", index() === selectedCommandIndex() ? "true" : _$escape(undefined, true), false), _$ssrAttribute("class", _$escape(command.icon ?? "ti ti-slash", true), false), _$escape(command.label ?? `/${command.name}`), _$escape(command.description))
|
|
399
398
|
})), _$escape(_$createComponent(Show, {
|
|
400
399
|
get when() {
|
|
401
400
|
return searching();
|
|
@@ -421,7 +420,7 @@ export function ChatComposer(props) {
|
|
|
421
420
|
}
|
|
422
421
|
})));
|
|
423
422
|
}
|
|
424
|
-
})), `k2b-chat-composer ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-running", running() ? "true" : _$escape(undefined, true), false)
|
|
423
|
+
})), `k2b-chat-composer ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-running", running() ? "true" : _$escape(undefined, true), false), _$ssrAttribute("aria-label", _$escape(props.label ?? messages().messageComposer, true), false), _$escape(_$createComponent(Show, {
|
|
425
424
|
get when() {
|
|
426
425
|
return attachments().length > 0;
|
|
427
426
|
},
|
|
@@ -430,52 +429,52 @@ export function ChatComposer(props) {
|
|
|
430
429
|
get each() {
|
|
431
430
|
return attachments();
|
|
432
431
|
},
|
|
433
|
-
children: attachment => _$ssr(_tmpl$
|
|
432
|
+
children: attachment => _$ssr(_tmpl$11, `k2b-chat-composer__attachment-content ${Boolean(attachment.action) ? "k2b-chat-composer__attachment-content--action" : ""}`, _$escape(_$createComponent(Show, {
|
|
434
433
|
get when() {
|
|
435
434
|
return attachment.href;
|
|
436
435
|
},
|
|
437
436
|
get fallback() {
|
|
438
|
-
return _$ssr(_tmpl$
|
|
437
|
+
return _$ssr(_tmpl$13, _$escape(_$createComponent(Show, {
|
|
439
438
|
get when() {
|
|
440
439
|
return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
|
|
441
440
|
},
|
|
442
441
|
get fallback() {
|
|
443
|
-
return _$ssr(_tmpl$
|
|
442
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("class", _$escape(attachmentIcon(attachment), true), false));
|
|
444
443
|
},
|
|
445
444
|
get children() {
|
|
446
|
-
return _$ssr(_tmpl$
|
|
445
|
+
return _$ssr(_tmpl$12, _$ssrAttribute("src", _$escape(attachment.previewUrl, true), false) + _$ssrAttribute("alt", _$escape(attachment.alt ?? "", true), false));
|
|
447
446
|
}
|
|
448
447
|
})), _$escape(renderAttachmentCopy(attachment)));
|
|
449
448
|
},
|
|
450
|
-
children: href => _$ssr(_tmpl$
|
|
449
|
+
children: href => _$ssr(_tmpl$15, _$ssrAttribute("href", _$escape(href(), true), false), _$ssrAttribute("aria-label", _$escape(messages().openInNewTab({
|
|
451
450
|
name: attachment.name
|
|
452
451
|
}), true), false), _$escape(_$createComponent(Show, {
|
|
453
452
|
get when() {
|
|
454
453
|
return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
|
|
455
454
|
},
|
|
456
455
|
get fallback() {
|
|
457
|
-
return _$ssr(_tmpl$
|
|
456
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("class", _$escape(attachmentIcon(attachment), true), false));
|
|
458
457
|
},
|
|
459
458
|
get children() {
|
|
460
|
-
return _$ssr(_tmpl$
|
|
459
|
+
return _$ssr(_tmpl$12, _$ssrAttribute("src", _$escape(attachment.previewUrl, true), false) + _$ssrAttribute("alt", _$escape(attachment.alt ?? "", true), false));
|
|
461
460
|
}
|
|
462
461
|
})), _$escape(renderAttachmentCopy(attachment)))
|
|
463
462
|
})), _$escape(_$createComponent(Show, {
|
|
464
463
|
get when() {
|
|
465
464
|
return attachment.action;
|
|
466
465
|
},
|
|
467
|
-
children: action => _$ssr(_tmpl$
|
|
466
|
+
children: action => _$ssr(_tmpl$16, _$ssrAttribute("disabled", blocked() || action().disabled, true), _$escape(_$createComponent(Show, {
|
|
468
467
|
get when() {
|
|
469
468
|
return action().icon;
|
|
470
469
|
},
|
|
471
|
-
children: icon => _$ssr(_tmpl$
|
|
470
|
+
children: icon => _$ssr(_tmpl$14, _$ssrAttribute("class", _$escape(icon(), true), false))
|
|
472
471
|
})), _$escape(action().label))
|
|
473
472
|
})), _$escape(_$createComponent(Show, {
|
|
474
473
|
get when() {
|
|
475
474
|
return props.onAttachmentsChange;
|
|
476
475
|
},
|
|
477
476
|
get children() {
|
|
478
|
-
return _$ssr(_tmpl$
|
|
477
|
+
return _$ssr(_tmpl$10, _$ssrAttribute("aria-label", _$escape(messages().removeNamed({
|
|
479
478
|
name: attachment.name
|
|
480
479
|
}), true), false), _$ssrAttribute("disabled", blocked(), true));
|
|
481
480
|
}
|
|
@@ -483,22 +482,15 @@ export function ChatComposer(props) {
|
|
|
483
482
|
})));
|
|
484
483
|
}
|
|
485
484
|
})), _$ssrAttribute("aria-label", _$escape(messages().messageInput, true), false), _$escape(_$createComponent(Show, {
|
|
486
|
-
get when() {
|
|
487
|
-
return dragActive();
|
|
488
|
-
},
|
|
489
|
-
get children() {
|
|
490
|
-
return _$ssr(_tmpl$8, _$escape(messages().dropFilesToAttach));
|
|
491
|
-
}
|
|
492
|
-
})), _$escape(_$createComponent(Show, {
|
|
493
485
|
get when() {
|
|
494
486
|
return mentions().length > 0;
|
|
495
487
|
},
|
|
496
488
|
get children() {
|
|
497
|
-
return _$ssr(_tmpl$
|
|
489
|
+
return _$ssr(_tmpl$8, _$escape(_$createComponent(For, {
|
|
498
490
|
get each() {
|
|
499
491
|
return chatMentionSegments(props.value, mentions());
|
|
500
492
|
},
|
|
501
|
-
children: part => _$ssr(_tmpl$
|
|
493
|
+
children: part => _$ssr(_tmpl$17, Boolean(part.mention) ? "k2b-chat-composer__mention" : "", _$escape(part.text))
|
|
502
494
|
})));
|
|
503
495
|
}
|
|
504
496
|
})), mentions().length > 0 ? "k2b-chat-composer__textarea--highlighted" : "", _$ssrAttribute("value", _$escape(props.value, true), false), _$ssrAttribute("disabled", blocked(), true) + _$ssrAttribute("placeholder", _$escape(props.placeholder ?? (running() ? messages().addGuidance : messages().writeMessage), true), false) + _$ssrAttribute("aria-label", _$escape(props.inputLabel ?? messages().message, true), false) + _$ssrAttribute("role", commandsOpen() ? "combobox" : _$escape(undefined, true), false) + _$ssrAttribute("aria-autocomplete", commandsOpen() ? "list" : _$escape(undefined, true), false) + _$ssrAttribute("aria-controls", commandsOpen() ? _$escape(commandListId, true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-expanded", commandsOpen() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-activedescendant", selectedCommand() ? `${_$escape(commandListId, true)}-${_$escape(selectedCommandIndex(), true)}` : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
|
|
@@ -506,14 +498,14 @@ export function ChatComposer(props) {
|
|
|
506
498
|
return props.error;
|
|
507
499
|
},
|
|
508
500
|
get children() {
|
|
509
|
-
return _$ssr(_tmpl$
|
|
501
|
+
return _$ssr(_tmpl$9, _$escape(props.error));
|
|
510
502
|
}
|
|
511
503
|
})), _$escape(_$createComponent(Show, {
|
|
512
504
|
get when() {
|
|
513
505
|
return props.footerContent;
|
|
514
506
|
},
|
|
515
507
|
get fallback() {
|
|
516
|
-
return [_$ssr(_tmpl$
|
|
508
|
+
return [_$ssr(_tmpl$20, _$escape(props.footerTools), _$escape(_$createComponent(Show, {
|
|
517
509
|
get when() {
|
|
518
510
|
return hasAddMenu();
|
|
519
511
|
},
|
|
@@ -540,7 +532,7 @@ export function ChatComposer(props) {
|
|
|
540
532
|
return messages().addToChat;
|
|
541
533
|
},
|
|
542
534
|
get children() {
|
|
543
|
-
return _$ssr(_tmpl$
|
|
535
|
+
return _$ssr(_tmpl$18);
|
|
544
536
|
}
|
|
545
537
|
});
|
|
546
538
|
}
|
|
@@ -551,7 +543,7 @@ export function ChatComposer(props) {
|
|
|
551
543
|
return props.fileSelection;
|
|
552
544
|
},
|
|
553
545
|
get children() {
|
|
554
|
-
return _$ssr(_tmpl$
|
|
546
|
+
return _$ssr(_tmpl$19, _$ssrAttribute("accept", _$escape(props.fileSelection?.accept, true), false), _$ssrAttribute("multiple", props.fileSelection?.multiple ?? true, true));
|
|
555
547
|
}
|
|
556
548
|
})), _$escape(_$createComponent(Show, {
|
|
557
549
|
get when() {
|
|
@@ -587,7 +579,7 @@ export function ChatComposer(props) {
|
|
|
587
579
|
}
|
|
588
580
|
});
|
|
589
581
|
}
|
|
590
|
-
})), _$escape(props.modelDetails)), _$ssr(_tmpl$
|
|
582
|
+
})), _$escape(props.modelDetails)), _$ssr(_tmpl$21, _$escape(_$createComponent(For, {
|
|
591
583
|
get each() {
|
|
592
584
|
return props.contextActions;
|
|
593
585
|
},
|
|
@@ -611,7 +603,7 @@ export function ChatComposer(props) {
|
|
|
611
603
|
},
|
|
612
604
|
onClick: () => reportChatFailure(() => executeChatAction(action), props.onError),
|
|
613
605
|
get children() {
|
|
614
|
-
return _$ssr(_tmpl$
|
|
606
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("class", _$escape(action.icon ?? "ti ti-dots", true), false));
|
|
615
607
|
}
|
|
616
608
|
})
|
|
617
609
|
})), _$escape(_$createComponent(Show, {
|
|
@@ -645,7 +637,7 @@ export function ChatComposer(props) {
|
|
|
645
637
|
},
|
|
646
638
|
onClick: () => void submit(),
|
|
647
639
|
get children() {
|
|
648
|
-
return _$ssr(_tmpl$
|
|
640
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("class", submitting() ? "ti ti-loader-2 k2b-spin" : "ti ti-arrow-up", false));
|
|
649
641
|
}
|
|
650
642
|
});
|
|
651
643
|
},
|
|
@@ -664,13 +656,32 @@ export function ChatComposer(props) {
|
|
|
664
656
|
},
|
|
665
657
|
onClick: () => reportChatFailure(() => props.onStop?.(), props.onError),
|
|
666
658
|
get children() {
|
|
667
|
-
return _$ssr(_tmpl$
|
|
659
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("class", stopping() ? "ti ti-loader-2 k2b-spin" : "ti ti-player-stop", false));
|
|
668
660
|
}
|
|
669
661
|
});
|
|
670
662
|
}
|
|
671
663
|
})))];
|
|
672
664
|
},
|
|
673
665
|
children: content => content()
|
|
666
|
+
})), _$escape(_$createComponent(Show, {
|
|
667
|
+
get when() {
|
|
668
|
+
return props.fileSelection;
|
|
669
|
+
},
|
|
670
|
+
children: selection => _$createComponent(FileDropTarget, {
|
|
671
|
+
get label() {
|
|
672
|
+
return messages().dropFilesToAttach;
|
|
673
|
+
},
|
|
674
|
+
get accept() {
|
|
675
|
+
return selection().accept;
|
|
676
|
+
},
|
|
677
|
+
get multiple() {
|
|
678
|
+
return selection().multiple;
|
|
679
|
+
},
|
|
680
|
+
get disabled() {
|
|
681
|
+
return !canSelectFiles();
|
|
682
|
+
},
|
|
683
|
+
onDrop: files => void runFiles(files)
|
|
684
|
+
})
|
|
674
685
|
})));
|
|
675
686
|
}
|
|
676
687
|
//# sourceMappingURL=ChatComposer.js.map
|