@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
@@ -1,4 +1,4 @@
1
- import { b as o } from "./operations-JgnjGx3H.js";
1
+ import { b as o } from "./operations-D8pn-_iW.js";
2
2
  import { m as i } from "./state-KfOqha3d.js";
3
3
  const a = o("memory", "questionAction", i);
4
4
  export {
@@ -0,0 +1,10 @@
1
+ import { b as e } from "./operations-D8pn-_iW.js";
2
+ import { c as o } from "./choice-Bt2xhoN_.js";
3
+ const n = e(
4
+ "tableKnowledge",
5
+ "knowledgeInline",
6
+ o
7
+ );
8
+ export {
9
+ n as default
10
+ };
@@ -1,4 +1,4 @@
1
- import { p as n, h as i } from "./FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js";
1
+ import { l as n, p as l, b as d } from "./FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js";
2
2
  const c = {
3
3
  id: "reasoningTemplate",
4
4
  slot: "sceneAction",
@@ -6,8 +6,8 @@ const c = {
6
6
  dataVersion: 1,
7
7
  actions: {
8
8
  "reasoningTemplate.load": {
9
- async execute(r, a) {
10
- const { option: e } = r;
9
+ async execute(s, t) {
10
+ const { option: e } = s;
11
11
  if (!e || typeof e.id != "string" || !e.id || typeof e.label != "string" || !e.label.trim())
12
12
  return {
13
13
  ok: !1,
@@ -17,8 +17,8 @@ const c = {
17
17
  retryable: !1
18
18
  }
19
19
  };
20
- const o = a.ports.getReasoningTemplate;
21
- if (!o)
20
+ const o = t.ports.getReasoningTemplate, r = await n(e.id, t);
21
+ if (!r && !o)
22
22
  return {
23
23
  ok: !1,
24
24
  error: {
@@ -27,19 +27,19 @@ const c = {
27
27
  retryable: !1
28
28
  }
29
29
  };
30
- const s = await o({ templateId: e.id }, a.request), t = n(s, i);
31
- return t.ok ? {
30
+ const i = r || await o({ templateId: e.id }, t.request), a = l(i, d);
31
+ return a.ok ? {
32
32
  ok: !0,
33
33
  data: [
34
34
  {
35
35
  kind: "replaceSceneDoc",
36
36
  capabilityId: "reasoningTemplate",
37
- doc: t.data.doc,
38
- question: t.data.question,
37
+ doc: a.data.doc,
38
+ question: a.data.question,
39
39
  confirmation: "使用后,将清空当前已配置内容,并添加此模板知识内容。确认使用吗?"
40
40
  }
41
41
  ]
42
- } : t;
42
+ } : a;
43
43
  }
44
44
  }
45
45
  }
@@ -0,0 +1,6 @@
1
+ import { b as a } from "./operations-D8pn-_iW.js";
2
+ import { m as e } from "./inline-KPGqYMIR.js";
3
+ const l = a("variable", "knowledgeInline", e);
4
+ export {
5
+ l as default
6
+ };
@@ -0,0 +1,5 @@
1
+ import { c as e } from "./media-upload-P9WeUHHr.js";
2
+ const a = e("video");
3
+ export {
4
+ a as default
5
+ };
@@ -0,0 +1,168 @@
1
+ import { defineComponent as P, computed as u, ref as c, watch as A, openBlock as j, createElementBlock as R, createVNode as m, unref as r, mergeProps as I, createSlots as K, withCtx as n, createElementVNode as a, renderSlot as b, toDisplayString as D, withModifiers as d, withKeys as k } from "vue";
2
+ import { Select as E, Input as N } from "@freecallai/ui";
3
+ const O = ["src"], Z = { class: "fkp-switcher-image" }, $ = ["src"], x = { class: "fkp-switcher-option-label" }, G = { class: "fkp-switcher-image" }, H = ["src"], W = { class: "fkp-switcher-image" }, q = ["src"], z = /* @__PURE__ */ P({
4
+ name: "FkpSwitcher",
5
+ inheritAttrs: !1,
6
+ __name: "FkpSwitcher",
7
+ props: {
8
+ modelValue: { type: [String, Number, Boolean] },
9
+ options: { default: () => [] },
10
+ disabled: { type: Boolean, default: !1 },
11
+ loading: { type: Boolean, default: !1 },
12
+ placeholder: { default: "请选择" },
13
+ ariaLabel: { default: "切换选项" },
14
+ iconUrl: {},
15
+ searchable: { type: Boolean, default: !1 },
16
+ searchPlaceholder: { default: "搜索选项" }
17
+ },
18
+ emits: ["update:modelValue", "change"],
19
+ setup(y, { emit: L }) {
20
+ const C = new URL("data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='16.0004'%20height='16.002'%20viewBox='0%200%2016.0004%2016.002'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Frame%2077'%3e%3cpath%20id='Union'%20d='M3.46421%200.00195312C4.33099%20-0.0194915%205.25046%200.19045%206.14683%200.535156C6.75024%200.767259%207.37112%201.07427%207.99839%201.44336C8.62694%201.0736%209.25045%200.767614%209.85484%200.535156C10.751%200.190618%2011.6699%20-0.0185089%2012.5365%200.00292969C13.4134%200.0247296%2014.3219%200.290296%2015.0169%200.985352C15.7118%201.68041%2015.9776%202.58898%2015.9994%203.46582C16.0207%204.33239%2015.8108%205.25132%2015.4662%206.14746C15.2342%206.75045%2014.9259%207.37033%2014.557%207.99707C14.927%208.62618%2015.2335%209.24959%2015.4662%209.85449C15.8108%2010.7508%2016.0198%2011.6694%2015.9984%2012.5361C15.9766%2013.413%2015.7119%2014.3215%2015.0169%2015.0166C14.3218%2015.7115%2013.4134%2015.9773%2012.5365%2015.999C11.6699%2016.0204%2010.751%2015.8114%209.85484%2015.4668C9.25138%2015.2347%208.6309%2014.9266%208.00328%2014.5576C7.37439%2014.9275%206.75152%2015.2342%206.14683%2015.4668C5.25072%2015.8114%204.33175%2016.0213%203.46519%2016C2.58826%2015.9783%201.67986%2015.7125%200.984722%2015.0176C0.289547%2014.3224%200.0240196%2013.4142%200.00230056%2012.5371C-0.0190901%2011.6705%200.189911%2010.7517%200.534527%209.85547C0.7668%209.25164%201.07341%208.62993%201.44273%208.00195C1.07305%207.37352%200.766956%206.75077%200.534527%206.14648C0.189893%205.25028%20-0.0190565%204.33147%200.00230056%203.46484C0.0240165%202.58791%200.289762%201.67951%200.984722%200.984375C1.67968%200.289527%202.58746%200.0237982%203.46421%200.00195312ZM3.53453%202.83594C3.16381%202.84521%203.03151%202.94637%202.98863%202.98926C2.94542%203.03276%202.84552%203.16517%202.83628%203.53418C2.8269%203.91532%202.92139%204.4538%203.18101%205.12891C3.69918%206.47605%204.77647%208.11694%206.33043%209.6709C6.53888%209.87934%206.74869%2010.0794%206.95933%2010.2705C6.12185%2010.8871%205.32727%2011.3276%204.65562%2011.5859C4.54378%2011.6289%204.43889%2011.6641%204.34312%2011.6943C4.33709%2011.6883%204.33157%2011.6818%204.32554%2011.6758C3.96563%2011.3159%203.62519%2010.9465%203.30308%2010.5732C3.25943%2010.6743%203.21876%2010.774%203.18101%2010.8721C2.92141%2011.547%202.82699%2012.0856%202.83628%2012.4668C2.8455%2012.837%202.94559%2012.9695%202.98863%2013.0127C3.03161%2013.0556%203.16385%2013.1558%203.53453%2013.165C3.91567%2013.1744%204.45421%2013.0809%205.12925%2012.8213C5.22682%2012.7838%205.32562%2012.7426%205.42613%2012.6992L5.72886%2012.5615C5.82561%2012.5155%205.923%2012.4661%206.02183%2012.415C6.03487%2012.4083%206.04782%2012.4014%206.06089%2012.3945C6.25404%2012.2937%206.45113%2012.184%206.65074%2012.0645C6.66312%2012.057%206.67545%2012.0495%206.68785%2012.042C7.10819%2011.7882%207.54052%2011.4933%207.97691%2011.1592C8.54068%2010.7274%209.11223%2010.2309%209.67125%209.67187C9.8789%209.46421%2010.0775%209.25379%2010.2679%209.04395C10.8852%209.88206%2011.3267%2010.6765%2011.5853%2011.3486C11.6281%2011.46%2011.6617%2011.5647%2011.6918%2011.6602C11.6865%2011.6654%2011.6814%2011.6715%2011.6761%2011.6768C11.3168%2012.036%2010.9481%2012.3767%2010.5755%2012.6982C10.6757%2012.7415%2010.7741%2012.7829%2010.8714%2012.8203C11.5465%2013.0799%2012.085%2013.1743%2012.4662%2013.165C12.8363%2013.1558%2012.9689%2013.0548%2013.0121%2013.0117C13.055%2012.9686%2013.1551%2012.8368%2013.1644%2012.4668C13.1738%2012.0857%2013.0803%2011.5472%2012.8207%2010.8721C12.7829%2010.7739%2012.7413%2010.6744%2012.6976%2010.5732L12.6966%2010.5752C12.3536%209.78076%2011.8299%208.89921%2011.14%208.00195L11.141%208C10.7134%207.44384%2010.2225%206.88135%209.67125%206.33008C9.46351%206.12234%209.25324%205.92389%209.04332%205.7334C9.88133%205.11621%2010.676%204.67454%2011.348%204.41602C11.4591%204.3733%2011.5633%204.33954%2011.6586%204.30957C11.664%204.31505%2011.6706%204.31971%2011.6761%204.3252C12.0357%204.68478%2012.3768%205.0529%2012.6986%205.42578C12.7418%205.32571%2012.7833%205.22705%2012.8207%205.12988C13.0802%204.45477%2013.1738%203.91625%2013.1644%203.53516C13.1551%203.1647%2013.055%203.03222%2013.0121%202.98926C12.9689%202.94623%2012.836%202.84619%2012.4662%202.83691C12.0851%202.82757%2011.5463%202.92212%2010.8714%203.18164C10.7739%203.21917%2010.6741%203.25937%2010.5736%203.30273L10.5746%203.30371C10.287%203.42782%209.98789%203.57517%209.68101%203.74609C9.66058%203.75746%209.63999%203.7687%209.61949%203.78027C9.09706%204.07545%208.55231%204.43769%208.00132%204.86133L8.00035%204.86035C7.44412%205.28806%206.8819%205.77961%206.33043%206.33105C6.12228%206.5392%205.92165%206.74865%205.73082%206.95898C5.11434%206.12161%204.67367%205.32779%204.41539%204.65625C4.37233%204.54427%204.33818%204.43963%204.30796%204.34375C4.31369%204.33801%204.31981%204.33191%204.32554%204.32617C4.68561%203.96613%205.05372%203.62396%205.42711%203.30176C5.3265%203.25832%205.22693%203.21823%205.12925%203.18066C4.45399%202.92098%203.91569%202.82651%203.53453%202.83594Z'%20fill='url(%23paint0_linear_0_45)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_0_45'%20x1='-0.0410981'%20y1='-0.0418891'%20x2='16.0442'%20y2='16.0409'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230E42D2'/%3e%3cstop%20offset='1'%20stop-color='%234080FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", import.meta.url).href, S = new URL("data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Frame'%3e%3cpath%20id='Vector'%20d='M12.916%206.6414H3.13318'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke='%2386909C'/%3e%3cpath%20id='Vector_2'%20d='M9.65508%203.38046L12.916%206.6414'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke='%2386909C'/%3e%3cpath%20id='Vector_3'%20d='M3.35033%209.3586H13.1332'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke='%2386909C'/%3e%3cpath%20id='Vector_4'%20d='M3.35033%209.3586L6.61129%2012.6195'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke='%2386909C'/%3e%3c/g%3e%3c/svg%3e", import.meta.url).href, V = new URL("data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='interactive-button/search'%3e%3cpath%20id='Vector'%20d='M9.23316%203.45857C7.63852%201.86393%205.0531%201.86393%203.45846%203.45857C1.86382%205.05321%201.86382%207.63863%203.45846%209.23327C5.0531%2010.8279%207.63852%2010.8279%209.23316%209.23327C10.8278%207.63863%2010.8278%205.05321%209.23316%203.45857ZM2.6335%202.63361C4.68375%200.583358%208.00787%200.583358%2010.0581%202.63361C11.969%204.54444%2012.0989%207.56177%2010.4479%209.62309L12.533%2011.7081L11.708%2012.5331L9.62298%2010.4481C7.56166%2012.099%204.54433%2011.9691%202.6335%2010.0582C0.583247%208.00798%200.583247%204.68386%202.6335%202.63361Z'%20fill-rule='evenodd'%20clip-rule='evenodd'%20fill='%234E5969'/%3e%3c/g%3e%3c/svg%3e", import.meta.url).href, t = y, f = L, h = u(
21
+ () => t.options.find((e) => e.value === t.modelValue)
22
+ ), U = u(
23
+ () => {
24
+ var e;
25
+ return ((e = h.value) == null ? void 0 : e.iconUrl) || t.iconUrl || C;
26
+ }
27
+ ), w = c(), s = c(!1), i = c(!1), p = c(""), _ = u(
28
+ () => t.options.filter(
29
+ (e) => !t.searchable || e.label.toLocaleLowerCase().includes(p.value.trim().toLocaleLowerCase())
30
+ )
31
+ );
32
+ A(s, (e) => {
33
+ e || (p.value = "", i.value = !1);
34
+ });
35
+ function M(e) {
36
+ t.disabled || t.loading || (e.key === "ArrowDown" || e.key === "ArrowUp") && (i.value = !0, s.value || (e.preventDefault(), e.stopPropagation(), s.value = !0));
37
+ }
38
+ function v() {
39
+ var e, o;
40
+ i.value = !0, (o = (e = w.value) == null ? void 0 : e.querySelector("input")) == null || o.focus();
41
+ }
42
+ function B() {
43
+ s.value = !1, v();
44
+ }
45
+ function F(e) {
46
+ const o = t.options.find((l) => l.value === e);
47
+ t.disabled || t.loading || !o || o.disabled || (f("update:modelValue", o.value), f("change", o.value, o));
48
+ }
49
+ return (e, o) => (j(), R("span", {
50
+ ref_key: "root",
51
+ ref: w,
52
+ class: "fkp-switcher-container",
53
+ onKeydownCapture: M
54
+ }, [
55
+ m(r(E), I({
56
+ "popup-visible": s.value,
57
+ "onUpdate:popupVisible": o[4] || (o[4] = (l) => s.value = l)
58
+ }, e.$attrs, {
59
+ class: "fkp-switcher",
60
+ "model-value": e.modelValue,
61
+ options: _.value,
62
+ "fallback-option": (l) => e.options.find((g) => g.value === l) || {
63
+ value: String(l),
64
+ label: String(l)
65
+ },
66
+ "show-extra-options": !1,
67
+ "show-header-on-empty": !0,
68
+ disabled: e.disabled || e.loading,
69
+ loading: e.loading,
70
+ placeholder: e.placeholder,
71
+ "aria-label": e.ariaLabel,
72
+ "trigger-props": {
73
+ contentClass: [
74
+ "fkp-switcher-popup",
75
+ {
76
+ "fkp-switcher-searchable": e.searchable,
77
+ "fkp-switcher-keyboard": i.value
78
+ }
79
+ ],
80
+ autoFitPopupWidth: !1,
81
+ autoFitPopupMinWidth: !1,
82
+ position: "bottom",
83
+ popupOffset: 14,
84
+ showArrow: !0,
85
+ arrowClass: "fkp-switcher-arrow"
86
+ },
87
+ onChange: F
88
+ }), K({
89
+ option: n(({ data: l }) => [
90
+ a("span", {
91
+ class: "fkp-switcher-option",
92
+ onMousemove: o[3] || (o[3] = (g) => i.value = !1)
93
+ }, [
94
+ b(e.$slots, "option-icon", { option: l }, () => [
95
+ a("span", Z, [
96
+ a("img", {
97
+ src: l.iconUrl || e.iconUrl || r(C),
98
+ alt: ""
99
+ }, null, 8, $)
100
+ ])
101
+ ]),
102
+ a("span", x, D(l.label), 1)
103
+ ], 32)
104
+ ]),
105
+ prefix: n(() => [
106
+ b(e.$slots, "icon", { option: h.value }, () => [
107
+ a("span", G, [
108
+ a("img", {
109
+ src: U.value,
110
+ alt: ""
111
+ }, null, 8, H)
112
+ ])
113
+ ])
114
+ ]),
115
+ "arrow-icon": n(() => [
116
+ a("span", W, [
117
+ a("img", {
118
+ src: r(S),
119
+ alt: ""
120
+ }, null, 8, q)
121
+ ])
122
+ ]),
123
+ _: 2
124
+ }, [
125
+ e.searchable ? {
126
+ name: "header",
127
+ fn: n(() => [
128
+ a("div", {
129
+ class: "fkp-switcher-search",
130
+ onMousedown: o[2] || (o[2] = d(() => {
131
+ }, ["stop"]))
132
+ }, [
133
+ m(r(N), {
134
+ modelValue: p.value,
135
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => p.value = l),
136
+ placeholder: e.searchPlaceholder,
137
+ "aria-label": e.searchPlaceholder,
138
+ "allow-clear": "",
139
+ onKeydown: [
140
+ o[1] || (o[1] = d(() => {
141
+ }, ["stop"])),
142
+ k(d(B, ["prevent"]), ["esc"]),
143
+ k(d(v, ["prevent"]), ["down"])
144
+ ]
145
+ }, {
146
+ suffix: n(() => [
147
+ a("img", {
148
+ src: r(V),
149
+ alt: ""
150
+ }, null, 8, O)
151
+ ]),
152
+ _: 1
153
+ }, 8, ["modelValue", "placeholder", "aria-label", "onKeydown"])
154
+ ], 32)
155
+ ]),
156
+ key: "0"
157
+ } : void 0
158
+ ]), 1040, ["popup-visible", "model-value", "options", "fallback-option", "disabled", "loading", "placeholder", "aria-label", "trigger-props"])
159
+ ], 544));
160
+ }
161
+ }), Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
162
+ __proto__: null,
163
+ FkpSwitcher: z
164
+ }, Symbol.toStringTag, { value: "Module" }));
165
+ export {
166
+ Q as S,
167
+ z as _
168
+ };
@@ -0,0 +1,327 @@
1
+ import { defineComponent as D, computed as O, ref as M, watch as B, openBlock as o, createElementBlock as l, normalizeClass as N, createElementVNode as a, createVNode as I, unref as s, withCtx as i, withKeys as L, withModifiers as V, createBlock as p, renderSlot as U, toDisplayString as f, createCommentVNode as c, Fragment as y, renderList as b, createTextVNode as F } from "vue";
2
+ import { Trigger as x, SortableList as E, Tooltip as H, Popover as P, Menu as R, SubMenu as q, MenuItem as A } from "@freecallai/ui";
3
+ import { IconMore as G } from "@freecallai/ui/es/icon/index.js";
4
+ import _ from "@freecallai/icons";
5
+ function J(h, C) {
6
+ const r = new Map(h.map((d) => [d.key, d]));
7
+ return [.../* @__PURE__ */ new Set([...C, ...h.map((d) => d.key)])].flatMap(
8
+ (d) => r.has(d) ? [r.get(d)] : []
9
+ );
10
+ }
11
+ const Q = { class: "fkp-navigation-scroll" }, W = ["aria-expanded", "disabled", "onKeydown"], X = ["src"], Y = ["onKeydown"], ee = {
12
+ key: 0,
13
+ class: "fkp-navigation-editor-divider",
14
+ role: "separator"
15
+ }, ne = ["src"], oe = { class: "fkp-navigation-product-icon" }, ae = ["src"], te = { class: "fkp-navigation-editor-label" }, le = {
16
+ class: "fkp-navigation-products",
17
+ "aria-label": "我的产品"
18
+ }, se = ["aria-label", "aria-current", "disabled", "data-product-key", "onClick"], ie = { class: "fkp-navigation-product-icon" }, de = ["src"], re = {
19
+ key: 0,
20
+ class: "fkp-navigation-product-label"
21
+ }, ce = {
22
+ key: 1,
23
+ class: "fkp-navigation-open",
24
+ "aria-hidden": "true"
25
+ }, pe = ["src"], ue = ["aria-expanded"], ke = { key: 0 }, ve = {
26
+ class: "fkp-navigation-more",
27
+ "aria-label": "更多产品"
28
+ }, ge = ["disabled", "data-product-key", "onClick"], fe = { class: "fkp-navigation-product-icon" }, he = ["src"], ye = { class: "fkp-navigation-product-label" }, be = {
29
+ key: 0,
30
+ class: "fkp-navigation-open",
31
+ "aria-hidden": "true"
32
+ }, _e = ["src"], Ce = {
33
+ key: 1,
34
+ class: "fkp-navigation-heading fkp-navigation-enterprise"
35
+ }, me = ["src"], we = { class: "fkp-navigation-menu-label" }, Me = {
36
+ key: 0,
37
+ class: "fkp-navigation-open",
38
+ "aria-hidden": "true"
39
+ }, Ne = ["src"], Ie = /* @__PURE__ */ D({
40
+ name: "FkpNavigation",
41
+ __name: "FkpNavigation",
42
+ props: {
43
+ products: {},
44
+ groups: { default: () => [] },
45
+ productOrder: { default: () => [] },
46
+ selectedKey: {},
47
+ collapsed: { type: Boolean, default: !1 }
48
+ },
49
+ emits: ["update:productOrder", "orderChange", "select", "open"],
50
+ setup(h, { emit: C }) {
51
+ const r = h, d = C, g = O(
52
+ () => J(r.products, r.productOrder)
53
+ ), S = new URL("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.33325%2014H14.3333'%20stroke='%2386909C'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.66675%208.90663V11.3333H6.10581L13.0001%204.43603L10.5651%202L3.66675%208.90663Z'%20stroke='%2386909C'%20stroke-linejoin='round'/%3e%3c/svg%3e", import.meta.url).href, Z = new URL("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.33341%203.33333C6.33341%204.0697%205.73645%204.66667%205.00008%204.66667C4.26371%204.66667%203.66675%204.0697%203.66675%203.33333C3.66675%202.59695%204.26371%202%205.00008%202C5.73645%202%206.33341%202.59695%206.33341%203.33333ZM5.00008%209.33333C5.73645%209.33333%206.33341%208.73637%206.33341%208C6.33341%207.26363%205.73645%206.66667%205.00008%206.66667C4.26371%206.66667%203.66675%207.26363%203.66675%208C3.66675%208.73637%204.26371%209.33333%205.00008%209.33333ZM5.00008%2014C5.73645%2014%206.33341%2013.403%206.33341%2012.6667C6.33341%2011.9303%205.73645%2011.3333%205.00008%2011.3333C4.26371%2011.3333%203.66675%2011.9303%203.66675%2012.6667C3.66675%2013.403%204.26371%2014%205.00008%2014Z'%20fill='%2386909C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.3334%203.33333C12.3334%204.0697%2011.7364%204.66667%2011.0001%204.66667C10.2637%204.66667%209.66675%204.0697%209.66675%203.33333C9.66675%202.59695%2010.2637%202%2011.0001%202C11.7364%202%2012.3334%202.59695%2012.3334%203.33333ZM11.0001%209.33333C11.7364%209.33333%2012.3334%208.73637%2012.3334%208C12.3334%207.26363%2011.7364%206.66667%2011.0001%206.66667C10.2637%206.66667%209.66675%207.26363%209.66675%208C9.66675%208.73637%2010.2637%209.33333%2011.0001%209.33333ZM11.0001%2014C11.7364%2014%2012.3334%2013.403%2012.3334%2012.6667C12.3334%2011.9303%2011.7364%2011.3333%2011.0001%2011.3333C10.2637%2011.3333%209.66675%2011.9303%209.66675%2012.6667C9.66675%2013.403%2010.2637%2014%2011.0001%2014Z'%20fill='%2386909C'/%3e%3c/svg%3e", import.meta.url).href, m = new URL("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.33325%2010.6667L10.9999%205'%20stroke='%23C9CDD4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5%205H11V11'%20stroke='%23C9CDD4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", import.meta.url).href, k = M(!1), u = M(!1), K = M();
54
+ B(
55
+ () => r.collapsed,
56
+ () => {
57
+ u.value = !1;
58
+ }
59
+ ), B(u, (n) => {
60
+ n && (k.value = !1);
61
+ });
62
+ function j(n) {
63
+ const t = n.map((e) => String(e.key));
64
+ d("update:productOrder", t), d("orderChange", t);
65
+ }
66
+ function T() {
67
+ var n;
68
+ u.value = !1, (n = K.value) == null || n.focus();
69
+ }
70
+ function w(n) {
71
+ n.disabled || (n.opensInNewTab ? d("open", n.key, n) : d("select", n.key), k.value = !1);
72
+ }
73
+ function z(n) {
74
+ const t = r.groups.flatMap((e) => e.children).find((e) => e.key === n);
75
+ t && w(t);
76
+ }
77
+ const $ = O(
78
+ () => r.groups.some(
79
+ (n) => n.children.some(
80
+ (t) => t.key === r.selectedKey && !t.opensInNewTab
81
+ )
82
+ ) && r.selectedKey ? [r.selectedKey] : []
83
+ );
84
+ return (n, t) => (o(), l("nav", {
85
+ class: N(["fkp-navigation", { "fkp-navigation-collapsed": n.collapsed }]),
86
+ "aria-label": "产品与企业导航"
87
+ }, [
88
+ a("div", Q, [
89
+ n.collapsed ? c("", !0) : (o(), l("div", {
90
+ key: 0,
91
+ class: N(["fkp-navigation-heading fkp-navigation-products-heading", { "is-editing": u.value }])
92
+ }, [
93
+ t[4] || (t[4] = a("span", null, "我的产品", -1)),
94
+ I(s(x), {
95
+ "popup-visible": u.value,
96
+ "onUpdate:popupVisible": t[0] || (t[0] = (e) => u.value = e),
97
+ trigger: "click",
98
+ position: "rt",
99
+ "popup-offset": 8,
100
+ "show-arrow": !1
101
+ }, {
102
+ content: i(() => [
103
+ a("div", {
104
+ class: "fkp-navigation-editor",
105
+ role: "dialog",
106
+ "aria-label": "编辑我的产品",
107
+ onKeydown: L(V(T, ["stop", "prevent"]), ["esc"])
108
+ }, [
109
+ t[3] || (t[3] = a("div", { class: "fkp-navigation-editor-title" }, "我的产品 (可拖拽排序)", -1)),
110
+ u.value ? (o(), p(s(E), {
111
+ key: 0,
112
+ class: "fkp-navigation-editor-list",
113
+ "model-value": g.value,
114
+ "handle-label": "拖拽排序",
115
+ "onUpdate:modelValue": j
116
+ }, {
117
+ "before-item": i(({ index: e }) => [
118
+ e === 4 ? (o(), l("div", ee)) : c("", !0)
119
+ ]),
120
+ handle: i(() => [
121
+ a("img", {
122
+ src: s(Z),
123
+ alt: ""
124
+ }, null, 8, ne)
125
+ ]),
126
+ default: i(({ item: e }) => [
127
+ a("span", oe, [
128
+ U(n.$slots, "product-icon", { item: e }, () => [
129
+ e.iconUrl ? (o(), l("img", {
130
+ key: 0,
131
+ src: e.iconUrl,
132
+ alt: ""
133
+ }, null, 8, ae)) : (o(), p(s(_), {
134
+ key: 1,
135
+ name: e.icon || "merchandise",
136
+ size: 24
137
+ }, null, 8, ["name"]))
138
+ ])
139
+ ]),
140
+ a("span", te, f(e.label), 1)
141
+ ]),
142
+ _: 3
143
+ }, 8, ["model-value"])) : c("", !0)
144
+ ], 40, Y)
145
+ ]),
146
+ default: i(() => [
147
+ a("button", {
148
+ ref_key: "editButton",
149
+ ref: K,
150
+ type: "button",
151
+ class: "fkp-navigation-edit",
152
+ "aria-label": "编辑我的产品",
153
+ "aria-expanded": u.value,
154
+ disabled: g.value.length < 2,
155
+ onKeydown: L(V(T, ["stop", "prevent"]), ["esc"])
156
+ }, [
157
+ a("img", {
158
+ src: s(S),
159
+ alt: ""
160
+ }, null, 8, X)
161
+ ], 40, W)
162
+ ]),
163
+ _: 3
164
+ }, 8, ["popup-visible"])
165
+ ], 2)),
166
+ a("div", le, [
167
+ (o(!0), l(y, null, b(g.value.slice(0, 4), (e) => (o(), p(s(H), {
168
+ key: e.key,
169
+ content: e.label,
170
+ disabled: !n.collapsed,
171
+ position: "right"
172
+ }, {
173
+ default: i(() => [
174
+ a("button", {
175
+ type: "button",
176
+ class: N(["fkp-navigation-product", {
177
+ "is-selected": !e.opensInNewTab && n.selectedKey === e.key
178
+ }]),
179
+ "aria-label": e.label,
180
+ "aria-current": !e.opensInNewTab && n.selectedKey === e.key ? "page" : void 0,
181
+ disabled: e.disabled,
182
+ "data-product-key": e.key,
183
+ onClick: (v) => w(e)
184
+ }, [
185
+ a("span", ie, [
186
+ U(n.$slots, "product-icon", { item: e }, () => [
187
+ e.iconUrl ? (o(), l("img", {
188
+ key: 0,
189
+ src: e.iconUrl,
190
+ alt: ""
191
+ }, null, 8, de)) : (o(), p(s(_), {
192
+ key: 1,
193
+ name: e.icon || "merchandise",
194
+ size: 24
195
+ }, null, 8, ["name"]))
196
+ ])
197
+ ]),
198
+ n.collapsed ? c("", !0) : (o(), l("span", re, f(e.label), 1)),
199
+ e.opensInNewTab && !n.collapsed ? (o(), l("span", ce, [
200
+ a("img", {
201
+ src: s(m),
202
+ alt: ""
203
+ }, null, 8, pe)
204
+ ])) : c("", !0)
205
+ ], 10, se)
206
+ ]),
207
+ _: 2
208
+ }, 1032, ["content", "disabled"]))), 128)),
209
+ g.value.length > 4 ? (o(), p(s(P), {
210
+ key: 0,
211
+ "popup-visible": k.value,
212
+ "onUpdate:popupVisible": t[2] || (t[2] = (e) => k.value = e),
213
+ trigger: "hover",
214
+ position: "right",
215
+ "content-style": { padding: "8px" }
216
+ }, {
217
+ content: i(() => [
218
+ a("div", ve, [
219
+ (o(!0), l(y, null, b(g.value.slice(4), (e) => (o(), l("button", {
220
+ key: e.key,
221
+ type: "button",
222
+ class: "fkp-navigation-product",
223
+ disabled: e.disabled,
224
+ "data-product-key": e.key,
225
+ onClick: (v) => w(e)
226
+ }, [
227
+ a("span", fe, [
228
+ U(n.$slots, "product-icon", { item: e }, () => [
229
+ e.iconUrl ? (o(), l("img", {
230
+ key: 0,
231
+ src: e.iconUrl,
232
+ alt: ""
233
+ }, null, 8, he)) : (o(), p(s(_), {
234
+ key: 1,
235
+ name: e.icon || "merchandise",
236
+ size: 24
237
+ }, null, 8, ["name"]))
238
+ ])
239
+ ]),
240
+ a("span", ye, f(e.label), 1),
241
+ e.opensInNewTab ? (o(), l("span", be, [
242
+ a("img", {
243
+ src: s(m),
244
+ alt: ""
245
+ }, null, 8, _e)
246
+ ])) : c("", !0)
247
+ ], 8, ge))), 128))
248
+ ])
249
+ ]),
250
+ default: i(() => [
251
+ a("button", {
252
+ type: "button",
253
+ class: "fkp-navigation-product",
254
+ "aria-label": "更多产品",
255
+ "aria-expanded": k.value,
256
+ onClick: t[1] || (t[1] = (e) => k.value = !k.value)
257
+ }, [
258
+ I(s(G)),
259
+ n.collapsed ? c("", !0) : (o(), l("span", ke, "更多"))
260
+ ], 8, ue)
261
+ ]),
262
+ _: 3
263
+ }, 8, ["popup-visible"])) : c("", !0)
264
+ ]),
265
+ n.collapsed ? c("", !0) : (o(), l("p", Ce, "企业管理")),
266
+ I(s(R), {
267
+ class: "fkp-navigation-menu",
268
+ collapsed: n.collapsed,
269
+ "selected-keys": $.value,
270
+ "default-open-keys": n.groups.map((e) => e.key),
271
+ "auto-open-selected": !0,
272
+ onMenuItemClick: z
273
+ }, {
274
+ default: i(() => [
275
+ (o(!0), l(y, null, b(n.groups, (e) => (o(), p(s(q), {
276
+ key: e.key,
277
+ disabled: e.disabled
278
+ }, {
279
+ icon: i(() => [
280
+ e.iconUrl ? (o(), l("img", {
281
+ key: 0,
282
+ src: e.iconUrl,
283
+ alt: "",
284
+ width: "16",
285
+ height: "16"
286
+ }, null, 8, me)) : (o(), p(s(_), {
287
+ key: 1,
288
+ name: e.icon || "system_management",
289
+ size: 16
290
+ }, null, 8, ["name"]))
291
+ ]),
292
+ title: i(() => [
293
+ F(f(e.label), 1)
294
+ ]),
295
+ default: i(() => [
296
+ (o(!0), l(y, null, b(e.children, (v) => (o(), p(s(A), {
297
+ key: v.key,
298
+ disabled: v.disabled
299
+ }, {
300
+ default: i(() => [
301
+ a("span", we, f(v.label), 1),
302
+ v.opensInNewTab ? (o(), l("span", Me, [
303
+ a("img", {
304
+ src: s(m),
305
+ alt: ""
306
+ }, null, 8, Ne)
307
+ ])) : c("", !0)
308
+ ]),
309
+ _: 2
310
+ }, 1032, ["disabled"]))), 128))
311
+ ]),
312
+ _: 2
313
+ }, 1032, ["disabled"]))), 128))
314
+ ]),
315
+ _: 1
316
+ }, 8, ["collapsed", "selected-keys", "default-open-keys"])
317
+ ])
318
+ ], 2));
319
+ }
320
+ }), Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
321
+ __proto__: null,
322
+ FkpNavigation: Ie
323
+ }, Symbol.toStringTag, { value: "Module" }));
324
+ export {
325
+ Be as N,
326
+ Ie as _
327
+ };
@@ -0,0 +1,57 @@
1
+ import { b as a } from "./operations-D8pn-_iW.js";
2
+ import { m as i } from "./inline-KPGqYMIR.js";
3
+ import { p as d } from "./guard-B7U3S4F1.js";
4
+ const l = {
5
+ validateInsert(n, e) {
6
+ const { option: t } = n;
7
+ if (!t || !["small_payment", "order_note"].includes(t.id))
8
+ return { ok: !0 };
9
+ const { params: o } = t;
10
+ if (!o || Object.values(o).some(
11
+ (s) => typeof s != "string" && typeof s != "boolean"
12
+ ))
13
+ return {
14
+ ok: !1,
15
+ code: "TOOL_PARAMS_INVALID",
16
+ message: "工具参数无效"
17
+ };
18
+ const r = d(
19
+ t.id,
20
+ o,
21
+ o,
22
+ e.knowledge.doc
23
+ );
24
+ return r.ok ? JSON.stringify(r.params) !== JSON.stringify(o) ? {
25
+ ok: !1,
26
+ code: "TOOL_PARAMS_INVALID",
27
+ message: "工具参数与当前知识内容冲突"
28
+ } : { ok: !0 } : r;
29
+ },
30
+ execute(n, e, t) {
31
+ if (!e.option) return [];
32
+ if (!e.edit) return i.execute(n, e, t);
33
+ const { nodeId: o, nodeVersion: r } = e.edit;
34
+ return [
35
+ {
36
+ kind: "updateOwnNode",
37
+ capabilityId: n,
38
+ nodeId: o,
39
+ expectedNodeVersion: r,
40
+ node: {
41
+ type: "businessToken",
42
+ attrs: {
43
+ id: o,
44
+ nodeVersion: r + 1,
45
+ kind: n,
46
+ key: e.option.id,
47
+ label: e.option.label,
48
+ params: e.option.params
49
+ }
50
+ }
51
+ }
52
+ ];
53
+ }
54
+ }, f = a("tool", "knowledgeInline", l);
55
+ export {
56
+ f as default
57
+ };