@freecallai/pro 0.0.14 → 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/package.json +1 -1
- package/dist/index-BMHUPL5x.js +0 -5
- package/dist/index-DJLfgC4v.js +0 -5
- package/dist/media-extensions-YYbGuUQa.js +0 -341
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { b as o } from "./operations-D8pn-_iW.js";
|
|
2
|
+
const n = {
|
|
3
|
+
execute: () => [
|
|
4
|
+
{
|
|
5
|
+
kind: "insertOwnToken",
|
|
6
|
+
capabilityId: "noFollow",
|
|
7
|
+
key: "noFollow",
|
|
8
|
+
label: "不跟单",
|
|
9
|
+
token: "<不发送跟单>"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}, l = o("noFollow", "knowledgeInline", n);
|
|
13
|
+
export {
|
|
14
|
+
l as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { b as e } from "./operations-D8pn-_iW.js";
|
|
2
|
+
const n = {
|
|
3
|
+
execute: () => [
|
|
4
|
+
{
|
|
5
|
+
kind: "insertOwnToken",
|
|
6
|
+
capabilityId: "reasoningMarker",
|
|
7
|
+
key: "reasoningMarker",
|
|
8
|
+
label: "推理",
|
|
9
|
+
token: "{推理}"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}, i = e(
|
|
13
|
+
"reasoningMarker",
|
|
14
|
+
"knowledgeInline",
|
|
15
|
+
n
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
i as default
|
|
19
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as n, p as l, b as d } from "./FkpRichText.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { l as n, p as l, b as d } from "./FkpRichText.vue_vue_type_script_setup_true_lang-DaSKjAe7.js";
|
|
2
2
|
const c = {
|
|
3
3
|
id: "reasoningTemplate",
|
|
4
4
|
slot: "sceneAction",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as a } from "./operations-D8pn-_iW.js";
|
|
2
|
-
import { m as i } from "./inline-
|
|
3
|
-
import { p as d } from "./guard-
|
|
2
|
+
import { m as i } from "./inline-BJJy0svW.js";
|
|
3
|
+
import { p as d } from "./guard-CZOoBb3d.js";
|
|
4
4
|
const l = {
|
|
5
5
|
validateInsert(n, e) {
|
|
6
6
|
const { option: t } = n;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as t } from "./FkpRichText.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { r as g } from "./FkpRichText.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as t } from "./FkpRichText.vue_vue_type_script_setup_true_lang-DaSKjAe7.js";
|
|
2
|
+
import { r as g } from "./FkpRichText.vue_vue_type_script_setup_true_lang-DaSKjAe7.js";
|
|
3
3
|
import { _ as i } from "./FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js";
|
|
4
4
|
import { a as h } from "./types-PvYB5e85.js";
|
|
5
|
-
import { s as u, e as w } from "./guard-
|
|
5
|
+
import { s as u, e as w } from "./guard-CZOoBb3d.js";
|
|
6
6
|
import { F as a } from "./index-CCATu_gD.js";
|
|
7
7
|
import { _ as v, a as y, b as E, c as M } from "./index-CCATu_gD.js";
|
|
8
8
|
import { N as s } from "./index-CbmRr3rH.js";
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { Node as M, mergeAttributes as $ } from "@tiptap/core";
|
|
2
|
+
import { nodeViewProps as B, NodeViewWrapper as D, VueNodeViewRenderer as L } from "@tiptap/vue-3";
|
|
3
|
+
import { defineComponent as F, ref as V, watch as N, onMounted as H, onBeforeUnmount as P, openBlock as s, createBlock as f, unref as r, normalizeClass as S, withCtx as m, createElementVNode as C, createElementBlock as k, createVNode as p, createTextVNode as y, createCommentVNode as n, toDisplayString as z, withModifiers as E, Fragment as U } from "vue";
|
|
4
|
+
import { Button as g, ImagePreview as O, Modal as R } from "@freecallai/ui";
|
|
5
|
+
import { closeHistory as W } from "@tiptap/pm/history";
|
|
6
|
+
import b from "@freecallai/icons";
|
|
7
|
+
import { IconDragDotVertical as j } from "@freecallai/ui/es/icon/index.js";
|
|
8
|
+
const G = { class: "fk-media-surface" }, J = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "fk-media-failed"
|
|
11
|
+
}, K = ["draggable", "src", "alt"], Q = ["id", "draggable", "src", "data-video-id", "poster", "controls"], X = {
|
|
12
|
+
key: 4,
|
|
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: 5,
|
|
21
|
+
class: "fk-upload-state"
|
|
22
|
+
}, h = { class: "fk-media-caption" }, x = {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "fk-error"
|
|
25
|
+
}, _ = ["src"], ee = /* @__PURE__ */ F({
|
|
26
|
+
__name: "MediaView",
|
|
27
|
+
props: B,
|
|
28
|
+
setup(t) {
|
|
29
|
+
const i = t, d = i.extension.options.sceneStyle === !0, o = V(!1), u = V(!1), c = V(null), l = V(i.editor.isEditable);
|
|
30
|
+
function q(e) {
|
|
31
|
+
const { detail: a } = e;
|
|
32
|
+
(a == null ? void 0 : a.id) === i.node.attrs.id && i.node.attrs.status === "uploading" && typeof a.percent == "number" && Number.isFinite(a.percent) && (c.value = a.percent);
|
|
33
|
+
}
|
|
34
|
+
const w = () => {
|
|
35
|
+
l.value = i.editor.isEditable;
|
|
36
|
+
};
|
|
37
|
+
i.editor.on("update", w), i.editor.on("transaction", w);
|
|
38
|
+
function A() {
|
|
39
|
+
i.editor.isEditable && (i.editor.view.dispatch(W(i.editor.state.tr)), i.deleteNode());
|
|
40
|
+
}
|
|
41
|
+
function I() {
|
|
42
|
+
i.editor.view.dom.dispatchEvent(
|
|
43
|
+
new CustomEvent("fkp-media-retry", {
|
|
44
|
+
bubbles: !0,
|
|
45
|
+
detail: { id: i.node.attrs.id }
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function T() {
|
|
50
|
+
!d || u.value || !["image", "video"].includes(i.node.attrs.kind) || i.node.attrs.status !== "ready" || (o.value = !0);
|
|
51
|
+
}
|
|
52
|
+
return N(
|
|
53
|
+
() => i.node.attrs.src,
|
|
54
|
+
() => {
|
|
55
|
+
u.value = !1;
|
|
56
|
+
}
|
|
57
|
+
), N(
|
|
58
|
+
() => i.node.attrs.status,
|
|
59
|
+
(e) => {
|
|
60
|
+
e !== "uploading" && (c.value = null);
|
|
61
|
+
}
|
|
62
|
+
), H(() => {
|
|
63
|
+
i.editor.view.dom.addEventListener("fkp-media-progress", q);
|
|
64
|
+
}), P(() => {
|
|
65
|
+
i.editor.view.dom.removeEventListener("fkp-media-progress", q), i.editor.off("update", w), i.editor.off("transaction", w);
|
|
66
|
+
}), (e, a) => (s(), f(r(D), {
|
|
67
|
+
class: S(["fk-media", {
|
|
68
|
+
"is-selected": e.selected,
|
|
69
|
+
"is-scene-media": d,
|
|
70
|
+
"is-video": e.node.attrs.kind === "video",
|
|
71
|
+
"is-error": e.node.attrs.status === "error"
|
|
72
|
+
}]),
|
|
73
|
+
"data-media-id": e.node.attrs.id,
|
|
74
|
+
"data-drag-handle": d && l.value ? "" : void 0,
|
|
75
|
+
contenteditable: "false",
|
|
76
|
+
onClick: T
|
|
77
|
+
}, {
|
|
78
|
+
default: m(() => [
|
|
79
|
+
C("div", G, [
|
|
80
|
+
u.value ? (s(), k("div", J, [
|
|
81
|
+
p(r(b), {
|
|
82
|
+
name: "fail",
|
|
83
|
+
size: 24
|
|
84
|
+
}),
|
|
85
|
+
a[7] || (a[7] = y("媒体无法加载"))
|
|
86
|
+
])) : n("", !0),
|
|
87
|
+
e.node.attrs.kind === "image" ? (s(), k("img", {
|
|
88
|
+
key: 1,
|
|
89
|
+
draggable: d ? !1 : void 0,
|
|
90
|
+
src: e.node.attrs.src,
|
|
91
|
+
alt: e.node.attrs.name,
|
|
92
|
+
onError: a[0] || (a[0] = (v) => u.value = !0),
|
|
93
|
+
onDblclick: a[1] || (a[1] = (v) => o.value = !0)
|
|
94
|
+
}, null, 40, K)) : (s(), k("video", {
|
|
95
|
+
key: 2,
|
|
96
|
+
id: e.node.attrs.sourceType === "qianniuVideo" ? e.node.attrs.assetId : void 0,
|
|
97
|
+
draggable: d ? !1 : void 0,
|
|
98
|
+
src: e.node.attrs.src,
|
|
99
|
+
"data-video-id": e.node.attrs.sourceType === "qianniuVideo" ? e.node.attrs.assetId : void 0,
|
|
100
|
+
poster: e.node.attrs.poster || void 0,
|
|
101
|
+
controls: !d,
|
|
102
|
+
muted: d,
|
|
103
|
+
playsinline: "",
|
|
104
|
+
preload: "metadata",
|
|
105
|
+
onError: a[2] || (a[2] = (v) => u.value = !0)
|
|
106
|
+
}, null, 40, Q)),
|
|
107
|
+
d && !u.value && e.node.attrs.status === "ready" && ["image", "video"].includes(e.node.attrs.kind) ? (s(), f(r(g), {
|
|
108
|
+
key: 3,
|
|
109
|
+
class: S(["fk-media-play", { "is-image-preview": e.node.attrs.kind === "image" }]),
|
|
110
|
+
type: "text",
|
|
111
|
+
"aria-label": e.node.attrs.kind === "image" ? "查看大图" : "播放视频",
|
|
112
|
+
style: { "pointer-events": "none" },
|
|
113
|
+
onClick: a[3] || (a[3] = (v) => o.value = !0)
|
|
114
|
+
}, {
|
|
115
|
+
default: m(() => [
|
|
116
|
+
p(r(b), {
|
|
117
|
+
name: "visible",
|
|
118
|
+
size: 14
|
|
119
|
+
}),
|
|
120
|
+
y(z(e.node.attrs.kind === "image" ? "点击查看大图" : "点击播放视频"), 1)
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["class", "aria-label"])) : n("", !0),
|
|
124
|
+
d ? n("", !0) : (s(), k("div", X, [
|
|
125
|
+
l.value ? (s(), k("span", Y, [
|
|
126
|
+
p(r(j), { size: 15 })
|
|
127
|
+
])) : n("", !0),
|
|
128
|
+
p(r(g), {
|
|
129
|
+
type: "text",
|
|
130
|
+
size: "mini",
|
|
131
|
+
title: "预览媒体",
|
|
132
|
+
"aria-label": "预览媒体",
|
|
133
|
+
onClick: a[4] || (a[4] = (v) => o.value = !0)
|
|
134
|
+
}, {
|
|
135
|
+
default: m(() => [
|
|
136
|
+
p(r(b), {
|
|
137
|
+
name: "open",
|
|
138
|
+
size: 15
|
|
139
|
+
})
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
}),
|
|
143
|
+
l.value && e.node.attrs.status === "error" ? (s(), f(r(g), {
|
|
144
|
+
key: 1,
|
|
145
|
+
type: "text",
|
|
146
|
+
size: "mini",
|
|
147
|
+
title: "重试上传",
|
|
148
|
+
"aria-label": "重试上传",
|
|
149
|
+
onClick: I
|
|
150
|
+
}, {
|
|
151
|
+
default: m(() => a[8] || (a[8] = [
|
|
152
|
+
y("重试")
|
|
153
|
+
])),
|
|
154
|
+
_: 1
|
|
155
|
+
})) : n("", !0),
|
|
156
|
+
l.value ? (s(), f(r(g), {
|
|
157
|
+
key: 2,
|
|
158
|
+
type: "text",
|
|
159
|
+
size: "mini",
|
|
160
|
+
title: "删除媒体",
|
|
161
|
+
"aria-label": "删除媒体",
|
|
162
|
+
onClick: A
|
|
163
|
+
}, {
|
|
164
|
+
default: m(() => [
|
|
165
|
+
p(r(b), {
|
|
166
|
+
name: "rte-del",
|
|
167
|
+
size: 15
|
|
168
|
+
})
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
})) : n("", !0)
|
|
172
|
+
])),
|
|
173
|
+
e.node.attrs.status === "uploading" ? (s(), k("div", Z, [
|
|
174
|
+
p(r(b), {
|
|
175
|
+
name: "sync",
|
|
176
|
+
size: 17,
|
|
177
|
+
class: "fk-spin"
|
|
178
|
+
}),
|
|
179
|
+
y("正在上传" + z(c.value === null ? "…" : ` ${c.value}%`), 1),
|
|
180
|
+
d && l.value ? (s(), f(r(g), {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: "fk-media-status-action",
|
|
183
|
+
type: "text",
|
|
184
|
+
size: "mini",
|
|
185
|
+
"aria-label": "取消上传",
|
|
186
|
+
onClick: E(A, ["stop"])
|
|
187
|
+
}, {
|
|
188
|
+
default: m(() => a[9] || (a[9] = [
|
|
189
|
+
y("取消上传")
|
|
190
|
+
])),
|
|
191
|
+
_: 1
|
|
192
|
+
})) : n("", !0)
|
|
193
|
+
])) : n("", !0)
|
|
194
|
+
]),
|
|
195
|
+
C("div", h, [
|
|
196
|
+
e.node.attrs.kind === "video" ? (s(), f(r(b), {
|
|
197
|
+
key: 0,
|
|
198
|
+
name: "video2",
|
|
199
|
+
size: 12
|
|
200
|
+
})) : n("", !0),
|
|
201
|
+
C("span", null, z(e.node.attrs.name), 1),
|
|
202
|
+
e.node.attrs.status === "error" ? (s(), k("span", x, z(e.node.attrs.error), 1)) : n("", !0),
|
|
203
|
+
d && l.value && e.node.attrs.status === "error" ? (s(), k(U, { key: 2 }, [
|
|
204
|
+
p(r(g), {
|
|
205
|
+
class: "fk-media-status-action",
|
|
206
|
+
type: "text",
|
|
207
|
+
size: "mini",
|
|
208
|
+
"aria-label": "重试上传",
|
|
209
|
+
onClick: E(I, ["stop"])
|
|
210
|
+
}, {
|
|
211
|
+
default: m(() => a[10] || (a[10] = [
|
|
212
|
+
y("重试")
|
|
213
|
+
])),
|
|
214
|
+
_: 1
|
|
215
|
+
}),
|
|
216
|
+
p(r(g), {
|
|
217
|
+
class: "fk-media-status-action",
|
|
218
|
+
type: "text",
|
|
219
|
+
size: "mini",
|
|
220
|
+
"aria-label": "移除失败媒体",
|
|
221
|
+
onClick: E(A, ["stop"])
|
|
222
|
+
}, {
|
|
223
|
+
default: m(() => a[11] || (a[11] = [
|
|
224
|
+
y("移除")
|
|
225
|
+
])),
|
|
226
|
+
_: 1
|
|
227
|
+
})
|
|
228
|
+
], 64)) : n("", !0)
|
|
229
|
+
]),
|
|
230
|
+
e.node.attrs.kind === "image" ? (s(), f(r(O), {
|
|
231
|
+
key: 0,
|
|
232
|
+
visible: o.value,
|
|
233
|
+
"onUpdate:visible": a[5] || (a[5] = (v) => o.value = v),
|
|
234
|
+
src: e.node.attrs.src,
|
|
235
|
+
"mask-closable": !0
|
|
236
|
+
}, null, 8, ["visible", "src"])) : (s(), f(r(R), {
|
|
237
|
+
key: 1,
|
|
238
|
+
visible: o.value,
|
|
239
|
+
"onUpdate:visible": a[6] || (a[6] = (v) => o.value = v),
|
|
240
|
+
title: e.node.attrs.name,
|
|
241
|
+
footer: !1,
|
|
242
|
+
width: "min(960px, 90vw)",
|
|
243
|
+
"unmount-on-close": ""
|
|
244
|
+
}, {
|
|
245
|
+
default: m(() => [
|
|
246
|
+
C("video", {
|
|
247
|
+
class: "fk-video-preview",
|
|
248
|
+
src: e.node.attrs.src,
|
|
249
|
+
controls: "",
|
|
250
|
+
autoplay: ""
|
|
251
|
+
}, null, 8, _)
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
}, 8, ["visible", "title"]))
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 8, ["class", "data-media-id", "data-drag-handle"]));
|
|
258
|
+
}
|
|
259
|
+
}), ne = M.create({
|
|
260
|
+
name: "mediaBlock",
|
|
261
|
+
group: "block",
|
|
262
|
+
atom: !0,
|
|
263
|
+
draggable: !0,
|
|
264
|
+
selectable: !0,
|
|
265
|
+
addOptions() {
|
|
266
|
+
return { sceneStyle: !1 };
|
|
267
|
+
},
|
|
268
|
+
addAttributes() {
|
|
269
|
+
return {
|
|
270
|
+
id: { default: "" },
|
|
271
|
+
nodeVersion: { default: 0 },
|
|
272
|
+
assetId: { default: null },
|
|
273
|
+
sourceType: { default: null },
|
|
274
|
+
src: { default: "" },
|
|
275
|
+
kind: { default: "image" },
|
|
276
|
+
name: { default: "" },
|
|
277
|
+
poster: { default: null },
|
|
278
|
+
status: { default: "ready" },
|
|
279
|
+
error: { default: "" }
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
parseHTML() {
|
|
283
|
+
return [
|
|
284
|
+
{
|
|
285
|
+
tag: "figure[data-media-block]",
|
|
286
|
+
getAttrs: (t) => {
|
|
287
|
+
var i, d, o, u, c, l;
|
|
288
|
+
return {
|
|
289
|
+
id: t.getAttribute("data-id"),
|
|
290
|
+
kind: t.getAttribute("data-kind"),
|
|
291
|
+
src: ((i = t.querySelector("img,video")) == null ? void 0 : i.getAttribute("src")) || (t.getAttribute("data-source-type") === "qianniuVideo" ? (d = t.querySelector("a[href]")) == null ? void 0 : d.getAttribute("href") : null),
|
|
292
|
+
name: (o = t.querySelector("figcaption")) == null ? void 0 : o.textContent,
|
|
293
|
+
assetId: t.getAttribute("data-asset-id") || ((u = t.querySelector("video")) == null ? void 0 : u.getAttribute("data-video-id")) || (t.getAttribute("data-source-type") === "qianniuVideo" ? (c = t.querySelector("video")) == null ? void 0 : c.getAttribute("id") : null),
|
|
294
|
+
sourceType: t.getAttribute("data-source-type"),
|
|
295
|
+
poster: (l = t.querySelector("video")) == null ? void 0 : l.getAttribute("poster"),
|
|
296
|
+
status: "ready"
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
];
|
|
301
|
+
},
|
|
302
|
+
renderHTML({ node: t, HTMLAttributes: i }) {
|
|
303
|
+
return [
|
|
304
|
+
"figure",
|
|
305
|
+
$(i, {
|
|
306
|
+
"data-media-block": "",
|
|
307
|
+
"data-fkp-node": "media-block",
|
|
308
|
+
"data-id": t.attrs.id,
|
|
309
|
+
"data-kind": t.attrs.kind,
|
|
310
|
+
"data-asset-id": t.attrs.assetId,
|
|
311
|
+
"data-source-type": t.attrs.sourceType,
|
|
312
|
+
"data-name": t.attrs.name
|
|
313
|
+
}),
|
|
314
|
+
t.attrs.kind === "video" ? [
|
|
315
|
+
"video",
|
|
316
|
+
{
|
|
317
|
+
src: t.attrs.src,
|
|
318
|
+
controls: "",
|
|
319
|
+
poster: t.attrs.poster,
|
|
320
|
+
...t.attrs.sourceType === "qianniuVideo" ? {
|
|
321
|
+
id: t.attrs.assetId,
|
|
322
|
+
"data-video-id": t.attrs.assetId
|
|
323
|
+
} : {}
|
|
324
|
+
}
|
|
325
|
+
] : ["img", { src: t.attrs.src, alt: t.attrs.name }],
|
|
326
|
+
["figcaption", {}, t.attrs.name]
|
|
327
|
+
];
|
|
328
|
+
},
|
|
329
|
+
renderText({ node: t }) {
|
|
330
|
+
return `[${t.attrs.kind === "video" ? "视频" : "图片"}:${t.attrs.name}]`;
|
|
331
|
+
},
|
|
332
|
+
addNodeView() {
|
|
333
|
+
return L(ee);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
export {
|
|
337
|
+
ne as MediaBlock
|
|
338
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as O, ref as v, watch as B, nextTick as N, openBlock as s, createElementBlock as
|
|
2
|
-
import { Menu as U, MenuItem as F, Modal as
|
|
3
|
-
import { i as h, o as J } from "./guard-
|
|
4
|
-
function
|
|
1
|
+
import { defineComponent as O, ref as v, watch as B, nextTick as N, openBlock as s, createElementBlock as I, Fragment as D, createBlock as k, unref as u, withKeys as c, withModifiers as p, normalizeStyle as H, withCtx as f, renderList as T, createTextVNode as y, toDisplayString as b, createCommentVNode as K, createElementVNode as m, createVNode as M } from "vue";
|
|
2
|
+
import { Menu as U, MenuItem as F, Modal as j, Input as $, Alert as L, Message as S } from "@freecallai/ui";
|
|
3
|
+
import { i as h, o as J, q as Q } from "./guard-CZOoBb3d.js";
|
|
4
|
+
function Z(a, l) {
|
|
5
5
|
const o = a == null ? void 0 : a[l];
|
|
6
6
|
return o === void 0 ? ["local"] : Array.isArray(o) ? [
|
|
7
7
|
...new Set(
|
|
@@ -19,14 +19,14 @@ function z(a) {
|
|
|
19
19
|
).join(",")}}` : JSON.stringify(o) ?? "null";
|
|
20
20
|
return l(a);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function x(a) {
|
|
23
23
|
return z(a);
|
|
24
24
|
}
|
|
25
|
-
const P = ["for"],
|
|
25
|
+
const P = ["for"], X = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "fkp-media-url-error",
|
|
28
28
|
role: "alert"
|
|
29
|
-
},
|
|
29
|
+
}, Y = { class: "fkp-qianniu-video-form" }, _ = /* @__PURE__ */ O({
|
|
30
30
|
__name: "MediaSourceControls",
|
|
31
31
|
props: {
|
|
32
32
|
menuKind: {},
|
|
@@ -47,21 +47,21 @@ const P = ["for"], Q = {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
function
|
|
50
|
+
function V() {
|
|
51
51
|
const i = r.value.trim();
|
|
52
52
|
return h(i) ? (d.value = "", n("submit", i), !0) : (d.value = "请输入有效的 http(s) 媒体链接", !1);
|
|
53
53
|
}
|
|
54
54
|
function C() {
|
|
55
55
|
const i = g.value.trim(), e = r.value.trim();
|
|
56
|
-
return !i || !e ? (
|
|
56
|
+
return !i || !e ? (S.error(
|
|
57
57
|
!i && !e ? "请填写视频ID与链接" : i ? "请填写视频链接" : "请填写视频ID"
|
|
58
|
-
), !1) : J(e) ? (n("submit-qianniu", { id: i, url: e }), !0) : (
|
|
58
|
+
), !1) : J(i) ? Q(e) ? (n("submit-qianniu", { id: i, url: e }), !0) : (S.error("不支持此链接格式,请前往千牛素材中心复制"), !1) : (S.error("视频ID仅支持数字"), !1);
|
|
59
59
|
}
|
|
60
60
|
function E() {
|
|
61
61
|
var i;
|
|
62
62
|
(i = w.value) == null || i.focus();
|
|
63
63
|
}
|
|
64
|
-
return (i, e) => (s(),
|
|
64
|
+
return (i, e) => (s(), I(D, null, [
|
|
65
65
|
i.menuKind ? (s(), k(u(U), {
|
|
66
66
|
key: 0,
|
|
67
67
|
class: "fkp-media-source-menu",
|
|
@@ -71,16 +71,16 @@ const P = ["for"], Q = {
|
|
|
71
71
|
onKeydown: e[1] || (e[1] = c(p((t) => n("close"), ["stop"]), ["esc"]))
|
|
72
72
|
}, {
|
|
73
73
|
default: f(() => [
|
|
74
|
-
(s(!0),
|
|
74
|
+
(s(!0), I(D, null, T(i.sources, (t) => (s(), k(u(F), {
|
|
75
75
|
key: t,
|
|
76
76
|
role: "menuitem",
|
|
77
77
|
tabindex: "0",
|
|
78
78
|
onMousedown: e[0] || (e[0] = p(() => {
|
|
79
79
|
}, ["prevent"])),
|
|
80
|
-
onClick: (
|
|
80
|
+
onClick: (q) => n("choose", t),
|
|
81
81
|
onKeydown: [
|
|
82
|
-
c(p((
|
|
83
|
-
c(p((
|
|
82
|
+
c(p((q) => n("choose", t), ["prevent"]), ["enter"]),
|
|
83
|
+
c(p((q) => n("choose", t), ["prevent"]), ["space"])
|
|
84
84
|
]
|
|
85
85
|
}, {
|
|
86
86
|
default: f(() => [
|
|
@@ -91,13 +91,13 @@ const P = ["for"], Q = {
|
|
|
91
91
|
]),
|
|
92
92
|
_: 1
|
|
93
93
|
}, 8, ["style", "aria-label"])) : K("", !0),
|
|
94
|
-
i.dialogKind && !i.qianniuDialog ? (s(), k(u(
|
|
94
|
+
i.dialogKind && !i.qianniuDialog ? (s(), k(u(j), {
|
|
95
95
|
key: 1,
|
|
96
96
|
visible: !0,
|
|
97
97
|
title: `添加在线${i.dialogKind === "image" ? "图片" : "视频"}`,
|
|
98
98
|
width: 420,
|
|
99
99
|
"render-to-body": !1,
|
|
100
|
-
"on-before-ok":
|
|
100
|
+
"on-before-ok": V,
|
|
101
101
|
"ok-text": "添加",
|
|
102
102
|
role: "dialog",
|
|
103
103
|
"aria-modal": "true",
|
|
@@ -110,7 +110,7 @@ const P = ["for"], Q = {
|
|
|
110
110
|
class: "fkp-media-url-label",
|
|
111
111
|
for: `fkp-media-url-${i.dialogKind}`
|
|
112
112
|
}, b(i.dialogKind === "image" ? "图片" : "视频") + "链接", 9, P),
|
|
113
|
-
M(u(
|
|
113
|
+
M(u($), {
|
|
114
114
|
ref_key: "input",
|
|
115
115
|
ref: w,
|
|
116
116
|
modelValue: r.value,
|
|
@@ -119,13 +119,13 @@ const P = ["for"], Q = {
|
|
|
119
119
|
"input-attrs": { id: `fkp-media-url-${i.dialogKind}`, type: "url" },
|
|
120
120
|
placeholder: "https://example.com/media",
|
|
121
121
|
onInput: e[3] || (e[3] = (t) => d.value = ""),
|
|
122
|
-
onKeydown: c(p(
|
|
122
|
+
onKeydown: c(p(V, ["prevent"]), ["enter"])
|
|
123
123
|
}, null, 8, ["modelValue", "error", "input-attrs", "onKeydown"]),
|
|
124
|
-
d.value ? (s(),
|
|
124
|
+
d.value ? (s(), I("p", X, b(d.value), 1)) : K("", !0)
|
|
125
125
|
]),
|
|
126
126
|
_: 1
|
|
127
127
|
}, 8, ["title", "aria-label"])) : K("", !0),
|
|
128
|
-
i.dialogKind === "video" && i.qianniuDialog ? (s(), k(u(
|
|
128
|
+
i.dialogKind === "video" && i.qianniuDialog ? (s(), k(u(j), {
|
|
129
129
|
key: 2,
|
|
130
130
|
visible: !0,
|
|
131
131
|
title: "添加视频",
|
|
@@ -139,7 +139,7 @@ const P = ["for"], Q = {
|
|
|
139
139
|
onCancel: e[7] || (e[7] = (t) => n("close"))
|
|
140
140
|
}, {
|
|
141
141
|
default: f(() => [
|
|
142
|
-
m("div",
|
|
142
|
+
m("div", Y, [
|
|
143
143
|
M(u(L), {
|
|
144
144
|
type: "info",
|
|
145
145
|
"show-icon": !0
|
|
@@ -153,7 +153,7 @@ const P = ["for"], Q = {
|
|
|
153
153
|
m("span", { "aria-hidden": "true" }, "*"),
|
|
154
154
|
y(" 视频ID")
|
|
155
155
|
], -1)),
|
|
156
|
-
M(u(
|
|
156
|
+
M(u($), {
|
|
157
157
|
id: "fkp-qianniu-video-id",
|
|
158
158
|
modelValue: g.value,
|
|
159
159
|
"onUpdate:modelValue": e[5] || (e[5] = (t) => g.value = t),
|
|
@@ -163,7 +163,7 @@ const P = ["for"], Q = {
|
|
|
163
163
|
m("span", { "aria-hidden": "true" }, "*"),
|
|
164
164
|
y(" 视频链接")
|
|
165
165
|
], -1)),
|
|
166
|
-
M(u(
|
|
166
|
+
M(u($), {
|
|
167
167
|
id: "fkp-qianniu-video-url",
|
|
168
168
|
modelValue: r.value,
|
|
169
169
|
"onUpdate:modelValue": e[6] || (e[6] = (t) => r.value = t),
|
|
@@ -176,7 +176,7 @@ const P = ["for"], Q = {
|
|
|
176
176
|
], 64));
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
function
|
|
179
|
+
function ee() {
|
|
180
180
|
const a = v(null);
|
|
181
181
|
function l(n) {
|
|
182
182
|
a.value = n;
|
|
@@ -186,10 +186,10 @@ function _() {
|
|
|
186
186
|
}
|
|
187
187
|
return { suppressedMediaHint: a, suppressMediaHint: l, resumeMediaHintOnHover: o };
|
|
188
188
|
}
|
|
189
|
-
const
|
|
189
|
+
const ne = 10, ie = {
|
|
190
190
|
image: 5 * 1024 * 1024,
|
|
191
191
|
video: 100 * 1024 * 1024
|
|
192
|
-
},
|
|
192
|
+
}, oe = {
|
|
193
193
|
image: ["image/png", "image/jpeg"],
|
|
194
194
|
video: ["video/mp4"]
|
|
195
195
|
}, A = {
|
|
@@ -198,18 +198,18 @@ const ee = 10, ne = {
|
|
|
198
198
|
jpeg: { kind: "image", mime: "image/jpeg" },
|
|
199
199
|
mp4: { kind: "video", mime: "video/mp4" }
|
|
200
200
|
};
|
|
201
|
-
function
|
|
201
|
+
function ae(a) {
|
|
202
202
|
const l = a.name.lastIndexOf("."), o = l < 0 ? "" : a.name.slice(l + 1).toLowerCase(), n = Object.prototype.hasOwnProperty.call(A, o) ? A[o] : void 0;
|
|
203
203
|
return !n || a.type && a.type.toLowerCase() !== n.mime ? null : n;
|
|
204
204
|
}
|
|
205
205
|
export {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
ne as M,
|
|
207
|
+
_,
|
|
208
|
+
ae as a,
|
|
209
|
+
ie as b,
|
|
210
210
|
z as c,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
x as d,
|
|
212
|
+
oe as e,
|
|
213
|
+
Z as m,
|
|
214
|
+
ee as u
|
|
215
215
|
};
|