@freecallai/pro 0.0.2 → 0.0.3

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.
Files changed (116) hide show
  1. package/README.md +23 -17
  2. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-xR8ZhhdJ.js +187 -0
  3. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js +4864 -0
  4. package/dist/KnowledgeArea-_rsydhnt.js +1438 -0
  5. package/dist/{ToolForm-BSJxTJ7U.js → ToolForm-Czg67cDT.js} +1 -1
  6. package/dist/{choice-DDg5gNtS.js → choice-Bt2xhoN_.js} +1 -1
  7. package/dist/edition-info/index.js +4 -0
  8. package/dist/filters/index.js +7 -0
  9. package/dist/guard-B7U3S4F1.js +1163 -0
  10. package/dist/{index-D8bcFtWR.js → index-9NM1SHoR.js} +1 -1
  11. package/dist/index-B4-2_sJI.js +10 -0
  12. package/dist/{index-BnFTr8u9.js → index-BBv72oZe.js} +10 -10
  13. package/dist/index-BF6MRSMb.js +6 -0
  14. package/dist/index-BQrYBmwR.js +5 -0
  15. package/dist/index-CS2xQQ8W.js +168 -0
  16. package/dist/index-D0bJAQSN.js +327 -0
  17. package/dist/index-D9yqpH_4.js +57 -0
  18. package/dist/index-DCmHHi07.js +71 -0
  19. package/dist/index-DYeJRJY1.js +6 -0
  20. package/dist/{index-CJlAseSN.js → index-DnaEbb6l.js} +1 -1
  21. package/dist/{index-DSgEWJGP.js → index-Dy2Gy3bL.js} +1 -1
  22. package/dist/index-lNhA3N9x.js +379 -0
  23. package/dist/{index-CG2j9Znw.js → index-sjDmbR5o.js} +1 -1
  24. package/dist/index-trxE5T0w.js +6 -0
  25. package/dist/index-uCVrA6xK.js +5 -0
  26. package/dist/index.js +36 -11
  27. package/dist/inline-KPGqYMIR.js +19 -0
  28. package/dist/knowledge-CupkY2rK.js +6 -0
  29. package/dist/{knowledge-DnYGicjn.js → knowledge-DzwXQR-q.js} +1 -1
  30. package/dist/knowledge-type-picker/index.js +5 -0
  31. package/dist/media-extensions-DhRlLKYM.js +321 -0
  32. package/dist/{media-migration-Cj-3xrxd.js → media-migration-CbMT2wS0.js} +1 -1
  33. package/dist/{media-upload-D7DpMJYx.js → media-upload-P9WeUHHr.js} +1 -1
  34. package/dist/navigation/index.js +4 -0
  35. package/dist/operations-D8pn-_iW.js +20 -0
  36. package/dist/{question-DGC6JHy5.js → question-C7akkjHn.js} +1 -1
  37. package/dist/{question-D1--acV8.js → question-DXZ8R-34.js} +1 -1
  38. package/dist/rich-text/index.js +57 -53
  39. package/dist/rich-text/legacy-converter/index.js +1129 -643
  40. package/dist/style.css +1 -1
  41. package/dist/switcher/index.js +4 -0
  42. package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +5 -0
  43. package/dist/types/edition-info/index.d.ts +2 -0
  44. package/dist/types/edition-info/types.d.ts +5 -0
  45. package/dist/types/filters/FkpFilter.vue.d.ts +20 -0
  46. package/dist/types/filters/FkpFilterDateRange.vue.d.ts +13 -0
  47. package/dist/types/filters/FkpFilterPeriod.vue.d.ts +17 -0
  48. package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +44 -0
  49. package/dist/types/filters/index.d.ts +5 -0
  50. package/dist/types/filters/selection.d.ts +5 -0
  51. package/dist/types/filters/types.d.ts +30 -0
  52. package/dist/types/index.d.ts +7 -1
  53. package/dist/types/knowledge-type-picker/index.d.ts +3 -0
  54. package/dist/types/navigation/FkpNavigation.vue.d.ts +51 -0
  55. package/dist/types/navigation/index.d.ts +2 -0
  56. package/dist/types/navigation/types.d.ts +15 -0
  57. package/dist/types/rich-text/FkpRichText.vue.d.ts +18 -5
  58. package/dist/types/rich-text/__demo__/conversion-fixtures.d.ts +2 -2
  59. package/dist/types/rich-text/__demo__/reasoning-template-examples.d.ts +2 -3
  60. package/dist/types/rich-text/config/descriptor.d.ts +25 -2
  61. package/dist/types/rich-text/config/resolve.d.ts +2 -0
  62. package/dist/types/rich-text/index.d.ts +3 -1
  63. package/dist/types/rich-text/legacy-converter/agent-prompt-preview.d.ts +2 -0
  64. package/dist/types/rich-text/legacy-converter/business-attribute.d.ts +9 -29
  65. package/dist/types/rich-text/legacy-converter/index.d.ts +8 -1
  66. package/dist/types/rich-text/legacy-converter/tool-contract.d.ts +1 -5
  67. package/dist/types/rich-text/model/guard.d.ts +2 -1
  68. package/dist/types/rich-text/model/node-contract.d.ts +3 -5
  69. package/dist/types/rich-text/model/node-identity.d.ts +7 -1
  70. package/dist/types/rich-text/model/question-text.d.ts +2 -4
  71. package/dist/types/rich-text/plugins/attribute/token.d.ts +9 -0
  72. package/dist/types/rich-text/plugins/operations.d.ts +9 -0
  73. package/dist/types/rich-text/plugins/reasoningTemplate/defaults.d.ts +14 -0
  74. package/dist/types/rich-text/plugins/reasoningTemplate/examples.d.ts +9 -0
  75. package/dist/types/rich-text/plugins/separator/token.d.ts +2 -0
  76. package/dist/types/rich-text/plugins/tableKnowledge/descriptor.d.ts +2 -0
  77. package/dist/types/rich-text/plugins/tableKnowledge/index.d.ts +2 -0
  78. package/dist/types/rich-text/plugins/tableKnowledge/token.d.ts +9 -0
  79. package/dist/types/rich-text/plugins/ticket/protocol.d.ts +8 -0
  80. package/dist/types/rich-text/plugins/ticket/token.d.ts +9 -0
  81. package/dist/types/rich-text/plugins/todo/token.d.ts +3 -0
  82. package/dist/types/rich-text/plugins/token-catalog.d.ts +46 -0
  83. package/dist/types/rich-text/plugins/token-definition.d.ts +24 -0
  84. package/dist/types/rich-text/plugins/tool/presentation.d.ts +2 -1
  85. package/dist/types/rich-text/plugins/tool/protocol.d.ts +5 -0
  86. package/dist/types/rich-text/plugins/tool/rules.d.ts +1 -0
  87. package/dist/types/rich-text/plugins/tool/token.d.ts +2 -0
  88. package/dist/types/rich-text/plugins/variable/token.d.ts +2 -0
  89. package/dist/types/rich-text/public/types.d.ts +63 -6
  90. package/dist/types/rich-text/runtime/action-ports.d.ts +6 -1
  91. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +16 -0
  92. package/dist/types/rich-text/runtime/media-target.d.ts +2 -0
  93. package/dist/types/rich-text/runtime/media-upload-session.d.ts +1 -1
  94. package/dist/types/rich-text/runtime/schema-plan.d.ts +1 -0
  95. package/dist/types/rich-text/types.d.ts +3 -40
  96. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +38 -0
  97. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +7 -3
  98. package/dist/types/rich-text/ui/knowledge-type-picker-types.d.ts +14 -0
  99. package/dist/types/rich-text/ui/token-renderer.d.ts +5 -0
  100. package/dist/types/switcher/FkpSwitcher.vue.d.ts +52 -0
  101. package/dist/types/switcher/index.d.ts +2 -0
  102. package/dist/types/switcher/types.d.ts +7 -0
  103. package/package.json +26 -6
  104. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js +0 -4416
  105. package/dist/KnowledgeArea-BkRVWFrg.js +0 -1224
  106. package/dist/index-BVHYCLDv.js +0 -5
  107. package/dist/index-CzpY61Qj.js +0 -6
  108. package/dist/index-DxxX09iY.js +0 -6
  109. package/dist/index-kOPLn4DD.js +0 -5
  110. package/dist/index-nnvfy5q0.js +0 -31
  111. package/dist/index-urNonkMH.js +0 -6
  112. package/dist/inline-TT_dl8Y3.js +0 -17
  113. package/dist/knowledge-BZCmalF_.js +0 -6
  114. package/dist/media-extensions-ZoxmhIhH.js +0 -276
  115. package/dist/operations-JgnjGx3H.js +0 -19
  116. package/dist/rules-CC6NoltX.js +0 -811
