@bagelink/vue 0.0.374 → 0.0.384
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/dist/components/BglVideo.vue.d.ts +6 -6
- package/dist/components/BglVideo.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +2 -0
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalForm.vue.d.ts +6 -0
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts +9 -2
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText.vue.d.ts.map +1 -1
- package/dist/index.cjs +460 -90
- package/dist/index.mjs +460 -90
- package/dist/plugins/modal.d.ts +2 -0
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +143 -134
- package/package.json +3 -1
- package/src/components/BglVideo.vue +27 -21
- package/src/components/Modal.vue +67 -46
- package/src/components/ModalForm.vue +39 -18
- package/src/components/form/inputs/FileUpload.vue +83 -91
- package/src/components/form/inputs/FileUploadURL.vue +296 -0
- package/src/components/form/inputs/RichText.vue +50 -10
- package/src/plugins/modal.ts +2 -0
- package/src/styles/modal.css +74 -74
package/dist/index.mjs
CHANGED
|
@@ -4791,7 +4791,7 @@ class Bagel {
|
|
|
4791
4791
|
async uploadFile(file, options) {
|
|
4792
4792
|
const formData = new FormData();
|
|
4793
4793
|
formData.append("file", file);
|
|
4794
|
-
const { data: data2 } = await axios.post("/
|
|
4794
|
+
const { data: data2 } = await axios.post("/static_files/upload", formData, {
|
|
4795
4795
|
headers: {
|
|
4796
4796
|
"Content-Type": "multipart/form-data"
|
|
4797
4797
|
},
|
|
@@ -4962,7 +4962,7 @@ function frmRow(...children2) {
|
|
|
4962
4962
|
children: children2
|
|
4963
4963
|
};
|
|
4964
4964
|
}
|
|
4965
|
-
const
|
|
4965
|
+
const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4966
4966
|
__proto__: null,
|
|
4967
4967
|
frmRow,
|
|
4968
4968
|
numField,
|
|
@@ -5040,7 +5040,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
5040
5040
|
});
|
|
5041
5041
|
const _hoisted_1$E = { class: "full-nav" };
|
|
5042
5042
|
const _hoisted_2$x = { class: "nav-scroll" };
|
|
5043
|
-
const _hoisted_3$
|
|
5043
|
+
const _hoisted_3$l = { class: "nav-links-wrapper" };
|
|
5044
5044
|
const _hoisted_4$e = { class: "tooltip" };
|
|
5045
5045
|
const _hoisted_5$b = { class: "bot-buttons-wrapper" };
|
|
5046
5046
|
const _hoisted_6$7 = { class: "tooltip" };
|
|
@@ -5075,7 +5075,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
5075
5075
|
], 32),
|
|
5076
5076
|
createElementVNode("div", _hoisted_1$E, [
|
|
5077
5077
|
createElementVNode("div", _hoisted_2$x, [
|
|
5078
|
-
createElementVNode("div", _hoisted_3$
|
|
5078
|
+
createElementVNode("div", _hoisted_3$l, [
|
|
5079
5079
|
(openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.links, (link) => {
|
|
5080
5080
|
return openBlock(), createBlock(resolveDynamicComponent(link.to ? "router-link" : "div"), {
|
|
5081
5081
|
class: "nav-button",
|
|
@@ -5255,6 +5255,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5255
5255
|
props: {
|
|
5256
5256
|
side: { type: Boolean },
|
|
5257
5257
|
title: {},
|
|
5258
|
+
width: {},
|
|
5258
5259
|
dismissable: { type: Boolean },
|
|
5259
5260
|
actions: {},
|
|
5260
5261
|
visible: { type: Boolean }
|
|
@@ -5263,14 +5264,26 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5263
5264
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5264
5265
|
const props2 = __props;
|
|
5265
5266
|
let isVisible = ref(false);
|
|
5266
|
-
watch(
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5267
|
+
watch(
|
|
5268
|
+
() => props2.visible,
|
|
5269
|
+
(val) => {
|
|
5270
|
+
if (val === isVisible.value || val === void 0)
|
|
5271
|
+
return;
|
|
5272
|
+
if (val)
|
|
5273
|
+
openModal();
|
|
5274
|
+
else
|
|
5275
|
+
closeModal();
|
|
5276
|
+
},
|
|
5277
|
+
{ immediate: true }
|
|
5278
|
+
);
|
|
5279
|
+
const maxWidth = computed(() => {
|
|
5280
|
+
const { width } = props2;
|
|
5281
|
+
if (width == null ? void 0 : width.match(/px|em|rem|vw|vh|%/))
|
|
5282
|
+
return { "max-width": width };
|
|
5283
|
+
if (width == null ? void 0 : width.match(/\d+/))
|
|
5284
|
+
return { "max-width": `${width}px` };
|
|
5285
|
+
return { "max-width": "720px" };
|
|
5286
|
+
});
|
|
5274
5287
|
const emit2 = __emit;
|
|
5275
5288
|
const closeModal = () => {
|
|
5276
5289
|
isVisible.value = false;
|
|
@@ -5294,7 +5307,8 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5294
5307
|
createVNode(unref(_sfc_main$u), {
|
|
5295
5308
|
class: "modal",
|
|
5296
5309
|
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
5297
|
-
}, ["stop"]))
|
|
5310
|
+
}, ["stop"])),
|
|
5311
|
+
style: normalizeStyle({ ...maxWidth.value })
|
|
5298
5312
|
}, {
|
|
5299
5313
|
default: withCtx(() => [
|
|
5300
5314
|
createElementVNode("header", _hoisted_1$C, [
|
|
@@ -5325,7 +5339,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5325
5339
|
])
|
|
5326
5340
|
]),
|
|
5327
5341
|
_: 3
|
|
5328
|
-
})
|
|
5342
|
+
}, 8, ["style"])
|
|
5329
5343
|
], 34);
|
|
5330
5344
|
};
|
|
5331
5345
|
}
|
|
@@ -5335,6 +5349,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5335
5349
|
props: /* @__PURE__ */ mergeModels({
|
|
5336
5350
|
side: { type: Boolean },
|
|
5337
5351
|
title: {},
|
|
5352
|
+
width: {},
|
|
5338
5353
|
dismissable: { type: Boolean },
|
|
5339
5354
|
actions: {},
|
|
5340
5355
|
schema: { type: Function },
|
|
@@ -5344,7 +5359,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5344
5359
|
onError: { type: Function },
|
|
5345
5360
|
modelValue: {}
|
|
5346
5361
|
}, {
|
|
5347
|
-
"modelValue": {
|
|
5362
|
+
"modelValue": {
|
|
5363
|
+
default: {}
|
|
5364
|
+
},
|
|
5348
5365
|
"modelModifiers": {}
|
|
5349
5366
|
}),
|
|
5350
5367
|
emits: ["update:modelValue"],
|
|
@@ -5392,6 +5409,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5392
5409
|
side: _ctx.side,
|
|
5393
5410
|
ref_key: "modal",
|
|
5394
5411
|
ref: modal,
|
|
5412
|
+
width: _ctx.width,
|
|
5395
5413
|
dismissable: _ctx.dismissable,
|
|
5396
5414
|
title: _ctx.title
|
|
5397
5415
|
}, createSlots({
|
|
@@ -5434,14 +5452,14 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5434
5452
|
]),
|
|
5435
5453
|
key: "0"
|
|
5436
5454
|
} : void 0
|
|
5437
|
-
]), 1032, ["onOnUpdate:isModalVisible", "side", "dismissable", "title"]);
|
|
5455
|
+
]), 1032, ["onOnUpdate:isModalVisible", "side", "width", "dismissable", "title"]);
|
|
5438
5456
|
};
|
|
5439
5457
|
}
|
|
5440
5458
|
});
|
|
5441
|
-
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
5459
|
+
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-204f5236"]]);
|
|
5442
5460
|
const _hoisted_1$B = { class: "accordion-item" };
|
|
5443
5461
|
const _hoisted_2$u = ["aria-expanded", "aria-controls"];
|
|
5444
|
-
const _hoisted_3$
|
|
5462
|
+
const _hoisted_3$k = { class: "accordion-label" };
|
|
5445
5463
|
const _hoisted_4$d = ["id", "aria-hidden"];
|
|
5446
5464
|
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
5447
5465
|
__name: "AccordionItem",
|
|
@@ -5474,7 +5492,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
5474
5492
|
class: "accordion-head",
|
|
5475
5493
|
"aria-controls": `accordion-body-${unref(id)}`
|
|
5476
5494
|
}, [
|
|
5477
|
-
createElementVNode("span", _hoisted_3$
|
|
5495
|
+
createElementVNode("span", _hoisted_3$k, toDisplayString(_ctx.label), 1),
|
|
5478
5496
|
createElementVNode("div", {
|
|
5479
5497
|
class: normalizeClass(["accordion-icon", { open: unref(open) }])
|
|
5480
5498
|
}, [
|
|
@@ -5501,7 +5519,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
5501
5519
|
const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-bf74738b"]]);
|
|
5502
5520
|
const _hoisted_1$A = { class: "list-wrap bgl_card thin grid overflow-hidden h-100 p-0" };
|
|
5503
5521
|
const _hoisted_2$t = { class: "p-1" };
|
|
5504
|
-
const _hoisted_3$
|
|
5522
|
+
const _hoisted_3$j = { class: "list-content auto-flow-rows align-items-start overflow-y h-100" };
|
|
5505
5523
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
5506
5524
|
__name: "ListView",
|
|
5507
5525
|
setup(__props) {
|
|
@@ -5510,7 +5528,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5510
5528
|
createElementVNode("div", _hoisted_2$t, [
|
|
5511
5529
|
renderSlot(_ctx.$slots, "header")
|
|
5512
5530
|
]),
|
|
5513
|
-
createElementVNode("div", _hoisted_3$
|
|
5531
|
+
createElementVNode("div", _hoisted_3$j, [
|
|
5514
5532
|
renderSlot(_ctx.$slots, "default")
|
|
5515
5533
|
])
|
|
5516
5534
|
]);
|
|
@@ -5581,7 +5599,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
5581
5599
|
});
|
|
5582
5600
|
const _hoisted_1$x = { class: "table-list-wrap h-100" };
|
|
5583
5601
|
const _hoisted_2$q = { class: "infinite-wrapper" };
|
|
5584
|
-
const _hoisted_3$
|
|
5602
|
+
const _hoisted_3$i = { class: "row first-row" };
|
|
5585
5603
|
const _hoisted_4$c = ["onClick"];
|
|
5586
5604
|
const _hoisted_5$a = { class: "flex" };
|
|
5587
5605
|
const _hoisted_6$6 = ["onClick"];
|
|
@@ -5622,7 +5640,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
5622
5640
|
return (_ctx, _cache) => {
|
|
5623
5641
|
return openBlock(), createElementBlock("div", _hoisted_1$x, [
|
|
5624
5642
|
createElementVNode("table", _hoisted_2$q, [
|
|
5625
|
-
createElementVNode("thead", _hoisted_3$
|
|
5643
|
+
createElementVNode("thead", _hoisted_3$i, [
|
|
5626
5644
|
(openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (field) => {
|
|
5627
5645
|
return openBlock(), createElementBlock("th", {
|
|
5628
5646
|
class: "col",
|
|
@@ -5718,7 +5736,7 @@ const _hoisted_2$p = {
|
|
|
5718
5736
|
key: 0,
|
|
5719
5737
|
class: "data-row"
|
|
5720
5738
|
};
|
|
5721
|
-
const _hoisted_3$
|
|
5739
|
+
const _hoisted_3$h = { class: "key" };
|
|
5722
5740
|
const _hoisted_4$b = { key: 1 };
|
|
5723
5741
|
const _hoisted_5$9 = { class: "key" };
|
|
5724
5742
|
const _hoisted_6$5 = { class: "vlue" };
|
|
@@ -5746,7 +5764,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
5746
5764
|
key: field.id
|
|
5747
5765
|
}, [
|
|
5748
5766
|
unref(iffer)(field, itemData.value) ? (openBlock(), createElementBlock("div", _hoisted_2$p, [
|
|
5749
|
-
createElementVNode("div", _hoisted_3$
|
|
5767
|
+
createElementVNode("div", _hoisted_3$h, toDisplayString((field == null ? void 0 : field.label) || unref(keyToLabel)(field.id)), 1),
|
|
5750
5768
|
createVNode(unref(_sfc_main$l), {
|
|
5751
5769
|
field,
|
|
5752
5770
|
modelValue: itemData.value,
|
|
@@ -5944,9 +5962,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
5944
5962
|
}
|
|
5945
5963
|
});
|
|
5946
5964
|
const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-10743b06"]]);
|
|
5947
|
-
const _hoisted_1$r =
|
|
5948
|
-
const _hoisted_2$n = ["src"];
|
|
5949
|
-
const _hoisted_3$h = ["src", "autoplay", "muted", "loop", "controls"];
|
|
5965
|
+
const _hoisted_1$r = ["src"];
|
|
5966
|
+
const _hoisted_2$n = ["src", "autoplay", "muted", "loop", "controls"];
|
|
5950
5967
|
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
5951
5968
|
__name: "BglVideo",
|
|
5952
5969
|
props: {
|
|
@@ -5959,26 +5976,31 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
5959
5976
|
},
|
|
5960
5977
|
setup(__props) {
|
|
5961
5978
|
const props2 = __props;
|
|
5962
|
-
const aspectRatio = computed(
|
|
5979
|
+
const aspectRatio = computed(
|
|
5980
|
+
() => {
|
|
5981
|
+
var _a2;
|
|
5982
|
+
return ((_a2 = props2.aspectRatio) == null ? void 0 : _a2.replace(":", "/")) || "16/9";
|
|
5983
|
+
}
|
|
5984
|
+
);
|
|
5963
5985
|
const embedType = computed(() => {
|
|
5964
5986
|
const youtubeRegex = /youtube\.com|youtu\.be/;
|
|
5965
|
-
if (youtubeRegex.test(props2.src))
|
|
5987
|
+
if (youtubeRegex.test(props2.src || ""))
|
|
5966
5988
|
return "YouTube";
|
|
5967
5989
|
const vimeoRegex = /vimeo\.com/;
|
|
5968
|
-
if (vimeoRegex.test(props2.src))
|
|
5990
|
+
if (vimeoRegex.test(props2.src || ""))
|
|
5969
5991
|
return "Vimeo";
|
|
5970
5992
|
return null;
|
|
5971
5993
|
});
|
|
5972
5994
|
const videoUrl = computed(() => {
|
|
5973
|
-
var _a2, _b, _c, _d;
|
|
5995
|
+
var _a2, _b, _c, _d, _e2, _f;
|
|
5974
5996
|
if (embedType.value) {
|
|
5975
5997
|
if (embedType.value === "YouTube") {
|
|
5976
|
-
const videoId = (_c = (_b = (_a2 = props2.src.split(/v=|youtu\.be\//)) == null ? void 0 :
|
|
5998
|
+
const videoId = (_d = (_c = (_b = (_a2 = props2.src) == null ? void 0 : _a2.split(/v=|youtu\.be\//)) == null ? void 0 : _b[1]) == null ? void 0 : _c.split("&")) == null ? void 0 : _d[0];
|
|
5977
5999
|
return `https://www.youtube.com/embed/${videoId}`;
|
|
5978
6000
|
}
|
|
5979
6001
|
if (embedType.value === "Vimeo") {
|
|
5980
6002
|
const vimeoRegex = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/;
|
|
5981
|
-
const videoId = (
|
|
6003
|
+
const videoId = (_f = (_e2 = props2.src) == null ? void 0 : _e2.match(vimeoRegex)) == null ? void 0 : _f[3];
|
|
5982
6004
|
return `https://player.vimeo.com/video/${videoId}`;
|
|
5983
6005
|
}
|
|
5984
6006
|
}
|
|
@@ -5986,7 +6008,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
5986
6008
|
});
|
|
5987
6009
|
console.log("Video URL:", videoUrl.value);
|
|
5988
6010
|
return (_ctx, _cache) => {
|
|
5989
|
-
return openBlock(), createElementBlock("div",
|
|
6011
|
+
return openBlock(), createElementBlock("div", {
|
|
6012
|
+
class: normalizeClass(["bgl_vid", { vid_empty: !_ctx.src }])
|
|
6013
|
+
}, [
|
|
5990
6014
|
embedType.value ? (openBlock(), createElementBlock("iframe", {
|
|
5991
6015
|
key: 0,
|
|
5992
6016
|
src: videoUrl.value,
|
|
@@ -5994,7 +6018,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
5994
6018
|
frameborder: "0",
|
|
5995
6019
|
allowfullscreen: "",
|
|
5996
6020
|
title: "Video"
|
|
5997
|
-
}, null, 12,
|
|
6021
|
+
}, null, 12, _hoisted_1$r)) : _ctx.src ? (openBlock(), createElementBlock("video", {
|
|
5998
6022
|
key: 1,
|
|
5999
6023
|
src: _ctx.src,
|
|
6000
6024
|
autoplay: _ctx.autoplay,
|
|
@@ -6003,12 +6027,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
6003
6027
|
style: normalizeStyle({ aspectRatio: aspectRatio.value }),
|
|
6004
6028
|
controls: _ctx.controls,
|
|
6005
6029
|
playsinline: ""
|
|
6006
|
-
}, null, 12,
|
|
6007
|
-
]);
|
|
6030
|
+
}, null, 12, _hoisted_2$n)) : createCommentVNode("", true)
|
|
6031
|
+
], 2);
|
|
6008
6032
|
};
|
|
6009
6033
|
}
|
|
6010
6034
|
});
|
|
6011
|
-
const BglVideo = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
6035
|
+
const BglVideo = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-bbfc4353"]]);
|
|
6012
6036
|
const _hoisted_1$q = {
|
|
6013
6037
|
key: 0,
|
|
6014
6038
|
class: "blocker"
|
|
@@ -18421,7 +18445,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18421
18445
|
label: {},
|
|
18422
18446
|
multiple: { type: Boolean },
|
|
18423
18447
|
files: {},
|
|
18424
|
-
deleteEndpoint: {}
|
|
18448
|
+
deleteEndpoint: {},
|
|
18449
|
+
bindkey: {}
|
|
18425
18450
|
}, {
|
|
18426
18451
|
"modelValue": {},
|
|
18427
18452
|
"modelModifiers": {}
|
|
@@ -18430,23 +18455,34 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18430
18455
|
setup(__props) {
|
|
18431
18456
|
const bagel = useBagel();
|
|
18432
18457
|
const props2 = __props;
|
|
18433
|
-
const
|
|
18458
|
+
const bindKey2 = props2.bindkey || "id";
|
|
18459
|
+
const file_bindkeys = useModel(__props, "modelValue");
|
|
18434
18460
|
const storageFiles = ref([]);
|
|
18435
18461
|
const compareIds = (v1, v2) => [v1].flat().join(",") === [v2].flat().join(",");
|
|
18436
|
-
watch(
|
|
18437
|
-
|
|
18438
|
-
|
|
18439
|
-
|
|
18440
|
-
|
|
18441
|
-
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
|
|
18448
|
-
|
|
18449
|
-
|
|
18462
|
+
watch(
|
|
18463
|
+
() => props2.files,
|
|
18464
|
+
(newFiles) => {
|
|
18465
|
+
if (newFiles)
|
|
18466
|
+
storageFiles.value.push(...[newFiles].flat());
|
|
18467
|
+
},
|
|
18468
|
+
{ immediate: true }
|
|
18469
|
+
);
|
|
18470
|
+
watch(
|
|
18471
|
+
() => storageFiles.value,
|
|
18472
|
+
(newFiles) => {
|
|
18473
|
+
var _a2;
|
|
18474
|
+
let idValue;
|
|
18475
|
+
if (props2.multiple)
|
|
18476
|
+
idValue = newFiles.map((f2) => f2[bindKey2]);
|
|
18477
|
+
else {
|
|
18478
|
+
idValue = ((_a2 = newFiles[0]) == null ? void 0 : _a2[bindKey2]) || "";
|
|
18479
|
+
}
|
|
18480
|
+
if (!compareIds(file_bindkeys == null ? void 0 : file_bindkeys.value, idValue)) {
|
|
18481
|
+
file_bindkeys.value = idValue;
|
|
18482
|
+
}
|
|
18483
|
+
},
|
|
18484
|
+
{ deep: true }
|
|
18485
|
+
);
|
|
18450
18486
|
const fileQueue = ref([]);
|
|
18451
18487
|
let isDragOver = ref(false);
|
|
18452
18488
|
const preventDefault = (e) => {
|
|
@@ -18457,21 +18493,20 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18457
18493
|
const removeFile = (file) => {
|
|
18458
18494
|
const index2 = storageFiles.value.indexOf(file);
|
|
18459
18495
|
storageFiles.value.splice(index2, 1);
|
|
18460
|
-
if (props2.deleteEndpoint)
|
|
18496
|
+
if (props2.deleteEndpoint) {
|
|
18461
18497
|
void bagel.delete(`${props2.deleteEndpoint}/${file.id}`);
|
|
18498
|
+
}
|
|
18462
18499
|
};
|
|
18463
18500
|
const flushQueue = () => {
|
|
18464
|
-
fileQueue.value.forEach(
|
|
18465
|
-
|
|
18466
|
-
|
|
18467
|
-
|
|
18468
|
-
|
|
18469
|
-
|
|
18470
|
-
|
|
18471
|
-
|
|
18472
|
-
|
|
18473
|
-
}
|
|
18474
|
-
);
|
|
18501
|
+
fileQueue.value.forEach(async (file, i2) => {
|
|
18502
|
+
if (!props2.multiple)
|
|
18503
|
+
storageFiles.value.splice(0, 1);
|
|
18504
|
+
const serverFile = await bagel.uploadFile(file.file, {
|
|
18505
|
+
onUploadProgress: (e) => file.progress = e.progress * 100 - 1
|
|
18506
|
+
});
|
|
18507
|
+
storageFiles.value.push(serverFile);
|
|
18508
|
+
fileQueue.value.splice(i2, 1);
|
|
18509
|
+
});
|
|
18475
18510
|
};
|
|
18476
18511
|
const browse = () => {
|
|
18477
18512
|
const input = document.createElement("input");
|
|
@@ -18480,7 +18515,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18480
18515
|
input.onchange = (e) => {
|
|
18481
18516
|
const target = e == null ? void 0 : e.target;
|
|
18482
18517
|
if (target == null ? void 0 : target.files) {
|
|
18483
|
-
Array.from(target.files).forEach(
|
|
18518
|
+
Array.from(target.files).forEach(
|
|
18519
|
+
(file) => fileQueue.value.push({ name: file.name, file, progress: 0 })
|
|
18520
|
+
);
|
|
18484
18521
|
}
|
|
18485
18522
|
flushQueue();
|
|
18486
18523
|
};
|
|
@@ -18518,7 +18555,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18518
18555
|
onDragover: dragover,
|
|
18519
18556
|
onDrop: drop3,
|
|
18520
18557
|
onDragleave: dragleave,
|
|
18521
|
-
class: normalizeClass(["fileUploadWrap", {
|
|
18558
|
+
class: normalizeClass(["fileUploadWrap", {
|
|
18559
|
+
fileDropZone: !storageFiles.value.length && !fileQueue.value.length,
|
|
18560
|
+
dragover: unref(isDragOver)
|
|
18561
|
+
}])
|
|
18522
18562
|
}, [
|
|
18523
18563
|
(openBlock(true), createElementBlock(Fragment$1, null, renderList(storageFiles.value, (file) => {
|
|
18524
18564
|
return openBlock(), createElementBlock(Fragment$1, {
|
|
@@ -18588,7 +18628,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
18588
18628
|
};
|
|
18589
18629
|
}
|
|
18590
18630
|
});
|
|
18591
|
-
const
|
|
18631
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0dbacaa0"]]);
|
|
18592
18632
|
const _withScopeId = (n2) => (pushScopeId("data-v-b87221d6"), n2 = n2(), popScopeId(), n2);
|
|
18593
18633
|
const _hoisted_1$e = ["title"];
|
|
18594
18634
|
const _hoisted_2$b = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "slider round" }, null, -1));
|
|
@@ -33857,7 +33897,24 @@ function markPasteRule(config) {
|
|
|
33857
33897
|
}
|
|
33858
33898
|
});
|
|
33859
33899
|
}
|
|
33860
|
-
|
|
33900
|
+
function nodePasteRule(config) {
|
|
33901
|
+
return new PasteRule({
|
|
33902
|
+
find: config.find,
|
|
33903
|
+
handler({ match: match2, chain, range: range2, pasteEvent }) {
|
|
33904
|
+
const attributes = callOrReturn(config.getAttributes, void 0, match2, pasteEvent);
|
|
33905
|
+
if (attributes === false || attributes === null) {
|
|
33906
|
+
return null;
|
|
33907
|
+
}
|
|
33908
|
+
if (match2.input) {
|
|
33909
|
+
chain().deleteRange(range2).insertContentAt(range2.from, {
|
|
33910
|
+
type: config.type.name,
|
|
33911
|
+
attrs: attributes
|
|
33912
|
+
});
|
|
33913
|
+
}
|
|
33914
|
+
}
|
|
33915
|
+
});
|
|
33916
|
+
}
|
|
33917
|
+
const inputRegex$5 = /^\s*>\s$/;
|
|
33861
33918
|
const Blockquote = Node$2.create({
|
|
33862
33919
|
name: "blockquote",
|
|
33863
33920
|
addOptions() {
|
|
@@ -33897,7 +33954,7 @@ const Blockquote = Node$2.create({
|
|
|
33897
33954
|
addInputRules() {
|
|
33898
33955
|
return [
|
|
33899
33956
|
wrappingInputRule({
|
|
33900
|
-
find: inputRegex$
|
|
33957
|
+
find: inputRegex$5,
|
|
33901
33958
|
type: this.type
|
|
33902
33959
|
})
|
|
33903
33960
|
];
|
|
@@ -34042,7 +34099,7 @@ const TextStyle$1 = Mark.create({
|
|
|
34042
34099
|
};
|
|
34043
34100
|
}
|
|
34044
34101
|
});
|
|
34045
|
-
const inputRegex$
|
|
34102
|
+
const inputRegex$4 = /^\s*([-+*])\s$/;
|
|
34046
34103
|
const BulletList = Node$2.create({
|
|
34047
34104
|
name: "bulletList",
|
|
34048
34105
|
addOptions() {
|
|
@@ -34082,12 +34139,12 @@ const BulletList = Node$2.create({
|
|
|
34082
34139
|
},
|
|
34083
34140
|
addInputRules() {
|
|
34084
34141
|
let inputRule = wrappingInputRule({
|
|
34085
|
-
find: inputRegex$
|
|
34142
|
+
find: inputRegex$4,
|
|
34086
34143
|
type: this.type
|
|
34087
34144
|
});
|
|
34088
34145
|
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
34089
34146
|
inputRule = wrappingInputRule({
|
|
34090
|
-
find: inputRegex$
|
|
34147
|
+
find: inputRegex$4,
|
|
34091
34148
|
type: this.type,
|
|
34092
34149
|
keepMarks: this.options.keepMarks,
|
|
34093
34150
|
keepAttributes: this.options.keepAttributes,
|
|
@@ -34102,7 +34159,7 @@ const BulletList = Node$2.create({
|
|
|
34102
34159
|
];
|
|
34103
34160
|
}
|
|
34104
34161
|
});
|
|
34105
|
-
const inputRegex$
|
|
34162
|
+
const inputRegex$3 = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/;
|
|
34106
34163
|
const pasteRegex$1 = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g;
|
|
34107
34164
|
const Code = Mark.create({
|
|
34108
34165
|
name: "code",
|
|
@@ -34143,7 +34200,7 @@ const Code = Mark.create({
|
|
|
34143
34200
|
addInputRules() {
|
|
34144
34201
|
return [
|
|
34145
34202
|
markInputRule({
|
|
34146
|
-
find: inputRegex$
|
|
34203
|
+
find: inputRegex$3,
|
|
34147
34204
|
type: this.type
|
|
34148
34205
|
})
|
|
34149
34206
|
];
|
|
@@ -35631,7 +35688,7 @@ const TextStyle = Mark.create({
|
|
|
35631
35688
|
};
|
|
35632
35689
|
}
|
|
35633
35690
|
});
|
|
35634
|
-
const inputRegex$
|
|
35691
|
+
const inputRegex$2 = /^(\d+)\.\s$/;
|
|
35635
35692
|
const OrderedList = Node$2.create({
|
|
35636
35693
|
name: "orderedList",
|
|
35637
35694
|
addOptions() {
|
|
@@ -35684,14 +35741,14 @@ const OrderedList = Node$2.create({
|
|
|
35684
35741
|
},
|
|
35685
35742
|
addInputRules() {
|
|
35686
35743
|
let inputRule = wrappingInputRule({
|
|
35687
|
-
find: inputRegex$
|
|
35744
|
+
find: inputRegex$2,
|
|
35688
35745
|
type: this.type,
|
|
35689
35746
|
getAttributes: (match2) => ({ start: +match2[1] }),
|
|
35690
35747
|
joinPredicate: (match2, node) => node.childCount + node.attrs.start === +match2[1]
|
|
35691
35748
|
});
|
|
35692
35749
|
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
35693
35750
|
inputRule = wrappingInputRule({
|
|
35694
|
-
find: inputRegex$
|
|
35751
|
+
find: inputRegex$2,
|
|
35695
35752
|
type: this.type,
|
|
35696
35753
|
keepMarks: this.options.keepMarks,
|
|
35697
35754
|
keepAttributes: this.options.keepAttributes,
|
|
@@ -35736,7 +35793,7 @@ const Paragraph = Node$2.create({
|
|
|
35736
35793
|
};
|
|
35737
35794
|
}
|
|
35738
35795
|
});
|
|
35739
|
-
const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/;
|
|
35796
|
+
const inputRegex$1 = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/;
|
|
35740
35797
|
const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g;
|
|
35741
35798
|
const Strike = Mark.create({
|
|
35742
35799
|
name: "strike",
|
|
@@ -35791,7 +35848,7 @@ const Strike = Mark.create({
|
|
|
35791
35848
|
addInputRules() {
|
|
35792
35849
|
return [
|
|
35793
35850
|
markInputRule({
|
|
35794
|
-
find: inputRegex,
|
|
35851
|
+
find: inputRegex$1,
|
|
35795
35852
|
type: this.type
|
|
35796
35853
|
})
|
|
35797
35854
|
];
|
|
@@ -39083,6 +39140,285 @@ defineComponent({
|
|
|
39083
39140
|
}, (_b = (_a2 = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a2));
|
|
39084
39141
|
}
|
|
39085
39142
|
});
|
|
39143
|
+
const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
39144
|
+
const Image = Node$2.create({
|
|
39145
|
+
name: "image",
|
|
39146
|
+
addOptions() {
|
|
39147
|
+
return {
|
|
39148
|
+
inline: false,
|
|
39149
|
+
allowBase64: false,
|
|
39150
|
+
HTMLAttributes: {}
|
|
39151
|
+
};
|
|
39152
|
+
},
|
|
39153
|
+
inline() {
|
|
39154
|
+
return this.options.inline;
|
|
39155
|
+
},
|
|
39156
|
+
group() {
|
|
39157
|
+
return this.options.inline ? "inline" : "block";
|
|
39158
|
+
},
|
|
39159
|
+
draggable: true,
|
|
39160
|
+
addAttributes() {
|
|
39161
|
+
return {
|
|
39162
|
+
src: {
|
|
39163
|
+
default: null
|
|
39164
|
+
},
|
|
39165
|
+
alt: {
|
|
39166
|
+
default: null
|
|
39167
|
+
},
|
|
39168
|
+
title: {
|
|
39169
|
+
default: null
|
|
39170
|
+
}
|
|
39171
|
+
};
|
|
39172
|
+
},
|
|
39173
|
+
parseHTML() {
|
|
39174
|
+
return [
|
|
39175
|
+
{
|
|
39176
|
+
tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
|
|
39177
|
+
}
|
|
39178
|
+
];
|
|
39179
|
+
},
|
|
39180
|
+
renderHTML({ HTMLAttributes }) {
|
|
39181
|
+
return ["img", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
39182
|
+
},
|
|
39183
|
+
addCommands() {
|
|
39184
|
+
return {
|
|
39185
|
+
setImage: (options) => ({ commands: commands2 }) => {
|
|
39186
|
+
return commands2.insertContent({
|
|
39187
|
+
type: this.name,
|
|
39188
|
+
attrs: options
|
|
39189
|
+
});
|
|
39190
|
+
}
|
|
39191
|
+
};
|
|
39192
|
+
},
|
|
39193
|
+
addInputRules() {
|
|
39194
|
+
return [
|
|
39195
|
+
nodeInputRule({
|
|
39196
|
+
find: inputRegex,
|
|
39197
|
+
type: this.type,
|
|
39198
|
+
getAttributes: (match2) => {
|
|
39199
|
+
const [, , alt, src, title] = match2;
|
|
39200
|
+
return { src, alt, title };
|
|
39201
|
+
}
|
|
39202
|
+
})
|
|
39203
|
+
];
|
|
39204
|
+
}
|
|
39205
|
+
});
|
|
39206
|
+
const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?!channel\/)(?!@)(.+)?$/;
|
|
39207
|
+
const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/g;
|
|
39208
|
+
const isValidYoutubeUrl = (url) => {
|
|
39209
|
+
return url.match(YOUTUBE_REGEX);
|
|
39210
|
+
};
|
|
39211
|
+
const getYoutubeEmbedUrl = (nocookie) => {
|
|
39212
|
+
return nocookie ? "https://www.youtube-nocookie.com/embed/" : "https://www.youtube.com/embed/";
|
|
39213
|
+
};
|
|
39214
|
+
const getEmbedUrlFromYoutubeUrl = (options) => {
|
|
39215
|
+
const { url, allowFullscreen, autoplay, ccLanguage, ccLoadPolicy, controls, disableKBcontrols, enableIFrameApi, endTime, interfaceLanguage, ivLoadPolicy, loop, modestBranding, nocookie, origin, playlist, progressBarColor, startAt } = options;
|
|
39216
|
+
if (!isValidYoutubeUrl(url)) {
|
|
39217
|
+
return null;
|
|
39218
|
+
}
|
|
39219
|
+
if (url.includes("/embed/")) {
|
|
39220
|
+
return url;
|
|
39221
|
+
}
|
|
39222
|
+
if (url.includes("youtu.be")) {
|
|
39223
|
+
const id = url.split("/").pop();
|
|
39224
|
+
if (!id) {
|
|
39225
|
+
return null;
|
|
39226
|
+
}
|
|
39227
|
+
return `${getYoutubeEmbedUrl(nocookie)}${id}`;
|
|
39228
|
+
}
|
|
39229
|
+
const videoIdRegex = /(?:v=|shorts\/)([-\w]+)/gm;
|
|
39230
|
+
const matches2 = videoIdRegex.exec(url);
|
|
39231
|
+
if (!matches2 || !matches2[1]) {
|
|
39232
|
+
return null;
|
|
39233
|
+
}
|
|
39234
|
+
let outputUrl = `${getYoutubeEmbedUrl(nocookie)}${matches2[1]}`;
|
|
39235
|
+
const params = [];
|
|
39236
|
+
if (allowFullscreen === false) {
|
|
39237
|
+
params.push("fs=0");
|
|
39238
|
+
}
|
|
39239
|
+
if (autoplay) {
|
|
39240
|
+
params.push("autoplay=1");
|
|
39241
|
+
}
|
|
39242
|
+
if (ccLanguage) {
|
|
39243
|
+
params.push(`cc_lang_pref=${ccLanguage}`);
|
|
39244
|
+
}
|
|
39245
|
+
if (ccLoadPolicy) {
|
|
39246
|
+
params.push("cc_load_policy=1");
|
|
39247
|
+
}
|
|
39248
|
+
if (!controls) {
|
|
39249
|
+
params.push("controls=0");
|
|
39250
|
+
}
|
|
39251
|
+
if (disableKBcontrols) {
|
|
39252
|
+
params.push("disablekb=1");
|
|
39253
|
+
}
|
|
39254
|
+
if (enableIFrameApi) {
|
|
39255
|
+
params.push("enablejsapi=1");
|
|
39256
|
+
}
|
|
39257
|
+
if (endTime) {
|
|
39258
|
+
params.push(`end=${endTime}`);
|
|
39259
|
+
}
|
|
39260
|
+
if (interfaceLanguage) {
|
|
39261
|
+
params.push(`hl=${interfaceLanguage}`);
|
|
39262
|
+
}
|
|
39263
|
+
if (ivLoadPolicy) {
|
|
39264
|
+
params.push(`iv_load_policy=${ivLoadPolicy}`);
|
|
39265
|
+
}
|
|
39266
|
+
if (loop) {
|
|
39267
|
+
params.push("loop=1");
|
|
39268
|
+
}
|
|
39269
|
+
if (modestBranding) {
|
|
39270
|
+
params.push("modestbranding=1");
|
|
39271
|
+
}
|
|
39272
|
+
if (origin) {
|
|
39273
|
+
params.push(`origin=${origin}`);
|
|
39274
|
+
}
|
|
39275
|
+
if (playlist) {
|
|
39276
|
+
params.push(`playlist=${playlist}`);
|
|
39277
|
+
}
|
|
39278
|
+
if (startAt) {
|
|
39279
|
+
params.push(`start=${startAt}`);
|
|
39280
|
+
}
|
|
39281
|
+
if (progressBarColor) {
|
|
39282
|
+
params.push(`color=${progressBarColor}`);
|
|
39283
|
+
}
|
|
39284
|
+
if (params.length) {
|
|
39285
|
+
outputUrl += `?${params.join("&")}`;
|
|
39286
|
+
}
|
|
39287
|
+
return outputUrl;
|
|
39288
|
+
};
|
|
39289
|
+
const Youtube = Node$2.create({
|
|
39290
|
+
name: "youtube",
|
|
39291
|
+
addOptions() {
|
|
39292
|
+
return {
|
|
39293
|
+
addPasteHandler: true,
|
|
39294
|
+
allowFullscreen: true,
|
|
39295
|
+
autoplay: false,
|
|
39296
|
+
ccLanguage: void 0,
|
|
39297
|
+
ccLoadPolicy: void 0,
|
|
39298
|
+
controls: true,
|
|
39299
|
+
disableKBcontrols: false,
|
|
39300
|
+
enableIFrameApi: false,
|
|
39301
|
+
endTime: 0,
|
|
39302
|
+
height: 480,
|
|
39303
|
+
interfaceLanguage: void 0,
|
|
39304
|
+
ivLoadPolicy: 0,
|
|
39305
|
+
loop: false,
|
|
39306
|
+
modestBranding: false,
|
|
39307
|
+
HTMLAttributes: {},
|
|
39308
|
+
inline: false,
|
|
39309
|
+
nocookie: false,
|
|
39310
|
+
origin: "",
|
|
39311
|
+
playlist: "",
|
|
39312
|
+
progressBarColor: void 0,
|
|
39313
|
+
width: 640
|
|
39314
|
+
};
|
|
39315
|
+
},
|
|
39316
|
+
inline() {
|
|
39317
|
+
return this.options.inline;
|
|
39318
|
+
},
|
|
39319
|
+
group() {
|
|
39320
|
+
return this.options.inline ? "inline" : "block";
|
|
39321
|
+
},
|
|
39322
|
+
draggable: true,
|
|
39323
|
+
addAttributes() {
|
|
39324
|
+
return {
|
|
39325
|
+
src: {
|
|
39326
|
+
default: null
|
|
39327
|
+
},
|
|
39328
|
+
start: {
|
|
39329
|
+
default: 0
|
|
39330
|
+
},
|
|
39331
|
+
width: {
|
|
39332
|
+
default: this.options.width
|
|
39333
|
+
},
|
|
39334
|
+
height: {
|
|
39335
|
+
default: this.options.height
|
|
39336
|
+
}
|
|
39337
|
+
};
|
|
39338
|
+
},
|
|
39339
|
+
parseHTML() {
|
|
39340
|
+
return [
|
|
39341
|
+
{
|
|
39342
|
+
tag: "div[data-youtube-video] iframe"
|
|
39343
|
+
}
|
|
39344
|
+
];
|
|
39345
|
+
},
|
|
39346
|
+
addCommands() {
|
|
39347
|
+
return {
|
|
39348
|
+
setYoutubeVideo: (options) => ({ commands: commands2 }) => {
|
|
39349
|
+
if (!isValidYoutubeUrl(options.src)) {
|
|
39350
|
+
return false;
|
|
39351
|
+
}
|
|
39352
|
+
return commands2.insertContent({
|
|
39353
|
+
type: this.name,
|
|
39354
|
+
attrs: options
|
|
39355
|
+
});
|
|
39356
|
+
}
|
|
39357
|
+
};
|
|
39358
|
+
},
|
|
39359
|
+
addPasteRules() {
|
|
39360
|
+
if (!this.options.addPasteHandler) {
|
|
39361
|
+
return [];
|
|
39362
|
+
}
|
|
39363
|
+
return [
|
|
39364
|
+
nodePasteRule({
|
|
39365
|
+
find: YOUTUBE_REGEX_GLOBAL,
|
|
39366
|
+
type: this.type,
|
|
39367
|
+
getAttributes: (match2) => {
|
|
39368
|
+
return { src: match2.input };
|
|
39369
|
+
}
|
|
39370
|
+
})
|
|
39371
|
+
];
|
|
39372
|
+
},
|
|
39373
|
+
renderHTML({ HTMLAttributes }) {
|
|
39374
|
+
const embedUrl = getEmbedUrlFromYoutubeUrl({
|
|
39375
|
+
url: HTMLAttributes.src,
|
|
39376
|
+
allowFullscreen: this.options.allowFullscreen,
|
|
39377
|
+
autoplay: this.options.autoplay,
|
|
39378
|
+
ccLanguage: this.options.ccLanguage,
|
|
39379
|
+
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
39380
|
+
controls: this.options.controls,
|
|
39381
|
+
disableKBcontrols: this.options.disableKBcontrols,
|
|
39382
|
+
enableIFrameApi: this.options.enableIFrameApi,
|
|
39383
|
+
endTime: this.options.endTime,
|
|
39384
|
+
interfaceLanguage: this.options.interfaceLanguage,
|
|
39385
|
+
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
39386
|
+
loop: this.options.loop,
|
|
39387
|
+
modestBranding: this.options.modestBranding,
|
|
39388
|
+
nocookie: this.options.nocookie,
|
|
39389
|
+
origin: this.options.origin,
|
|
39390
|
+
playlist: this.options.playlist,
|
|
39391
|
+
progressBarColor: this.options.progressBarColor,
|
|
39392
|
+
startAt: HTMLAttributes.start || 0
|
|
39393
|
+
});
|
|
39394
|
+
HTMLAttributes.src = embedUrl;
|
|
39395
|
+
return [
|
|
39396
|
+
"div",
|
|
39397
|
+
{ "data-youtube-video": "" },
|
|
39398
|
+
[
|
|
39399
|
+
"iframe",
|
|
39400
|
+
mergeAttributes(this.options.HTMLAttributes, {
|
|
39401
|
+
width: this.options.width,
|
|
39402
|
+
height: this.options.height,
|
|
39403
|
+
allowfullscreen: this.options.allowFullscreen,
|
|
39404
|
+
autoplay: this.options.autoplay,
|
|
39405
|
+
ccLanguage: this.options.ccLanguage,
|
|
39406
|
+
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
39407
|
+
disableKBcontrols: this.options.disableKBcontrols,
|
|
39408
|
+
enableIFrameApi: this.options.enableIFrameApi,
|
|
39409
|
+
endTime: this.options.endTime,
|
|
39410
|
+
interfaceLanguage: this.options.interfaceLanguage,
|
|
39411
|
+
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
39412
|
+
loop: this.options.loop,
|
|
39413
|
+
modestBranding: this.options.modestBranding,
|
|
39414
|
+
origin: this.options.origin,
|
|
39415
|
+
playlist: this.options.playlist,
|
|
39416
|
+
progressBarColor: this.options.progressBarColor
|
|
39417
|
+
}, HTMLAttributes)
|
|
39418
|
+
]
|
|
39419
|
+
];
|
|
39420
|
+
}
|
|
39421
|
+
});
|
|
39086
39422
|
const _hoisted_1$d = { class: "RichText" };
|
|
39087
39423
|
const _hoisted_2$a = {
|
|
39088
39424
|
key: 0,
|
|
@@ -39095,6 +39431,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
39095
39431
|
},
|
|
39096
39432
|
emits: ["update:modelValue"],
|
|
39097
39433
|
setup(__props, { emit: __emit }) {
|
|
39434
|
+
const { txtField: txtField2 } = bagelFormUtils;
|
|
39098
39435
|
let editor = ref();
|
|
39099
39436
|
const props2 = __props;
|
|
39100
39437
|
const focus2 = () => {
|
|
@@ -39102,6 +39439,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
39102
39439
|
throw new Error("editor is not defined");
|
|
39103
39440
|
return editor.value.chain().focus();
|
|
39104
39441
|
};
|
|
39442
|
+
const { showModalForm } = useModal();
|
|
39443
|
+
function addImage() {
|
|
39444
|
+
showModalForm({
|
|
39445
|
+
title: "Add Image",
|
|
39446
|
+
schema: [
|
|
39447
|
+
txtField2("title", "Title"),
|
|
39448
|
+
{ $el, id: "src", attrs: { bindkey: "url" } },
|
|
39449
|
+
txtField2("alt", "Alt Text")
|
|
39450
|
+
],
|
|
39451
|
+
onSubmit: (imgObj) => focus2().setImage(imgObj).run()
|
|
39452
|
+
});
|
|
39453
|
+
}
|
|
39105
39454
|
const config = [
|
|
39106
39455
|
{
|
|
39107
39456
|
name: "Bold",
|
|
@@ -39138,11 +39487,31 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
39138
39487
|
command: () => focus2().toggleCode().run(),
|
|
39139
39488
|
icon: "code"
|
|
39140
39489
|
},
|
|
39141
|
-
|
|
39142
|
-
|
|
39143
|
-
|
|
39144
|
-
|
|
39145
|
-
|
|
39490
|
+
{
|
|
39491
|
+
name: "Image",
|
|
39492
|
+
command: addImage,
|
|
39493
|
+
icon: "image"
|
|
39494
|
+
},
|
|
39495
|
+
{
|
|
39496
|
+
name: "YouTube",
|
|
39497
|
+
command: () => {
|
|
39498
|
+
showModalForm({
|
|
39499
|
+
title: "Add YouTube Video",
|
|
39500
|
+
schema: [
|
|
39501
|
+
txtField2("src", "YouTube URL"),
|
|
39502
|
+
{
|
|
39503
|
+
$el: BglVideo,
|
|
39504
|
+
attrs: { src: (_2, { src }) => src || "" }
|
|
39505
|
+
}
|
|
39506
|
+
],
|
|
39507
|
+
onSubmit: (videoObj) => {
|
|
39508
|
+
var _a2;
|
|
39509
|
+
return (_a2 = editor.value) == null ? void 0 : _a2.commands.setYoutubeVideo(videoObj);
|
|
39510
|
+
}
|
|
39511
|
+
});
|
|
39512
|
+
},
|
|
39513
|
+
icon: "youtube_activity"
|
|
39514
|
+
},
|
|
39146
39515
|
{
|
|
39147
39516
|
name: "Clear",
|
|
39148
39517
|
command: () => focus2().clearNodes().run(),
|
|
@@ -39241,7 +39610,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
39241
39610
|
const emit2 = __emit;
|
|
39242
39611
|
function initEditor() {
|
|
39243
39612
|
editor.value = new Editor({
|
|
39244
|
-
extensions: [StarterKit],
|
|
39613
|
+
extensions: [StarterKit, Image, Youtube],
|
|
39245
39614
|
content: props2.modelValue,
|
|
39246
39615
|
onUpdate: ({ editor: editor2 }) => emit2("update:modelValue", editor2.getHTML())
|
|
39247
39616
|
});
|
|
@@ -39268,6 +39637,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
39268
39637
|
(openBlock(), createElementBlock(Fragment$1, null, renderList(config, (item) => {
|
|
39269
39638
|
var _a2;
|
|
39270
39639
|
return withDirectives(createVNode(unref(Btn), {
|
|
39640
|
+
tabindex: "-1",
|
|
39271
39641
|
flat: !unref(editor).isActive(item.name, item.option),
|
|
39272
39642
|
onClick: item.command,
|
|
39273
39643
|
thin: "",
|
|
@@ -45985,7 +46355,7 @@ export {
|
|
|
45985
46355
|
_sfc_main$j as DateInput,
|
|
45986
46356
|
_sfc_main$c as DatePicker,
|
|
45987
46357
|
kt$1 as Dropdown,
|
|
45988
|
-
FileUpload,
|
|
46358
|
+
$el as FileUpload,
|
|
45989
46359
|
_sfc_main$H as Icon,
|
|
45990
46360
|
JSONInput,
|
|
45991
46361
|
Layout,
|
|
@@ -46013,7 +46383,7 @@ export {
|
|
|
46013
46383
|
_sfc_main$s as Title,
|
|
46014
46384
|
ToggleInput,
|
|
46015
46385
|
TopBar,
|
|
46016
|
-
|
|
46386
|
+
bagelFormUtils,
|
|
46017
46387
|
bagelInjectionKey,
|
|
46018
46388
|
bindAttrs,
|
|
46019
46389
|
classify,
|