@icen.ai/ui 0.8.1 → 0.10.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/AGENTS.md +176 -75
- package/README.md +66 -88
- package/dist/base.css +208 -179
- package/dist/behaviors/accordion.mjs +8 -8
- package/dist/behaviors/ai-branch.d.mts +19 -0
- package/dist/behaviors/ai-branch.mjs +1133 -0
- package/dist/behaviors/ai-chat.d.mts +12 -10
- package/dist/behaviors/ai-chat.mjs +1125 -155
- package/dist/behaviors/ai-composer.d.mts +44 -12
- package/dist/behaviors/ai-composer.mjs +2084 -523
- package/dist/behaviors/ai-core.d.mts +1 -1
- package/dist/behaviors/ai-core.mjs +1016 -107
- package/dist/behaviors/ai-diff.mjs +1019 -127
- package/dist/behaviors/ai-feedback.d.mts +26 -0
- package/dist/behaviors/ai-feedback.mjs +1212 -0
- package/dist/behaviors/ai-panel.d.mts +21 -7
- package/dist/behaviors/ai-panel.mjs +1308 -264
- package/dist/behaviors/ai-provider.mjs +1003 -101
- package/dist/behaviors/ai-threads.d.mts +38 -0
- package/dist/behaviors/ai-threads.mjs +1233 -0
- package/dist/behaviors/ai-tool.d.mts +2 -2
- package/dist/behaviors/ai-tool.mjs +2042 -396
- package/dist/behaviors/ai-tools.d.mts +89 -16
- package/dist/behaviors/ai-tools.mjs +4453 -372
- package/dist/behaviors/autocomplete.d.mts +53 -0
- package/dist/behaviors/autocomplete.mjs +1600 -0
- package/dist/behaviors/back-top.d.mts +1 -1
- package/dist/behaviors/back-top.mjs +951 -14
- package/dist/behaviors/carousel.d.mts +1 -1
- package/dist/behaviors/carousel.mjs +906 -11
- package/dist/behaviors/cascader.d.mts +48 -0
- package/dist/behaviors/cascader.mjs +1853 -0
- package/dist/behaviors/charts.d.mts +174 -8
- package/dist/behaviors/charts.mjs +2632 -192
- package/dist/behaviors/code-block.d.mts +36 -0
- package/dist/behaviors/code-block.mjs +1611 -0
- package/dist/behaviors/command-palette.d.mts +9 -6
- package/dist/behaviors/command-palette.mjs +161 -59
- package/dist/behaviors/context-menu.d.mts +9 -8
- package/dist/behaviors/context-menu.mjs +1112 -44
- package/dist/behaviors/controls.d.mts +13 -13
- package/dist/behaviors/controls.mjs +989 -130
- package/dist/behaviors/copy.d.mts +21 -2
- package/dist/behaviors/copy.mjs +1206 -42
- package/dist/behaviors/datatable.d.mts +53 -3
- package/dist/behaviors/datatable.mjs +1963 -207
- package/dist/behaviors/date-picker.d.mts +0 -1
- package/dist/behaviors/date-picker.mjs +1340 -293
- package/dist/behaviors/design.d.mts +54 -0
- package/dist/behaviors/design.mjs +109 -0
- package/dist/behaviors/dropdown.d.mts +5 -6
- package/dist/behaviors/dropdown.mjs +262 -110
- package/dist/behaviors/events.d.mts +313 -3
- package/dist/behaviors/events.mjs +47 -2
- package/dist/behaviors/feedback.d.mts +30 -0
- package/dist/behaviors/feedback.mjs +296 -0
- package/dist/behaviors/focus.d.mts +8 -0
- package/dist/behaviors/focus.mjs +24 -0
- package/dist/behaviors/form-validate.d.mts +102 -0
- package/dist/behaviors/form-validate.mjs +6091 -0
- package/dist/behaviors/i18n.d.mts +789 -0
- package/dist/behaviors/i18n.mjs +1711 -0
- package/dist/behaviors/icons.d.mts +93 -0
- package/dist/behaviors/icons.mjs +113 -0
- package/dist/behaviors/input.d.mts +9 -1
- package/dist/behaviors/input.mjs +1056 -60
- package/dist/behaviors/kb-access.d.mts +34 -0
- package/dist/behaviors/kb-access.mjs +2459 -0
- package/dist/behaviors/kb-acl.d.mts +50 -0
- package/dist/behaviors/kb-acl.mjs +1345 -0
- package/dist/behaviors/kb-answer.d.mts +38 -0
- package/dist/behaviors/kb-answer.mjs +3707 -0
- package/dist/behaviors/kb-audit.d.mts +23 -0
- package/dist/behaviors/kb-audit.mjs +1297 -0
- package/dist/behaviors/kb-canvas.d.mts +44 -0
- package/dist/behaviors/kb-canvas.mjs +1512 -0
- package/dist/behaviors/kb-chain.d.mts +15 -0
- package/dist/behaviors/kb-chain.mjs +1192 -0
- package/dist/behaviors/kb-checkpoint.d.mts +16 -0
- package/dist/behaviors/kb-checkpoint.mjs +1492 -0
- package/dist/behaviors/kb-chunks.d.mts +31 -0
- package/dist/behaviors/kb-chunks.mjs +1414 -0
- package/dist/behaviors/kb-citation.d.mts +38 -0
- package/dist/behaviors/kb-citation.mjs +1699 -0
- package/dist/behaviors/kb-clarify.d.mts +20 -0
- package/dist/behaviors/kb-clarify.mjs +1176 -0
- package/dist/behaviors/kb-conflict.d.mts +22 -0
- package/dist/behaviors/kb-conflict.mjs +1206 -0
- package/dist/behaviors/kb-connector.d.mts +17 -0
- package/dist/behaviors/kb-connector.mjs +1303 -0
- package/dist/behaviors/kb-core.d.mts +534 -0
- package/dist/behaviors/kb-core.mjs +1805 -0
- package/dist/behaviors/kb-eval.d.mts +22 -0
- package/dist/behaviors/kb-eval.mjs +2235 -0
- package/dist/behaviors/kb-explain.d.mts +11 -0
- package/dist/behaviors/kb-explain.mjs +1165 -0
- package/dist/behaviors/kb-filter.d.mts +31 -0
- package/dist/behaviors/kb-filter.mjs +2417 -0
- package/dist/behaviors/kb-gap.d.mts +27 -0
- package/dist/behaviors/kb-gap.mjs +1195 -0
- package/dist/behaviors/kb-hittest.d.mts +34 -0
- package/dist/behaviors/kb-hittest.mjs +1352 -0
- package/dist/behaviors/kb-metadata.d.mts +29 -0
- package/dist/behaviors/kb-metadata.mjs +1248 -0
- package/dist/behaviors/kb-passage.d.mts +41 -0
- package/dist/behaviors/kb-passage.mjs +1469 -0
- package/dist/behaviors/kb-pipeline.d.mts +18 -0
- package/dist/behaviors/kb-pipeline.mjs +1301 -0
- package/dist/behaviors/kb-qa.d.mts +26 -0
- package/dist/behaviors/kb-qa.mjs +1260 -0
- package/dist/behaviors/kb-rerank.d.mts +20 -0
- package/dist/behaviors/kb-rerank.mjs +1248 -0
- package/dist/behaviors/kb-retrieval.d.mts +49 -0
- package/dist/behaviors/kb-retrieval.mjs +2585 -0
- package/dist/behaviors/kb-review.d.mts +44 -0
- package/dist/behaviors/kb-review.mjs +2282 -0
- package/dist/behaviors/kb-sandbox.d.mts +33 -0
- package/dist/behaviors/kb-sandbox.mjs +1247 -0
- package/dist/behaviors/kb-segment.d.mts +32 -0
- package/dist/behaviors/kb-segment.mjs +1431 -0
- package/dist/behaviors/kb-select.d.mts +24 -0
- package/dist/behaviors/kb-select.mjs +1989 -0
- package/dist/behaviors/kb-sources.d.mts +27 -0
- package/dist/behaviors/kb-sources.mjs +1287 -0
- package/dist/behaviors/kb-sql.d.mts +43 -0
- package/dist/behaviors/kb-sql.mjs +1865 -0
- package/dist/behaviors/kb-trace.d.mts +16 -0
- package/dist/behaviors/kb-trace.mjs +1328 -0
- package/dist/behaviors/kb-visibility.d.mts +44 -0
- package/dist/behaviors/kb-visibility.mjs +1331 -0
- package/dist/behaviors/kb-who-can.d.mts +32 -0
- package/dist/behaviors/kb-who-can.mjs +2216 -0
- package/dist/behaviors/mentions.d.mts +93 -0
- package/dist/behaviors/mentions.mjs +2152 -0
- package/dist/behaviors/modal.d.mts +4 -3
- package/dist/behaviors/modal.mjs +1055 -33
- package/dist/behaviors/nav.d.mts +1 -1
- package/dist/behaviors/nav.mjs +6 -6
- package/dist/behaviors/notification.d.mts +16 -8
- package/dist/behaviors/notification.mjs +1615 -265
- package/dist/behaviors/panel.d.mts +4 -0
- package/dist/behaviors/panel.mjs +994 -0
- package/dist/behaviors/popover.d.mts +28 -5
- package/dist/behaviors/popover.mjs +225 -24
- package/dist/behaviors/select.d.mts +5 -2
- package/dist/behaviors/select.mjs +1410 -117
- package/dist/behaviors/sidebar.d.mts +1 -1
- package/dist/behaviors/sidebar.mjs +13 -13
- package/dist/behaviors/slider.d.mts +1 -1
- package/dist/behaviors/slider.mjs +9 -9
- package/dist/behaviors/split-pane.d.mts +1 -1
- package/dist/behaviors/split-pane.mjs +7 -7
- package/dist/behaviors/suggestions.d.mts +27 -0
- package/dist/behaviors/suggestions.mjs +1089 -0
- package/dist/behaviors/svg-parse.d.mts +14 -0
- package/dist/behaviors/svg-parse.mjs +37 -0
- package/dist/behaviors/tabs.d.mts +2 -2
- package/dist/behaviors/tabs.mjs +25 -25
- package/dist/behaviors/tag-input.d.mts +23 -5
- package/dist/behaviors/tag-input.mjs +1359 -104
- package/dist/behaviors/theme-switcher.d.mts +24 -0
- package/dist/behaviors/theme-switcher.mjs +1981 -0
- package/dist/behaviors/theme.d.mts +15 -8
- package/dist/behaviors/theme.mjs +390 -28
- package/dist/behaviors/toast.d.mts +24 -25
- package/dist/behaviors/toast.mjs +1266 -88
- package/dist/behaviors/tooltip.d.mts +4 -0
- package/dist/behaviors/tooltip.mjs +378 -0
- package/dist/behaviors/tree-select.d.mts +69 -0
- package/dist/behaviors/tree-select.mjs +1907 -0
- package/dist/behaviors/tree.d.mts +1 -1
- package/dist/behaviors/tree.mjs +15 -15
- package/dist/behaviors/upload.d.mts +3 -2
- package/dist/behaviors/upload.mjs +1076 -66
- package/dist/cli.mjs +5 -6
- package/dist/components/ai-branch.mjs +3 -0
- package/dist/components/ai-chat.css +846 -458
- package/dist/components/ai-diff.css +153 -132
- package/dist/components/ai-feedback.mjs +3 -0
- package/dist/components/ai-panel.css +495 -270
- package/dist/components/ai-threads.mjs +3 -0
- package/dist/components/ai-tool.css +393 -238
- package/dist/components/autocomplete.css +61 -0
- package/dist/components/autocomplete.mjs +3 -0
- package/dist/components/back-top.css +34 -31
- package/dist/components/badge.css +44 -41
- package/dist/components/breadcrumb.css +67 -46
- package/dist/components/btn.css +80 -74
- package/dist/components/card.css +117 -106
- package/dist/components/cascader.css +311 -0
- package/dist/components/cascader.mjs +3 -0
- package/dist/components/chart-area.css +8 -2
- package/dist/components/chart-bar.css +95 -33
- package/dist/components/chart-gauge.css +14 -11
- package/dist/components/chart-graph.css +60 -0
- package/dist/components/chart-graph.mjs +4 -0
- package/dist/components/chart-heatmap.css +96 -90
- package/dist/components/chart-line.css +8 -3
- package/dist/components/chart-map.mjs +3 -0
- package/dist/components/chart-pie.css +9 -6
- package/dist/components/chart-radar.css +8 -5
- package/dist/components/chart-scatter.css +9 -6
- package/dist/components/chart-scatter.mjs +1 -1
- package/dist/components/chart-sparkline.css +5 -2
- package/dist/components/chart-stack.css +14 -11
- package/dist/components/charts.css +190 -67
- package/dist/components/charts.mjs +1 -0
- package/dist/components/code-block.css +418 -0
- package/dist/components/code-block.mjs +4 -0
- package/dist/components/command-palette.css +138 -117
- package/dist/components/content.css +257 -251
- package/dist/components/copy.css +72 -44
- package/dist/components/datatable.css +423 -181
- package/dist/components/date-picker.css +135 -104
- package/dist/components/empty.css +68 -65
- package/dist/components/feedback.css +201 -183
- package/dist/components/form-validate.css +120 -0
- package/dist/components/form-validate.mjs +3 -0
- package/dist/components/form.css +150 -127
- package/dist/components/icon.css +102 -0
- package/dist/components/icon.mjs +3 -0
- package/dist/components/input.css +159 -104
- package/dist/components/kb-access.mjs +4 -0
- package/dist/components/kb-acl.mjs +4 -0
- package/dist/components/kb-agent.css +496 -0
- package/dist/components/kb-answer.mjs +4 -0
- package/dist/components/kb-audit.mjs +4 -0
- package/dist/components/kb-canvas.mjs +4 -0
- package/dist/components/kb-chain.mjs +4 -0
- package/dist/components/kb-checkpoint.mjs +4 -0
- package/dist/components/kb-chunks.mjs +4 -0
- package/dist/components/kb-citation.mjs +4 -0
- package/dist/components/kb-clarify.mjs +4 -0
- package/dist/components/kb-conflict.mjs +4 -0
- package/dist/components/kb-connector.mjs +4 -0
- package/dist/components/kb-data.css +653 -0
- package/dist/components/kb-eval.mjs +4 -0
- package/dist/components/kb-explain.mjs +4 -0
- package/dist/components/kb-filter.mjs +4 -0
- package/dist/components/kb-gap.mjs +4 -0
- package/dist/components/kb-ground.css +578 -0
- package/dist/components/kb-hittest.mjs +4 -0
- package/dist/components/kb-ingest.css +882 -0
- package/dist/components/kb-metadata.mjs +4 -0
- package/dist/components/kb-ops.css +554 -0
- package/dist/components/kb-passage.mjs +4 -0
- package/dist/components/kb-perm.css +433 -0
- package/dist/components/kb-pipeline.mjs +4 -0
- package/dist/components/kb-qa.mjs +4 -0
- package/dist/components/kb-rerank.mjs +4 -0
- package/dist/components/kb-retrieval.mjs +4 -0
- package/dist/components/kb-review.mjs +4 -0
- package/dist/components/kb-sandbox.mjs +4 -0
- package/dist/components/kb-search.css +897 -0
- package/dist/components/kb-segment.mjs +4 -0
- package/dist/components/kb-sources.mjs +4 -0
- package/dist/components/kb-sql.mjs +4 -0
- package/dist/components/kb-trace.mjs +4 -0
- package/dist/components/kb-visibility.mjs +4 -0
- package/dist/components/kb-who-can.mjs +4 -0
- package/dist/components/kb.css +263 -0
- package/dist/components/kb.mjs +9 -0
- package/dist/components/layout.css +85 -82
- package/dist/components/material-chinese.css +73 -0
- package/dist/components/material-soviet.css +76 -0
- package/dist/components/material.css +275 -0
- package/dist/components/media.css +220 -166
- package/dist/components/mentions.css +189 -0
- package/dist/components/mentions.mjs +3 -0
- package/dist/components/menu.css +113 -105
- package/dist/components/modal.css +107 -112
- package/dist/components/nav.css +118 -115
- package/dist/components/notification.css +238 -174
- package/dist/components/pagination.css +56 -53
- package/dist/components/panel.css +66 -63
- package/dist/components/panel.mjs +1 -0
- package/dist/components/pill.css +81 -71
- package/dist/components/popover.css +67 -53
- package/dist/components/scroll-area.css +113 -110
- package/dist/components/segmented.css +146 -143
- package/dist/components/select.css +206 -186
- package/dist/components/sidebar.css +137 -127
- package/dist/components/slider.css +117 -114
- package/dist/components/split-pane.css +112 -109
- package/dist/components/stat.css +112 -106
- package/dist/components/steps.css +109 -103
- package/dist/components/switch.css +138 -134
- package/dist/components/table.css +131 -107
- package/dist/components/tabs.css +114 -108
- package/dist/components/tag-input.css +48 -133
- package/dist/components/tag.css +81 -71
- package/dist/components/theme-switcher.css +105 -0
- package/dist/components/theme-switcher.mjs +3 -0
- package/dist/components/toast.css +100 -86
- package/dist/components/toolbar.css +45 -42
- package/dist/components/tooltip.css +102 -43
- package/dist/components/tooltip.mjs +1 -0
- package/dist/components/tree-select.css +416 -0
- package/dist/components/tree-select.mjs +3 -0
- package/dist/components/upload.css +135 -92
- package/dist/fonts/LICENSES/ark-pixel/OFL.txt +96 -0
- package/dist/fonts/LICENSES/cubic-11/OFL.txt +108 -0
- package/dist/fonts/LICENSES/galmuri/LICENSE.txt +93 -0
- package/dist/fonts/OFL.txt +96 -0
- package/dist/fonts/README.md +14 -0
- package/dist/fonts/fusion-pixel-12px-zh-hans.woff2 +0 -0
- package/dist/index.d.mts +64 -15
- package/dist/index.mjs +28049 -8595
- package/dist/react.d.mts +91 -0
- package/dist/react.mjs +8208 -0
- package/dist/registry.json +454 -15
- package/dist/tokens/chinese.css +44 -0
- package/dist/tokens/colors.css +365 -1222
- package/dist/tokens/design.css +109 -0
- package/dist/tokens/dtcg.json +11198 -0
- package/dist/tokens/figma.variables.json +7017 -0
- package/dist/tokens/icon-masks.css +78 -0
- package/dist/tokens/pixel.css +50 -0
- package/dist/tokens/soviet.css +44 -0
- package/dist/tokens/style-profiles.css +36 -547
- package/dist/tokens/themes.json +308 -0
- package/dist/tokens/tokens-studio.json +6728 -0
- package/dist/tokens/typography.css +21 -18
- package/dist/tokens.css +1555 -1801
- package/dist/ui.css +16147 -8597
- package/dist/vue.d.mts +344 -0
- package/dist/vue.mjs +7781 -0
- package/docs/spec/ai-input-experience.md +75 -0
- package/docs/spec/ai-native.md +238 -147
- package/docs/spec/design-philosophy.md +189 -0
- package/docs/spec/design-primitives.md +196 -0
- package/docs/spec/kb-family.md +475 -0
- package/package.json +42 -7
- package/dist/retro-effects.css +0 -255
- package/dist/tokens/retro-effects.css +0 -255
|
@@ -2,11 +2,15 @@ import { ChartEventDetail } from './charts.js';
|
|
|
2
2
|
import { AiUsage } from './ai-core.js';
|
|
3
3
|
import { AiDoneEventDetail } from './ai-provider.js';
|
|
4
4
|
import { AiComposerRefSource } from './ai-composer.js';
|
|
5
|
+
import { MentionEntity, MentionValue } from './mentions.js';
|
|
6
|
+
import { KbCitation, KbSegmentConfig, KbRetrievalQuery, KbFilterNode, KbCheckpointScope, KbSandboxMessage, KbChainStep, KbAclEntry, KbIdentity, KbAclDecision, KbAccessRequest, KbRole, KbAuditChannel, KbHygieneIssue } from './kb-core.js';
|
|
7
|
+
import './icons.js';
|
|
5
8
|
import './popover.js';
|
|
6
9
|
import './ai-panel.js';
|
|
10
|
+
import './suggestions.js';
|
|
7
11
|
|
|
8
12
|
interface IcenGestureDetail {
|
|
9
|
-
/** 手势命中源:最近的 [data-gestures] 宿主 */
|
|
13
|
+
/** 手势命中源:最近的 [data-icen-gestures] 宿主 */
|
|
10
14
|
source: HTMLElement;
|
|
11
15
|
/** 原始 DOM 事件(click / contextmenu / pointerdown / mouseup…) */
|
|
12
16
|
originalEvent: Event;
|
|
@@ -19,6 +23,8 @@ interface IcenGestureDetail {
|
|
|
19
23
|
type IcenPolicy = (e: CustomEvent<IcenGestureDetail>) => void;
|
|
20
24
|
/** 手势层事件名(策略层只认这五种,编译期收死)。 */
|
|
21
25
|
type IcenGestureEvent = 'icen:click' | 'icen:dblclick' | 'icen:contextmenu' | 'icen:longpress' | 'icen:text-select';
|
|
26
|
+
/** 滑动手势事件名(策略层不收——swipe 只有事件语义,无全站默认行为需求)。 */
|
|
27
|
+
type IcenSwipeEvent = 'icen:swipe-left' | 'icen:swipe-right' | 'icen:swipe-up' | 'icen:swipe-down';
|
|
22
28
|
/**
|
|
23
29
|
* 全库事件注册表:事件名 → detail 契约。onIcen 推断、emitIcen 校验,双侧同表。
|
|
24
30
|
* 新增事件必须在此登记(模板签名兜底只留给宿主自定义事件)。
|
|
@@ -29,6 +35,25 @@ interface IcenEventMap {
|
|
|
29
35
|
'icen:contextmenu': IcenGestureDetail;
|
|
30
36
|
'icen:longpress': IcenGestureDetail;
|
|
31
37
|
'icen:text-select': IcenGestureDetail;
|
|
38
|
+
'icen:swipe-left': IcenGestureDetail & {
|
|
39
|
+
dx: number;
|
|
40
|
+
dy: number;
|
|
41
|
+
};
|
|
42
|
+
'icen:swipe-right': IcenGestureDetail & {
|
|
43
|
+
dx: number;
|
|
44
|
+
dy: number;
|
|
45
|
+
};
|
|
46
|
+
'icen:swipe-up': IcenGestureDetail & {
|
|
47
|
+
dx: number;
|
|
48
|
+
dy: number;
|
|
49
|
+
};
|
|
50
|
+
'icen:swipe-down': IcenGestureDetail & {
|
|
51
|
+
dx: number;
|
|
52
|
+
dy: number;
|
|
53
|
+
};
|
|
54
|
+
'icen:locale-change': {
|
|
55
|
+
changed: string[];
|
|
56
|
+
};
|
|
32
57
|
'icen:chart-hover': ChartEventDetail;
|
|
33
58
|
'icen:chart-click': ChartEventDetail;
|
|
34
59
|
'icen:chart-dblclick': ChartEventDetail;
|
|
@@ -41,6 +66,12 @@ interface IcenEventMap {
|
|
|
41
66
|
'icen:chart-legend-visibility': {
|
|
42
67
|
visible: boolean;
|
|
43
68
|
};
|
|
69
|
+
/** 缩放/刷选(renderChart spec.zoom):类目索引区间 [from, to](含端点) */
|
|
70
|
+
'icen:chart-zoom': {
|
|
71
|
+
chart: string;
|
|
72
|
+
from: number;
|
|
73
|
+
to: number;
|
|
74
|
+
};
|
|
44
75
|
'icen:tab-change': {
|
|
45
76
|
tab: HTMLElement | null;
|
|
46
77
|
panel: HTMLElement | null;
|
|
@@ -117,6 +148,11 @@ interface IcenEventMap {
|
|
|
117
148
|
text: string;
|
|
118
149
|
reason: string;
|
|
119
150
|
};
|
|
151
|
+
'icen:code-block-toggle': {
|
|
152
|
+
el: HTMLElement;
|
|
153
|
+
action: 'num' | 'wrap' | 'fold';
|
|
154
|
+
value: boolean;
|
|
155
|
+
};
|
|
120
156
|
'icen:back-top': Record<string, never>;
|
|
121
157
|
'icen:modal-open': {
|
|
122
158
|
id: string;
|
|
@@ -141,6 +177,10 @@ interface IcenEventMap {
|
|
|
141
177
|
value: string;
|
|
142
178
|
date: Date | null;
|
|
143
179
|
};
|
|
180
|
+
'icen:panel-toggle': {
|
|
181
|
+
panel: HTMLElement;
|
|
182
|
+
expanded: boolean;
|
|
183
|
+
};
|
|
144
184
|
'icen:accordion-toggle': {
|
|
145
185
|
item: HTMLElement;
|
|
146
186
|
index: number;
|
|
@@ -198,6 +238,65 @@ interface IcenEventMap {
|
|
|
198
238
|
'icen:table-export': {
|
|
199
239
|
count: number;
|
|
200
240
|
};
|
|
241
|
+
/** 单元格编辑提交(editable 列;宿主应用数据后调 handle.updateCell 或 setData) */
|
|
242
|
+
'icen:table-cell-edit': {
|
|
243
|
+
rowKey: string;
|
|
244
|
+
field: string;
|
|
245
|
+
value: unknown;
|
|
246
|
+
row: unknown;
|
|
247
|
+
};
|
|
248
|
+
/** 列拖拽重排完成 */
|
|
249
|
+
'icen:table-column-reorder': {
|
|
250
|
+
key: string;
|
|
251
|
+
fromIndex: number;
|
|
252
|
+
toIndex: number;
|
|
253
|
+
};
|
|
254
|
+
/** 分组行展开/折叠 */
|
|
255
|
+
'icen:table-group-toggle': {
|
|
256
|
+
key: string;
|
|
257
|
+
collapsed: boolean;
|
|
258
|
+
};
|
|
259
|
+
/** 列宽拖拽完成(拖动过程中不派发,防事件洪泛) */
|
|
260
|
+
'icen:table-column-resize': {
|
|
261
|
+
key: string;
|
|
262
|
+
width: string;
|
|
263
|
+
};
|
|
264
|
+
'icen:form-field-validate': {
|
|
265
|
+
name: string;
|
|
266
|
+
valid: boolean;
|
|
267
|
+
message?: string;
|
|
268
|
+
};
|
|
269
|
+
'icen:form-valid': {
|
|
270
|
+
names: string[];
|
|
271
|
+
};
|
|
272
|
+
'icen:form-invalid': {
|
|
273
|
+
errors: Record<string, string>;
|
|
274
|
+
first: string | null;
|
|
275
|
+
};
|
|
276
|
+
'icen:cascader-change': {
|
|
277
|
+
value: string[];
|
|
278
|
+
path: string[];
|
|
279
|
+
};
|
|
280
|
+
'icen:tree-select-change': {
|
|
281
|
+
value: string[];
|
|
282
|
+
labels: string[];
|
|
283
|
+
};
|
|
284
|
+
'icen:mention-select': {
|
|
285
|
+
item: MentionEntity<unknown>;
|
|
286
|
+
query: string;
|
|
287
|
+
};
|
|
288
|
+
'icen:mention-change': {
|
|
289
|
+
value: MentionValue<unknown>[];
|
|
290
|
+
text: string;
|
|
291
|
+
mentions: MentionEntity<unknown>[];
|
|
292
|
+
};
|
|
293
|
+
'icen:autocomplete-select': {
|
|
294
|
+
value: string;
|
|
295
|
+
label: string;
|
|
296
|
+
};
|
|
297
|
+
'icen:autocomplete-change': {
|
|
298
|
+
value: string;
|
|
299
|
+
};
|
|
201
300
|
'icen:upload': {
|
|
202
301
|
files: File[];
|
|
203
302
|
};
|
|
@@ -234,10 +333,14 @@ interface IcenEventMap {
|
|
|
234
333
|
};
|
|
235
334
|
'icen:ai-send': {
|
|
236
335
|
text: string;
|
|
336
|
+
refs?: AiComposerRefSource[];
|
|
337
|
+
files?: File[];
|
|
237
338
|
};
|
|
238
339
|
'icen:ai-stop': Record<string, never>;
|
|
239
340
|
'icen:ai-queue': {
|
|
240
341
|
text: string;
|
|
342
|
+
refs?: AiComposerRefSource[];
|
|
343
|
+
files?: File[];
|
|
241
344
|
};
|
|
242
345
|
'icen:ai-dequeue': {
|
|
243
346
|
index: number;
|
|
@@ -245,6 +348,10 @@ interface IcenEventMap {
|
|
|
245
348
|
'icen:ai-attach': {
|
|
246
349
|
files: File[];
|
|
247
350
|
};
|
|
351
|
+
'icen:ai-attachment-remove': {
|
|
352
|
+
file: File;
|
|
353
|
+
files: File[];
|
|
354
|
+
};
|
|
248
355
|
'icen:ai-model-change': {
|
|
249
356
|
provider: string;
|
|
250
357
|
model: string;
|
|
@@ -282,8 +389,211 @@ interface IcenEventMap {
|
|
|
282
389
|
name: string;
|
|
283
390
|
el: HTMLElement;
|
|
284
391
|
};
|
|
392
|
+
/** 工具审批(requiresApproval 的工具在挂载卡上等待宿主裁决;approve 才执行 run) */
|
|
393
|
+
'icen:ai-tool-approve': {
|
|
394
|
+
name: string;
|
|
395
|
+
input: Record<string, unknown>;
|
|
396
|
+
el: HTMLElement;
|
|
397
|
+
};
|
|
398
|
+
'icen:ai-tool-reject': {
|
|
399
|
+
name: string;
|
|
400
|
+
input: Record<string, unknown>;
|
|
401
|
+
el: HTMLElement;
|
|
402
|
+
};
|
|
285
403
|
'icen:ai-usage': AiUsage;
|
|
286
404
|
'icen:ai-done': AiDoneEventDetail;
|
|
405
|
+
'icen:ai-thread-select': {
|
|
406
|
+
key: string;
|
|
407
|
+
};
|
|
408
|
+
'icen:ai-thread-action': {
|
|
409
|
+
action: 'rename' | 'pin' | 'archive' | 'delete' | 'move';
|
|
410
|
+
key: string;
|
|
411
|
+
};
|
|
412
|
+
'icen:ai-feedback': {
|
|
413
|
+
value: 1 | -1 | 0;
|
|
414
|
+
reason?: string;
|
|
415
|
+
el?: HTMLElement;
|
|
416
|
+
};
|
|
417
|
+
'icen:ai-branch-change': {
|
|
418
|
+
index: number;
|
|
419
|
+
count: number;
|
|
420
|
+
};
|
|
421
|
+
'icen:kb-citation-open': {
|
|
422
|
+
citation: KbCitation;
|
|
423
|
+
};
|
|
424
|
+
'icen:kb-source-open': {
|
|
425
|
+
source: KbCitation;
|
|
426
|
+
};
|
|
427
|
+
'icen:kb-passage-jump': {
|
|
428
|
+
citation: KbCitation;
|
|
429
|
+
};
|
|
430
|
+
'icen:kb-passage-close': Record<string, never>;
|
|
431
|
+
'icen:kb-pipeline-toggle': {
|
|
432
|
+
el: HTMLElement;
|
|
433
|
+
open: boolean;
|
|
434
|
+
};
|
|
435
|
+
'icen:kb-pipeline-rerun': {
|
|
436
|
+
documentId: string;
|
|
437
|
+
};
|
|
438
|
+
'icen:kb-chunk-toggle': {
|
|
439
|
+
chunkId: string;
|
|
440
|
+
available: boolean;
|
|
441
|
+
};
|
|
442
|
+
'icen:kb-chunk-edit': {
|
|
443
|
+
chunkId: string;
|
|
444
|
+
};
|
|
445
|
+
'icen:kb-chunk-remove': {
|
|
446
|
+
chunkId: string;
|
|
447
|
+
};
|
|
448
|
+
'icen:kb-chunk-add': {
|
|
449
|
+
documentId: string;
|
|
450
|
+
};
|
|
451
|
+
'icen:kb-chunk-search': {
|
|
452
|
+
mode: 'text' | 'vector';
|
|
453
|
+
query: string;
|
|
454
|
+
};
|
|
455
|
+
'icen:kb-segment-change': {
|
|
456
|
+
config: KbSegmentConfig;
|
|
457
|
+
};
|
|
458
|
+
'icen:kb-connector-sync': {
|
|
459
|
+
connectorId: string;
|
|
460
|
+
};
|
|
461
|
+
'icen:kb-connector-reauth': {
|
|
462
|
+
connectorId: string;
|
|
463
|
+
};
|
|
464
|
+
'icen:kb-connector-schedule': {
|
|
465
|
+
connectorId: string;
|
|
466
|
+
schedule: string;
|
|
467
|
+
};
|
|
468
|
+
'icen:kb-metadata-change': {
|
|
469
|
+
action: 'define' | 'bind' | 'remove';
|
|
470
|
+
key: string;
|
|
471
|
+
};
|
|
472
|
+
'icen:kb-qa-change': {
|
|
473
|
+
op: 'add' | 'edit' | 'remove';
|
|
474
|
+
index: number;
|
|
475
|
+
};
|
|
476
|
+
'icen:kb-qa-import': {
|
|
477
|
+
source: string;
|
|
478
|
+
};
|
|
479
|
+
'icen:kb-retrieval-run': {
|
|
480
|
+
query: KbRetrievalQuery;
|
|
481
|
+
};
|
|
482
|
+
'icen:kb-filter-change': {
|
|
483
|
+
node: KbFilterNode | null;
|
|
484
|
+
valid: boolean;
|
|
485
|
+
};
|
|
486
|
+
'icen:kb-rerank-toggle': {
|
|
487
|
+
enabled: boolean;
|
|
488
|
+
model?: string;
|
|
489
|
+
};
|
|
490
|
+
'icen:kb-hittest-add': {
|
|
491
|
+
question: string;
|
|
492
|
+
};
|
|
493
|
+
'icen:kb-hittest-run': Record<string, never>;
|
|
494
|
+
'icen:kb-sql-edit': {
|
|
495
|
+
sql: string;
|
|
496
|
+
};
|
|
497
|
+
'icen:kb-sql-rerun': {
|
|
498
|
+
sql: string;
|
|
499
|
+
};
|
|
500
|
+
'icen:kb-clarify-answer': {
|
|
501
|
+
id?: string;
|
|
502
|
+
value: string;
|
|
503
|
+
label: string;
|
|
504
|
+
};
|
|
505
|
+
'icen:kb-verified-open': {
|
|
506
|
+
assetId: string;
|
|
507
|
+
};
|
|
508
|
+
'icen:kb-explain-toggle': {
|
|
509
|
+
el: HTMLElement;
|
|
510
|
+
open: boolean;
|
|
511
|
+
};
|
|
512
|
+
'icen:kb-trace-select': {
|
|
513
|
+
spanId: string;
|
|
514
|
+
};
|
|
515
|
+
'icen:kb-trace-toggle': {
|
|
516
|
+
spanId: string;
|
|
517
|
+
open: boolean;
|
|
518
|
+
};
|
|
519
|
+
'icen:kb-review-assign': {
|
|
520
|
+
taskId: string;
|
|
521
|
+
assignee: string;
|
|
522
|
+
};
|
|
523
|
+
'icen:kb-review-score': {
|
|
524
|
+
taskId: string;
|
|
525
|
+
name: string;
|
|
526
|
+
value: string | number;
|
|
527
|
+
};
|
|
528
|
+
'icen:kb-review-submit': {
|
|
529
|
+
taskId: string;
|
|
530
|
+
};
|
|
531
|
+
'icen:kb-gap-action': {
|
|
532
|
+
query: string;
|
|
533
|
+
action: 'create-doc' | 'add-synonym';
|
|
534
|
+
};
|
|
535
|
+
'icen:kb-eval-compare': {
|
|
536
|
+
runA: string;
|
|
537
|
+
runB: string;
|
|
538
|
+
};
|
|
539
|
+
'icen:kb-canvas-ai': {
|
|
540
|
+
instruction: string;
|
|
541
|
+
selection?: {
|
|
542
|
+
text: string;
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
'icen:kb-canvas-version': {
|
|
546
|
+
versionId: string;
|
|
547
|
+
};
|
|
548
|
+
'icen:kb-checkpoint-restore': {
|
|
549
|
+
checkpointId: string;
|
|
550
|
+
scope: KbCheckpointScope;
|
|
551
|
+
};
|
|
552
|
+
'icen:kb-sandbox-message': {
|
|
553
|
+
channel: 'in' | 'out';
|
|
554
|
+
payload: KbSandboxMessage;
|
|
555
|
+
};
|
|
556
|
+
'icen:kb-chain-step': {
|
|
557
|
+
index: number;
|
|
558
|
+
step: KbChainStep;
|
|
559
|
+
};
|
|
560
|
+
'icen:kb-acl-grant': {};
|
|
561
|
+
'icen:kb-acl-remove': {
|
|
562
|
+
subject: KbAclEntry['subject'];
|
|
563
|
+
};
|
|
564
|
+
'icen:kb-acl-inherit': {
|
|
565
|
+
action: 'break' | 'restore';
|
|
566
|
+
};
|
|
567
|
+
'icen:kb-whocan-check': {
|
|
568
|
+
identity: KbIdentity;
|
|
569
|
+
decision: KbAclDecision;
|
|
570
|
+
};
|
|
571
|
+
'icen:kb-access-request': {
|
|
572
|
+
request: KbAccessRequest;
|
|
573
|
+
};
|
|
574
|
+
'icen:kb-access-decide': {
|
|
575
|
+
id: string;
|
|
576
|
+
decision: 'approve' | 'deny';
|
|
577
|
+
role?: KbRole;
|
|
578
|
+
};
|
|
579
|
+
'icen:kb-access-expire': {
|
|
580
|
+
id: string;
|
|
581
|
+
};
|
|
582
|
+
'icen:kb-audit-filter': {
|
|
583
|
+
channel: KbAuditChannel | 'all';
|
|
584
|
+
};
|
|
585
|
+
'icen:kb-audit-export': {
|
|
586
|
+
channel: KbAuditChannel | 'all';
|
|
587
|
+
};
|
|
588
|
+
'icen:kb-hygiene-action': {
|
|
589
|
+
issue: KbHygieneIssue;
|
|
590
|
+
};
|
|
591
|
+
'icen:kb-visibility-identity': {
|
|
592
|
+
identity: KbIdentity;
|
|
593
|
+
};
|
|
594
|
+
'icen:kb-visibility-layer': {
|
|
595
|
+
layer: 'pre' | 'post' | 'none';
|
|
596
|
+
};
|
|
287
597
|
[key: `icen:${string}`]: unknown;
|
|
288
598
|
}
|
|
289
599
|
interface IcenListenOptions {
|
|
@@ -298,7 +608,7 @@ interface IcenListenOptions {
|
|
|
298
608
|
/**
|
|
299
609
|
* 统一绑定器(全库事件一个入口):
|
|
300
610
|
* onIcen('icen:tab-change', (e) => e.detail.index) 全局
|
|
301
|
-
* onIcen('icen:chart-click', '.chart', (e) => …) 选择器委托
|
|
611
|
+
* onIcen('icen:chart-click', '.icen-chart', (e) => …) 选择器委托
|
|
302
612
|
* onIcen('icen:upload', (e) => …, { within: formEl }) 子树限定
|
|
303
613
|
* onIcen('icen:ai-done', (e) => …, { signal: ctrl.signal }) 广播 + 信号解绑
|
|
304
614
|
* 返回解绑函数 —— React useEffect / Vue onUnmounted 直接 return。
|
|
@@ -327,4 +637,4 @@ declare function initGestures(): () => void;
|
|
|
327
637
|
/** 摘除手势层委托(等同 initGestures 返回的销毁函数;未启动时为 no-op)。 */
|
|
328
638
|
declare function destroyGestures(): void;
|
|
329
639
|
|
|
330
|
-
export { type IcenEventMap, type IcenGestureDetail, type IcenGestureEvent, type IcenListenOptions, type IcenPolicy, destroyGestures, emitIcen, getEventPolicy, initGestures, onIcen, resetEventPolicies, setEventPolicy };
|
|
640
|
+
export { type IcenEventMap, type IcenGestureDetail, type IcenGestureEvent, type IcenListenOptions, type IcenPolicy, type IcenSwipeEvent, destroyGestures, emitIcen, getEventPolicy, initGestures, onIcen, resetEventPolicies, setEventPolicy };
|
|
@@ -55,10 +55,13 @@ var LONGPRESS_MS = 520;
|
|
|
55
55
|
var LONGPRESS_MOVE = 12;
|
|
56
56
|
var CLICK_DELAY = 220;
|
|
57
57
|
var CLICK_DRAG_TOLERANCE = 5;
|
|
58
|
+
var SWIPE_MIN = 48;
|
|
59
|
+
var SWIPE_AXIS_RATIO = 2;
|
|
60
|
+
var SWIPE_SCROLL_HINT = 12;
|
|
58
61
|
function gestureHost(e, name) {
|
|
59
62
|
const t = e.target;
|
|
60
63
|
if (!(t instanceof Element)) return null;
|
|
61
|
-
return t.closest(`[data-gestures~="${name}"]`);
|
|
64
|
+
return t.closest(`[data-icen-gestures~="${name}"]`);
|
|
62
65
|
}
|
|
63
66
|
function pointOf(e) {
|
|
64
67
|
return e instanceof MouseEvent || typeof PointerEvent !== "undefined" && e instanceof PointerEvent ? { x: e.clientX, y: e.clientY } : { x: 0, y: 0 };
|
|
@@ -105,7 +108,7 @@ function initGestures() {
|
|
|
105
108
|
return;
|
|
106
109
|
}
|
|
107
110
|
if (isDragRelease(e)) return;
|
|
108
|
-
if (host.matches('[data-gestures~="dblclick"]')) {
|
|
111
|
+
if (host.matches('[data-icen-gestures~="dblclick"]')) {
|
|
109
112
|
if (clickTimer) clearTimeout(clickTimer);
|
|
110
113
|
pending = { host, e };
|
|
111
114
|
clickTimer = setTimeout(() => {
|
|
@@ -160,6 +163,39 @@ function initGestures() {
|
|
|
160
163
|
if (!lp) return;
|
|
161
164
|
if (Math.hypot(e.clientX - lp.x, e.clientY - lp.y) > LONGPRESS_MOVE) clearLp();
|
|
162
165
|
};
|
|
166
|
+
let sw = null;
|
|
167
|
+
const clearSwipe = () => {
|
|
168
|
+
sw = null;
|
|
169
|
+
};
|
|
170
|
+
const onSwipeDown = (e) => {
|
|
171
|
+
const host = gestureHost(e, "swipe");
|
|
172
|
+
if (!host) return;
|
|
173
|
+
sw = { host, x: e.clientX, y: e.clientY, scroll: false };
|
|
174
|
+
};
|
|
175
|
+
const onSwipeMove = (e) => {
|
|
176
|
+
if (!sw) return;
|
|
177
|
+
const adx = Math.abs(e.clientX - sw.x);
|
|
178
|
+
const ady = Math.abs(e.clientY - sw.y);
|
|
179
|
+
if (ady > adx && ady >= SWIPE_SCROLL_HINT) sw.scroll = true;
|
|
180
|
+
};
|
|
181
|
+
const onSwipeUp = (e) => {
|
|
182
|
+
const cur = sw;
|
|
183
|
+
sw = null;
|
|
184
|
+
if (!cur) return;
|
|
185
|
+
const dx = e.clientX - cur.x;
|
|
186
|
+
const dy = e.clientY - cur.y;
|
|
187
|
+
const adx = Math.abs(dx);
|
|
188
|
+
const ady = Math.abs(dy);
|
|
189
|
+
const main = Math.max(adx, ady);
|
|
190
|
+
if (main < SWIPE_MIN) return;
|
|
191
|
+
if (Math.min(adx, ady) * SWIPE_AXIS_RATIO >= main) return;
|
|
192
|
+
let dir;
|
|
193
|
+
if (adx >= ady) dir = dx < 0 ? "left" : "right";
|
|
194
|
+
else dir = dy < 0 ? "up" : "down";
|
|
195
|
+
if (cur.scroll && (dir === "left" || dir === "right")) return;
|
|
196
|
+
const { x, y } = pointOf(e);
|
|
197
|
+
emitIcen(cur.host, `icen:swipe-${dir}`, { source: cur.host, originalEvent: e, x, y, dx, dy });
|
|
198
|
+
};
|
|
163
199
|
const onTextSelect = (e) => {
|
|
164
200
|
const host = gestureHost(e, "text-select");
|
|
165
201
|
if (!host) return;
|
|
@@ -176,6 +212,10 @@ function initGestures() {
|
|
|
176
212
|
document.addEventListener("pointermove", onLpMove);
|
|
177
213
|
document.addEventListener("pointerup", clearLp);
|
|
178
214
|
document.addEventListener("pointercancel", clearLp);
|
|
215
|
+
document.addEventListener("pointerdown", onSwipeDown);
|
|
216
|
+
document.addEventListener("pointermove", onSwipeMove);
|
|
217
|
+
document.addEventListener("pointerup", onSwipeUp);
|
|
218
|
+
document.addEventListener("pointercancel", clearSwipe);
|
|
179
219
|
document.addEventListener("mouseup", onTextSelect);
|
|
180
220
|
gesturesTeardown = () => {
|
|
181
221
|
document.removeEventListener("pointerdown", onDownPos);
|
|
@@ -186,9 +226,14 @@ function initGestures() {
|
|
|
186
226
|
document.removeEventListener("pointermove", onLpMove);
|
|
187
227
|
document.removeEventListener("pointerup", clearLp);
|
|
188
228
|
document.removeEventListener("pointercancel", clearLp);
|
|
229
|
+
document.removeEventListener("pointerdown", onSwipeDown);
|
|
230
|
+
document.removeEventListener("pointermove", onSwipeMove);
|
|
231
|
+
document.removeEventListener("pointerup", onSwipeUp);
|
|
232
|
+
document.removeEventListener("pointercancel", clearSwipe);
|
|
189
233
|
document.removeEventListener("mouseup", onTextSelect);
|
|
190
234
|
cancelPendingClick();
|
|
191
235
|
clearLp();
|
|
236
|
+
clearSwipe();
|
|
192
237
|
gesturesInit = false;
|
|
193
238
|
gesturesTeardown = null;
|
|
194
239
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
interface CountdownState {
|
|
2
|
+
duration: number;
|
|
3
|
+
remaining: number;
|
|
4
|
+
paused: boolean;
|
|
5
|
+
timer: number;
|
|
6
|
+
startedAt: number;
|
|
7
|
+
}
|
|
8
|
+
interface FeedbackClock {
|
|
9
|
+
pause(reason?: string): void;
|
|
10
|
+
resume(reason?: string): void;
|
|
11
|
+
reset(ms: number): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|
|
14
|
+
declare function createFeedbackClock(el: HTMLElement, state: CountdownState, expire: () => void, progress: string, pauseOnHover?: () => boolean): FeedbackClock;
|
|
15
|
+
type FeedbackAction = (signal: AbortSignal) => void | boolean | Promise<void | boolean>;
|
|
16
|
+
/** Cancel the UI continuation and signal cooperative work; stale promises never
|
|
17
|
+
* dismiss a replaced card or resurrect controls after the owner was destroyed. */
|
|
18
|
+
declare function cancelFeedbackAction(card: HTMLElement): void;
|
|
19
|
+
declare function runFeedbackAction(card: HTMLElement, button: HTMLButtonElement, action: FeedbackAction, hooks: {
|
|
20
|
+
busy(value: boolean): void;
|
|
21
|
+
complete(accepted: boolean): void;
|
|
22
|
+
error(error: unknown): void;
|
|
23
|
+
}): void;
|
|
24
|
+
declare function setFeedbackError(host: HTMLElement, message?: string): void;
|
|
25
|
+
/** Isolate caller text from the layout direction (CJK/Latin in an RTL shell). */
|
|
26
|
+
declare function setFeedbackText(host: HTMLElement, value: string): void;
|
|
27
|
+
declare function rememberFeedbackOrigin(card: HTMLElement): void;
|
|
28
|
+
declare function restoreFeedbackFocus(card: HTMLElement): void;
|
|
29
|
+
|
|
30
|
+
export { type CountdownState, type FeedbackAction, type FeedbackClock, cancelFeedbackAction, createFeedbackClock, rememberFeedbackOrigin, restoreFeedbackFocus, runFeedbackAction, setFeedbackError, setFeedbackText };
|