@icen.ai/ui 0.10.0 → 0.11.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 +79 -309
- package/LICENSE +21 -0
- package/README.md +43 -54
- package/dist/base.css +57 -16
- package/dist/behaviors/accordion.mjs +1 -1
- package/dist/behaviors/ai-branch.mjs +1 -0
- package/dist/behaviors/ai-chat.d.mts +2 -2
- package/dist/behaviors/ai-chat.mjs +53 -10
- package/dist/behaviors/ai-composer.d.mts +5 -5
- package/dist/behaviors/ai-composer.mjs +21 -10
- package/dist/behaviors/ai-core.mjs +1 -0
- package/dist/behaviors/ai-diff.mjs +1 -0
- package/dist/behaviors/ai-feedback.mjs +1 -0
- package/dist/behaviors/ai-panel.d.mts +2 -2
- package/dist/behaviors/ai-panel.mjs +1 -0
- package/dist/behaviors/ai-provider.d.mts +1 -1
- package/dist/behaviors/ai-provider.mjs +1 -0
- package/dist/behaviors/ai-threads.mjs +1 -0
- package/dist/behaviors/ai-tool.d.mts +1 -1
- package/dist/behaviors/ai-tool.mjs +57 -24
- package/dist/behaviors/ai-tools.mjs +937 -28
- package/dist/behaviors/autocomplete.d.mts +1 -1
- package/dist/behaviors/autocomplete.mjs +1 -0
- package/dist/behaviors/back-top.mjs +1 -0
- package/dist/behaviors/carousel.mjs +8 -1
- package/dist/behaviors/cascader.mjs +14 -0
- package/dist/behaviors/charts.mjs +56 -20
- package/dist/behaviors/code-block.mjs +9 -1
- package/dist/behaviors/command-palette.mjs +3 -3
- package/dist/behaviors/context-menu.d.mts +2 -2
- package/dist/behaviors/context-menu.mjs +1 -0
- package/dist/behaviors/controls.d.mts +8 -8
- package/dist/behaviors/controls.mjs +37 -6
- package/dist/behaviors/copy.mjs +1 -0
- package/dist/behaviors/datatable.d.mts +3 -3
- package/dist/behaviors/datatable.mjs +76 -11
- package/dist/behaviors/date-picker.mjs +1 -0
- package/dist/behaviors/events.d.mts +10 -10
- package/dist/behaviors/events.mjs +11 -1
- package/dist/behaviors/form-validate.d.mts +10 -1
- package/dist/behaviors/form-validate.mjs +266 -4611
- package/dist/behaviors/i18n.d.mts +1 -0
- package/dist/behaviors/i18n.mjs +2 -0
- package/dist/behaviors/input.mjs +3 -0
- package/dist/behaviors/kb-access.d.mts +2 -2
- package/dist/behaviors/kb-access.mjs +8 -2
- package/dist/behaviors/kb-acl.d.mts +2 -2
- package/dist/behaviors/kb-acl.mjs +1 -0
- package/dist/behaviors/kb-answer.d.mts +2 -2
- package/dist/behaviors/kb-answer.mjs +56 -23
- package/dist/behaviors/kb-audit.d.mts +2 -2
- package/dist/behaviors/kb-audit.mjs +1 -0
- package/dist/behaviors/kb-canvas.d.mts +3 -3
- package/dist/behaviors/kb-canvas.mjs +1 -0
- package/dist/behaviors/kb-chain.d.mts +2 -2
- package/dist/behaviors/kb-chain.mjs +1 -0
- package/dist/behaviors/kb-checkpoint.d.mts +2 -2
- package/dist/behaviors/kb-checkpoint.mjs +1 -0
- package/dist/behaviors/kb-chunks.d.mts +2 -2
- package/dist/behaviors/kb-chunks.mjs +1 -0
- package/dist/behaviors/kb-citation.d.mts +2 -2
- package/dist/behaviors/kb-citation.mjs +20 -6
- package/dist/behaviors/kb-clarify.d.mts +2 -2
- package/dist/behaviors/kb-clarify.mjs +1 -0
- package/dist/behaviors/kb-conflict.d.mts +2 -2
- package/dist/behaviors/kb-conflict.mjs +1 -0
- package/dist/behaviors/kb-connector.d.mts +2 -2
- package/dist/behaviors/kb-connector.mjs +1 -0
- package/dist/behaviors/kb-core.d.mts +1 -1
- package/dist/behaviors/kb-core.mjs +1 -0
- package/dist/behaviors/kb-eval.d.mts +2 -2
- package/dist/behaviors/kb-eval.mjs +8 -2
- package/dist/behaviors/kb-explain.d.mts +2 -2
- package/dist/behaviors/kb-explain.mjs +13 -2
- package/dist/behaviors/kb-filter.d.mts +2 -2
- package/dist/behaviors/kb-filter.mjs +8 -2
- package/dist/behaviors/kb-gap.d.mts +2 -2
- package/dist/behaviors/kb-gap.mjs +1 -0
- package/dist/behaviors/kb-hittest.d.mts +2 -2
- package/dist/behaviors/kb-hittest.mjs +2 -1
- package/dist/behaviors/kb-metadata.mjs +6 -0
- package/dist/behaviors/kb-passage.d.mts +2 -2
- package/dist/behaviors/kb-passage.mjs +1 -0
- package/dist/behaviors/kb-pipeline.d.mts +2 -2
- package/dist/behaviors/kb-pipeline.mjs +1 -0
- package/dist/behaviors/kb-qa.mjs +1 -0
- package/dist/behaviors/kb-rerank.d.mts +2 -2
- package/dist/behaviors/kb-rerank.mjs +1 -0
- package/dist/behaviors/kb-retrieval.d.mts +2 -2
- package/dist/behaviors/kb-retrieval.mjs +18 -4
- package/dist/behaviors/kb-review.d.mts +2 -2
- package/dist/behaviors/kb-review.mjs +8 -2
- package/dist/behaviors/kb-sandbox.d.mts +2 -2
- package/dist/behaviors/kb-sandbox.mjs +7 -1
- package/dist/behaviors/kb-segment.d.mts +2 -2
- package/dist/behaviors/kb-segment.mjs +2 -1
- package/dist/behaviors/kb-select.mjs +8 -2
- package/dist/behaviors/kb-sources.d.mts +2 -2
- package/dist/behaviors/kb-sources.mjs +1 -0
- package/dist/behaviors/kb-sql.d.mts +2 -2
- package/dist/behaviors/kb-sql.mjs +1 -0
- package/dist/behaviors/kb-trace.d.mts +2 -2
- package/dist/behaviors/kb-trace.mjs +9 -3
- package/dist/behaviors/kb-visibility.d.mts +2 -2
- package/dist/behaviors/kb-visibility.mjs +1 -0
- package/dist/behaviors/kb-who-can.d.mts +2 -2
- package/dist/behaviors/kb-who-can.mjs +8 -2
- package/dist/behaviors/mentions.d.mts +1 -1
- package/dist/behaviors/mentions.mjs +1 -0
- package/dist/behaviors/modal.d.mts +1 -1
- package/dist/behaviors/modal.mjs +1 -0
- package/dist/behaviors/notification.d.mts +2 -2
- package/dist/behaviors/notification.mjs +14 -3
- package/dist/behaviors/panel.mjs +1 -0
- package/dist/behaviors/scroll-area.d.mts +17 -0
- package/dist/behaviors/scroll-area.mjs +59 -0
- package/dist/behaviors/select.mjs +8 -2
- package/dist/behaviors/slider.mjs +3 -3
- package/dist/behaviors/split-pane.mjs +2 -0
- package/dist/behaviors/suggestions.mjs +1 -0
- package/dist/behaviors/tabs.mjs +10 -0
- package/dist/behaviors/tag-input.mjs +1 -0
- package/dist/behaviors/theme-switcher.d.mts +2 -2
- package/dist/behaviors/theme-switcher.mjs +17 -2
- package/dist/behaviors/theme.mjs +16 -2
- package/dist/behaviors/toast.d.mts +2 -2
- package/dist/behaviors/toast.mjs +1 -0
- package/dist/behaviors/tree-select.mjs +14 -0
- package/dist/behaviors/tree.mjs +4 -4
- package/dist/behaviors/upload.mjs +1 -0
- package/dist/behaviors/url-safety.d.mts +8 -0
- package/dist/behaviors/url-safety.mjs +11 -0
- package/dist/components/accordion.d.mts +2 -0
- package/dist/components/ai-branch.d.mts +2 -0
- package/dist/components/ai-chat.css +40 -33
- package/dist/components/ai-chat.d.mts +2 -0
- package/dist/components/ai-composer.d.mts +2 -0
- package/dist/components/ai-context.d.mts +2 -0
- package/dist/components/ai-context.mjs +1 -0
- package/dist/components/ai-diff.css +6 -6
- package/dist/components/ai-diff.d.mts +2 -0
- package/dist/components/ai-feedback.d.mts +2 -0
- package/dist/components/ai-files.d.mts +2 -0
- package/dist/components/ai-message.d.mts +2 -0
- package/dist/components/ai-panel.css +12 -10
- package/dist/components/ai-reasoning.d.mts +2 -0
- package/dist/components/ai-subagent.d.mts +2 -0
- package/dist/components/ai-subagent.mjs +1 -0
- package/dist/components/ai-threads.d.mts +2 -0
- package/dist/components/ai-todo.d.mts +2 -0
- package/dist/components/ai-todo.mjs +1 -0
- package/dist/components/ai-tool-call.d.mts +2 -0
- package/dist/components/ai-tool-call.mjs +1 -0
- package/dist/components/ai-tool.css +16 -16
- package/dist/components/ai-usage.d.mts +2 -0
- package/dist/components/alert.d.mts +2 -0
- package/dist/components/autocomplete.css +12 -12
- package/dist/components/autocomplete.d.mts +2 -0
- package/dist/components/avatar.d.mts +2 -0
- package/dist/components/back-top.css +47 -16
- package/dist/components/back-top.d.mts +2 -0
- package/dist/components/badge.css +1 -1
- package/dist/components/badge.d.mts +2 -0
- package/dist/components/breadcrumb.css +26 -8
- package/dist/components/breadcrumb.d.mts +2 -0
- package/dist/components/btn.css +67 -62
- package/dist/components/btn.d.mts +2 -0
- package/dist/components/card.css +22 -22
- package/dist/components/card.d.mts +2 -0
- package/dist/components/carousel.d.mts +2 -0
- package/dist/components/cascader.css +56 -35
- package/dist/components/cascader.d.mts +2 -0
- package/dist/components/chart-area.css +46 -0
- package/dist/components/chart-area.d.mts +2 -0
- package/dist/components/chart-bar.css +66 -19
- package/dist/components/chart-bar.d.mts +2 -0
- package/dist/components/chart-calendar.d.mts +2 -0
- package/dist/components/chart-gauge.css +23 -3
- package/dist/components/chart-gauge.d.mts +2 -0
- package/dist/components/chart-graph.css +15 -3
- package/dist/components/chart-graph.d.mts +2 -0
- package/dist/components/chart-heatmap.css +117 -95
- package/dist/components/chart-heatmap.d.mts +2 -0
- package/dist/components/chart-line.css +54 -0
- package/dist/components/chart-line.d.mts +2 -0
- package/dist/components/chart-map.d.mts +2 -0
- package/dist/components/chart-pie.css +29 -0
- package/dist/components/chart-pie.d.mts +2 -0
- package/dist/components/chart-radar.css +50 -1
- package/dist/components/chart-radar.d.mts +2 -0
- package/dist/components/chart-scatter.css +39 -2
- package/dist/components/chart-scatter.d.mts +2 -0
- package/dist/components/chart-sparkline.css +20 -0
- package/dist/components/chart-sparkline.d.mts +2 -0
- package/dist/components/chart-stack.css +16 -5
- package/dist/components/chart-stack.d.mts +2 -0
- package/dist/components/charts.css +80 -35
- package/dist/components/charts.d.mts +2 -0
- package/dist/components/code-block.css +10 -8
- package/dist/components/code-block.d.mts +2 -0
- package/dist/components/command-palette.css +45 -38
- package/dist/components/command-palette.d.mts +2 -0
- package/dist/components/content.css +62 -57
- package/dist/components/context-menu.d.mts +2 -0
- package/dist/components/copy.css +10 -10
- package/dist/components/copy.d.mts +2 -0
- package/dist/components/datatable.css +72 -59
- package/dist/components/datatable.d.mts +2 -0
- package/dist/components/date-picker.css +26 -26
- package/dist/components/date-picker.d.mts +2 -0
- package/dist/components/desc.d.mts +2 -0
- package/dist/components/dropdown.d.mts +2 -0
- package/dist/components/empty.css +16 -16
- package/dist/components/empty.d.mts +2 -0
- package/dist/components/feedback.css +31 -29
- package/dist/components/form-validate.css +20 -6
- package/dist/components/form-validate.d.mts +2 -0
- package/dist/components/form.css +17 -14
- package/dist/components/form.d.mts +2 -0
- package/dist/components/icon.css +21 -10
- package/dist/components/icon.d.mts +2 -0
- package/dist/components/input.css +22 -22
- package/dist/components/input.d.mts +2 -0
- package/dist/components/kb-access.d.mts +2 -0
- package/dist/components/kb-acl.d.mts +2 -0
- package/dist/components/kb-agent.css +134 -55
- package/dist/components/kb-answer.d.mts +2 -0
- package/dist/components/kb-audit.d.mts +2 -0
- package/dist/components/kb-canvas.d.mts +2 -0
- package/dist/components/kb-chain.d.mts +2 -0
- package/dist/components/kb-checkpoint.d.mts +2 -0
- package/dist/components/kb-chunks.d.mts +2 -0
- package/dist/components/kb-citation.d.mts +2 -0
- package/dist/components/kb-clarify.d.mts +2 -0
- package/dist/components/kb-conflict.d.mts +2 -0
- package/dist/components/kb-connector.d.mts +2 -0
- package/dist/components/kb-data.css +192 -80
- package/dist/components/kb-eval.d.mts +2 -0
- package/dist/components/kb-explain.d.mts +2 -0
- package/dist/components/kb-filter.d.mts +2 -0
- package/dist/components/kb-gap.d.mts +2 -0
- package/dist/components/kb-ground.css +165 -73
- package/dist/components/kb-hittest.d.mts +2 -0
- package/dist/components/kb-ingest.css +308 -113
- package/dist/components/kb-metadata.d.mts +2 -0
- package/dist/components/kb-ops.css +189 -75
- package/dist/components/kb-passage.d.mts +2 -0
- package/dist/components/kb-perm.css +158 -87
- package/dist/components/kb-pipeline.d.mts +2 -0
- package/dist/components/kb-qa.d.mts +2 -0
- package/dist/components/kb-rerank.d.mts +2 -0
- package/dist/components/kb-retrieval.d.mts +2 -0
- package/dist/components/kb-review.d.mts +2 -0
- package/dist/components/kb-sandbox.d.mts +2 -0
- package/dist/components/kb-search.css +353 -116
- package/dist/components/kb-segment.d.mts +2 -0
- package/dist/components/kb-sources.d.mts +2 -0
- package/dist/components/kb-sql.d.mts +2 -0
- package/dist/components/kb-trace.d.mts +2 -0
- package/dist/components/kb-visibility.d.mts +2 -0
- package/dist/components/kb-who-can.d.mts +2 -0
- package/dist/components/kb.css +60 -36
- package/dist/components/kb.d.mts +2 -0
- package/dist/components/kbd.d.mts +2 -0
- package/dist/components/layout.css +10 -10
- package/dist/components/layout.d.mts +2 -0
- package/dist/components/list.d.mts +2 -0
- package/dist/components/material-chinese.css +10 -0
- package/dist/components/material-soviet.css +10 -0
- package/dist/components/material.css +61 -18
- package/dist/components/media-card.d.mts +2 -0
- package/dist/components/media.css +22 -27
- package/dist/components/mentions.css +18 -17
- package/dist/components/mentions.d.mts +2 -0
- package/dist/components/menu.css +32 -28
- package/dist/components/modal.css +30 -27
- package/dist/components/modal.d.mts +2 -0
- package/dist/components/nav.css +48 -44
- package/dist/components/nav.d.mts +2 -0
- package/dist/components/notification.css +31 -25
- package/dist/components/notification.d.mts +2 -0
- package/dist/components/pagination.css +15 -13
- package/dist/components/pagination.d.mts +2 -0
- package/dist/components/panel.css +19 -20
- package/dist/components/panel.d.mts +2 -0
- package/dist/components/pill.css +8 -7
- package/dist/components/pill.d.mts +2 -0
- package/dist/components/popover.css +32 -23
- package/dist/components/popover.d.mts +2 -0
- package/dist/components/progress.d.mts +2 -0
- package/dist/components/rating.d.mts +2 -0
- package/dist/components/result.d.mts +2 -0
- package/dist/components/scroll-area.css +84 -112
- package/dist/components/scroll-area.d.mts +2 -0
- package/dist/components/scroll-area.mjs +1 -0
- package/dist/components/segmented.css +47 -29
- package/dist/components/segmented.d.mts +2 -0
- package/dist/components/select.css +80 -41
- package/dist/components/select.d.mts +2 -0
- package/dist/components/sidebar.css +42 -38
- package/dist/components/sidebar.d.mts +2 -0
- package/dist/components/skeleton.d.mts +2 -0
- package/dist/components/slider.css +26 -22
- package/dist/components/slider.d.mts +2 -0
- package/dist/components/spinner.d.mts +2 -0
- package/dist/components/split-pane.css +16 -7
- package/dist/components/split-pane.d.mts +2 -0
- package/dist/components/stat.css +17 -16
- package/dist/components/stat.d.mts +2 -0
- package/dist/components/steps.css +26 -26
- package/dist/components/steps.d.mts +2 -0
- package/dist/components/switch.css +78 -39
- package/dist/components/switch.d.mts +2 -0
- package/dist/components/table.css +54 -32
- package/dist/components/table.d.mts +2 -0
- package/dist/components/tabs.css +53 -32
- package/dist/components/tabs.d.mts +2 -0
- package/dist/components/tag-input.css +12 -8
- package/dist/components/tag-input.d.mts +2 -0
- package/dist/components/tag.css +20 -12
- package/dist/components/tag.d.mts +2 -0
- package/dist/components/theme-switcher.css +7 -7
- package/dist/components/theme-switcher.d.mts +2 -0
- package/dist/components/timeline.d.mts +2 -0
- package/dist/components/toast.css +34 -30
- package/dist/components/toast.d.mts +2 -0
- package/dist/components/toolbar.css +19 -18
- package/dist/components/toolbar.d.mts +2 -0
- package/dist/components/tooltip.css +9 -8
- package/dist/components/tooltip.d.mts +2 -0
- package/dist/components/tree-select.css +63 -40
- package/dist/components/tree-select.d.mts +2 -0
- package/dist/components/tree.d.mts +2 -0
- package/dist/components/upload.css +9 -11
- package/dist/components/upload.d.mts +2 -0
- package/dist/index.d.mts +85 -84
- package/dist/index.mjs +14764 -14311
- package/dist/react.d.mts +18 -18
- package/dist/react.mjs +135 -36
- package/dist/registry.json +795 -64
- package/dist/tokens/colors.css +6 -0
- package/dist/tokens/design.css +130 -30
- package/dist/tokens/dtcg.json +6189 -1461
- package/dist/tokens/figma.variables.json +4107 -345
- package/dist/tokens/pixel.css +3 -0
- package/dist/tokens/scrollbars.css +40 -0
- package/dist/tokens/tokens-studio.json +5191 -271
- package/dist/tokens.css +304 -81
- package/dist/ui.css +4050 -2148
- package/dist/vue.d.mts +17 -17
- package/dist/vue.mjs +129 -34
- package/docs/spec/design-philosophy.md +5 -5
- package/docs/spec/design-primitives.md +10 -10
- package/docs/spec/scrollbars.md +46 -0
- package/package.json +16 -3
package/dist/behaviors/i18n.mjs
CHANGED
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -856,6 +857,7 @@ var ICEN_LOCALE_EN_US = {
|
|
|
856
857
|
"aiChat.roleTool": "Tool",
|
|
857
858
|
"aiChat.roleUser": "Me",
|
|
858
859
|
"aiChat.thinking": "Thinking {p0}",
|
|
860
|
+
"aiChat.thinkingNow": "Thinking\u2026",
|
|
859
861
|
/* ── aiComposer ── */
|
|
860
862
|
"aiComposer.attachAgent": "Agent",
|
|
861
863
|
"aiComposer.library": "Add context and commands",
|
package/dist/behaviors/input.mjs
CHANGED
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1034,6 +1035,7 @@ function setupClear(wrap) {
|
|
|
1034
1035
|
const field = wrap.querySelector("input.icen-input, textarea.icen-textarea");
|
|
1035
1036
|
if (!btn || !field) return;
|
|
1036
1037
|
btn.addEventListener("click", () => {
|
|
1038
|
+
if (field.disabled || field.readOnly) return;
|
|
1037
1039
|
field.value = "";
|
|
1038
1040
|
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
1039
1041
|
field.focus();
|
|
@@ -1242,6 +1244,7 @@ function setupOtp(group) {
|
|
|
1242
1244
|
syncFilled(target);
|
|
1243
1245
|
}
|
|
1244
1246
|
cells[Math.min(i + text.length, cells.length - 1)].focus();
|
|
1247
|
+
fireComplete();
|
|
1245
1248
|
});
|
|
1246
1249
|
});
|
|
1247
1250
|
const fireComplete = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { KbAccessRequest, KbAccessState, KbRole } from './kb-core.
|
|
2
|
-
import './ai-core.
|
|
1
|
+
import { KbAccessRequest, KbAccessState, KbRole } from './kb-core.mjs';
|
|
2
|
+
import './ai-core.mjs';
|
|
3
3
|
|
|
4
4
|
/** createKbAccess 入参(spec §9.3;request 宽进——素对象经 normalizeAccessRequest 归一) */
|
|
5
5
|
interface KbAccessOpts {
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1448,8 +1449,13 @@ function setup(container) {
|
|
|
1448
1449
|
el.__icenSelectInit = true;
|
|
1449
1450
|
const trigger = triggerEl;
|
|
1450
1451
|
const panel = panelEl;
|
|
1451
|
-
|
|
1452
|
-
|
|
1452
|
+
if (!trigger.querySelector(".icen-select-chevron")) {
|
|
1453
|
+
const chevron = createIcon("chevron-down", { size: 12, className: "icen-select-chevron" });
|
|
1454
|
+
if (chevron) {
|
|
1455
|
+
chevron.setAttribute("aria-hidden", "true");
|
|
1456
|
+
trigger.append(chevron);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1453
1459
|
const isMultiple = container.hasAttribute("data-icen-select-multiple");
|
|
1454
1460
|
const isSearchable = container.hasAttribute("data-icen-select-search");
|
|
1455
1461
|
if (isMultiple && !trigger.hasAttribute("aria-label") && !trigger.hasAttribute("aria-labelledby")) trigger.setAttribute("aria-label", container.getAttribute("data-icen-select-label") ?? t("select.fieldLabel"));
|
|
@@ -122,6 +122,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
122
122
|
"aiChat.roleTool": "\u5DE5",
|
|
123
123
|
"aiChat.roleUser": "\u6211",
|
|
124
124
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
125
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
125
126
|
/* ── aiComposer ── */
|
|
126
127
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
127
128
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { KbAnswerKind, KbVerifiedVia, KbCitation, KbClarification, KbExplainFact, KbPermissionNotice, KbQueryResult } from './kb-core.
|
|
2
|
-
import './ai-core.
|
|
1
|
+
import { KbAnswerKind, KbVerifiedVia, KbCitation, KbClarification, KbExplainFact, KbPermissionNotice, KbQueryResult } from './kb-core.mjs';
|
|
2
|
+
import './ai-core.mjs';
|
|
3
3
|
|
|
4
4
|
/** 问数答案的组合模型(各槽位有才渲;共享类型一律 import 自 kb-core) */
|
|
5
5
|
interface KbAnswerModel {
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1216,6 +1217,15 @@ function renderKbClarify(el, c, opts) {
|
|
|
1216
1217
|
return el;
|
|
1217
1218
|
}
|
|
1218
1219
|
|
|
1220
|
+
// src/behaviors/url-safety.ts
|
|
1221
|
+
function safeUrl(uri) {
|
|
1222
|
+
const s = uri.replace(/[\t\n\r\0-\x1f\x7f]/g, "").trim().toLowerCase();
|
|
1223
|
+
if (!s) return void 0;
|
|
1224
|
+
if (s.startsWith("javascript:") || s.startsWith("vbscript:")) return void 0;
|
|
1225
|
+
if (/^data:\s*text\/html/.test(s)) return void 0;
|
|
1226
|
+
return uri;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1219
1229
|
// src/behaviors/kb-explain.ts
|
|
1220
1230
|
function toExplainFact(raw) {
|
|
1221
1231
|
const r = raw ?? {};
|
|
@@ -1276,9 +1286,10 @@ function renderKbExplain(el, fact) {
|
|
|
1276
1286
|
const row = h("div", "icen-kb-explain-metric");
|
|
1277
1287
|
row.appendChild(h("span", "icen-kb-explain-metric-name", m.name));
|
|
1278
1288
|
if (m.ref) {
|
|
1279
|
-
|
|
1289
|
+
const href = safeUrl(m.ref);
|
|
1290
|
+
if (href) {
|
|
1280
1291
|
const a = h("a", "icen-kb-explain-metric-ref", t("kbExplain.viewDefinition"));
|
|
1281
|
-
a.href =
|
|
1292
|
+
a.href = href;
|
|
1282
1293
|
a.rel = "noopener";
|
|
1283
1294
|
row.appendChild(a);
|
|
1284
1295
|
}
|
|
@@ -1521,7 +1532,8 @@ function withChrome(el, opts, hasLegend, paint, state, extras) {
|
|
|
1521
1532
|
emitIcen(el, "icen:chart-legend-visibility", { visible: hidden ? false : true });
|
|
1522
1533
|
});
|
|
1523
1534
|
syncEye();
|
|
1524
|
-
head.append(title, eye);
|
|
1535
|
+
if (hasLegend) head.append(title, eye);
|
|
1536
|
+
else head.append(title);
|
|
1525
1537
|
el.append(head, body);
|
|
1526
1538
|
paint(body);
|
|
1527
1539
|
}
|
|
@@ -1622,7 +1634,7 @@ function renderVBar(el, opts) {
|
|
|
1622
1634
|
wrap.appendChild(track);
|
|
1623
1635
|
}
|
|
1624
1636
|
body.append(wrap, labelsRow(labelsUsed));
|
|
1625
|
-
if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: s.name
|
|
1637
|
+
if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: `${si}:${s.name}`, label: s.name, tone: s.tone ?? (si === 0 ? opts.tone : void 0), si })), wrap));
|
|
1626
1638
|
});
|
|
1627
1639
|
attachChartInteraction(el, "vbar");
|
|
1628
1640
|
return el;
|
|
@@ -1717,8 +1729,10 @@ function renderDonut(el, opts) {
|
|
|
1717
1729
|
"stroke-width": "14"
|
|
1718
1730
|
}));
|
|
1719
1731
|
let offset = 0;
|
|
1732
|
+
const gap = opts.segments.length > 1 ? 2.5 : 0;
|
|
1720
1733
|
opts.segments.forEach((seg, segIndex) => {
|
|
1721
|
-
const
|
|
1734
|
+
const arcLength = Math.max(0, seg.value / total * circumference);
|
|
1735
|
+
const dash = arcLength - Math.min(gap, arcLength * 0.1);
|
|
1722
1736
|
const arc = svgEl("circle", {
|
|
1723
1737
|
cx: "60",
|
|
1724
1738
|
cy: "60",
|
|
@@ -1732,7 +1746,7 @@ function renderDonut(el, opts) {
|
|
|
1732
1746
|
});
|
|
1733
1747
|
setMarkData(arc, { index: segIndex, label: seg.label, value: seg.value });
|
|
1734
1748
|
svg.appendChild(arc);
|
|
1735
|
-
offset +=
|
|
1749
|
+
offset += arcLength;
|
|
1736
1750
|
});
|
|
1737
1751
|
const legend = document.createElement("div");
|
|
1738
1752
|
legend.className = "icen-chart-legend";
|
|
@@ -1767,8 +1781,9 @@ function renderLine(el, opts) {
|
|
|
1767
1781
|
const svg = svgEl("svg", { viewBox: `0 0 ${width} ${height}`, role: "img", "aria-label": chartAriaLabel(opts.title, t("charts.type.line")) });
|
|
1768
1782
|
const defs = svgEl("defs", {});
|
|
1769
1783
|
for (let i = 0; i < 4; i++) {
|
|
1770
|
-
const y = pad + i * (height - pad * 2) / 3;
|
|
1784
|
+
const y = Math.round(pad + i * (height - pad * 2) / 3) + 0.5;
|
|
1771
1785
|
svg.appendChild(svgEl("line", {
|
|
1786
|
+
class: i === 3 ? "icen-chart-grid icen-chart-baseline" : "icen-chart-grid",
|
|
1772
1787
|
x1: String(pad),
|
|
1773
1788
|
x2: String(width - pad),
|
|
1774
1789
|
y1: String(y),
|
|
@@ -1852,7 +1867,7 @@ function renderLine(el, opts) {
|
|
|
1852
1867
|
if (defs.firstChild) svg.insertBefore(defs, svg.firstChild);
|
|
1853
1868
|
wrap.append(svg, pointLabelsRow(labelsUsed, width, pad));
|
|
1854
1869
|
body.appendChild(wrap);
|
|
1855
|
-
if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: s.name
|
|
1870
|
+
if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: `${si}:${s.name}`, label: s.name, tone: s.tone ?? (si === 0 ? opts.tone : void 0), si })), wrap));
|
|
1856
1871
|
});
|
|
1857
1872
|
if (el.dataset.icenChartBody == null) observeFluidWidth(el, () => renderLine(el, opts));
|
|
1858
1873
|
attachChartInteraction(el, "line");
|
|
@@ -1959,7 +1974,7 @@ function renderRadar(el, opts) {
|
|
|
1959
1974
|
setMarkData(dot, { index: i, seriesIndex: si, seriesName: s.name || void 0, label: axes[i] ?? "", value: s.values[i] ?? 0 });
|
|
1960
1975
|
svg.appendChild(dot);
|
|
1961
1976
|
}
|
|
1962
|
-
legendItems.push({ key: s.name || t("charts.seriesName", { p0: si + 1 })
|
|
1977
|
+
legendItems.push({ key: `${si}:${s.name || t("charts.seriesName", { p0: si + 1 })}`, label: s.name || t("charts.seriesName", { p0: si + 1 }), tone: s.tone, si });
|
|
1963
1978
|
});
|
|
1964
1979
|
wrap.appendChild(svg);
|
|
1965
1980
|
body.appendChild(wrap);
|
|
@@ -1981,6 +1996,11 @@ function niceCeil(v) {
|
|
|
1981
1996
|
else nice = 10;
|
|
1982
1997
|
return nice * base;
|
|
1983
1998
|
}
|
|
1999
|
+
function tickPrecision(min, max, steps) {
|
|
2000
|
+
const span = Math.abs(max - min);
|
|
2001
|
+
if (!Number.isFinite(span) || span <= 0) return 0;
|
|
2002
|
+
return Math.max(0, Math.ceil(-Math.log10(span / steps)));
|
|
2003
|
+
}
|
|
1984
2004
|
function isoDate(d) {
|
|
1985
2005
|
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
1986
2006
|
const day = String(d.getDate()).padStart(2, "0");
|
|
@@ -2076,7 +2096,8 @@ function renderSparkline(el, opts) {
|
|
|
2076
2096
|
const tone = toneVar(opts.tone);
|
|
2077
2097
|
const points = values.map((value, i) => ({
|
|
2078
2098
|
x: values.length <= 1 ? width / 2 : pad + i / (values.length - 1) * (width - pad * 2),
|
|
2079
|
-
|
|
2099
|
+
/* 负值钳到基线(与折线图同口径):viewBox 仅 28 高,反向射出更刺眼 */
|
|
2100
|
+
y: height - pad - Math.max(0, value) / max * (height - pad * 2),
|
|
2080
2101
|
value
|
|
2081
2102
|
}));
|
|
2082
2103
|
const line = points.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(1)},${p.y.toFixed(1)}`).join(" ");
|
|
@@ -2201,6 +2222,7 @@ function renderCalendar(el, opts) {
|
|
|
2201
2222
|
weekdayRow.appendChild(s);
|
|
2202
2223
|
});
|
|
2203
2224
|
const max = maxOf(entries.map((e) => e.value));
|
|
2225
|
+
entries.sort((a, b) => a.date.localeCompare(b.date));
|
|
2204
2226
|
const pad = padFirstWeek(grid, entries[0].date, weekStart);
|
|
2205
2227
|
let lastMonth = -1;
|
|
2206
2228
|
entries.forEach((entry, i) => {
|
|
@@ -2259,8 +2281,9 @@ function renderScatter(el, opts) {
|
|
|
2259
2281
|
const xAt = (x) => pad + (x - xMin) / (xMax - xMin) * (width - pad * 2);
|
|
2260
2282
|
const yAt = (y) => height - pad - (y - yMin) / (yMax - yMin) * (height - pad * 2);
|
|
2261
2283
|
for (let i = 0; i <= 3; i++) {
|
|
2262
|
-
const y = pad + i * (height - pad * 2) / 3;
|
|
2284
|
+
const y = Math.round(pad + i * (height - pad * 2) / 3) + 0.5;
|
|
2263
2285
|
svg.appendChild(svgEl("line", {
|
|
2286
|
+
class: i === 3 ? "icen-chart-grid icen-chart-baseline" : "icen-chart-grid",
|
|
2264
2287
|
x1: String(pad),
|
|
2265
2288
|
x2: String(width - pad),
|
|
2266
2289
|
y1: String(y),
|
|
@@ -2276,12 +2299,13 @@ function renderScatter(el, opts) {
|
|
|
2276
2299
|
"font-size": "8",
|
|
2277
2300
|
fill: "var(--icen-token-text-faint)"
|
|
2278
2301
|
});
|
|
2279
|
-
txt.textContent = fmt(opts,
|
|
2302
|
+
txt.textContent = fmt(opts, +tv.toFixed(tickPrecision(yMin, yMax, 3)));
|
|
2280
2303
|
svg.appendChild(txt);
|
|
2281
2304
|
}
|
|
2282
2305
|
for (let i = 0; i <= 4; i++) {
|
|
2283
|
-
const x = pad + i * (width - pad * 2) / 4;
|
|
2306
|
+
const x = Math.round(pad + i * (width - pad * 2) / 4) + 0.5;
|
|
2284
2307
|
svg.appendChild(svgEl("line", {
|
|
2308
|
+
class: i === 0 ? "icen-chart-grid icen-chart-grid--v icen-chart-axis" : "icen-chart-grid icen-chart-grid--v",
|
|
2285
2309
|
x1: String(x),
|
|
2286
2310
|
x2: String(x),
|
|
2287
2311
|
y1: String(pad),
|
|
@@ -2298,7 +2322,7 @@ function renderScatter(el, opts) {
|
|
|
2298
2322
|
"font-size": "8",
|
|
2299
2323
|
fill: "var(--icen-token-text-faint)"
|
|
2300
2324
|
});
|
|
2301
|
-
txt.textContent = fmt(opts,
|
|
2325
|
+
txt.textContent = fmt(opts, +tv.toFixed(tickPrecision(xMin, xMax, 4)));
|
|
2302
2326
|
svg.appendChild(txt);
|
|
2303
2327
|
}
|
|
2304
2328
|
if (opts.yLabel) {
|
|
@@ -2662,6 +2686,7 @@ function renderChartSkeleton(body) {
|
|
|
2662
2686
|
body.appendChild(box);
|
|
2663
2687
|
}
|
|
2664
2688
|
var CHART_MARK_ACCENT = "var(--icen-token-accent)";
|
|
2689
|
+
var CHART_MARK_ACCENT_TEXT = "var(--icen-token-accent-text)";
|
|
2665
2690
|
function markToneVar(tone) {
|
|
2666
2691
|
switch (tone) {
|
|
2667
2692
|
case "success":
|
|
@@ -2797,7 +2822,7 @@ function paintSvgChartMarks(root, view, marks, formatValue, warned) {
|
|
|
2797
2822
|
y: String(clampNum(y - 10, 8, CHART_LINE_H - 4)),
|
|
2798
2823
|
"text-anchor": "middle",
|
|
2799
2824
|
"font-size": "8",
|
|
2800
|
-
fill:
|
|
2825
|
+
fill: CHART_MARK_ACCENT_TEXT
|
|
2801
2826
|
});
|
|
2802
2827
|
label.textContent = mark.text ?? mark.label;
|
|
2803
2828
|
g.appendChild(label);
|
|
@@ -3355,6 +3380,12 @@ function renderChart(el, raw) {
|
|
|
3355
3380
|
const graphic = root.querySelector('[role="img"]');
|
|
3356
3381
|
if (graphic && !graphic.getAttribute("aria-label")) {
|
|
3357
3382
|
graphic.setAttribute("aria-label", spec.title ? `${spec.title}\uFF08${type}\uFF09` : type);
|
|
3383
|
+
} else if (!graphic) {
|
|
3384
|
+
const dom = root.querySelector(".icen-chart-vbar, .icen-chart-hbar");
|
|
3385
|
+
if (dom) {
|
|
3386
|
+
dom.setAttribute("role", "img");
|
|
3387
|
+
dom.setAttribute("aria-label", spec.title ? `${spec.title}\uFF08${type}\uFF09` : type);
|
|
3388
|
+
}
|
|
3358
3389
|
}
|
|
3359
3390
|
}
|
|
3360
3391
|
if (loading) return;
|
|
@@ -3507,15 +3538,17 @@ function renderPermissionNotice(p) {
|
|
|
3507
3538
|
function renderBody(text, citations) {
|
|
3508
3539
|
const box = h("div", "icen-kb-answer-body");
|
|
3509
3540
|
for (const seg of parseInlineCitations(text)) {
|
|
3510
|
-
if (typeof seg.n === "number" && citations
|
|
3511
|
-
const
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3541
|
+
if (typeof seg.n === "number" && citations) {
|
|
3542
|
+
const c = citations.find((x) => x.index === seg.n) ?? (seg.n >= 1 && seg.n <= citations.length ? citations[seg.n - 1] : void 0);
|
|
3543
|
+
if (c) {
|
|
3544
|
+
const sup = h("sup", "icen-kb-citation", `[${seg.n}]`);
|
|
3545
|
+
sup.dataset.icenCite = String(seg.n);
|
|
3546
|
+
if (c.title) sup.title = c.title;
|
|
3547
|
+
box.appendChild(sup);
|
|
3548
|
+
continue;
|
|
3549
|
+
}
|
|
3518
3550
|
}
|
|
3551
|
+
box.appendChild(document.createTextNode(seg.text));
|
|
3519
3552
|
}
|
|
3520
3553
|
return box;
|
|
3521
3554
|
}
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KbCanvasVersion } from './kb-core.
|
|
2
|
-
import { renderAiDiff } from './ai-diff.
|
|
3
|
-
import './ai-core.
|
|
1
|
+
import { KbCanvasVersion } from './kb-core.mjs';
|
|
2
|
+
import { renderAiDiff } from './ai-diff.mjs';
|
|
3
|
+
import './ai-core.mjs';
|
|
4
4
|
|
|
5
5
|
interface KbCanvasOptions {
|
|
6
6
|
/** 左栏最小占比(同时约束右栏 1-minRatio);默认 0.2,钳制到 [0.05, 0.5] */
|
|
@@ -57,6 +57,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
57
57
|
"aiChat.roleTool": "\u5DE5",
|
|
58
58
|
"aiChat.roleUser": "\u6211",
|
|
59
59
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
60
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
60
61
|
/* ── aiComposer ── */
|
|
61
62
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
62
63
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -122,6 +122,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
122
122
|
"aiChat.roleTool": "\u5DE5",
|
|
123
123
|
"aiChat.roleUser": "\u6211",
|
|
124
124
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
125
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
125
126
|
/* ── aiComposer ── */
|
|
126
127
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
127
128
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1505,6 +1506,7 @@ function kbDomainOf(url) {
|
|
|
1505
1506
|
}
|
|
1506
1507
|
}
|
|
1507
1508
|
var registrySources = [];
|
|
1509
|
+
var rootPools = /* @__PURE__ */ new WeakMap();
|
|
1508
1510
|
function setKbCitationSources(sources) {
|
|
1509
1511
|
registrySources = Array.isArray(sources) ? sources.map(normalizeCitation) : [];
|
|
1510
1512
|
}
|
|
@@ -1543,7 +1545,10 @@ function citationMark(n, pool) {
|
|
|
1543
1545
|
function renderCitationText(el, text, sources) {
|
|
1544
1546
|
if (typeof document === "undefined") return el;
|
|
1545
1547
|
const pool = sources && sources.length ? sources.map(normalizeCitation) : void 0;
|
|
1546
|
-
if (pool)
|
|
1548
|
+
if (pool) {
|
|
1549
|
+
setKbCitationSources(pool);
|
|
1550
|
+
rootPools.set(el, pool);
|
|
1551
|
+
}
|
|
1547
1552
|
el.textContent = "";
|
|
1548
1553
|
for (const seg of parseInlineCitations(text ?? "")) {
|
|
1549
1554
|
if (typeof seg.n === "number") el.appendChild(citationMark(seg.n, pool));
|
|
@@ -1620,9 +1625,18 @@ function initKbCitation(root, opts) {
|
|
|
1620
1625
|
if (initedScopes.has(key)) return () => void 0;
|
|
1621
1626
|
initedScopes.add(key);
|
|
1622
1627
|
const target = scope;
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1625
|
-
|
|
1628
|
+
const poolFor = (mark) => {
|
|
1629
|
+
if (opts?.sources && opts.sources.length) return opts.sources;
|
|
1630
|
+
let cur = mark;
|
|
1631
|
+
while (cur) {
|
|
1632
|
+
const pool = rootPools.get(cur);
|
|
1633
|
+
if (pool && pool.length) return pool;
|
|
1634
|
+
cur = cur.parentElement;
|
|
1635
|
+
}
|
|
1636
|
+
return registrySources;
|
|
1637
|
+
};
|
|
1638
|
+
const cardDataFor = (mark, n) => {
|
|
1639
|
+
const found = lookupCitation(poolFor(mark), n) ?? null;
|
|
1626
1640
|
if (opts?.getCard) return opts.getCard(found ?? syntheticCitation(n)) ?? found;
|
|
1627
1641
|
return found;
|
|
1628
1642
|
};
|
|
@@ -1633,7 +1647,7 @@ function initKbCitation(root, opts) {
|
|
|
1633
1647
|
const showCard = (mark) => {
|
|
1634
1648
|
const n = citeNum(mark);
|
|
1635
1649
|
if (n < 1) return;
|
|
1636
|
-
const data = cardDataFor(n);
|
|
1650
|
+
const data = cardDataFor(mark, n);
|
|
1637
1651
|
if (!data) return;
|
|
1638
1652
|
const panel = buildCitationCard(data, /* @__PURE__ */ new Date());
|
|
1639
1653
|
hover.panel = panel;
|
|
@@ -1655,7 +1669,7 @@ function initKbCitation(root, opts) {
|
|
|
1655
1669
|
const n = citeNum(mark);
|
|
1656
1670
|
if (n < 1) return;
|
|
1657
1671
|
closeHoverCard();
|
|
1658
|
-
const citation = cardDataFor(n) ?? lookupCitation(
|
|
1672
|
+
const citation = cardDataFor(mark, n) ?? lookupCitation(poolFor(mark), n) ?? syntheticCitation(n);
|
|
1659
1673
|
emitIcen(mark, "icen:kb-citation-open", { citation });
|
|
1660
1674
|
};
|
|
1661
1675
|
const onPointerOver = (e) => {
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -14,6 +14,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
14
14
|
"aiChat.roleTool": "\u5DE5",
|
|
15
15
|
"aiChat.roleUser": "\u6211",
|
|
16
16
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
17
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
17
18
|
/* ── aiComposer ── */
|
|
18
19
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
19
20
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1379,8 +1380,13 @@ function setup(container) {
|
|
|
1379
1380
|
el.__icenSelectInit = true;
|
|
1380
1381
|
const trigger = triggerEl;
|
|
1381
1382
|
const panel = panelEl;
|
|
1382
|
-
|
|
1383
|
-
|
|
1383
|
+
if (!trigger.querySelector(".icen-select-chevron")) {
|
|
1384
|
+
const chevron = createIcon("chevron-down", { size: 12, className: "icen-select-chevron" });
|
|
1385
|
+
if (chevron) {
|
|
1386
|
+
chevron.setAttribute("aria-hidden", "true");
|
|
1387
|
+
trigger.append(chevron);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1384
1390
|
const isMultiple = container.hasAttribute("data-icen-select-multiple");
|
|
1385
1391
|
const isSearchable = container.hasAttribute("data-icen-select-search");
|
|
1386
1392
|
if (isMultiple && !trigger.hasAttribute("aria-label") && !trigger.hasAttribute("aria-labelledby")) trigger.setAttribute("aria-label", container.getAttribute("data-icen-select-label") ?? t("select.fieldLabel"));
|