@grapesjs/studio-sdk-plugins 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/accordionComponent/index.cjs.js +4 -4
  2. package/dist/accordionComponent/index.es.js +83 -70
  3. package/dist/accordionComponent/index.umd.js +4 -4
  4. package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
  5. package/dist/aiChat/components/utils.d.ts +1 -0
  6. package/dist/aiChat/components/utilsTw.d.ts +11 -0
  7. package/dist/aiChat/index.cjs.js +70 -70
  8. package/dist/aiChat/index.es.js +8627 -8161
  9. package/dist/aiChat/index.js +70 -70
  10. package/dist/aiChat/index.umd.js +70 -70
  11. package/dist/aiChat/projectGeneration.d.ts +17 -0
  12. package/dist/animationComponent/index.cjs.js +3 -3
  13. package/dist/animationComponent/index.es.js +55 -42
  14. package/dist/animationComponent/index.umd.js +3 -3
  15. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  16. package/dist/canvasAbsoluteMode/index.es.js +67 -54
  17. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  18. package/dist/canvasEmptyState/index.cjs.js +1 -1
  19. package/dist/canvasEmptyState/index.es.js +59 -46
  20. package/dist/canvasEmptyState/index.umd.js +1 -1
  21. package/dist/canvasFullSize/index.cjs.js +4 -4
  22. package/dist/canvasFullSize/index.es.js +59 -46
  23. package/dist/canvasFullSize/index.umd.js +4 -4
  24. package/dist/canvasGridMode/index.cjs.js +2 -2
  25. package/dist/canvasGridMode/index.es.js +70 -57
  26. package/dist/canvasGridMode/index.umd.js +4 -4
  27. package/dist/canvasScreenshot/index.cjs.js +1 -1
  28. package/dist/canvasScreenshot/index.es.js +37 -24
  29. package/dist/canvasScreenshot/index.umd.js +1 -1
  30. package/dist/dataSourceEjs/index.cjs.js +3 -3
  31. package/dist/dataSourceEjs/index.es.js +51 -38
  32. package/dist/dataSourceEjs/index.umd.js +3 -3
  33. package/dist/dataSourceHandlebars/index.cjs.js +2 -2
  34. package/dist/dataSourceHandlebars/index.es.js +50 -37
  35. package/dist/dataSourceHandlebars/index.umd.js +6 -6
  36. package/dist/dialogComponent/index.cjs.js +9 -9
  37. package/dist/dialogComponent/index.es.js +58 -45
  38. package/dist/dialogComponent/index.umd.js +3 -3
  39. package/dist/flexComponent/index.cjs.js +6 -6
  40. package/dist/flexComponent/index.es.js +82 -69
  41. package/dist/flexComponent/index.umd.js +6 -6
  42. package/dist/fsLightboxComponent/index.cjs.js +2 -2
  43. package/dist/fsLightboxComponent/index.es.js +70 -57
  44. package/dist/fsLightboxComponent/index.umd.js +2 -2
  45. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  46. package/dist/googleFontsAssetProvider/index.es.js +84 -71
  47. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  48. package/dist/iconifyComponent/index.cjs.js +2 -2
  49. package/dist/iconifyComponent/index.es.js +82 -69
  50. package/dist/iconifyComponent/index.umd.js +2 -2
  51. package/dist/index.cjs.js +36 -36
  52. package/dist/index.es.js +843 -830
  53. package/dist/index.umd.js +36 -36
  54. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  55. package/dist/layoutSidebarButtons/index.es.js +81 -68
  56. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  57. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  58. package/dist/lightGalleryComponent/index.es.js +86 -73
  59. package/dist/lightGalleryComponent/index.umd.js +1 -1
  60. package/dist/linkImageComponent/index.cjs.js +2 -2
  61. package/dist/linkImageComponent/index.es.js +70 -57
  62. package/dist/linkImageComponent/index.umd.js +2 -2
  63. package/dist/listPagesComponent/index.cjs.js +3 -3
  64. package/dist/listPagesComponent/index.es.js +49 -36
  65. package/dist/listPagesComponent/index.umd.js +3 -3
  66. package/dist/presetPrintable/index.cjs.js +3 -3
  67. package/dist/presetPrintable/index.es.js +130 -117
  68. package/dist/presetPrintable/index.umd.js +3 -3
  69. package/dist/prosemirror/index.cjs.js +1 -1
  70. package/dist/prosemirror/index.es.js +96 -83
  71. package/dist/prosemirror/index.umd.js +1 -1
  72. package/dist/rendererReact/index.cjs.js +1 -1
  73. package/dist/rendererReact/index.es.js +143 -131
  74. package/dist/rendererReact/index.js +1 -1
  75. package/dist/rendererReact/index.umd.js +1 -1
  76. package/dist/rteTinyMce/index.cjs.js +2 -2
  77. package/dist/rteTinyMce/index.es.js +74 -61
  78. package/dist/rteTinyMce/index.umd.js +2 -2
  79. package/dist/shapeDividerComponent/index.cjs.js +3 -3
  80. package/dist/shapeDividerComponent/index.es.js +33 -20
  81. package/dist/shapeDividerComponent/index.umd.js +3 -3
  82. package/dist/swiperComponent/index.cjs.js +5 -5
  83. package/dist/swiperComponent/index.es.js +105 -92
  84. package/dist/swiperComponent/index.umd.js +5 -5
  85. package/dist/tableComponent/index.cjs.js +1 -1
  86. package/dist/tableComponent/index.es.js +163 -150
  87. package/dist/tableComponent/index.umd.js +1 -1
  88. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  89. package/dist/youtubeAssetProvider/index.es.js +36 -23
  90. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  91. package/package.json +2 -2
