@freecallai/pro 0.0.3 → 0.0.5

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 (95) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +23 -23
  3. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js +193 -0
  4. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js +4980 -0
  5. package/dist/KnowledgeArea-CEX1esVZ.js +4 -0
  6. package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-Bg1e7xYT.js +1653 -0
  7. package/dist/ToolForm-DA-EFBhw.js +196 -0
  8. package/dist/agent-prompt-editor/index.js +917 -0
  9. package/dist/agent-prompt-editor/legacy-converter/index.js +490 -0
  10. package/dist/{choice-Bt2xhoN_.js → choice-2dbddjJU.js} +1 -1
  11. package/dist/edition-info/index.js +1 -1
  12. package/dist/filters/index.js +1 -1
  13. package/dist/{guard-B7U3S4F1.js → guard-Cr_ny-sR.js} +255 -237
  14. package/dist/index-7x1OTv0m.js +98 -0
  15. package/dist/{index-BF6MRSMb.js → index-BBxrpF3v.js} +1 -1
  16. package/dist/{index-sjDmbR5o.js → index-CgRisH4B.js} +1 -1
  17. package/dist/index-Ck8RYpuE.js +816 -0
  18. package/dist/index-CnjG7Mj4.js +5 -0
  19. package/dist/{index-lNhA3N9x.js → index-DBQsQ1ZK.js} +1 -0
  20. package/dist/index-DCZKt14c.js +5 -0
  21. package/dist/{index-D9yqpH_4.js → index-DiaPY8Db.js} +2 -2
  22. package/dist/{index-trxE5T0w.js → index-DmdrsEvk.js} +1 -1
  23. package/dist/index-DnmCPdCI.js +168 -0
  24. package/dist/{index-B4-2_sJI.js → index-DwDYy2lj.js} +1 -1
  25. package/dist/{index-BBv72oZe.js → index-FQQfN6nm.js} +1 -1
  26. package/dist/{index-DYeJRJY1.js → index-aic1yCBs.js} +1 -1
  27. package/dist/index.js +13 -13
  28. package/dist/{inline-KPGqYMIR.js → inline-8aNfINLF.js} +1 -1
  29. package/dist/knowledge-type-picker/index.js +1 -1
  30. package/dist/{knowledge-CupkY2rK.js → knowledge-y2j0ijgx.js} +1 -1
  31. package/dist/{media-extensions-DhRlLKYM.js → media-extensions-wlcCEdtg.js} +27 -24
  32. package/dist/media-id-b2dgniSy.js +15 -0
  33. package/dist/{media-migration-CbMT2wS0.js → media-migration-Dy_rbdkK.js} +1 -1
  34. package/dist/media-policy-BwKjZPWt.js +158 -0
  35. package/dist/{media-upload-P9WeUHHr.js → media-upload-NzWYyCm3.js} +1 -1
  36. package/dist/model-DvukseoR.js +146 -0
  37. package/dist/navigation/index.js +1 -1
  38. package/dist/rich-text/index.js +75 -73
  39. package/dist/rich-text/legacy-converter/index.js +988 -867
  40. package/dist/style.css +1 -1
  41. package/dist/switcher/index.js +1 -1
  42. package/dist/types/agent-prompt-editor/FkpAgentPromptEditor.vue.d.ts +550 -0
  43. package/dist/types/agent-prompt-editor/agent-size-chart.d.ts +3 -0
  44. package/dist/types/agent-prompt-editor/document-adapter.d.ts +3 -0
  45. package/dist/types/agent-prompt-editor/index.d.ts +6 -0
  46. package/dist/types/agent-prompt-editor/legacy-converter-index.d.ts +2 -0
  47. package/dist/types/agent-prompt-editor/legacy-converter.d.ts +26 -0
  48. package/dist/types/agent-prompt-editor/model.d.ts +21 -0
  49. package/dist/types/agent-prompt-editor/types.d.ts +56 -0
  50. package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +1 -3
  51. package/dist/types/edition-info/presets.d.ts +8 -0
  52. package/dist/types/edition-info/types.d.ts +1 -0
  53. package/dist/types/filters/FkpFilter.vue.d.ts +2 -2
  54. package/dist/types/filters/FkpFilterDateRange.vue.d.ts +2 -2
  55. package/dist/types/filters/FkpFilterPeriod.vue.d.ts +2 -2
  56. package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +2 -2
  57. package/dist/types/index.d.ts +4 -1
  58. package/dist/types/navigation/FkpNavigation.vue.d.ts +20 -29
  59. package/dist/types/navigation/NavigationButton.vue.d.ts +26 -0
  60. package/dist/types/navigation/NavigationGroup.vue.d.ts +45 -0
  61. package/dist/types/navigation/NavigationIcon.vue.d.ts +28 -0
  62. package/dist/types/navigation/NavigationNodes.vue.d.ts +40 -0
  63. package/dist/types/navigation/index.d.ts +1 -1
  64. package/dist/types/navigation/types.d.ts +43 -5
  65. package/dist/types/navigation/use-navigation-tree.d.ts +13 -0
  66. package/dist/types/rich-text/FkpRichText.vue.d.ts +28 -8
  67. package/dist/types/rich-text/config/descriptor.d.ts +1 -0
  68. package/dist/types/rich-text/config/resolve.d.ts +1 -1
  69. package/dist/types/rich-text/index.d.ts +4 -1
  70. package/dist/types/rich-text/knowledge-document-adapter.d.ts +2 -0
  71. package/dist/types/rich-text/model/question-text.d.ts +1 -1
  72. package/dist/types/rich-text/plugins/registry.d.ts +2 -1
  73. package/dist/types/rich-text/public/types.d.ts +12 -0
  74. package/dist/types/rich-text/runtime/document-adapter.d.ts +9 -0
  75. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +9 -3
  76. package/dist/types/rich-text/runtime/media-sources.d.ts +7 -0
  77. package/dist/types/rich-text/runtime/media-upload-session.d.ts +2 -0
  78. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +3 -3
  79. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +18 -3
  80. package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +190 -0
  81. package/dist/types/rich-text/ui/ToolForm.vue.d.ts +2 -2
  82. package/dist/types/rich-text/ui/token-renderer.d.ts +3 -0
  83. package/dist/types/rich-text/ui/useMediaHint.d.ts +6 -0
  84. package/dist/types/switcher/FkpSwitcher.vue.d.ts +2 -2
  85. package/dist/types-PvYB5e85.js +14 -0
  86. package/package.json +13 -5
  87. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-xR8ZhhdJ.js +0 -187
  88. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js +0 -4864
  89. package/dist/KnowledgeArea-_rsydhnt.js +0 -1438
  90. package/dist/ToolForm-Czg67cDT.js +0 -185
  91. package/dist/index-BQrYBmwR.js +0 -5
  92. package/dist/index-CS2xQQ8W.js +0 -168
  93. package/dist/index-D0bJAQSN.js +0 -327
  94. package/dist/index-DCmHHi07.js +0 -71
  95. package/dist/index-uCVrA6xK.js +0 -5
