@bagelink/vue 0.0.378 → 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/index.mjs CHANGED
@@ -4962,7 +4962,7 @@ function frmRow(...children2) {
4962
4962
  children: children2
4963
4963
  };
4964
4964
  }
4965
- const BagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
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$m = { class: "nav-links-wrapper" };
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$m, [
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(() => props2.visible, (val) => {
5267
- if (val === isVisible.value || val === void 0)
5268
- return;
5269
- if (val)
5270
- openModal();
5271
- else
5272
- closeModal();
5273
- }, { immediate: true });
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": { default: {} },
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-7e6899c7"]]);
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$l = { class: "accordion-label" };
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$l, toDisplayString(_ctx.label), 1),
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$k = { class: "list-content auto-flow-rows align-items-start overflow-y h-100" };
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$k, [
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$j = { class: "row first-row" };
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$j, [
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$i = { class: "key" };
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$i, toDisplayString((field == null ? void 0 : field.label) || unref(keyToLabel)(field.id)), 1),
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 = { class: "bgl_vid" };
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(() => props2.aspectRatio.replace(":", "/"));
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 : _a2[1]) == null ? void 0 : _b.split("&")) == null ? void 0 : _c[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 = (_d = props2.src.match(vimeoRegex)) == null ? void 0 : _d[3];
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", _hoisted_1$r, [
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, _hoisted_2$n)) : (openBlock(), createElementBlock("video", {
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, _hoisted_3$h))
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-23835d69"]]);
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,7 +18455,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18430
18455
  setup(__props) {
18431
18456
  const bagel = useBagel();
18432
18457
  const props2 = __props;
18433
- const file_ids = useModel(__props, "modelValue");
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
18462
  watch(
@@ -18445,13 +18471,15 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18445
18471
  () => storageFiles.value,
18446
18472
  (newFiles) => {
18447
18473
  var _a2;
18448
- let idValue = "";
18474
+ let idValue;
18449
18475
  if (props2.multiple)
18450
- idValue = newFiles.map((f2) => f2.id || "");
18451
- else
18452
- idValue = ((_a2 = newFiles[0]) == null ? void 0 : _a2.id) || "";
18453
- if (!compareIds(file_ids == null ? void 0 : file_ids.value, idValue))
18454
- file_ids.value = idValue;
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
+ }
18455
18483
  },
18456
18484
  { deep: true }
18457
18485
  );
@@ -18600,7 +18628,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18600
18628
  };
18601
18629
  }
18602
18630
  });
18603
- const FileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-3bb24b0c"]]);
18631
+ const $el = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0dbacaa0"]]);
18604
18632
  const _withScopeId = (n2) => (pushScopeId("data-v-b87221d6"), n2 = n2(), popScopeId(), n2);
18605
18633
  const _hoisted_1$e = ["title"];
18606
18634
  const _hoisted_2$b = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "slider round" }, null, -1));
@@ -33869,7 +33897,24 @@ function markPasteRule(config) {
33869
33897
  }
33870
33898
  });
33871
33899
  }