@@ -11245,17 +11245,30 @@ const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com", jf = "app2.grapesj
11245
11245
  // For stackblitz.com demos
11246
11246
  ".local.webcontainer.io",
11247
11247
  // For stackblitz.com demos
11248
- "-sandpack.codesandbox.io"
11248
+ "-sandpack.codesandbox.io",
11249
11249
  // For Sandpack demos
11250
+ ".claudemcpcontent.com",
11251
+ // For Claude mcp app
11252
+ ".web-sandbox.oaiusercontent.com"
11253
+ // For OpenAI mcp app
11250
11254
  ], Gf = "license:check:end", _f = () => typeof window < "u", Xf = ({
11251
11255
  isDev: n,
11252
11256
  isStage: e,
11253
11257
  isPlatform: t
11254
11258
  }) => `${n ? "" : `https://${e ? Lo : Vo}`}/${t ? "platform-api" : "api"}`, Yf = () => {
11255
- const n = _f() && window.location.hostname;
11259
+ if (!_f()) return "";
11260
+ const { hostname: n } = window.location;
11261
+ if (n) return n;
11262
+ try {
11263
+ return window.parent.location.hostname || "";
11264
+ } catch {
11265
+ return "";
11266
+ }
11267
+ }, Zf = () => {
11268
+ const n = Yf();
11256
11269
  return !!n && (Gi.includes(n) || Gi.some((e) => n.endsWith(e)));
11257
11270
  };