@@ -0,0 +1,196 @@
1
+ import { defineComponent as T, ref as w, watch as q, openBlock as l, createElementBlock as o, createElementVNode as v, Fragment as f, renderList as S, normalizeClass as _, createTextVNode as c, toDisplayString as s, createCommentVNode as b, createVNode as g, unref as u, withCtx as k, createBlock as x, normalizeStyle as B } from "vue";
2
+ import { RadioGroup as F, Radio as E, Checkbox as P, Switch as W, Textarea as z, Input as R, Button as I } from "@freecallai/ui";
3
+ import { c as j } from "./FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js";
4
+ const D = { class: "fkp-tool-form" }, G = { class: "fkp-tool-form-fields" }, O = { key: 0 }, A = { class: "fkp-visually-hidden" }, H = {
5
+ key: 1,
6
+ class: "fkp-tool-form-checkbox"
7
+ }, J = { key: 0 }, K = {
8
+ key: 3,
9
+ class: "fkp-tool-form-unit"
10
+ }, M = {
11
+ key: 0,
12
+ class: "fkp-tool-form-error",
13
+ role: "alert"
14
+ }, Q = { class: "fkp-tool-form-actions" }, Z = /* @__PURE__ */ T({
15
+ __name: "ToolForm",
16
+ props: {
17
+ definition: {},
18
+ initialParams: {},
19
+ submitLabel: {}
20
+ },
21
+ emits: ["submit", "cancel"],
22
+ setup(V, { emit: $ }) {
23
+ const d = V, C = $, n = w({}), i = w("");
24
+ q(
25
+ () => [d.definition, d.initialParams],
26
+ () => {
27
+ n.value = Object.fromEntries(
28
+ d.definition.fields.map((t) => [
29
+ t.id,
30
+ j(t, d.initialParams)
31
+ ])
32
+ ), i.value = "";
33
+ },
34
+ { immediate: !0 }
35
+ );
36
+ function h(t) {
37
+ return t.visibleWhen ? n.value[t.visibleWhen.fieldId] === t.visibleWhen.equals : !0;
38
+ }
39
+ function L(t, r) {
40
+ n.value[t.id] = t.maxLength === void 0 ? r : r.slice(0, t.maxLength);
41
+ }
42
+ function N(t) {
43
+ var e;
44
+ const r = {};
45
+ for (const a of d.definition.fields) {
46
+ if (!h(a)) continue;
47
+ const y = n.value[a.id];
48
+ if (a.kind === "switch" || a.kind === "checkbox") {
49
+ if (a.required && y !== !0) {
50
+ i.value = `请选择${a.label}`;
51
+ return;
52
+ }
53
+ r[a.id] = y === !0;
54
+ continue;
55
+ }
56
+ const m = String(y ?? "").trim();
57
+ if (a.required && !m) {
58
+ i.value = `请填写${a.label}`;
59
+ return;
60
+ }
61
+ if (a.maxLength !== void 0 && [...m].length > a.maxLength) {
62
+ i.value = `${a.label}不能超过${a.maxLength}字`;
63
+ return;
64
+ }
65
+ if (a.kind === "radio" && !((e = a.options) != null && e.some((p) => p.value === m))) {
66
+ i.value = `请选择${a.label}`;
67
+ return;
68
+ }
69
+ if (a.kind === "number" && m) {
70
+ const p = Number(m);
71
+ if (!Number.isFinite(p) || a.min !== void 0 && p < a.min || a.max !== void 0 && p > a.max) {
72
+ i.value = `${a.label}数值无效`;
73
+ return;
74
+ }
75
+ }
76
+ r[a.id] = m;
77
+ }
78
+ i.value = "", C("submit", r, t.currentTarget);
79
+ }
80
+ return (t, r) => (l(), o("div", D, [
81
+ v("div", G, [
82
+ (l(!0), o(f, null, S(t.definition.fields, (e) => (l(), o(f, {
83
+ key: e.id
84
+ }, [
85
+ h(e) && e.kind === "radio" ? (l(), o("fieldset", {
86
+ key: 0,
87
+ class: _(["fkp-tool-form-field fkp-tool-form-choice", { "fkp-tool-form-flags": e.appearance === "flag" }])
88
+ }, [
89
+ v("legend", null, [
90
+ c(s(e.label), 1),
91
+ e.required ? (l(), o("b", O, "*")) : b("", !0)
92
+ ]),
93
+ g(u(F), {
94
+ "model-value": String(n.value[e.id] ?? ""),
95
+ onChange: (a) => n.value[e.id] = String(a)
96
+ }, {
97
+ default: k(() => [
98
+ (l(!0), o(f, null, S(e.options || [], (a) => (l(), x(u(E), {
99
+ key: a.value,
100
+ value: a.value,
101
+ "aria-label": a.label
102
+ }, {
103
+ default: k(() => [
104
+ e.appearance === "flag" && a.color ? (l(), o("span", {
105
+ key: 0,
106
+ class: "fkp-tool-form-flag",
107
+ style: B({ "--fkp-flag-color": a.color })
108
+ }, [
109
+ v("span", A, s(a.label), 1)
110
+ ], 4)) : (l(), o(f, { key: 1 }, [
111
+ c(s(a.label), 1)
112
+ ], 64))
113
+ ]),
114
+ _: 2
115
+ }, 1032, ["value", "aria-label"]))), 128))
116
+ ]),
117
+ _: 2
118
+ }, 1032, ["model-value", "onChange"])
119
+ ], 2)) : h(e) && e.kind === "checkbox" ? (l(), o("div", H, [
120
+ g(u(P), {
121
+ "model-value": n.value[e.id] === !0,
122
+ onChange: (a) => n.value[e.id] = a === !0
123
+ }, {
124
+ default: k(() => [
125
+ c(s(e.label), 1)
126
+ ]),
127
+ _: 2
128
+ }, 1032, ["model-value", "onChange"])
129
+ ])) : h(e) ? (l(), o("label", {
130
+ key: 2,
131
+ class: _(["fkp-tool-form-field", {
132
+ "fkp-tool-form-field--no-label": e.hideLabel,
133
+ "fkp-tool-form-field--amount": t.definition.toolId === "small_payment" && e.id === "amount"
134
+ }])
135
+ }, [
136
+ v("span", {
137
+ class: _({ "fkp-visually-hidden": e.hideLabel })
138
+ }, [
139
+ c(s(e.label), 1),
140
+ e.required ? (l(), o("b", J, "*")) : b("", !0)
141
+ ], 2),
142
+ e.kind === "switch" ? (l(), x(u(W), {
143
+ key: 0,
144
+ "model-value": n.value[e.id] === !0,
145
+ "aria-label": e.label,
146
+ onChange: (a) => n.value[e.id] = a === !0
147
+ }, null, 8, ["model-value", "aria-label", "onChange"])) : e.kind === "textarea" ? (l(), x(u(z), {
148
+ key: 1,
149
+ "model-value": String(n.value[e.id] ?? ""),
150
+ placeholder: e.placeholder,
151
+ "max-length": e.maxLength,
152
+ "show-word-limit": !!e.maxLength,
153
+ "textarea-attrs": { "aria-label": e.label, rows: 4 },
154
+ onInput: (a) => L(e, String(a))
155
+ }, null, 8, ["model-value", "placeholder", "max-length", "show-word-limit", "textarea-attrs", "onInput"])) : (l(), x(u(R), {
156
+ key: 2,
157
+ "model-value": String(n.value[e.id] ?? ""),
158
+ placeholder: e.placeholder,
159
+ "input-attrs": {
160
+ type: e.kind === "number" ? "number" : "text",
161
+ "aria-label": e.label,
162
+ min: e.min,
163
+ max: e.max
164
+ },
165
+ onInput: (a) => L(e, String(a))
166
+ }, null, 8, ["model-value", "placeholder", "input-attrs", "onInput"])),
167
+ t.definition.toolId === "small_payment" && e.id === "amount" ? (l(), o("span", K, "元")) : b("", !0)
168
+ ], 2)) : b("", !0)
169
+ ], 64))), 128)),
170
+ i.value ? (l(), o("p", M, s(i.value), 1)) : b("", !0)
171
+ ]),
172
+ v("div", Q, [
173
+ g(u(I), {
174
+ onClick: r[0] || (r[0] = (e) => C("cancel"))
175
+ }, {
176
+ default: k(() => r[1] || (r[1] = [
177
+ c("取消")
178
+ ])),
179
+ _: 1
180
+ }),
181
+ g(u(I), {
182
+ type: "primary",
183
+ onClick: N
184
+ }, {
185
+ default: k(() => [
186
+ c(s(t.submitLabel), 1)
187
+ ]),
188
+ _: 1
189
+ })
190
+ ])
191
+ ]));
192
+ }
193
+ });
194
+ export {
195
+ Z as default
196
+ };