33872
- const inputRegex$4 = /^\s*>\s$/;
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$/;
33873
33918
  const Blockquote = Node$2.create({
33874
33919
  name: "blockquote",
33875
33920
  addOptions() {
@@ -33909,7 +33954,7 @@ const Blockquote = Node$2.create({
33909
33954
  addInputRules() {
33910
33955
  return [
33911
33956
  wrappingInputRule({
33912
- find: inputRegex$4,
33957
+ find: inputRegex$5,
33913
33958
  type: this.type
33914
33959
  })
33915
33960
  ];
@@ -34054,7 +34099,7 @@ const TextStyle$1 = Mark.create({
34054
34099
  };
34055
34100
  }
34056
34101
  });
34057
- const inputRegex$3 = /^\s*([-+*])\s$/;
34102
+ const inputRegex$4 = /^\s*([-+*])\s$/;
34058
34103
  const BulletList = Node$2.create({
34059
34104
  name: "bulletList",
34060
34105
  addOptions() {
@@ -34094,12 +34139,12 @@ const BulletList = Node$2.create({
34094
34139
  },
34095
34140
  addInputRules() {
34096
34141
  let inputRule = wrappingInputRule({
34097
- find: inputRegex$3,
34142
+ find: inputRegex$4,
34098
34143
  type: this.type
34099
34144
  });
34100
34145
  if (this.options.keepMarks || this.options.keepAttributes) {
34101
34146
  inputRule = wrappingInputRule({
34102
- find: inputRegex$3,
34147
+ find: inputRegex$4,
34103
34148
  type: this.type,
34104
34149
  keepMarks: this.options.keepMarks,
34105
34150
  keepAttributes: this.options.keepAttributes,
@@ -34114,7 +34159,7 @@ const BulletList = Node$2.create({
34114
34159
  ];
34115
34160
  }
34116
34161
  });
34117
- const inputRegex$2 = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/;
34162
+ const inputRegex$3 = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/;
34118
34163
  const pasteRegex$1 = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g;
34119
34164
  const Code = Mark.create({
34120
34165
  name: "code",
@@ -34155,7 +34200,7 @@ const Code = Mark.create({
34155
34200
  addInputRules() {
34156
34201
  return [
34157
34202
  markInputRule({
34158
- find: inputRegex$2,
34203
+ find: inputRegex$3,
34159
34204
  type: this.type
34160
34205
  })
34161
34206
  ];
@@ -35643,7 +35688,7 @@ const TextStyle = Mark.create({
35643
35688
  };
35644
35689
  }
35645
35690
  });
35646
- const inputRegex$1 = /^(\d+)\.\s$/;
35691
+ const inputRegex$2 = /^(\d+)\.\s$/;
35647
35692
  const OrderedList = Node$2.create({
35648
35693
  name: "orderedList",
35649
35694
  addOptions() {
@@ -35696,14 +35741,14 @@ const OrderedList = Node$2.create({
35696
35741
  },
35697
35742
  addInputRules() {
35698
35743
  let inputRule = wrappingInputRule({
35699
- find: inputRegex$1,
35744
+ find: inputRegex$2,
35700
35745
  type: this.type,
35701
35746
  getAttributes: (match2) => ({ start: +match2[1] }),
35702
35747
  joinPredicate: (match2, node) => node.childCount + node.attrs.start === +match2[1]
35703
35748
  });
35704
35749
  if (this.options.keepMarks || this.options.keepAttributes) {
35705
35750
  inputRule = wrappingInputRule({
35706
- find: inputRegex$1,
35751
+ find: inputRegex$2,
35707
35752
  type: this.type,
35708
35753
  keepMarks: this.options.keepMarks,
35709
35754
  keepAttributes: this.options.keepAttributes,
@@ -35748,7 +35793,7 @@ const Paragraph = Node$2.create({
35748
35793
  };
35749
35794
  }
35750
35795
  });
35751
- const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/;
35796
+ const inputRegex$1 = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/;
35752
35797
  const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g;
35753
35798
  const Strike = Mark.create({
35754
35799
  name: "strike",
@@ -35803,7 +35848,7 @@ const Strike = Mark.create({
35803
35848
  addInputRules() {
35804
35849
  return [
35805
35850
  markInputRule({
35806
- find: inputRegex,
35851
+ find: inputRegex$1,
35807
35852
  type: this.type
35808
35853
  })
35809
35854
  ];
@@ -39095,6 +39140,285 @@ defineComponent({
39095
39140
  }, (_b = (_a2 = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a2));
39096
39141
  }
39097
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
+ });
39098
39422
  const _hoisted_1$d = { class: "RichText" };
39099
39423
  const _hoisted_2$a = {
39100
39424
  key: 0,
@@ -39107,6 +39431,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39107
39431
  },
39108
39432
  emits: ["update:modelValue"],
39109
39433
  setup(__props, { emit: __emit }) {
39434
+ const { txtField: txtField2 } = bagelFormUtils;
39110
39435
  let editor = ref();
39111
39436
  const props2 = __props;
39112
39437
  const focus2 = () => {
@@ -39114,6 +39439,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39114
39439
  throw new Error("editor is not defined");
39115
39440
  return editor.value.chain().focus();
39116
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
+ }
39117
39454
  const config = [
39118
39455
  {
39119
39456
  name: "Bold",
@@ -39150,11 +39487,31 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39150
39487
  command: () => focus2().toggleCode().run(),
39151
39488
  icon: "code"
39152
39489
  },
39153
- // {
39154
- // name: 'clearMarks',
39155
- // command: () => focus().unsetAllMarks(),
39156
- // icon: 'clear',
39157
- // },
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
+ },
39158
39515
  {
39159
39516
  name: "Clear",
39160
39517
  command: () => focus2().clearNodes().run(),
@@ -39253,7 +39610,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39253
39610
  const emit2 = __emit;
39254
39611
  function initEditor() {
39255
39612
  editor.value = new Editor({
39256
- extensions: [StarterKit],
39613
+ extensions: [StarterKit, Image, Youtube],
39257
39614
  content: props2.modelValue,
39258
39615
  onUpdate: ({ editor: editor2 }) => emit2("update:modelValue", editor2.getHTML())
39259
39616
  });
@@ -39280,6 +39637,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39280
39637
  (openBlock(), createElementBlock(Fragment$1, null, renderList(config, (item) => {
39281
39638
  var _a2;
39282
39639
  return withDirectives(createVNode(unref(Btn), {
39640
+ tabindex: "-1",
39283
39641
  flat: !unref(editor).isActive(item.name, item.option),
39284
39642
  onClick: item.command,
39285
39643
  thin: "",
@@ -45997,7 +46355,7 @@ export {
45997
46355
  _sfc_main$j as DateInput,
45998
46356
  _sfc_main$c as DatePicker,
45999
46357
  kt$1 as Dropdown,
46000
- FileUpload,
46358
+ $el as FileUpload,
46001
46359
  _sfc_main$H as Icon,
46002
46360
  JSONInput,
46003
46361
  Layout,
@@ -46025,7 +46383,7 @@ export {
46025
46383
  _sfc_main$s as Title,
46026
46384
  ToggleInput,
46027
46385
  TopBar,
46028
- BagelFormUtils as bagelFormUtils,
46386
+ bagelFormUtils,
46029
46387
  bagelInjectionKey,
46030
46388
  bindAttrs,
46031
46389
  classify,