tiptapify 0.0.22 → 0.0.23

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.
@@ -77450,11 +77450,13 @@ function mW2(e, t, r) {
77450
77450
  }
77451
77451
  return a;
77452
77452
  }
77453
- function fW2(e, t, r = !0, a) {
77454
- const n = mW2(t, r, a);
77453
+ function fW2(e, t, r = !0, a, n = () => {
77454
+ }) {
77455
+ const i = mW2(t, r, a);
77455
77456
  return Mx2({
77456
77457
  content: e,
77457
- extensions: n
77458
+ extensions: i,
77459
+ onUpdate: ({ editor: C }) => n()
77458
77460
  });
77459
77461
  }
77460
77462
  const AW2 = {
@@ -77566,29 +77568,35 @@ const AW2 = {
77566
77568
  return [];
77567
77569
  } }
77568
77570
  },
77569
- emits: ["update:modelValue", "editor-ready"],
77571
+ emits: ["update:modelValue", "editor-ready", "content-changed"],
77570
77572
  setup(e, { emit: t }) {
77571
- var H;
77572
- const { t: r, setLocale: a } = EI2(), n = e, i = B8(), o = t1(i.global.name), C = fW2(
77573
+ var V;
77574
+ const { t: r, setLocale: a } = EI2(), n = e, i = B8(), o = t1(i.global.name);
77575
+ function C() {
77576
+ var l, L;
77577
+ H("content-changed", { html: (l = s.value) == null ? void 0 : l.getHTML(), json: (L = s.value) == null ? void 0 : L.getJSON() });
77578
+ }
77579
+ const s = fW2(
77573
77580
  n.content,
77574
77581
  k(() => n.placeholder || r("content.placeholder")).value,
77575
77582
  n.slashCommands,
77576
- n.customExtensions
77577
- ), s = t;
77578
- return o5("tiptapifyEditor", C), o5("tiptapifyI18n", { t: r, setLocale: a }), (H = C.value) == null || H.chain().setFontFamily(n.defaultFontFamily).run(), y1(() => C.value, (V) => {
77579
- V instanceof hc && s("editor-ready", {
77580
- editor: V,
77581
- getHTML: () => V.getHTML(),
77582
- getJSON: () => V.getJSON()
77583
+ n.customExtensions,
77584
+ C
77585
+ ), H = t;
77586
+ return o5("tiptapifyEditor", s), o5("tiptapifyI18n", { t: r, setLocale: a }), (V = s.value) == null || V.chain().setFontFamily(n.defaultFontFamily).run(), y1(() => s.value, (l) => {
77587
+ l instanceof hc && H("editor-ready", {
77588
+ editor: l,
77589
+ getHTML: () => l.getHTML(),
77590
+ getJSON: () => l.getJSON()
77583
77591
  });
77584
77592
  }, { immediate: !0 }), y1(() => n.locale, () => {
77585
77593
  a(n.locale);
77586
77594
  }, { immediate: !0 }), g5(() => {
77587
- var V;
77588
- (V = C.value) == null || V.destroy();
77589
- }), (V, l) => (Y(), j1(p1, null, [
77595
+ var l;
77596
+ (l = s.value) == null || l.destroy();
77597
+ }), (l, L) => (Y(), j1(p1, null, [
77590
77598
  e.toolbar ? (Y(), j1(p1, { key: 0 }, [
77591
- Z(C) ? (Y(), S1(hE2, {
77599
+ Z(s) ? (Y(), S1(hE2, {
77592
77600
  key: 0,
77593
77601
  "variant-btn": e.variantBtn,
77594
77602
  "variant-field": e.variantField,
@@ -77618,7 +77626,7 @@ const AW2 = {
77618
77626
  theme: o.value
77619
77627
  }, null, 8, ["variant", "theme"])) : n0("", !0),
77620
77628
  A(Z(cx2), {
77621
- editor: Z(C),
77629
+ editor: Z(s),
77622
77630
  class: "tiptapify-editor"
77623
77631
  }, null, 8, ["editor"])
77624
77632
  ], 4),
@@ -77629,7 +77637,7 @@ const AW2 = {
77629
77637
  ], 2)
77630
77638
  ], 64));
77631
77639
  }
77632
- }), bW2 = /* @__PURE__ */ _5(vW2, [["__scopeId", "data-v-1f74f869"]]), kW2 = {
77640
+ }), bW2 = /* @__PURE__ */ _5(vW2, [["__scopeId", "data-v-870bb767"]]), kW2 = {
77633
77641
  install(e, t = {}) {
77634
77642
  e.component("Tiptapify", bW2), e.component("TiptapifyDialog", A4);
77635
77643
  }