@quirekit/ui 0.0.2 → 0.1.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/LICENSE.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/{catalog-AqWLE58Z.mjs → catalog-TxH_u9wJ.mjs} +318 -276
- package/dist/catalog-TxH_u9wJ.mjs.map +1 -0
- package/dist/{chat-DaOlDJNQ.mjs → chat-CDuOfk3d.mjs} +225 -144
- package/dist/chat-CDuOfk3d.mjs.map +1 -0
- package/dist/chat.d.mts +2 -2
- package/dist/chat.mjs +1 -1
- package/dist/{code-block-D1kd-gAB.mjs → code-block-5fEEwwMN.mjs} +3 -3
- package/dist/{code-block-D1kd-gAB.mjs.map → code-block-5fEEwwMN.mjs.map} +1 -1
- package/dist/{html-sandbox-BYIni0q6.mjs → html-sandbox-BJeg9mHs.mjs} +2 -2
- package/dist/{html-sandbox-BYIni0q6.mjs.map → html-sandbox-BJeg9mHs.mjs.map} +1 -1
- package/dist/html-sandbox.mjs +1 -1
- package/dist/{index-Bf9CudSF.d.mts → index-BOSlg0Xl.d.mts} +212 -142
- package/dist/index-BOSlg0Xl.d.mts.map +1 -0
- package/dist/{index-DZc5z5s2.d.mts → index-CtgUjd_A.d.mts} +3 -2
- package/dist/index-CtgUjd_A.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +21 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{model-D4-FbKXY.mjs → model-DvNHVLwg.mjs} +3 -3
- package/dist/{model-D4-FbKXY.mjs.map → model-DvNHVLwg.mjs.map} +1 -1
- package/dist/{resolve-BwTfY4PS.mjs → resolve-DlCNcx0Q.mjs} +2 -2
- package/dist/{resolve-BwTfY4PS.mjs.map → resolve-DlCNcx0Q.mjs.map} +1 -1
- package/dist/vue.d.mts +492 -441
- package/dist/vue.d.mts.map +1 -1
- package/dist/vue.mjs +3295 -2837
- package/dist/vue.mjs.map +1 -1
- package/package.json +11 -4
- package/src/components/chat/composer/types.ts +2 -0
- package/src/components/chat/message-part/types.ts +3 -1
- package/src/components/chat/reasoning/types.ts +1 -1
- package/src/components/chat/tool/types.ts +1 -1
- package/src/components/edit-bar/index.ts +1 -0
- package/src/components/edit-bar/types.ts +24 -0
- package/src/components/icon/custom/indicators.ts +1 -0
- package/src/components/icon/custom/insert.ts +3 -1
- package/src/components/icon/metadata.ts +12 -0
- package/src/components/index.ts +1 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/kbd/platform.test.ts +16 -0
- package/src/components/kbd/platform.ts +16 -0
- package/src/components/toolbar/index.ts +1 -0
- package/src/components/toolbar/types.ts +8 -0
- package/src/locale/components/chat.ts +9 -7
- package/src/locale/components/edit-bar.ts +15 -0
- package/src/locale/components/icon-catalog/en.ts +3 -0
- package/src/locale/components/icon-catalog/zh-hans.ts +3 -0
- package/src/locale/packs/en.ts +2 -0
- package/src/locale/packs/zh-cn.ts +2 -0
- package/src/locale/types.ts +3 -0
- package/src/vue/action-menu/directory.vue +0 -7
- package/src/vue/block-handle/block-handle.test.ts +5 -0
- package/src/vue/block-handle/block-handle.vue +4 -11
- package/src/vue/block-handle/index.ts +1 -1
- package/src/vue/block-handle/presentation.ts +4 -0
- package/src/vue/chat/composer/composer.test.ts +11 -2
- package/src/vue/chat/composer/composer.vue +15 -3
- package/src/vue/chat/composer-submit/composer-submit.test.ts +5 -1
- package/src/vue/chat/composer-submit/composer-submit.vue +1 -1
- package/src/vue/chat/confirmation/confirmation.vue +3 -2
- package/src/vue/chat/locale.test.ts +2 -2
- package/src/vue/chat/message/message.test.ts +1 -1
- package/src/vue/chat/message/message.vue +8 -3
- package/src/vue/chat/message-actions/message-actions.vue +1 -1
- package/src/vue/chat/message-list/message-list.test.ts +2 -2
- package/src/vue/chat/message-list/message-list.vue +2 -2
- package/src/vue/chat/message-list/types.ts +2 -0
- package/src/vue/chat/message-list/use-scroll.test.ts +7 -1
- package/src/vue/chat/message-list/use-scroll.ts +12 -9
- package/src/vue/chat/message-part/message-part.test.ts +1 -1
- package/src/vue/chat/message-part/message-part.vue +2 -3
- package/src/vue/chat/shared/disclosure.vue +1 -1
- package/src/vue/chat/shared/part-actions.ts +1 -1
- package/src/vue/chat/shared/state-icon.ts +2 -1
- package/src/vue/code-block/theme-surface.vue +4 -1
- package/src/vue/combobox/async-value.test.ts +49 -0
- package/src/vue/combobox/use-combobox-model.ts +3 -1
- package/src/vue/component-styles.test.ts +17 -0
- package/src/vue/edit-bar/edit-bar.test.ts +125 -0
- package/src/vue/edit-bar/edit-bar.vue +108 -0
- package/src/vue/edit-bar/index.ts +2 -0
- package/src/vue/edit-bar/types.ts +21 -0
- package/src/vue/file-upload/file-upload.vue +1 -1
- package/src/vue/image-preview/theme-surface.vue +4 -1
- package/src/vue/index.ts +1 -0
- package/src/vue/menu/items/disabled-submenu.test.ts +24 -0
- package/src/vue/menu/items/items.test.ts +29 -0
- package/src/vue/menu/items/items.vue +6 -0
- package/src/vue/menu/menu-group.vue +11 -2
- package/src/vue/prose/mapping/native.ts +1 -1
- package/src/vue/prose/mapping/rich.ts +2 -1
- package/src/vue/schema-form/controls/registry.ts +1 -1
- package/src/vue/schema-form/tree.ts +1 -1
- package/src/vue/shared/task/trigger.vue +1 -1
- package/src/vue/splitter/splitter.test.ts +18 -0
- package/src/vue/splitter/splitter.vue +5 -2
- package/src/vue/tags-input/tags-input.vue +1 -1
- package/src/vue/task-panel/root.vue +0 -8
- package/src/vue/theme-provider/portal.vue +4 -1
- package/src/vue/theme-provider/surface.vue +4 -1
- package/src/vue/toolbar/context.ts +5 -2
- package/src/vue/toolbar/items/control.vue +9 -1
- package/src/vue/toolbar/items/sheet-entries.ts +52 -0
- package/src/vue/toolbar/items/sheet.test.ts +61 -0
- package/src/vue/toolbar/items/sheet.vue +78 -0
- package/src/vue/toolbar/presentation/mobile.test.ts +14 -0
- package/src/vue/toolbar/presentation/visibility.ts +38 -0
- package/src/vue/toolbar/toolbar.vue +8 -3
- package/src/vue/toolbar/types.ts +3 -1
- package/dist/catalog-AqWLE58Z.mjs.map +0 -1
- package/dist/chat-DaOlDJNQ.mjs.map +0 -1
- package/dist/index-Bf9CudSF.d.mts.map +0 -1
- package/dist/index-DZc5z5s2.d.mts.map +0 -1
- package/dist/style.css +0 -37
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quirekit/ui",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Wang Yishuai (王一帅)"
|
|
7
|
+
},
|
|
8
|
+
"contributors": [
|
|
9
|
+
{
|
|
10
|
+
"name": "上海轻书远行信息科技有限公司"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
5
13
|
"repository": {
|
|
6
14
|
"type": "git",
|
|
7
15
|
"url": "git+https://github.com/quirekit/quirekit.git",
|
|
@@ -21,7 +29,6 @@
|
|
|
21
29
|
"src"
|
|
22
30
|
],
|
|
23
31
|
"exports": {
|
|
24
|
-
"./styles.css": "./dist/style.css",
|
|
25
32
|
".": {
|
|
26
33
|
"types": "./dist/index.d.mts",
|
|
27
34
|
"import": "./dist/index.mjs",
|
|
@@ -66,13 +73,13 @@
|
|
|
66
73
|
"@internationalized/date": "3.12.3",
|
|
67
74
|
"@tanstack/vue-table": "8.21.3",
|
|
68
75
|
"vee-validate": "4.15.1",
|
|
69
|
-
"@quirekit/html-sandbox": "0.0
|
|
76
|
+
"@quirekit/html-sandbox": "0.1.0"
|
|
70
77
|
},
|
|
71
78
|
"scripts": {
|
|
72
79
|
"build": "pnpm icons:generate && tsdown --config tsdown.config.ts",
|
|
73
80
|
"dev": "pnpm icons:generate && tsdown --config tsdown.config.ts --watch --no-clean",
|
|
74
81
|
"icons:generate": "node scripts/generate-editor-icons.mjs",
|
|
75
82
|
"typecheck": "vue-tsc --noEmit -p tsconfig.json",
|
|
76
|
-
"test": "vitest run src"
|
|
83
|
+
"test": "vitest run src --test-timeout=30000"
|
|
77
84
|
}
|
|
78
85
|
}
|
|
@@ -45,6 +45,8 @@ export interface QuireKitChatComposerContext {
|
|
|
45
45
|
readonly readOnly: boolean;
|
|
46
46
|
/** 是否正在处理。 */
|
|
47
47
|
readonly busy: boolean;
|
|
48
|
+
/** 当前可用的键盘提交方式,供自定义输入沿用。 */
|
|
49
|
+
readonly submitMode: NonNullable<QuireKitChatComposerInputProps['submitMode']>;
|
|
48
50
|
/** 文本或外部内容非空,且所有提交门禁允许。 */
|
|
49
51
|
readonly canSubmit: boolean;
|
|
50
52
|
/** 通知宿主更新草稿。 */
|
|
@@ -8,7 +8,7 @@ import type { QuireKitChatQuestionAnswer, QuireKitChatQuestionOpenDetails, Quire
|
|
|
8
8
|
/** 一段内容的接收/终态;不与显示动画进度混用。 */
|
|
9
9
|
export type QuireKitChatPartState = 'streaming' | 'complete' | 'stopped' | 'error';
|
|
10
10
|
/** 工具执行状态的中立展示投影。 */
|
|
11
|
-
export type QuireKitChatToolState = 'queued' | 'running' | 'waiting' | 'succeeded' | 'failed' | 'cancelled';
|
|
11
|
+
export type QuireKitChatToolState = 'queued' | 'running' | 'waiting' | 'succeeded' | 'failed' | 'cancelled' | 'interrupted';
|
|
12
12
|
|
|
13
13
|
/** Part 的身份与局部操作;不包含业务协议。 */
|
|
14
14
|
export interface QuireKitChatPartBase {
|
|
@@ -193,6 +193,8 @@ export type QuireKitChatMessagePart = QuireKitChatTextPart | QuireKitChatReasoni
|
|
|
193
193
|
export interface QuireKitChatMessagePartProps {
|
|
194
194
|
/** 有稳定身份的展示单元。 */
|
|
195
195
|
readonly part: QuireKitChatMessagePart;
|
|
196
|
+
/** 正文是否单独显示停止或错误提示;所属消息已经显示相同状态时可关闭。 */
|
|
197
|
+
readonly showTextStatus?: boolean;
|
|
196
198
|
/** 所属消息的身份,独立使用时可省略。 */
|
|
197
199
|
readonly messageId?: string | undefined;
|
|
198
200
|
/** 受控展开状态;省略时组件按 Part 身份持有。 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { QuireKitChatMessagePartProps, QuireKitChatReasoningPart } from '../message-part/types';
|
|
2
2
|
|
|
3
3
|
/** 独立推理呈现,与 MessagePart 使用相同的身份及展开合同。 */
|
|
4
|
-
export interface QuireKitChatReasoningProps extends Omit<QuireKitChatMessagePartProps, 'part'> {
|
|
4
|
+
export interface QuireKitChatReasoningProps extends Omit<QuireKitChatMessagePartProps, 'part' | 'showTextStatus'> {
|
|
5
5
|
/** 推理展示投影。 */
|
|
6
6
|
readonly part: QuireKitChatReasoningPart;
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { QuireKitChatMessagePartProps, QuireKitChatToolPart } from '../message-part/types';
|
|
2
2
|
|
|
3
3
|
/** 独立工具呈现;不调用工具或解释业务参数。 */
|
|
4
|
-
export interface QuireKitChatToolProps extends Omit<QuireKitChatMessagePartProps, 'part'> {
|
|
4
|
+
export interface QuireKitChatToolProps extends Omit<QuireKitChatMessagePartProps, 'part' | 'showTextStatus'> {
|
|
5
5
|
/** 工具展示投影,输入/输出为宿主提供的权威文本。 */
|
|
6
6
|
readonly part: QuireKitChatToolPart;
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { QuireKitEditBarEntry, QuireKitEditBarKeyboardRequest } from "./types";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { QuireKitToolbarRow } from "../toolbar/types";
|
|
2
|
+
|
|
3
|
+
/** One entry on the mobile edit bar. */
|
|
4
|
+
export interface QuireKitEditBarEntry {
|
|
5
|
+
/** Stable identity, first in every execute path that starts at this entry. */
|
|
6
|
+
readonly value: string;
|
|
7
|
+
/** Accessible name and tooltip. */
|
|
8
|
+
readonly label: string;
|
|
9
|
+
/** Provider icon name. */
|
|
10
|
+
readonly icon?: string;
|
|
11
|
+
/** Visible text beside the icon, or in place of a missing icon. */
|
|
12
|
+
readonly text?: string;
|
|
13
|
+
/** Toolbar rows of the panel this entry opens in place of the keyboard; omitted for an immediate action. */
|
|
14
|
+
readonly panel?: readonly QuireKitToolbarRow[];
|
|
15
|
+
/** Shown on the bar (default), or listed in the trailing More menu and opened from there. */
|
|
16
|
+
readonly placement?: "bar" | "more";
|
|
17
|
+
/** Hidden entries take no place, as an object entry while no object is current. */
|
|
18
|
+
readonly hidden?: boolean;
|
|
19
|
+
/** Unavailable entries keep their place. */
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Soft-keyboard transition the edit bar asks of its host, which owns the text input. */
|
|
24
|
+
export type QuireKitEditBarKeyboardRequest = "show" | "hide";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Purpose-specific editor artwork on the shared 24-unit, 2-unit stroke grid. */
|
|
2
2
|
export const indicatorIconSvg = Object.freeze({
|
|
3
|
+
stop: '<svg data-icon-style="lucide-custom" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="5" y="5" width="14" height="14" rx="2" fill="currentColor"/></svg>',
|
|
3
4
|
triangleUp: "<svg data-icon-style=\"lucide-custom\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"m12 8.5 5.5 6h-11z\"/></svg>",
|
|
4
5
|
triangleDown: "<svg data-icon-style=\"lucide-custom\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M6.5 9h11L12 15.5z\"/></svg>"
|
|
5
6
|
});
|
|
@@ -12,7 +12,9 @@ export const insertIconSvg = Object.freeze({
|
|
|
12
12
|
figureCaption: icon('<rect x="4" y="3" width="16" height="11" rx="2"/><path d="m5 12 5-5 4 4 2-2 3 3M6 18h12M9 21h6"/>'),
|
|
13
13
|
whiteboard: icon('<path d="M3 4h18v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2ZM8 17l-2 4m10-4 2 4M7 12c1-5 3-5 4-2s3 3 6-2"/>'),
|
|
14
14
|
textDiagram: icon('<path d="m5 3-3 4 3 4m5-8 3 4-3 4M7 14v3a2 2 0 0 0 2 2h5m-3-3 3 3-3 3"/><rect x="16" y="12" width="6" height="8" rx="1"/>'),
|
|
15
|
-
|
|
15
|
+
documentOutline: icon('<path d="M4 6h.01M9 6h11M8 12h.01M13 12h7M8 18h.01M13 18h7"/>'),
|
|
16
|
+
mindMap: icon('<rect x="2" y="9" width="7" height="6" rx="1.5"/><path d="M9 12h12M9 12c3 0 3-7 6-7h6M9 12c3 0 3 7 6 7h6"/>'),
|
|
17
|
+
markdown: icon('<rect x="2" y="5" width="20" height="14" rx="2"/><path d="M5.5 15.5v-7l3 3 3-3v7M17 8.5v7m-3-3 3 3 3-3"/>'),
|
|
16
18
|
sectionBreak: icon('<path d="M4 3h16M4 7h10M3 12h3m4 0h4m4 0h3M4 17h16M4 21h10"/>'),
|
|
17
19
|
footnote: icon('<path d="M15 3H5v18h14V10M8 7h4M8 11h4M8 16h8M8 19h4m8-16 2-1v5"/>'),
|
|
18
20
|
endnote: icon('<path d="M8 3H4v14m4-10h12v14H8ZM11 12h6m-6 4h6m-6 3h3"/>'),
|
|
@@ -279,6 +279,10 @@ export const quireKitEditorIconGroups = [
|
|
|
279
279
|
"name": "fileText",
|
|
280
280
|
"upstream": "file-text"
|
|
281
281
|
},
|
|
282
|
+
{
|
|
283
|
+
"name": "markdown",
|
|
284
|
+
"upstream": "custom"
|
|
285
|
+
},
|
|
282
286
|
{
|
|
283
287
|
"name": "files",
|
|
284
288
|
"upstream": "files"
|
|
@@ -1134,6 +1138,10 @@ export const quireKitEditorIconGroups = [
|
|
|
1134
1138
|
"category": "navigation",
|
|
1135
1139
|
"scope": "general",
|
|
1136
1140
|
"icons": [
|
|
1141
|
+
{
|
|
1142
|
+
"name": "stop",
|
|
1143
|
+
"upstream": "custom"
|
|
1144
|
+
},
|
|
1137
1145
|
{
|
|
1138
1146
|
"name": "triangleUp",
|
|
1139
1147
|
"upstream": "custom"
|
|
@@ -1268,6 +1276,10 @@ export const quireKitEditorIconGroups = [
|
|
|
1268
1276
|
"name": "heading6",
|
|
1269
1277
|
"upstream": "heading-6"
|
|
1270
1278
|
},
|
|
1279
|
+
{
|
|
1280
|
+
"name": "documentOutline",
|
|
1281
|
+
"upstream": "custom"
|
|
1282
|
+
},
|
|
1271
1283
|
{
|
|
1272
1284
|
"name": "textQuote",
|
|
1273
1285
|
"upstream": "text-quote"
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { formatQuireKitShortcut } from "./platform";
|
|
3
|
+
|
|
4
|
+
afterEach(() => { vi.unstubAllGlobals(); });
|
|
5
|
+
|
|
6
|
+
describe("platform shortcut text", () => {
|
|
7
|
+
it("shows the command key on Apple platforms", () => {
|
|
8
|
+
vi.stubGlobal("navigator", { platform: "MacIntel" });
|
|
9
|
+
expect(formatQuireKitShortcut("撤销 · Ctrl/⌘ Z")).toBe("撤销 · ⌘ Z");
|
|
10
|
+
});
|
|
11
|
+
it("shows Ctrl elsewhere and leaves other text untouched", () => {
|
|
12
|
+
vi.stubGlobal("navigator", { platform: "Win32" });
|
|
13
|
+
expect(formatQuireKitShortcut("Ctrl/⌘ Shift G")).toBe("Ctrl Shift G");
|
|
14
|
+
expect(formatQuireKitShortcut("Delete")).toBe("Delete");
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @returns Whether the viewer is on Apple hardware, where the command key replaces Ctrl. */
|
|
2
|
+
function isApple(): boolean {
|
|
3
|
+
if (typeof navigator === "undefined") return false;
|
|
4
|
+
const platform = (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData?.platform ?? navigator.platform ?? "";
|
|
5
|
+
return /mac|iphone|ipad|ipod/iu.test(platform);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Shows the shortcut modifier for the viewer's platform instead of a combined "Ctrl/⌘" catalog notation.
|
|
10
|
+
*
|
|
11
|
+
* @param text - Label, tooltip or key text that may contain the combined notation.
|
|
12
|
+
* @returns Text with ⌘ on Apple platforms and Ctrl elsewhere; text without the notation is returned unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export function formatQuireKitShortcut(text: string): string {
|
|
15
|
+
return text.includes("Ctrl/⌘") ? text.replaceAll("Ctrl/⌘", isApple() ? "⌘" : "Ctrl") : text;
|
|
16
|
+
}
|
|
@@ -167,6 +167,9 @@ export interface QuireKitToolbarTokens {
|
|
|
167
167
|
readonly feedbackEasing: string;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
/** Second-level surfaces anchored to their control, or bottom sheets for a touch command bar. */
|
|
171
|
+
export type QuireKitToolbarPopupPresentation = "anchored" | "bottom";
|
|
172
|
+
|
|
170
173
|
/** Natural control widths, or widths measured in toolbar units. */
|
|
171
174
|
export type QuireKitToolbarSizing = "natural" | "units";
|
|
172
175
|
|
|
@@ -231,6 +234,11 @@ export interface QuireKitToolbarEntry {
|
|
|
231
234
|
readonly disabled?: boolean;
|
|
232
235
|
/** Hidden entries are unmounted and excluded from keyboard navigation. */
|
|
233
236
|
readonly hidden?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Whether the entry is shown in mobile mode. Defaults to true; false keeps
|
|
239
|
+
* desktop-only controls, such as launchers of desktop side panels, off touch toolbars.
|
|
240
|
+
*/
|
|
241
|
+
readonly mobile?: boolean;
|
|
234
242
|
/** Host-defined metadata, such as a command id; never interpreted by Toolbar. */
|
|
235
243
|
readonly meta?: unknown;
|
|
236
244
|
/** Default command parameters; custom renderers may supply a different payload. */
|
|
@@ -22,6 +22,8 @@ export interface StatusMessages {
|
|
|
22
22
|
readonly failed: string;
|
|
23
23
|
/** Tool cancelled. */
|
|
24
24
|
readonly cancelled: string;
|
|
25
|
+
/** The turn ended before a terminal tool result was observed. */
|
|
26
|
+
readonly interrupted: string;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/** Composer, ComposerInput, ComposerSubmit and RichInput text. */
|
|
@@ -60,7 +62,7 @@ export interface MessageMessages {
|
|
|
60
62
|
|
|
61
63
|
/** MessagePart fallbacks. */
|
|
62
64
|
export interface PartMessages {
|
|
63
|
-
/**
|
|
65
|
+
/** Optional renderer diagnostics for custom consumer presentations. */
|
|
64
66
|
readonly markdownFallback: string;
|
|
65
67
|
/** Part kind that has no presentation. */
|
|
66
68
|
readonly unsupported: string;
|
|
@@ -175,11 +177,11 @@ export interface Messages {
|
|
|
175
177
|
export const zhCN: Messages = {
|
|
176
178
|
status: {
|
|
177
179
|
pending: "正在等待回复", streaming: "正在生成", complete: "已完成", stopped: "已停止生成", error: "生成失败",
|
|
178
|
-
queued: "等待执行", running: "执行中", waiting: "等待确认", succeeded: "已完成", failed: "执行失败", cancelled: "已取消"
|
|
180
|
+
queued: "等待执行", running: "执行中", waiting: "等待确认", succeeded: "已完成", failed: "执行失败", cancelled: "已取消", interrupted: "结果未确认"
|
|
179
181
|
},
|
|
180
|
-
composer: { label: "消息", placeholder: "输入消息…", submit: "发送", stop: "停止", candidates: "
|
|
182
|
+
composer: { label: "消息", placeholder: "输入消息…", submit: "发送", stop: "停止", candidates: "引用与指令候选" },
|
|
181
183
|
message: {
|
|
182
|
-
copy: "
|
|
184
|
+
copy: "复制消息", copied: "已复制", copyError: "复制失败,请重试或手动复制", more: "更多操作",
|
|
183
185
|
previousBranch: "上一个版本", nextBranch: "下一个版本", branchUnavailable: "分支不可用",
|
|
184
186
|
branchPosition: (current, total) => `${current} / ${total}`
|
|
185
187
|
},
|
|
@@ -209,11 +211,11 @@ export const zhCN: Messages = {
|
|
|
209
211
|
export const en: Messages = {
|
|
210
212
|
status: {
|
|
211
213
|
pending: "Waiting for a reply", streaming: "Generating", complete: "Done", stopped: "Generation stopped", error: "Generation failed",
|
|
212
|
-
queued: "Queued", running: "Running", waiting: "Awaiting confirmation", succeeded: "Done", failed: "Failed", cancelled: "Cancelled"
|
|
214
|
+
queued: "Queued", running: "Running", waiting: "Awaiting confirmation", succeeded: "Done", failed: "Failed", cancelled: "Cancelled", interrupted: "Outcome unconfirmed"
|
|
213
215
|
},
|
|
214
|
-
composer: { label: "Message", placeholder: "Type a message…", submit: "Send", stop: "Stop", candidates: "
|
|
216
|
+
composer: { label: "Message", placeholder: "Type a message…", submit: "Send", stop: "Stop", candidates: "Mention and command suggestions" },
|
|
215
217
|
message: {
|
|
216
|
-
copy: "Copy
|
|
218
|
+
copy: "Copy message", copied: "Copied", copyError: "Copy failed. Try again or copy manually.", more: "More actions",
|
|
217
219
|
previousBranch: "Previous version", nextBranch: "Next version", branchUnavailable: "Version unavailable",
|
|
218
220
|
branchPosition: (current, total) => `${current} / ${total}`
|
|
219
221
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** EditBar interface text. */
|
|
2
|
+
export interface Messages {
|
|
3
|
+
/** Keyboard toggle while the keyboard is hidden or a panel replaces it. */
|
|
4
|
+
readonly keyboard: string;
|
|
5
|
+
/** Keyboard toggle while the keyboard is showing. */
|
|
6
|
+
readonly hideKeyboard: string;
|
|
7
|
+
/** Trailing menu of low-frequency tasks. */
|
|
8
|
+
readonly more: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Simplified Chinese. */
|
|
12
|
+
export const zhCN: Messages = { keyboard: "键盘", hideKeyboard: "收起键盘", more: "更多" };
|
|
13
|
+
|
|
14
|
+
/** English. */
|
|
15
|
+
export const en: Messages = { keyboard: "Keyboard", hideKeyboard: "Hide keyboard", more: "More" };
|
|
@@ -35,6 +35,7 @@ export const en: Messages = {
|
|
|
35
35
|
pencilRuler: "Drawing tools",
|
|
36
36
|
whiteboard: "Whiteboard",
|
|
37
37
|
textDiagram: "Text diagram",
|
|
38
|
+
documentOutline: "Document outline",
|
|
38
39
|
mindMap: "Mind map",
|
|
39
40
|
sectionBreak: "Section break",
|
|
40
41
|
footnote: "Footnote",
|
|
@@ -105,6 +106,7 @@ export const en: Messages = {
|
|
|
105
106
|
menu: "Menu",
|
|
106
107
|
file: "File",
|
|
107
108
|
fileText: "Text document",
|
|
109
|
+
markdown: "Markdown document",
|
|
108
110
|
files: "Files",
|
|
109
111
|
filePlus: "New file",
|
|
110
112
|
fileMinus: "Remove file",
|
|
@@ -300,6 +302,7 @@ export const en: Messages = {
|
|
|
300
302
|
sendToBack: "Send to back",
|
|
301
303
|
group: "Group",
|
|
302
304
|
ungroup: "Ungroup",
|
|
305
|
+
stop: "Stop",
|
|
303
306
|
triangleUp: "Step up",
|
|
304
307
|
triangleDown: "Step down",
|
|
305
308
|
bold: "Bold",
|
|
@@ -35,6 +35,7 @@ export const zhCN: Messages = {
|
|
|
35
35
|
pencilRuler: "绘图工具",
|
|
36
36
|
whiteboard: "白板",
|
|
37
37
|
textDiagram: "文本绘图",
|
|
38
|
+
documentOutline: "大纲",
|
|
38
39
|
mindMap: "思维导图",
|
|
39
40
|
sectionBreak: "分节符",
|
|
40
41
|
footnote: "脚注",
|
|
@@ -105,6 +106,7 @@ export const zhCN: Messages = {
|
|
|
105
106
|
menu: "菜单",
|
|
106
107
|
file: "文件",
|
|
107
108
|
fileText: "文本文档",
|
|
109
|
+
markdown: "Markdown 文档",
|
|
108
110
|
files: "多个文件",
|
|
109
111
|
filePlus: "新建文件",
|
|
110
112
|
fileMinus: "移除文件",
|
|
@@ -300,6 +302,7 @@ export const zhCN: Messages = {
|
|
|
300
302
|
sendToBack: "置于底层",
|
|
301
303
|
group: "组合",
|
|
302
304
|
ungroup: "取消组合",
|
|
305
|
+
stop: "停止",
|
|
303
306
|
triangleUp: "向上步进",
|
|
304
307
|
triangleDown: "向下步进",
|
|
305
308
|
bold: "加粗",
|
package/src/locale/packs/en.ts
CHANGED
|
@@ -64,6 +64,7 @@ import * as steps from "../components/steps";
|
|
|
64
64
|
import * as timeline from "../components/timeline";
|
|
65
65
|
import * as tag from "../components/tag";
|
|
66
66
|
import * as toolbar from "../components/toolbar";
|
|
67
|
+
import * as editBar from "../components/edit-bar";
|
|
67
68
|
import * as splitter from "../components/splitter";
|
|
68
69
|
import * as statistic from "../components/statistic";
|
|
69
70
|
import * as progress from "../components/progress";
|
|
@@ -144,6 +145,7 @@ export const quireKitEn: QuireKitLocale = {
|
|
|
144
145
|
timeline: timeline.en,
|
|
145
146
|
tag: tag.en,
|
|
146
147
|
toolbar: toolbar.en,
|
|
148
|
+
editBar: editBar.en,
|
|
147
149
|
splitter: splitter.en,
|
|
148
150
|
statistic: statistic.en,
|
|
149
151
|
progress: progress.en,
|
|
@@ -64,6 +64,7 @@ import * as steps from "../components/steps";
|
|
|
64
64
|
import * as timeline from "../components/timeline";
|
|
65
65
|
import * as tag from "../components/tag";
|
|
66
66
|
import * as toolbar from "../components/toolbar";
|
|
67
|
+
import * as editBar from "../components/edit-bar";
|
|
67
68
|
import * as splitter from "../components/splitter";
|
|
68
69
|
import * as statistic from "../components/statistic";
|
|
69
70
|
import * as progress from "../components/progress";
|
|
@@ -144,6 +145,7 @@ export const quireKitZhCN: QuireKitLocale = {
|
|
|
144
145
|
timeline: timeline.zhCN,
|
|
145
146
|
tag: tag.zhCN,
|
|
146
147
|
toolbar: toolbar.zhCN,
|
|
148
|
+
editBar: editBar.zhCN,
|
|
147
149
|
splitter: splitter.zhCN,
|
|
148
150
|
statistic: statistic.zhCN,
|
|
149
151
|
progress: progress.zhCN,
|
package/src/locale/types.ts
CHANGED
|
@@ -63,6 +63,7 @@ import type { Messages as StepsMessages } from "./components/steps";
|
|
|
63
63
|
import type { Messages as TimelineMessages } from "./components/timeline";
|
|
64
64
|
import type { Messages as TagMessages } from "./components/tag";
|
|
65
65
|
import type { Messages as ToolbarMessages } from "./components/toolbar";
|
|
66
|
+
import type { Messages as EditBarMessages } from "./components/edit-bar";
|
|
66
67
|
import type { Messages as SplitterMessages } from "./components/splitter";
|
|
67
68
|
import type { Messages as StatisticMessages } from "./components/statistic";
|
|
68
69
|
import type { Messages as ProgressMessages } from "./components/progress";
|
|
@@ -204,6 +205,8 @@ export interface QuireKitMessages {
|
|
|
204
205
|
readonly tag: TagMessages;
|
|
205
206
|
/** Toolbar. */
|
|
206
207
|
readonly toolbar: ToolbarMessages;
|
|
208
|
+
/** EditBar. */
|
|
209
|
+
readonly editBar: EditBarMessages;
|
|
207
210
|
/** Splitter. */
|
|
208
211
|
readonly splitter: SplitterMessages;
|
|
209
212
|
/** Statistic. */
|
|
@@ -36,10 +36,3 @@ function activate(value: string): void { if (!props.busy && props.actions.some(a
|
|
|
36
36
|
<p v-if="!groups.length" class="qk-action-sheet__empty" role="status">{{ text.empty }}</p>
|
|
37
37
|
</div>
|
|
38
38
|
</template>
|
|
39
|
-
<style scoped>
|
|
40
|
-
.qk-action-directory { display: grid; gap: var(--qk-space-surface-compact); }
|
|
41
|
-
.qk-action-directory__search { display: grid; }
|
|
42
|
-
.qk-action-directory__search-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
43
|
-
.qk-action-directory__actions--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--qk-space-inline); }
|
|
44
|
-
.qk-action-directory__actions--grid > button { min-width: 0; min-height: 48px; border-radius: var(--qk-radius-control); background: var(--qk-color-surface-subtle); }
|
|
45
|
-
</style>
|
|
@@ -27,4 +27,9 @@ describe("QuireBlockHandle", () => {
|
|
|
27
27
|
it("falls back to a neutral mark", async () => {
|
|
28
28
|
expect(await render({ label: "拖动", icon: "layers" })).toContain(quireBlockToneColor("neutral"));
|
|
29
29
|
});
|
|
30
|
+
|
|
31
|
+
it("keeps a fixed box instead of following the theme's control height and surface radius", async () => {
|
|
32
|
+
const html = await render({ label: "拖动", icon: "type" });
|
|
33
|
+
expect(html).toMatch(/<button[^>]*style="[^"]*width:42px;[^"]*height:24px;[^"]*border-radius:6px;/);
|
|
34
|
+
});
|
|
30
35
|
});
|
|
@@ -2,26 +2,19 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import QuireButton from "../button/button.vue";
|
|
4
4
|
import QuireIcon from "../icon/icon.vue";
|
|
5
|
-
import { quireBlockHandleWidth, quireBlockToneColor } from "./presentation";
|
|
5
|
+
import { quireBlockHandleHeight, quireBlockHandleRadius, quireBlockHandleWidth, quireBlockToneColor } from "./presentation";
|
|
6
6
|
import type { QuireBlockHandleProps } from "./types";
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(defineProps<QuireBlockHandleProps>(), { tone: "neutral" });
|
|
9
9
|
const typeStyle = computed(() => ({ color: quireBlockToneColor(props.tone) }));
|
|
10
|
+
// Fixed box: neither the theme's control height nor its surface radius reshapes the handle.
|
|
11
|
+
const boxStyle = { width: `${quireBlockHandleWidth}px`, height: `${quireBlockHandleHeight}px`, minHeight: `${quireBlockHandleHeight}px`, borderRadius: `${quireBlockHandleRadius}px` };
|
|
10
12
|
</script>
|
|
11
13
|
<template>
|
|
12
|
-
<QuireButton size="xs" color="neutral" variant="outline" class="qk-block-handle" :aria-label="label" :style="
|
|
14
|
+
<QuireButton size="xs" color="neutral" variant="outline" class="qk-block-handle" :aria-label="label" :style="boxStyle">
|
|
13
15
|
<span class="qk-block-handle__content" aria-hidden="true">
|
|
14
16
|
<span class="qk-block-handle__type" :style="typeStyle"><span v-if="badge" class="qk-type-helper">{{ badge }}</span><QuireIcon v-else-if="icon" :name="icon" :size="16" /></span>
|
|
15
17
|
<QuireIcon name="gripVertical" :size="16" class="qk-block-handle__grip" />
|
|
16
18
|
</span>
|
|
17
19
|
</QuireButton>
|
|
18
20
|
</template>
|
|
19
|
-
<style scoped>
|
|
20
|
-
/* A quiet chip on the page: hairline edge, no fill until hover; the block type carries the color, the grip stays muted. */
|
|
21
|
-
.qk-block-handle { cursor: grab; touch-action: none; padding-inline: 1px 2px; border-radius: var(--qk-radius-group);
|
|
22
|
-
border-color: var(--qk-color-border-subtle); background: var(--qk-color-surface-page); box-shadow: none; }
|
|
23
|
-
.qk-block-handle:hover, .qk-block-handle[aria-expanded="true"] { background: var(--qk-color-surface-hover); }
|
|
24
|
-
.qk-block-handle__content { display: flex; align-items: center; justify-content: center; gap: 1px; }
|
|
25
|
-
.qk-block-handle__type { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; font-weight: var(--qk-type-heading-font-weight); }
|
|
26
|
-
.qk-block-handle__grip { color: var(--qk-color-text-placeholder); }
|
|
27
|
-
</style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as QuireBlockHandle } from "./block-handle.vue";
|
|
2
|
-
export { quireBlockHandleWidth, quireBlockToneColor } from "./presentation";
|
|
2
|
+
export { quireBlockHandleHeight, quireBlockHandleRadius, quireBlockHandleWidth, quireBlockToneColor } from "./presentation";
|
|
3
3
|
export type * from "./types";
|
|
@@ -2,6 +2,10 @@ import type { QuireBlockTone } from "./types";
|
|
|
2
2
|
|
|
3
3
|
/** Fixed handle width, so hosts can reserve its gutter before it mounts. */
|
|
4
4
|
export const quireBlockHandleWidth = 42;
|
|
5
|
+
/** Fixed handle height of one compact row, so hosts can center it on a text line under any theme. */
|
|
6
|
+
export const quireBlockHandleHeight = 24;
|
|
7
|
+
/** Fixed corner radius; the handle and its adjacent rail buttons are document marks that keep their shape when a theme enlarges surface corners. */
|
|
8
|
+
export const quireBlockHandleRadius = 6;
|
|
5
9
|
|
|
6
10
|
/** Each tone derives from semantic feedback colors, so both schemes stay readable. */
|
|
7
11
|
const colors: Readonly<Record<QuireBlockTone, string>> = {
|
|
@@ -33,16 +33,25 @@ it('emits literal drafts without clearing them, protects IME and exposes stop se
|
|
|
33
33
|
expect(enter().defaultPrevented).toBe(true);
|
|
34
34
|
expect(submit).toHaveBeenCalledExactlyOnceWith({ text: ' 你好\nworld ' });
|
|
35
35
|
expect(host.querySelector('textarea')!.value).toBe(state.text);
|
|
36
|
-
state.busy = true; await nextTick();
|
|
36
|
+
state.busy = true; await nextTick();
|
|
37
|
+
expect(enter().defaultPrevented).toBe(false);
|
|
38
|
+
expect(submit).toHaveBeenCalledTimes(1);
|
|
37
39
|
expect(host.querySelector('textarea')!.disabled).toBe(false);
|
|
40
|
+
for (const modifiers of [{ isComposing: true }, { keyCode: 229 }, { shiftKey: true }, { repeat: true }]) {
|
|
41
|
+
expect(enter({ key: 'Escape', ...modifiers }).defaultPrevented).toBe(false);
|
|
42
|
+
}
|
|
43
|
+
expect(stop).not.toHaveBeenCalled();
|
|
38
44
|
host.querySelector<HTMLButtonElement>('button')!.click(); expect(stop).toHaveBeenCalledOnce();
|
|
45
|
+
expect(enter({ key: 'Escape' }).defaultPrevented).toBe(true);
|
|
46
|
+
expect(stop).toHaveBeenCalledTimes(2);
|
|
39
47
|
state.busy = false; state.readOnly = true; await nextTick(); enter();
|
|
48
|
+
expect(enter({ key: 'Escape' }).defaultPrevented).toBe(false);
|
|
40
49
|
expect(submit).toHaveBeenCalledTimes(1);
|
|
41
50
|
state.readOnly = false; state.text = ' \n '; await nextTick(); enter();
|
|
42
51
|
expect(submit).toHaveBeenCalledTimes(1);
|
|
43
52
|
state.disabled = true; state.busy = true; await nextTick();
|
|
44
53
|
expect(host.querySelector('.qk-chat-composer')!.hasAttribute('data-disabled')).toBe(true);
|
|
45
|
-
host.querySelector<HTMLButtonElement>('button')!.click(); expect(stop).
|
|
54
|
+
host.querySelector<HTMLButtonElement>('button')!.click(); expect(stop).toHaveBeenCalledTimes(2);
|
|
46
55
|
} finally { app.unmount(); host.remove(); }
|
|
47
56
|
});
|
|
48
57
|
|
|
@@ -27,11 +27,12 @@ const input = ref<QuireKitChatComposerInputInstance>();
|
|
|
27
27
|
const fileDragging = ref(false);
|
|
28
28
|
const footerId = `qk-composer-footer-${useId()}`;
|
|
29
29
|
const minRows = computed(() => props.rows ?? (props.layout === 'inline' ? 1 : 2));
|
|
30
|
+
const inputSubmitMode = computed(() => props.busy || props.submitDisabled ? 'button' : props.submitMode);
|
|
30
31
|
const canSubmit = computed(() => !props.disabled && !props.readOnly && !props.busy && !props.submitDisabled
|
|
31
32
|
&& (props.modelValue.trim().length > 0 || props.hasContent));
|
|
32
33
|
const context = computed<QuireKitChatComposerContext>(() => ({
|
|
33
34
|
value: props.modelValue, label: label.value, busy: props.busy, disabled: props.disabled,
|
|
34
|
-
readOnly: props.readOnly, canSubmit: canSubmit.value, updateValue, submit, stop
|
|
35
|
+
readOnly: props.readOnly, submitMode: inputSubmitMode.value, canSubmit: canSubmit.value, updateValue, submit, stop
|
|
35
36
|
}));
|
|
36
37
|
|
|
37
38
|
/** Notify the controlled draft owner.
|
|
@@ -51,6 +52,17 @@ function stop(): void {
|
|
|
51
52
|
if (props.busy && !props.disabled) emit('stop');
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
/** Cancel from the default draft field while leaving IME, menus and custom input adapters their own Escape.
|
|
56
|
+
* @param event - Native field key event.
|
|
57
|
+
*/
|
|
58
|
+
function onInputEscape(event: KeyboardEvent): void {
|
|
59
|
+
if (!props.busy || props.disabled || event.defaultPrevented || event.isComposing || event.keyCode === 229
|
|
60
|
+
|| event.repeat || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
stop();
|
|
64
|
+
}
|
|
65
|
+
|
|
54
66
|
/** Forward default-input focus without querying a child component's DOM.
|
|
55
67
|
* @param options - Native focus scrolling options.
|
|
56
68
|
*/
|
|
@@ -136,8 +148,8 @@ watch([() => props.disabled, () => props.readOnly, () => props.addTransferFiles]
|
|
|
136
148
|
<div class="qk-chat-composer__input">
|
|
137
149
|
<slot name="input" v-bind="context">
|
|
138
150
|
<ComposerInput ref="input" :model-value="modelValue" :label="label" :placeholder="placeholder ?? text.composer.placeholder" :size="size" variant="embedded"
|
|
139
|
-
:aria-describedby="$slots.footer ? footerId : undefined" :submit-mode="
|
|
140
|
-
:rows="minRows" :max-rows="maxRows" @update:model-value="updateValue" @submit="submit" />
|
|
151
|
+
:aria-describedby="$slots.footer ? footerId : undefined" :submit-mode="inputSubmitMode" :disabled="disabled" :read-only="readOnly"
|
|
152
|
+
:rows="minRows" :max-rows="maxRows" @update:model-value="updateValue" @submit="submit" @keydown.esc="onInputEscape" />
|
|
141
153
|
</slot>
|
|
142
154
|
</div>
|
|
143
155
|
</div>
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
import { createApp, h, nextTick, reactive } from 'vue';
|
|
3
3
|
import { expect, it, vi } from 'vitest';
|
|
4
4
|
import Submit from './composer-submit.vue';
|
|
5
|
+
import IconProvider from '../../icon/icon-provider.vue';
|
|
6
|
+
import { quireIconRegistry } from '../../../components/icon/catalog';
|
|
5
7
|
|
|
6
8
|
it.each(['icon', 'text'] as const)('retains the %s button while switching between submit and stop', async (appearance) => {
|
|
7
9
|
const state = reactive({ busy: false, canSubmit: false, disabled: false });
|
|
8
10
|
const submit = vi.fn(); const stop = vi.fn();
|
|
9
11
|
const host = document.createElement('div'); document.body.append(host);
|
|
10
|
-
const app = createApp({ render: () => h(
|
|
12
|
+
const app = createApp({ render: () => h(IconProvider, { registry: quireIconRegistry }, () =>
|
|
13
|
+
h(Submit, { ...state, appearance, onSubmit: submit, onStop: stop })) });
|
|
11
14
|
app.mount(host);
|
|
12
15
|
try {
|
|
13
16
|
const button = host.querySelector('button')!;
|
|
@@ -16,6 +19,7 @@ it.each(['icon', 'text'] as const)('retains the %s button while switching betwee
|
|
|
16
19
|
state.canSubmit = true; await nextTick(); button.click(); expect(submit).toHaveBeenCalledOnce();
|
|
17
20
|
button.focus(); state.busy = true; state.canSubmit = false; await nextTick();
|
|
18
21
|
expect(host.querySelector('button')).toBe(button); expect(document.activeElement).toBe(button);
|
|
22
|
+
if (appearance === 'icon') expect(button.querySelector('svg rect')?.getAttribute('fill')).toBe('currentColor');
|
|
19
23
|
expect(button.disabled).toBe(false); button.click(); expect(stop).toHaveBeenCalledOnce();
|
|
20
24
|
state.disabled = true; await nextTick(); button.click(); expect(stop).toHaveBeenCalledOnce();
|
|
21
25
|
} finally { app.unmount(); host.remove(); }
|
|
@@ -28,7 +28,7 @@ function activate(): void {
|
|
|
28
28
|
<template>
|
|
29
29
|
<QuireIconButton v-if="appearance === 'icon'" :label="label" :title="label" shape="circle" variant="solid"
|
|
30
30
|
:color="color" :size="size" :disabled="unavailable" :data-mode="busy ? 'stop' : 'submit'" @click="activate">
|
|
31
|
-
<QuireIcon :name="busy ? '
|
|
31
|
+
<QuireIcon :name="busy ? 'stop' : 'arrowUp'" :size="16" />
|
|
32
32
|
</QuireIconButton>
|
|
33
33
|
<QuireButton v-else variant="solid" :color="color" :size="size" :disabled="unavailable"
|
|
34
34
|
:data-mode="busy ? 'stop' : 'submit'" @click="activate">{{ label }}</QuireButton>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import type { QuireKitChatConfirmationDecision, QuireKitChatConfirmationProps, QuireKitChatConfirmationSlots } from '../../../components/chat';
|
|
4
4
|
import QuireButton from '../../button/button.vue';
|
|
5
|
+
import QuireIcon from '../../icon/icon.vue';
|
|
5
6
|
import { vChatFocusRecovery } from '../shared/focus-recovery';
|
|
6
7
|
import { useQuireKitMessages } from '../../locale-provider/context';
|
|
7
8
|
|
|
@@ -20,9 +21,9 @@ function decide(decision: QuireKitChatConfirmationDecision['decision']): void {
|
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
23
|
<template>
|
|
23
|
-
<section v-chat-focus-recovery class="qk-chat-decision qk-chat-confirmation" :data-state="state" :aria-label="title" tabindex="-1">
|
|
24
|
+
<section v-chat-focus-recovery class="qk-chat-decision qk-chat-confirmation" :data-intent="intent ?? 'permission'" :data-state="state" :aria-label="title" tabindex="-1">
|
|
24
25
|
<div class="qk-chat-decision__heading">
|
|
25
|
-
<strong class="qk-chat-decision__title"
|
|
26
|
+
<strong class="qk-chat-decision__title"><QuireIcon v-if="intent === 'review'" name="fileCheck" :size="16" />{{ title }}</strong>
|
|
26
27
|
<span class="qk-chat-decision__state" :data-state="state" role="status">{{ labels[state] }}</span>
|
|
27
28
|
</div>
|
|
28
29
|
<p v-if="description" class="qk-chat-decision__description">{{ description }}</p>
|