@freecallai/pro 0.0.13 → 0.0.15
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/README.md +1 -1
- package/dist/{FkpRichText.vue_vue_type_script_setup_true_lang-D-SOdFra.js → FkpRichText.vue_vue_type_script_setup_true_lang-DaSKjAe7.js} +246 -244
- package/dist/{KnowledgeArea-ClZoLiaZ.js → KnowledgeArea-BV2T5ecq.js} +1 -1
- package/dist/{KnowledgeArea.vue_vue_type_script_setup_true_lang-CoFF-WCe.js → KnowledgeArea.vue_vue_type_script_setup_true_lang-QJZNyAnH.js} +221 -223
- package/dist/{ToolForm-BK9epxdr.js → ToolForm-CJRw9QhZ.js} +1 -1
- package/dist/agent-prompt-editor/index.js +198 -179
- package/dist/agent-prompt-editor/legacy-converter/index.js +188 -162
- package/dist/{choice-UgePgrSl.js → choice-BZa68Gpl.js} +1 -1
- package/dist/{guard-DPwe4mCm.js → guard-CZOoBb3d.js} +271 -213
- package/dist/index-9-vUHS0W.js +15 -0
- package/dist/index-B4oT1Q9u.js +5 -0
- package/dist/index-BHgHsPrz.js +5 -0
- package/dist/index-Bd2S6qOP.js +19 -0
- package/dist/{index-CaA13lC9.js → index-BdSClCaD.js} +1 -1
- package/dist/{index-BIi3k45j.js → index-BwkcWrL6.js} +1 -1
- package/dist/{index-ChuzFuNm.js → index-Cn_sllKh.js} +1 -1
- package/dist/{index-DiLMgNEe.js → index-DvDbrMvv.js} +1 -1
- package/dist/{index-DfKH-RZq.js → index-OMoExOaa.js} +2 -2
- package/dist/{index-RHu4JIw7.js → index-WExTogRL.js} +1 -1
- package/dist/{index-v1UD08i6.js → index-w2M63UAJ.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{inline-CVF1zEsG.js → inline-BJJy0svW.js} +1 -1
- package/dist/{knowledge-DWM6tWnP.js → knowledge-B3aTxExW.js} +1 -1
- package/dist/media-extensions-CpwsEWCD.js +338 -0
- package/dist/{media-migration-BctCLEuT.js → media-migration-3-xnOp0T.js} +1 -1
- package/dist/{media-policy-B1UuSN2e.js → media-policy-BqquGDH1.js} +36 -36
- package/dist/{media-upload-DtH-oCtw.js → media-upload-AunEWyNv.js} +1 -1
- package/dist/{model-VLLhEQfn.js → model-aED-32GY.js} +10 -6
- package/dist/rich-text/index.js +6 -6
- package/dist/rich-text/legacy-converter/index.js +905 -842
- package/dist/style.css +1 -1
- package/dist/types/agent-prompt-editor/model.d.ts +1 -1
- package/dist/types/rich-text/config/descriptor.d.ts +2 -0
- package/dist/types/rich-text/model/qianniu-video.d.ts +1 -0
- package/dist/types/rich-text/plugins/noFollow/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/noFollow/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/noFollow/token.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningMarker/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningMarker/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningMarker/token.d.ts +2 -0
- package/dist/types/rich-text/plugins/token-catalog.d.ts +2 -0
- package/dist/types/rich-text/public/types.d.ts +1 -1
- package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +6 -6
- package/package.json +3 -3
- package/dist/index-BMHUPL5x.js +0 -5
- package/dist/index-DJLfgC4v.js +0 -5
- package/dist/media-extensions-YYbGuUQa.js +0 -341
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
import { Node as $, mergeAttributes as B } from "@tiptap/core";
|
|
2
|
-
import { nodeViewProps as I, NodeViewWrapper as D, VueNodeViewRenderer as L } from "@tiptap/vue-3";
|
|
3
|
-
import { defineComponent as F, ref as C, watch as N, onMounted as H, onBeforeUnmount as P, openBlock as s, createBlock as p, unref as i, normalizeClass as M, withCtx as m, createElementVNode as z, createElementBlock as l, createVNode as v, createTextVNode as c, createCommentVNode as n, withModifiers as q, toDisplayString as b, Fragment as U } from "vue";
|
|
4
|
-
import { Button as y, ImagePreview as h, Modal as O } from "@freecallai/ui";
|
|
5
|
-
import { closeHistory as R } from "@tiptap/pm/history";
|
|
6
|
-
import g from "@freecallai/icons";
|
|
7
|
-
import { IconDragDotVertical as W } from "@freecallai/ui/es/icon/index.js";
|
|
8
|
-
const j = { class: "fk-media-surface" }, G = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "fk-media-failed"
|
|
11
|
-
}, J = ["href"], K = ["draggable", "src", "alt"], Q = ["draggable", "src", "poster", "controls"], X = {
|
|
12
|
-
key: 5,
|
|
13
|
-
class: "fk-media-actions"
|
|
14
|
-
}, Y = {
|
|
15
|
-
key: 0,
|
|
16
|
-
"data-drag-handle": "",
|
|
17
|
-
class: "fk-media-handle",
|
|
18
|
-
title: "拖动调整位置"
|
|
19
|
-
}, Z = {
|
|
20
|
-
key: 6,
|
|
21
|
-
class: "fk-upload-state"
|
|
22
|
-
}, x = {
|
|
23
|
-
key: 0,
|
|
24
|
-
class: "fk-media-caption"
|
|
25
|
-
}, _ = {
|
|
26
|
-
key: 1,
|
|
27
|
-
class: "fk-error"
|
|
28
|
-
}, ee = ["src"], te = /* @__PURE__ */ F({
|
|
29
|
-
__name: "MediaView",
|
|
30
|
-
props: I,
|
|
31
|
-
setup(a) {
|
|
32
|
-
const r = a, o = r.extension.options.sceneStyle === !0, d = C(!1), u = C(!1), V = C(null), k = C(r.editor.isEditable);
|
|
33
|
-
function E(e) {
|
|
34
|
-
const { detail: t } = e;
|
|
35
|
-
(t == null ? void 0 : t.id) === r.node.attrs.id && r.node.attrs.status === "uploading" && typeof t.percent == "number" && Number.isFinite(t.percent) && (V.value = t.percent);
|
|
36
|
-
}
|
|
37
|
-
const w = () => {
|
|
38
|
-
k.value = r.editor.isEditable;
|
|
39
|
-
};
|
|
40
|
-
r.editor.on("update", w), r.editor.on("transaction", w);
|
|
41
|
-
function T() {
|
|
42
|
-
r.editor.isEditable && (r.editor.view.dispatch(R(r.editor.state.tr)), r.deleteNode());
|
|
43
|
-
}
|
|
44
|
-
function A() {
|
|
45
|
-
r.editor.view.dom.dispatchEvent(
|
|
46
|
-
new CustomEvent("fkp-media-retry", {
|
|
47
|
-
bubbles: !0,
|
|
48
|
-
detail: { id: r.node.attrs.id }
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
function S() {
|
|
53
|
-
!o || r.node.attrs.sourceType === "qianniuVideo" || u.value || !["image", "video"].includes(r.node.attrs.kind) || r.node.attrs.status !== "ready" || (d.value = !0);
|
|
54
|
-
}
|
|
55
|
-
return N(
|
|
56
|
-
() => r.node.attrs.src,
|
|
57
|
-
() => {
|
|
58
|
-
u.value = !1;
|
|
59
|
-
}
|
|
60
|
-
), N(
|
|
61
|
-
() => r.node.attrs.status,
|
|
62
|
-
(e) => {
|
|
63
|
-
e !== "uploading" && (V.value = null);
|
|
64
|
-
}
|
|
65
|
-
), H(() => {
|
|
66
|
-
r.editor.view.dom.addEventListener("fkp-media-progress", E);
|
|
67
|
-
}), P(() => {
|
|
68
|
-
r.editor.view.dom.removeEventListener("fkp-media-progress", E), r.editor.off("update", w), r.editor.off("transaction", w);
|
|
69
|
-
}), (e, t) => (s(), p(i(D), {
|
|
70
|
-
class: M(["fk-media", {
|
|
71
|
-
"is-selected": e.selected,
|
|
72
|
-
"is-scene-media": o,
|
|
73
|
-
"is-video": e.node.attrs.kind === "video",
|
|
74
|
-
"is-qianniu-video": e.node.attrs.sourceType === "qianniuVideo",
|
|
75
|
-
"is-error": e.node.attrs.status === "error"
|
|
76
|
-
}]),
|
|
77
|
-
"data-media-id": e.node.attrs.id,
|
|
78
|
-
"data-drag-handle": o && k.value ? "" : void 0,
|
|
79
|
-
contenteditable: "false",
|
|
80
|
-
onClick: S
|
|
81
|
-
}, {
|
|
82
|
-
default: m(() => [
|
|
83
|
-
z("div", j, [
|
|
84
|
-
u.value ? (s(), l("div", G, [
|
|
85
|
-
v(i(g), {
|
|
86
|
-
name: "fail",
|
|
87
|
-
size: 24
|
|
88
|
-
}),
|
|
89
|
-
t[8] || (t[8] = c("媒体无法加载"))
|
|
90
|
-
])) : n("", !0),
|
|
91
|
-
e.node.attrs.sourceType === "qianniuVideo" ? (s(), l("a", {
|
|
92
|
-
key: 1,
|
|
93
|
-
class: "fk-qianniu-video-link",
|
|
94
|
-
href: e.node.attrs.src,
|
|
95
|
-
target: "_blank",
|
|
96
|
-
rel: "noopener noreferrer",
|
|
97
|
-
onClick: t[0] || (t[0] = q(() => {
|
|
98
|
-
}, ["stop"]))
|
|
99
|
-
}, b(e.node.attrs.src), 9, J)) : e.node.attrs.kind === "image" ? (s(), l("img", {
|
|
100
|
-
key: 2,
|
|
101
|
-
draggable: o ? !1 : void 0,
|
|
102
|
-
src: e.node.attrs.src,
|
|
103
|
-
alt: e.node.attrs.name,
|
|
104
|
-
onError: t[1] || (t[1] = (f) => u.value = !0),
|
|
105
|
-
onDblclick: t[2] || (t[2] = (f) => d.value = !0)
|
|
106
|
-
}, null, 40, K)) : (s(), l("video", {
|
|
107
|
-
key: 3,
|
|
108
|
-
draggable: o ? !1 : void 0,
|
|
109
|
-
src: e.node.attrs.src,
|
|
110
|
-
poster: e.node.attrs.poster || void 0,
|
|
111
|
-
controls: !o,
|
|
112
|
-
muted: o,
|
|
113
|
-
playsinline: "",
|
|
114
|
-
preload: "metadata",
|
|
115
|
-
onError: t[3] || (t[3] = (f) => u.value = !0)
|
|
116
|
-
}, null, 40, Q)),
|
|
117
|
-
o && !u.value && e.node.attrs.sourceType !== "qianniuVideo" && e.node.attrs.status === "ready" && ["image", "video"].includes(e.node.attrs.kind) ? (s(), p(i(y), {
|
|
118
|
-
key: 4,
|
|
119
|
-
class: M(["fk-media-play", { "is-image-preview": e.node.attrs.kind === "image" }]),
|
|
120
|
-
type: "text",
|
|
121
|
-
"aria-label": e.node.attrs.kind === "image" ? "查看大图" : "播放视频",
|
|
122
|
-
style: { "pointer-events": "none" },
|
|
123
|
-
onClick: t[4] || (t[4] = (f) => d.value = !0)
|
|
124
|
-
}, {
|
|
125
|
-
default: m(() => [
|
|
126
|
-
v(i(g), {
|
|
127
|
-
name: "visible",
|
|
128
|
-
size: 14
|
|
129
|
-
}),
|
|
130
|
-
c(b(e.node.attrs.kind === "image" ? "点击查看大图" : "点击播放视频"), 1)
|
|
131
|
-
]),
|
|
132
|
-
_: 1
|
|
133
|
-
}, 8, ["class", "aria-label"])) : n("", !0),
|
|
134
|
-
o ? n("", !0) : (s(), l("div", X, [
|
|
135
|
-
k.value ? (s(), l("span", Y, [
|
|
136
|
-
v(i(W), { size: 15 })
|
|
137
|
-
])) : n("", !0),
|
|
138
|
-
e.node.attrs.sourceType !== "qianniuVideo" ? (s(), p(i(y), {
|
|
139
|
-
key: 1,
|
|
140
|
-
type: "text",
|
|
141
|
-
size: "mini",
|
|
142
|
-
title: "预览媒体",
|
|
143
|
-
"aria-label": "预览媒体",
|
|
144
|
-
onClick: t[5] || (t[5] = (f) => d.value = !0)
|
|
145
|
-
}, {
|
|
146
|
-
default: m(() => [
|
|
147
|
-
v(i(g), {
|
|
148
|
-
name: "open",
|
|
149
|
-
size: 15
|
|
150
|
-
})
|
|
151
|
-
]),
|
|
152
|
-
_: 1
|
|
153
|
-
})) : n("", !0),
|
|
154
|
-
k.value && e.node.attrs.status === "error" ? (s(), p(i(y), {
|
|
155
|
-
key: 2,
|
|
156
|
-
type: "text",
|
|
157
|
-
size: "mini",
|
|
158
|
-
title: "重试上传",
|
|
159
|
-
"aria-label": "重试上传",
|
|
160
|
-
onClick: A
|
|
161
|
-
}, {
|
|
162
|
-
default: m(() => t[9] || (t[9] = [
|
|
163
|
-
c("重试")
|
|
164
|
-
])),
|
|
165
|
-
_: 1
|
|
166
|
-
})) : n("", !0),
|
|
167
|
-
k.value ? (s(), p(i(y), {
|
|
168
|
-
key: 3,
|
|
169
|
-
type: "text",
|
|
170
|
-
size: "mini",
|
|
171
|
-
title: "删除媒体",
|
|
172
|
-
"aria-label": "删除媒体",
|
|
173
|
-
onClick: T
|
|
174
|
-
}, {
|
|
175
|
-
default: m(() => [
|
|
176
|
-
v(i(g), {
|
|
177
|
-
name: "rte-del",
|
|
178
|
-
size: 15
|
|
179
|
-
})
|
|
180
|
-
]),
|
|
181
|
-
_: 1
|
|
182
|
-
})) : n("", !0)
|
|
183
|
-
])),
|
|
184
|
-
e.node.attrs.status === "uploading" ? (s(), l("div", Z, [
|
|
185
|
-
v(i(g), {
|
|
186
|
-
name: "sync",
|
|
187
|
-
size: 17,
|
|
188
|
-
class: "fk-spin"
|
|
189
|
-
}),
|
|
190
|
-
c("正在上传" + b(V.value === null ? "…" : ` ${V.value}%`), 1),
|
|
191
|
-
o && k.value ? (s(), p(i(y), {
|
|
192
|
-
key: 0,
|
|
193
|
-
class: "fk-media-status-action",
|
|
194
|
-
type: "text",
|
|
195
|
-
size: "mini",
|
|
196
|
-
"aria-label": "取消上传",
|
|
197
|
-
onClick: q(T, ["stop"])
|
|
198
|
-
}, {
|
|
199
|
-
default: m(() => t[10] || (t[10] = [
|
|
200
|
-
c("取消上传")
|
|
201
|
-
])),
|
|
202
|
-
_: 1
|
|
203
|
-
})) : n("", !0)
|
|
204
|
-
])) : n("", !0)
|
|
205
|
-
]),
|
|
206
|
-
e.node.attrs.sourceType !== "qianniuVideo" ? (s(), l("div", x, [
|
|
207
|
-
e.node.attrs.kind === "video" ? (s(), p(i(g), {
|
|
208
|
-
key: 0,
|
|
209
|
-
name: "video2",
|
|
210
|
-
size: 12
|
|
211
|
-
})) : n("", !0),
|
|
212
|
-
z("span", null, b(e.node.attrs.name), 1),
|
|
213
|
-
e.node.attrs.status === "error" ? (s(), l("span", _, b(e.node.attrs.error), 1)) : n("", !0),
|
|
214
|
-
o && k.value && e.node.attrs.status === "error" ? (s(), l(U, { key: 2 }, [
|
|
215
|
-
v(i(y), {
|
|
216
|
-
class: "fk-media-status-action",
|
|
217
|
-
type: "text",
|
|
218
|
-
size: "mini",
|
|
219
|
-
"aria-label": "重试上传",
|
|
220
|
-
onClick: q(A, ["stop"])
|
|
221
|
-
}, {
|
|
222
|
-
default: m(() => t[11] || (t[11] = [
|
|
223
|
-
c("重试")
|
|
224
|
-
])),
|
|
225
|
-
_: 1
|
|
226
|
-
}),
|
|
227
|
-
v(i(y), {
|
|
228
|
-
class: "fk-media-status-action",
|
|
229
|
-
type: "text",
|
|
230
|
-
size: "mini",
|
|
231
|
-
"aria-label": "移除失败媒体",
|
|
232
|
-
onClick: q(T, ["stop"])
|
|
233
|
-
}, {
|
|
234
|
-
default: m(() => t[12] || (t[12] = [
|
|
235
|
-
c("移除")
|
|
236
|
-
])),
|
|
237
|
-
_: 1
|
|
238
|
-
})
|
|
239
|
-
], 64)) : n("", !0)
|
|
240
|
-
])) : n("", !0),
|
|
241
|
-
e.node.attrs.kind === "image" ? (s(), p(i(h), {
|
|
242
|
-
key: 1,
|
|
243
|
-
visible: d.value,
|
|
244
|
-
"onUpdate:visible": t[6] || (t[6] = (f) => d.value = f),
|
|
245
|
-
src: e.node.attrs.src,
|
|
246
|
-
"mask-closable": !0
|
|
247
|
-
}, null, 8, ["visible", "src"])) : (s(), p(i(O), {
|
|
248
|
-
key: 2,
|
|
249
|
-
visible: d.value,
|
|
250
|
-
"onUpdate:visible": t[7] || (t[7] = (f) => d.value = f),
|
|
251
|
-
title: e.node.attrs.name,
|
|
252
|
-
footer: !1,
|
|
253
|
-
width: "min(960px, 90vw)",
|
|
254
|
-
"unmount-on-close": ""
|
|
255
|
-
}, {
|
|
256
|
-
default: m(() => [
|
|
257
|
-
z("video", {
|
|
258
|
-
class: "fk-video-preview",
|
|
259
|
-
src: e.node.attrs.src,
|
|
260
|
-
controls: "",
|
|
261
|
-
autoplay: ""
|
|
262
|
-
}, null, 8, ee)
|
|
263
|
-
]),
|
|
264
|
-
_: 1
|
|
265
|
-
}, 8, ["visible", "title"]))
|
|
266
|
-
]),
|
|
267
|
-
_: 1
|
|
268
|
-
}, 8, ["class", "data-media-id", "data-drag-handle"]));
|
|
269
|
-
}
|
|
270
|
-
}), le = $.create({
|
|
271
|
-
name: "mediaBlock",
|
|
272
|
-
group: "block",
|
|
273
|
-
atom: !0,
|
|
274
|
-
draggable: !0,
|
|
275
|
-
selectable: !0,
|
|
276
|
-
addOptions() {
|
|
277
|
-
return { sceneStyle: !1 };
|
|
278
|
-
},
|
|
279
|
-
addAttributes() {
|
|
280
|
-
return {
|
|
281
|
-
id: { default: "" },
|
|
282
|
-
nodeVersion: { default: 0 },
|
|
283
|
-
assetId: { default: null },
|
|
284
|
-
sourceType: { default: null },
|
|
285
|
-
src: { default: "" },
|
|
286
|
-
kind: { default: "image" },
|
|
287
|
-
name: { default: "" },
|
|
288
|
-
poster: { default: null },
|
|
289
|
-
status: { default: "ready" },
|
|
290
|
-
error: { default: "" }
|
|
291
|
-
};
|
|
292
|
-
},
|
|
293
|
-
parseHTML() {
|
|
294
|
-
return [
|
|
295
|
-
{
|
|
296
|
-
tag: "figure[data-media-block]",
|
|
297
|
-
getAttrs: (a) => {
|
|
298
|
-
var r, o, d, u;
|
|
299
|
-
return {
|
|
300
|
-
id: a.getAttribute("data-id"),
|
|
301
|
-
kind: a.getAttribute("data-kind"),
|
|
302
|
-
src: ((r = a.querySelector("img,video")) == null ? void 0 : r.getAttribute("src")) || (a.getAttribute("data-source-type") === "qianniuVideo" ? (o = a.querySelector("a[href]")) == null ? void 0 : o.getAttribute("href") : null),
|
|
303
|
-
name: (d = a.querySelector("figcaption")) == null ? void 0 : d.textContent,
|
|
304
|
-
assetId: a.getAttribute("data-asset-id"),
|
|
305
|
-
sourceType: a.getAttribute("data-source-type"),
|
|
306
|
-
poster: (u = a.querySelector("video")) == null ? void 0 : u.getAttribute("poster"),
|
|
307
|
-
status: "ready"
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
];
|
|
312
|
-
},
|
|
313
|
-
renderHTML({ node: a, HTMLAttributes: r }) {
|
|
314
|
-
return [
|
|
315
|
-
"figure",
|
|
316
|
-
B(r, {
|
|
317
|
-
"data-media-block": "",
|
|
318
|
-
"data-fkp-node": "media-block",
|
|
319
|
-
"data-id": a.attrs.id,
|
|
320
|
-
"data-kind": a.attrs.kind,
|
|
321
|
-
"data-asset-id": a.attrs.assetId,
|
|
322
|
-
"data-source-type": a.attrs.sourceType,
|
|
323
|
-
"data-name": a.attrs.name
|
|
324
|
-
}),
|
|
325
|
-
a.attrs.sourceType === "qianniuVideo" ? ["a", { href: a.attrs.src }, a.attrs.src] : a.attrs.kind === "video" ? [
|
|
326
|
-
"video",
|
|
327
|
-
{ src: a.attrs.src, controls: "", poster: a.attrs.poster }
|
|
328
|
-
] : ["img", { src: a.attrs.src, alt: a.attrs.name }],
|
|
329
|
-
["figcaption", {}, a.attrs.name]
|
|
330
|
-
];
|
|
331
|
-
},
|
|
332
|
-
renderText({ node: a }) {
|
|
333
|
-
return a.attrs.sourceType === "qianniuVideo" ? a.attrs.src : `[${a.attrs.kind === "video" ? "视频" : "图片"}:${a.attrs.name}]`;
|
|
334
|
-
},
|
|
335
|
-
addNodeView() {
|
|
336
|
-
return L(te);
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
export {
|
|
340
|
-
le as MediaBlock
|
|
341
|
-
};
|