11258
- async function Zf({
11271
+ async function Qf({
11259
11272
  path: n,
11260
11273
  baseApiUrl: e,
11261
11274
  method: t = "GET",
@@ -11283,12 +11296,12 @@ const _i = {
11283
11296
  [rt.business]: 20,
11284
11297
  [rt.enterprise]: 30
11285
11298
  };
11286
- function Qf(n) {
11299
+ function eh(n) {
11287
11300
  const e = n;
11288
11301
  return e.init = (t) => (r) => n(r, t), e;
11289
11302
  }
11290
- const eh = (n) => /* @__PURE__ */ Qf(n);
11291
- async function th({
11303
+ const th = (n) => /* @__PURE__ */ eh(n);
11304
+ async function nh({
11292
11305
  editor: n,
11293
11306
  plan: e,
11294
11307
  pluginName: t,
@@ -11315,9 +11328,9 @@ async function th({
11315
11328
  };
11316
11329
  if (!l) {
11317
11330
  n.onReady(async () => {
11318
- if (!Yf())
11331
+ if (!Zf())
11319
11332
  if (r) {
11320
- const h = await rh({ licenseKey: r, pluginName: t, baseApiUrl: o });
11333
+ const h = await ih({ licenseKey: r, pluginName: t, baseApiUrl: o });
11321
11334
  f(h);
11322
11335
  } else
11323
11336
  a("The `licenseKey` option not provided");
@@ -11325,22 +11338,22 @@ async function th({
11325
11338
  return;
11326
11339
  }
11327
11340
  if (l.licensePlan || l.licenseError) {
11328
- const h = nh(l);
11341
+ const h = rh(l);
11329
11342
  f(h);
11330
11343
  return;
11331
11344
  }
11332
11345
  n.on(Gf, (h) => f(h));
11333
11346
  }
11334
- const nh = (n) => ({
11347
+ const rh = (n) => ({
11335
11348
  sdkLicense: n.license,
11336
11349
  license: n.license,
11337
11350
  error: n.licenseError,
11338
11351
  plan: n.licensePlan
11339
11352
  });
11340
- async function rh(n) {
11353
+ async function ih(n) {
11341
11354
  const { licenseKey: e, pluginName: t, baseApiUrl: r } = n;
11342
11355
  try {
11343
- return (await Zf({
11356
+ return (await Qf({
11344
11357
  baseApiUrl: r,
11345
11358
  path: `/sdk/${e || "na"}`,
11346
11359
  method: "POST",
@@ -11353,7 +11366,7 @@ async function rh(n) {
11353
11366
  return console.error("Error during SDK license check:", i), !1;
11354
11367
  }
11355
11368
  }
11356
- const ih = (n, e) => {
11369
+ const sh = (n, e) => {
11357
11370
  if (!e) return () => {
11358
11371
  };
11359
11372
  const t = "keydown", r = (s) => {
@@ -11364,7 +11377,7 @@ const ih = (n, e) => {
11364
11377
  document.addEventListener(t, r), n.on(n.events.destroy, i);
11365
11378
  }), i;
11366
11379
  };
11367
- function sh(n, e) {
11380
+ function oh(n, e) {
11368
11381
  if (!e) return () => {
11369
11382
  };
11370
11383
  const t = n.Components.events, r = (f) => n.getSelectedAll().includes(f), i = (f) => f.isInstanceOf("text") && !f.isChildOf("text"), s = (f) => f.isChildOf("text"), o = (f) => n.getEditing() === f, l = (f, h = {}) => {
@@ -11408,13 +11421,13 @@ const Nt = (n) => {
11408
11421
  return o && (l.style = `${t}: ${o}`), [r, l, 0];
11409
11422
  }
11410
11423
  };
11411
- }, Xi = "data-gs-mrk-fs", oh = "data-gs-mrk-color", lh = "data-gs-mrk-bgcolor", Fo = "data-gs-mrk-wrap", pn = "data-gs-ifrg", ke = "attrs", wn = {
11424
+ }, Xi = "data-gs-mrk-fs", lh = "data-gs-mrk-color", ah = "data-gs-mrk-bgcolor", Fo = "data-gs-mrk-wrap", pn = "data-gs-ifrg", ke = "attrs", wn = {
11412
11425
  [ke]: { default: "{}" }
11413
11426
  }, oe = {
11414
11427
  [ke]: { default: {} }
11415
11428
  }, Mn = (n) => ({
11416
11429
  [ke]: JSON.stringify(Nt(n))
11417
- }), le = (n) => ({ attrs: Nt(n) }), gt = (n) => (e) => [n, e.attrs.attrs, 0], ce = (n) => n.attrs[ke] ? JSON.parse(n.attrs[ke]) : {}, ah = {
11430
+ }), le = (n) => ({ attrs: Nt(n) }), gt = (n) => (e) => [n, e.attrs.attrs, 0], ce = (n) => n.attrs[ke] ? JSON.parse(n.attrs[ke]) : {}, ch = {
11418
11431
  doc: {
11419
11432
  content: "block+"
11420
11433
  },
@@ -11570,7 +11583,7 @@ const Nt = (n) => {
11570
11583
  getAttrs: Mn
11571
11584
  })),
11572
11585
  toDOM: e
11573
- }), ch = (n) => ({
11586
+ }), fh = (n) => ({
11574
11587
  attrs: { ...wn },
11575
11588
  parseDOM: [
11576
11589
  {
@@ -11584,13 +11597,13 @@ const Nt = (n) => {
11584
11597
  [n]: !0
11585
11598
  }, 0];
11586
11599
  }
11587
- }), fh = {
11600
+ }), hh = {
11588
11601
  strong: yt(["strong", "b"], (n) => ["b", ce(n)]),
11589
11602
  link: yt(["a"], (n) => ["a", ce(n), 0]),
11590
11603
  em: yt(["em", "i"], (n) => ["em", ce(n)]),
11591
11604
  underline: yt(["u"], (n) => ["u", ce(n), 0]),
11592
11605
  strikethrough: yt(["s"], (n) => ["s", ce(n), 0]),
11593
- wrapStyle: ch(Fo),
11606
+ wrapStyle: fh(Fo),
11594
11607
  font_size: {
11595
11608
  attrs: {
11596
11609
  ...wn,
@@ -11614,19 +11627,19 @@ const Nt = (n) => {
11614
11627
  }
11615
11628
  },
11616
11629
  color: pr({
11617
- key: oh,
11630
+ key: lh,
11618
11631
  cssProperty: "color"
11619
11632
  }),
11620
11633
  bgColor: pr({
11621
- key: lh,
11634
+ key: ah,
11622
11635
  cssProperty: "background-color"
11623
11636
  })
11624
11637
  }, Yi = new hl({
11625
- nodes: ah,
11626
- marks: fh
11627
- }), Ft = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), hh = (n, e, t) => {
11638
+ nodes: ch,
11639
+ marks: hh
11640
+ }), Ft = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), dh = (n, e, t) => {
11628
11641
  Ft.set(n, { view: e, gjsView: t, initialDoc: e.state.doc }), Ir.set(e, { el: n, gjsView: t });
11629
- }, dh = (n, e) => {
11642
+ }, uh = (n, e) => {
11630
11643
  Ft.delete(n), Ir.delete(e);
11631
11644
  }, Zt = (n) => Ft.get(n), Ho = (n) => Ir.get(n), Zi = (n) => {
11632
11645
  const e = Zt(n), t = e == null ? void 0 : e.view, r = e == null ? void 0 : e.initialDoc;
@@ -11634,8 +11647,8 @@ const Nt = (n) => {
11634
11647
  }, Kn = (n) => {
11635
11648
  var e, t;
11636
11649
  return (t = (e = Ho(n)) == null ? void 0 : e.gjsView) == null ? void 0 : t.model;
11637
- }, uh = (n) => n.dispatchEvent(new CustomEvent("input"));
11638
- function ph(n) {
11650
+ }, ph = (n) => n.dispatchEvent(new CustomEvent("input"));
11651
+ function mh(n) {
11639
11652
  const e = (t) => {
11640
11653
  if (t.tagName === "SPAN" && t.hasAttribute(pn)) {
11641
11654
  if (t.getAttribute("style")) {
@@ -11661,10 +11674,10 @@ const $o = (n) => {
11661
11674
  } else
11662
11675
  $o(e);
11663
11676
  });
11664
- }, mh = (n, e) => {
11677
+ }, gh = (n, e) => {
11665
11678
  const t = Wo(n);
11666
- return t && Th(t) ? yh(n, e) : t ? $s(() => ({ type: n.schema.nodes.div }))(n, e) : !1;
11667
- }, gh = (n, e) => (t, r) => {
11679
+ return t && Ah(t) ? bh(n, e) : t ? $s(() => ({ type: n.schema.nodes.div }))(n, e) : !1;
11680
+ }, yh = (n, e) => (t, r) => {
11668
11681
  var l;
11669
11682
  const i = Wo(t), s = Ft.get(n.el).view, o = (l = e.onEnter) == null ? void 0 : l.call(e, {
11670
11683
  ...n,
@@ -11672,7 +11685,7 @@ const $o = (n) => {
11672
11685
  commands: vr(s, n.editor, e),
11673
11686
  proseMirror: { view: s, dispatch: r }
11674
11687
  });
11675
- return o !== void 0 ? o : mh(t, r);
11688
+ return o !== void 0 ? o : gh(t, r);
11676
11689
  };
11677
11690
  function Wo(n) {
11678
11691
  const e = n.selection.$from;
@@ -11682,13 +11695,13 @@ function Wo(n) {
11682
11695
  }
11683
11696
  return e.node(e.depth);
11684
11697
  }
11685
- function yh(n, e) {
11698
+ function bh(n, e) {
11686
11699
  const { selection: t, schema: r, tr: i } = n;
11687
11700
  i.split(t.from, 1);
11688
11701
  const s = t.from + 1, o = i.doc.nodeAt(s), l = { ...o.attrs.attrs, id: void 0 }, a = o.textContent.length > 0, c = o.textContent.length || 0, f = o.textContent || " ", h = r.text(f), d = r.nodes.div.create(l, a ? h : [], []);
11689
11702
  return i.replaceRangeWith(s, s + c + 2, d), i.setSelection(C.create(i.doc, s + 1)), e == null || e(i.scrollIntoView()), !0;
11690
11703
  }
11691
- function bh(n, e, t) {
11704
+ function kh(n, e, t) {
11692
11705
  const { state: r, dispatch: i } = n, { selection: s, tr: o } = r, l = (a, c, f) => {
11693
11706
  const h = {};
11694
11707
  return a.split(";").forEach((d) => {
@@ -11741,7 +11754,7 @@ const bt = (n, e) => {
11741
11754
  s.marks.some((o) => o.type === e) && (i = !0);
11742
11755
  }), i;
11743
11756
  };
11744
- function kh(n) {
11757
+ function xh(n) {
11745
11758
  var h, d;
11746
11759
  const { view: e, href: t, options: r, target: i = "_blank" } = n, { state: s, dispatch: o } = e, { schema: l, selection: a, tr: c } = s, f = l.marks.link;
11747
11760
  try {
@@ -11751,7 +11764,7 @@ function kh(n) {
11751
11764
  console.error("Error applying link mark:", u);
11752
11765
  }
11753
11766
  }
11754
- function xh(n, e) {
11767
+ function Sh(n, e) {
11755
11768
  const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
11756
11769
  if (i.empty) return;
11757
11770
  const o = t.schema.marks.font_size;
@@ -11761,7 +11774,7 @@ function xh(n, e) {
11761
11774
  }
11762
11775
  s.addMark(i.from, i.to, o.create({ size: e })), r(s.scrollIntoView());
11763
11776
  }
11764
- function Sh(n, e) {
11777
+ function Ch(n, e) {
11765
11778
  const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
11766
11779
  if (i.empty) return;
11767
11780
  const o = t.schema.marks.color;
@@ -11771,7 +11784,7 @@ function Sh(n, e) {
11771
11784
  }
11772
11785
  s.addMark(i.from, i.to, o.create({ value: e })), r(s.scrollIntoView());
11773
11786
  }
11774
- function Ch(n, e) {
11787
+ function wh(n, e) {
11775
11788
  const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
11776
11789
  if (i.empty) return;
11777
11790
  const o = t.schema.marks.bgColor;
@@ -11793,11 +11806,11 @@ const He = (n, e) => {
11793
11806
  node: o
11794
11807
  };
11795
11808
  }
11796
- }, wh = (n) => (n || "").split(";").map((e) => e.split(":")).reduce(
11809
+ }, Mh = (n) => (n || "").split(";").map((e) => e.split(":")).reduce(
11797
11810
  (e, [t, r]) => (t = t.replace(/-./g, (i) => i.toUpperCase()[1]).trim(), e[t] = `${r}`.trim(), e),
11798
11811
  {}
11799
11812
  );
11800
- function Mh(...n) {
11813
+ function Oh(...n) {
11801
11814
  return (e, t) => {
11802
11815
  const r = (o) => {
11803
11816
  e = e.apply(o), t == null || t(o);
@@ -11805,7 +11818,7 @@ function Mh(...n) {
11805
11818
  return n.reduce((o, l) => o || l(e, r), !1) && i !== void 0 && i(e, t);
11806
11819
  };
11807
11820
  }
11808
- const Oh = (n, e) => {
11821
+ const Nh = (n, e) => {
11809
11822
  const { state: t, dispatch: r } = n;
11810
11823
  if (e != null && e.event) {
11811
11824
  const { event: i } = e, s = n.posAtCoords({ left: i.clientX, top: i.clientY });
@@ -11813,19 +11826,19 @@ const Oh = (n, e) => {
11813
11826
  } else
11814
11827
  Ws(t, r);
11815
11828
  setTimeout(() => setTimeout(() => n.focus()));
11816
- }, mr = (n) => n.isBlock, Jo = (n) => n.type.name === "inlineFragment", Nh = (n) => mr(n) && !Jo(n), qo = (n) => n.type.name === "bulletList", Ko = (n) => n.type.name === "orderedList", Th = (n) => n.type.name === "heading", Ah = (n) => qo(n) || Ko(n), Qi = (n, e) => {
11829
+ }, mr = (n) => n.isBlock, Jo = (n) => n.type.name === "inlineFragment", Th = (n) => mr(n) && !Jo(n), qo = (n) => n.type.name === "bulletList", Ko = (n) => n.type.name === "orderedList", Ah = (n) => n.type.name === "heading", Dh = (n) => qo(n) || Ko(n), Qi = (n, e) => {
11817
11830
  var s, o;
11818
11831
  const t = (s = He(n, (l) => l.type === e)) == null ? void 0 : s.node, r = n.state.schema.nodes.listItem;
11819
11832
  let i;
11820
- return t ? i = Zn(r) : (o = He(n, Ah)) != null && o.node ? i = Mh(Zn(r), ri(e)) : i = ri(e), i(n.state, n.dispatch);
11833
+ return t ? i = Zn(r) : (o = He(n, Dh)) != null && o.node ? i = Oh(Zn(r), ri(e)) : i = ri(e), i(n.state, n.dispatch);
11821
11834
  }, jo = (n, e) => {
11822
11835
  const { selection: t } = n.state;
11823
11836
  return [...t.$from.marks(), ...t.$to.marks()].find((r) => r.type.name === e);
11824
- }, Dh = (n) => {
11837
+ }, Eh = (n) => {
11825
11838
  var o;
11826
- const { view: e, prop: t, editor: r, propCSS: i } = n, s = (o = He(e, Nh)) == null ? void 0 : o.node;
11839
+ const { view: e, prop: t, editor: r, propCSS: i } = n, s = (o = He(e, Th)) == null ? void 0 : o.node;
11827
11840
  if (s) {
11828
- const l = s.attrs.attrs || {}, a = wh(l.style);
11841
+ const l = s.attrs.attrs || {}, a = Mh(l.style);
11829
11842
  if (t in a)
11830
11843
  return a[t] || "";
11831
11844
  if (l.id) {
@@ -11915,24 +11928,24 @@ const Oh = (n, e) => {
11915
11928
  const u = (m = (p = Ho(n)) == null ? void 0 : p.gjsView) == null ? void 0 : m.el;
11916
11929
  u && u.contentEditable !== "true" && (u.contentEditable = "true"), n.focus();
11917
11930
  };
11918
- a != null && a.is("link") ? (a.addAttributes({ href: f, target: h }), d()) : c ? (a == null || a.addAttributes({ [c.getName()]: f }), d()) : kh({ view: n, href: f, target: h, options: t });
11931
+ a != null && a.is("link") ? (a.addAttributes({ href: f, target: h }), d()) : c ? (a == null || a.addAttributes({ [c.getName()]: f }), d()) : xh({ view: n, href: f, target: h, options: t });
11919
11932
  }
11920
11933
  },
11921
11934
  alignText: {
11922
- get: () => Dh({ view: n, editor: e, prop: "textAlign", propCSS: "text-align" }),
11923
- set: (l) => bh(n, l.value, !0)
11935
+ get: () => Eh({ view: n, editor: e, prop: "textAlign", propCSS: "text-align" }),
11936
+ set: (l) => kh(n, l.value, !0)
11924
11937
  },
11925
11938
  fontSize: {
11926
11939
  get: () => jn({ view: n, editor: e, markName: "font_size", prop: "size", propCSS: "font-size" }),
11927
- set: (l) => xh(n, l.value)
11940
+ set: (l) => Sh(n, l.value)
11928
11941
  },
11929
11942
  color: {
11930
11943
  get: () => jn({ view: n, editor: e, markName: "color", prop: "value", propCSS: "color" }),
11931
- set: (l) => Sh(n, l.value)
11944
+ set: (l) => Ch(n, l.value)
11932
11945
  },
11933
11946
  bgColor: {
11934
11947
  get: () => jn({ view: n, editor: e, markName: "bgColor", prop: "value", propCSS: "background-color" }),
11935
- set: (l) => Ch(n, l.value)
11948
+ set: (l) => wh(n, l.value)
11936
11949
  },
11937
11950
  image: {
11938
11951
  open() {
@@ -12003,10 +12016,10 @@ class Be {
12003
12016
  rule's effect, or null to indicate the input was not handled.
12004
12017
  */
12005
12018
  constructor(e, t, r = {}) {
12006
- this.match = e, this.match = e, this.handler = typeof t == "string" ? Eh(t) : t, this.undoable = r.undoable !== !1, this.inCode = r.inCode || !1;
12019
+ this.match = e, this.match = e, this.handler = typeof t == "string" ? Rh(t) : t, this.undoable = r.undoable !== !1, this.inCode = r.inCode || !1;
12007
12020
  }
12008
12021
  }
12009
- function Eh(n) {
12022
+ function Rh(n) {
12010
12023
  return function(e, t, r, i) {
12011
12024
  let s = n;
12012
12025
  if (t[1]) {
@@ -12018,8 +12031,8 @@ function Eh(n) {
12018
12031
  return e.tr.insertText(s, r, i);
12019
12032
  };
12020
12033
  }
12021
- const Rh = 500;
12022
- function Ih({ rules: n }) {
12034
+ const Ih = 500;
12035
+ function vh({ rules: n }) {
12023
12036
  let e = new pt({
12024
12037
  state: {
12025
12038
  init() {
@@ -12050,7 +12063,7 @@ function Ih({ rules: n }) {
12050
12063
  function es(n, e, t, r, i, s) {
12051
12064
  if (n.composing)
12052
12065
  return !1;
12053
- let o = n.state, l = o.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Rh), l.parentOffset, null, "") + r;
12066
+ let o = n.state, l = o.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Ih), l.parentOffset, null, "") + r;
12054
12067
  for (let c = 0; c < i.length; c++) {
12055
12068
  let f = i[c];
12056
12069
  if (l.parent.type.spec.code) {
@@ -12064,7 +12077,7 @@ function es(n, e, t, r, i, s) {
12064
12077
  }
12065
12078
  return !1;
12066
12079
  }
12067
- const vh = new Be(/--$/, "—"), zh = new Be(/\.\.\.$/, "…"), Bh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Ph = new Be(/"$/, "”"), Vh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Lh = new Be(/'$/, "’"), Fh = [Bh, Ph, Vh, Lh];
12080
+ const zh = new Be(/--$/, "—"), Bh = new Be(/\.\.\.$/, "…"), Ph = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Vh = new Be(/"$/, "”"), Lh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Fh = new Be(/'$/, "’"), Hh = [Ph, Vh, Lh, Fh];
12068
12081
  function zr(n, e, t = null, r) {
12069
12082
  return new Be(n, (i, s, o, l) => {
12070
12083
  let a = t instanceof Function ? t(s) : t, c = i.tr.delete(o, l), f = c.doc.resolve(o), h = f.blockRange(), d = h && Os(h, e, a);
@@ -12081,10 +12094,10 @@ function Uo(n, e, t = null) {
12081
12094
  return l.node(-1).canReplaceWith(l.index(-1), l.indexAfter(-1), e) ? r.tr.delete(s, o).setBlockType(s, s, e, a) : null;
12082
12095
  });
12083
12096
  }
12084
- function Hh(n) {
12097
+ function $h(n) {
12085
12098
  return zr(/^\s*>\s$/, n);
12086
12099
  }
12087
- function $h(n) {
12100
+ function Wh(n) {
12088
12101
  return zr(
12089
12102
  /^(\d+)\.\s$/,
12090
12103
  n,
@@ -12092,23 +12105,23 @@ function $h(n) {
12092
12105
  (e, t) => t.childCount + t.attrs.order == +e[1]
12093
12106
  );
12094
12107
  }
12095
- function Wh(n) {
12108
+ function Jh(n) {
12096
12109
  return zr(/^\s*([-+*])\s$/, n);
12097
12110
  }
12098
- function Jh(n) {
12111
+ function qh(n) {
12099
12112
  return Uo(/^```$/, n);
12100
12113
  }
12101
- function qh(n, e) {
12114
+ function Kh(n, e) {
12102
12115
  return Uo(new RegExp("^(#{1," + e + "})\\s$"), n, (t) => ({
12103
12116
  level: t[1].length
12104
12117
  }));
12105
12118
  }
12106
- function Kh(n) {
12107
- const e = Fh.concat(zh, vh);
12119
+ function jh(n) {
12120
+ const e = Hh.concat(Bh, zh);
12108
12121
  let t;
12109
- return (t = n.nodes.blockquote) && e.push(Hh(t)), (t = n.nodes.orderedList) && e.push($h(t)), (t = n.nodes.bulletList) && e.push(Wh(t)), (t = n.nodes.codeBlock) && e.push(Jh(t)), (t = n.nodes.heading) && e.push(qh(t, 6)), Ih({ rules: e });
12122
+ return (t = n.nodes.blockquote) && e.push($h(t)), (t = n.nodes.orderedList) && e.push(Wh(t)), (t = n.nodes.bulletList) && e.push(Jh(t)), (t = n.nodes.codeBlock) && e.push(qh(t)), (t = n.nodes.heading) && e.push(Kh(t, 6)), vh({ rules: e });
12110
12123
  }
12111
- const jh = "rteProseMirror", Uh = rt.free, q = "rte:selectionchange", I = {
12124
+ const Uh = "rteProseMirror", Gh = rt.free, q = "rte:selectionchange", I = {
12112
12125
  bold: '<svg viewBox="0 0 24 24"><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',
12113
12126
  italic: '<svg viewBox="0 0 24 24"><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',
12114
12127
  underline: '<svg viewBox="0 0 24 24"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z" /></svg>',
@@ -12142,7 +12155,7 @@ const jh = "rteProseMirror", Uh = rt.free, q = "rte:selectionchange", I = {
12142
12155
  }
12143
12156
  }
12144
12157
  ]
12145
- }), Gh = (n, e) => {
12158
+ }), _h = (n, e) => {
12146
12159
  var a;
12147
12160
  const { editor: t, el: r } = n, i = Ft.get(r).view, s = vr(i, t, e), o = {
12148
12161
  separator: {
@@ -12491,7 +12504,7 @@ const jh = "rteProseMirror", Uh = rt.free, q = "rte:selectionchange", I = {
12491
12504
  items: l
12492
12505
  })) || l;
12493
12506
  };
12494
- class _h {
12507
+ class Xh {
12495
12508
  constructor(e, t, r) {
12496
12509
  this.editor = r, this.node = e, this.dom = document.createElement("img"), this.view = t, Object.keys(e.attrs.attrs).forEach((i) => {
12497
12510
  this.dom.setAttribute(i, e.attrs.attrs[i]);
@@ -12513,7 +12526,7 @@ class _h {
12513
12526
  this.dom.style.outline = "";
12514
12527
  }
12515
12528
  }
12516
- const Xh = function(n, e = {}) {
12529
+ const Yh = function(n, e = {}) {
12517
12530
  const t = {
12518
12531
  plugins: (l) => l.plugins,
12519
12532
  ...e
@@ -12535,14 +12548,14 @@ const Xh = function(n, e = {}) {
12535
12548
  plugins: [
12536
12549
  Bf(),
12537
12550
  Kf(),
12538
- Kh(c),
12551
+ jh(c),
12539
12552
  ga(),
12540
12553
  Ln({
12541
12554
  Tab: Hi(1),
12542
12555
  "Shift-Tab": Hi(-1)
12543
12556
  }),
12544
12557
  Ln({
12545
- Enter: Dt(Hs, Ma(f.listItem), gh(d, t)),
12558
+ Enter: Dt(Hs, Ma(f.listItem), yh(d, t)),
12546
12559
  "Shift-Enter": Dt(Fs, (w, N) => (N && N(w.tr.replaceSelectionWith(f.inlineBreak.create()).scrollIntoView()), !0)),
12547
12560
  "Mod-z": Gs,
12548
12561
  "Mod-y": Yn,
@@ -12567,18 +12580,18 @@ const Xh = function(n, e = {}) {
12567
12580
  const { state: N } = m, F = N.apply(w), R = !N.doc.eq(F.doc);
12568
12581
  m.updateState(F);
12569
12582
  const A = !N.selection.eq(F.selection);
12570
- R && (uh(((Q = a == null ? void 0 : a.view) == null ? void 0 : Q.el) || l), m.focus()), (A || R) && n.trigger(q);
12583
+ R && (ph(((Q = a == null ? void 0 : a.view) == null ? void 0 : Q.el) || l), m.focus()), (A || R) && n.trigger(q);
12571
12584
  }
12572
12585
  }
12573
12586
  );
12574
12587
  return l.__rteView = m, m.setProps({
12575
12588
  nodeViews: {
12576
12589
  image(w) {
12577
- return new _h(w, m, n);
12590
+ return new Xh(w, m, n);
12578
12591
  }
12579
12592
  }
12580
12593
  }), m;
12581
- }, i = (l) => Gh(l, t);
12594
+ }, i = (l) => _h(l, t);
12582
12595
  n.setCustomRte({
12583
12596
  // Use Studio SDK toolbar
12584
12597
  toolbar: i,
@@ -12588,13 +12601,13 @@ const Xh = function(n, e = {}) {
12588
12601
  const f = Zt(l);
12589
12602
  if (f) return f;
12590
12603
  const h = r(l, c);
12591
- return hh(l, h, c.view), Oh(h, c), h;
12604
+ return dh(l, h, c.view), Nh(h, c), h;
12592
12605
  },
12593
12606
  disable(l) {
12594
12607
  const a = Zt(l), c = a == null ? void 0 : a.view;
12595
12608
  if (c) {
12596
12609
  const f = Zi(l);
12597
- return dh(l, c), f || n.once(n.RichTextEditor.events.disable, () => {
12610
+ return uh(l, c), f || n.once(n.RichTextEditor.events.disable, () => {
12598
12611
  a.gjsView.model.trigger("rerender");
12599
12612
  }), c.destroy(), { forceSync: f };
12600
12613
  }
@@ -12610,22 +12623,22 @@ const Xh = function(n, e = {}) {
12610
12623
  return m.childNodes.forEach((g) => {
12611
12624
  var b;
12612
12625
  g.nodeType === Node.ELEMENT_NODE && (g.innerHTML === "" ? g.innerHTML = "<br/>" : ((b = g.lastChild) == null ? void 0 : b.nodeName) === "BR" && g.appendChild(document.createElement("br")));
12613
- }), p.appendChild(m), ph(p), l.classList.remove("ProseMirror-focused"), p.innerHTML;
12626
+ }), p.appendChild(m), mh(p), l.classList.remove("ProseMirror-focused"), p.innerHTML;
12614
12627
  }
12615
12628
  return l.innerHTML;
12616
12629
  }
12617
12630
  });
12618
- const s = sh(n, t.enableOnClick), o = ih(n, t.disableOnEsc);
12619
- th({
12631
+ const s = oh(n, t.enableOnClick), o = sh(n, t.disableOnEsc);
12632
+ nh({
12620
12633
  editor: n,
12621
12634
  licenseKey: t.licenseKey,
12622
- plan: Uh,
12623
- pluginName: jh,
12635
+ plan: Gh,
12636
+ pluginName: Uh,
12624
12637
  cleanup: () => {
12625
12638
  n.RichTextEditor.customRte = void 0, s(), o();
12626
12639
  }
12627
12640
  });
12628
- }, Yh = eh(Xh);
12641
+ }, Zh = th(Yh);
12629
12642
  export {
12630
- Yh as default
12643
+ Zh as default
12631
12644
  };