package/README.md CHANGED
@@ -1,17 +1,23 @@
1
- # Fuker UI 业务组件
2
-
3
- `packages/web-vue-pro` 是与 `packages/web-vue` 平级的独立 workspace 包,包名为 `@freecallai/pro`。业务组件直接按名称放在 `components/` 下,各自维护源码、类型、样式、`TEMPLATE.md`、演示和测试。基础包 `@freecallai/ui` 不依赖此包。
4
-
5
- 使用 pnpm 9.5.0 开发:
6
-
7
- ```bash
8
- pnpm --filter @freecallai/pro docgen
9
- pnpm --filter @freecallai/pro build
10
- pnpm --filter @freecallai/pro test
11
- ```
12
-
13
- 第一个组件 `FkpRichText` 同时提供整包注册和 `@freecallai/pro/rich-text` 按需入口。组件使用 Tiptap 和独立的 `@freecallai/icons`;宿主需先加载 `@freecallai/ui/dist/arco.css`,再加载 `@freecallai/pro/style.css`。上传、鉴权、保存和 AI 操作仍由宿主注入或响应事件。当前包版本为 0.0.1,发布状态见[发布指南](../../docs/fuker/RELEASE.md)。
14
-
15
- 字体图标由独立的 [`@freecallai/icons`](../web-vue-icons/README.md) 包维护。富文本组件直接引用该包,字体样式包含在 `@freecallai/pro/style.css` 中。业务包目前不另设 Icon 导出或注册入口;其他场景可直接使用 `@freecallai/icons`。
16
-
17
- 文档站从[快速上手](/ui/pro/start)进入;[组件开发](/ui/pro/development)放在“开发指南”,演示和公开 API 放在[业务富文本组件页](/ui/pro/rich-text)。富文本的设计与实施复核保留在组件源码目录。
1
+ # Fuker UI 业务组件
2
+
3
+ `packages/web-vue-pro` 是与 `packages/web-vue` 平级的独立 workspace 包,包名为 `@freecallai/pro`。业务组件直接按名称放在 `components/` 下,各自维护源码、类型、样式、`TEMPLATE.md`、演示和测试。基础包 `@freecallai/ui` 不依赖此包。
4
+
5
+ 使用 pnpm 9.5.0 开发:
6
+
7
+ ```bash
8
+ pnpm --filter @freecallai/pro docgen
9
+ pnpm --filter @freecallai/pro build
10
+ pnpm --filter @freecallai/pro test
11
+ ```
12
+
13
+ 第一个组件 `FkpRichText` 同时提供整包注册和 `@freecallai/pro/rich-text` 按需入口。组件使用 Tiptap 和独立的 `@freecallai/icons`;宿主需先加载 `@freecallai/ui/dist/arco.css`,再加载 `@freecallai/pro/style.css`。上传、鉴权、保存和 AI 操作仍由宿主注入或响应事件。当前包版本为 0.0.3,要求 UI ^0.0.2、Vue ^3.5.13,Icons 使用 0.0.1,发布状态见[发布指南](../../docs/fuker/RELEASE.md)。
14
+
15
+ 字体图标由独立的 [`@freecallai/icons`](../web-vue-icons/README.md) 包维护。富文本组件直接引用该包,字体样式包含在 `@freecallai/pro/style.css` 中。业务包目前不另设 Icon 导出或注册入口;其他场景可直接使用 `@freecallai/icons`。
16
+
17
+ 文档站从[快速上手](/ui/pro/start)进入;[组件开发](/ui/pro/development)放在“开发指南”,演示和公开 API 放在[业务富文本组件页](/ui/pro/rich-text)。富文本的设计与实施复核保留在组件源码目录。
18
+
19
+ ## 组件与场景
20
+
21
+ 业务组件提供 Filter、SearchableMultiSelect、FilterPeriod、FilterDateRange、Switcher、EditionInfo、Navigation、RichText 和 KnowledgeTypePicker。公开子入口为 `@freecallai/pro/filters`、`/switcher`、`/edition-info`、`/navigation`、`/rich-text`、`/knowledge-type-picker` 和 `/rich-text/legacy-converter`。
22
+
23
+ Header、Sidebar、PageLayout 仅为使用业务组件和 UI 组合的文档场景,不导出独立组件或 `/layout` 入口。Navigation 的排序复用 `@freecallai/ui` 的 SortableList;宿主负责账号保存和页面跳转。未发布的旧 ProjectSwitcher / FilterSearch / FilterSelect 名称不保留兼容入口。
@@ -0,0 +1,187 @@
1
+ import { defineComponent as O, ref as A, computed as q, watch as E, onMounted as _, onBeforeUnmount as R, openBlock as c, createElementBlock as d, withKeys as U, withModifiers as j, normalizeClass as L, createVNode as i, unref as p, withCtx as b, Fragment as h, createElementVNode as r, toDisplayString as y, Transition as G, renderList as H, createCommentVNode as J, renderSlot as Q } from "vue";
2
+ import { Button as K } from "@freecallai/ui";
3
+ import { IconPlusCircle as W } from "@freecallai/ui/es/icon/index.js";
4
+ import w from "@freecallai/icons";
5
+ const X = () => ({
6
+ type: "doc",
7
+ content: [{ type: "paragraph" }]
8
+ }), Y = (f = "normal") => ({
9
+ schemaVersion: 1,
10
+ type: f,
11
+ question: { text: "" },
12
+ knowledge: { doc: f === "agent" ? null : X(), agentRef: null },
13
+ extensionState: {}
14
+ }), Z = ["onKeydown"], x = {
15
+ key: 0,
16
+ class: "fkp-type-popup",
17
+ "aria-hidden": "false"
18
+ }, ee = {
19
+ class: "fkp-menu fkp-type-menu",
20
+ "aria-label": "选择知识类型"
21
+ }, ne = { class: "fkp-type-option-copy" }, ie = /* @__PURE__ */ O({
22
+ name: "FkpKnowledgeTypePicker",
23
+ __name: "FkpKnowledgeTypePicker",
24
+ props: {
25
+ currentType: { default: "normal" },
26
+ mode: { default: "add" },
27
+ trigger: { default: "button" },
28
+ buttonLabel: { default: "添加知识" },
29
+ disabled: { type: Boolean, default: !1 },
30
+ open: { type: [Boolean, null], default: null },
31
+ ariaKeyshortcuts: {}
32
+ },
33
+ emits: ["update:open", "select", "create"],
34
+ setup(f, { emit: S }) {
35
+ const l = f, m = S, v = A(), T = A(!1), o = q(() => l.open ?? T.value);
36
+ let t = !1, k;
37
+ const z = ["normal", "reasoning", "agent"], B = {
38
+ normal: "常规知识",
39
+ reasoning: "推理知识",
40
+ agent: "Agent 知识"
41
+ }, I = {
42
+ normal: "适用于答案明确、无需条件判断的基础问答场景,命中后 AI 将参考知识内容生成回复。",
43
+ reasoning: "适用于需要基础逻辑规则,按条件分情况判断处理的场景,命中后 AI 将按配置规则执行并回复。",
44
+ agent: "适用于多步骤复杂业务流程、或需调用外部接口的场景,命中后 AI 将按 Agent 提示词执行并回复。"
45
+ }, C = {
46
+ normal: "regular",
47
+ reasoning: "thinking",
48
+ agent: "robot"
49
+ };
50
+ function a() {
51
+ k && clearTimeout(k), k = void 0;
52
+ }
53
+ function u(e, n) {
54
+ l.open === null && (T.value = e), m("update:open", e, n);
55
+ }
56
+ function M() {
57
+ a(), !(l.disabled || o.value) && (t = !1, u(!0, "hover"));
58
+ }
59
+ function P() {
60
+ if (a(), !l.disabled) {
61
+ if (o.value && !t) {
62
+ t = !0, m("update:open", !0, "click");
63
+ return;
64
+ }
65
+ t = !o.value, u(t, "click");
66
+ }
67
+ }
68
+ function F() {
69
+ !o.value || t || (a(), k = setTimeout(() => {
70
+ t || u(!1, "leave");
71
+ }, 180));
72
+ }
73
+ function V(e) {
74
+ a(), t = !1, u(!1, "select"), m("select", e), l.mode === "add" && m("create", { type: e, scene: Y(e), position: "start" });
75
+ }
76
+ function g(e) {
77
+ var n;
78
+ !o.value || (n = v.value) != null && n.contains(e.target) || (t = !1, a(), u(!1, "outside"));
79
+ }
80
+ function $() {
81
+ var e, n;
82
+ o.value && (t = !1, a(), u(!1, "escape"), (n = (e = v.value) == null ? void 0 : e.querySelector(".fkp-type-button")) == null || n.focus());
83
+ }
84
+ function D(e) {
85
+ e.setAttribute("aria-hidden", "false"), e.removeAttribute("inert");
86
+ }
87
+ function N(e) {
88
+ e.setAttribute("aria-hidden", "true"), e.setAttribute("inert", "");
89
+ }
90
+ return E(
91
+ () => l.open,
92
+ (e) => {
93
+ e === !1 && (t = !1, a());
94
+ }
95
+ ), E(o, (e) => {
96
+ e ? document.addEventListener("click", g) : document.removeEventListener("click", g);
97
+ }), _(() => {
98
+ o.value && document.addEventListener("click", g);
99
+ }), R(() => {
100
+ a(), document.removeEventListener("click", g);
101
+ }), (e, n) => (c(), d("div", {
102
+ ref_key: "root",
103
+ ref: v,
104
+ class: L(["fkp-knowledge-type-picker", [`is-${e.currentType}`, { "is-add-button": e.trigger === "button" }]]),
105
+ onMouseenter: a,
106
+ onMouseleave: F,
107
+ onKeydown: U(j($, ["stop", "prevent"]), ["esc"])
108
+ }, [
109
+ i(p(K), {
110
+ class: "fkp-type-button",
111
+ type: e.trigger === "button" ? "primary" : "text",
112
+ "data-fkp-menu-trigger": "type",
113
+ disabled: e.disabled,
114
+ "aria-label": e.mode === "add" ? "添加知识场景" : "选择知识类型",
115
+ "aria-expanded": o.value,
116
+ "aria-keyshortcuts": e.ariaKeyshortcuts,
117
+ onMouseenter: M,
118
+ onClick: P
119
+ }, {
120
+ default: b(() => [
121
+ e.trigger === "button" ? (c(), d(h, { key: 0 }, [
122
+ i(p(W)),
123
+ r("strong", null, y(e.buttonLabel), 1)
124
+ ], 64)) : (c(), d(h, { key: 1 }, [
125
+ i(p(w), {
126
+ name: C[e.currentType],
127
+ size: 16
128
+ }, null, 8, ["name"]),
129
+ r("strong", null, y(B[e.currentType]), 1),
130
+ i(p(w), {
131
+ name: "arrow-down",
132
+ size: 12
133
+ })
134
+ ], 64))
135
+ ]),
136
+ _: 1
137
+ }, 8, ["type", "disabled", "aria-label", "aria-expanded", "aria-keyshortcuts"]),
138
+ i(G, {
139
+ name: "zoom-in-fade-out",
140
+ onBeforeEnter: D,
141
+ onBeforeLeave: N
142
+ }, {
143
+ default: b(() => [
144
+ o.value ? (c(), d("div", x, [
145
+ n[1] || (n[1] = r("span", {
146
+ class: "fkp-type-menu-arrow",
147
+ "aria-hidden": "true"
148
+ }, null, -1)),
149
+ r("div", ee, [
150
+ n[0] || (n[0] = r("strong", { class: "fkp-type-menu-title" }, "选择要添加的知识类型:", -1)),
151
+ (c(), d(h, null, H(z, (s) => i(p(K), {
152
+ key: s,
153
+ class: "fkp-type-option",
154
+ type: "text",
155
+ "aria-pressed": e.mode === "switch" ? e.currentType === s : void 0,
156
+ onClick: (te) => V(s)
157
+ }, {
158
+ default: b(() => [
159
+ r("span", {
160
+ class: L(["fkp-type-option-icon", `is-${s}`])
161
+ }, [
162
+ i(p(w), {
163
+ name: C[s],
164
+ size: 16
165
+ }, null, 8, ["name"])
166
+ ], 2),
167
+ r("span", ne, [
168
+ r("strong", null, y(B[s]), 1),
169
+ r("span", null, y(I[s]), 1)
170
+ ])
171
+ ]),
172
+ _: 2
173
+ }, 1032, ["aria-pressed", "onClick"])), 64))
174
+ ])
175
+ ])) : J("", !0)
176
+ ]),
177
+ _: 1
178
+ }),
179
+ Q(e.$slots, "default")
180
+ ], 42, Z));
181
+ }
182
+ });
183
+ export {
184
+ ie as _,
185
+ X as a,
186
+ Y as e
187
+ };