v-notion-editor 0.2.3 → 0.2.4

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.
@@ -24894,7 +24894,7 @@ const EI = { class: "tooltip-wrapper" }, CI = /* @__PURE__ */ Ae({
24894
24894
  }), RI = { class: "p-0.5 px-2 space-y-3" }, II = { class: "space-y-1" }, DI = { class: "grid grid-cols-5 gap-1" }, LI = ["title", "onClick"], BI = {
24895
24895
  key: 0,
24896
24896
  class: "absolute inset-0 flex items-center justify-center"
24897
- }, PI = { class: "space-y-2" }, $I = { class: "grid grid-cols-5 gap-1" }, zI = ["title", "onClick"], FI = {
24897
+ }, PI = { class: "space-y-2" }, $I = { class: "grid grid-cols-4 gap-x-2 gap-y-1" }, zI = ["title", "onClick"], FI = {
24898
24898
  key: 0,
24899
24899
  class: "absolute inset-0 flex items-center justify-center"
24900
24900
  }, T5 = /* @__PURE__ */ Ae({
@@ -24921,9 +24921,19 @@ const EI = { class: "tooltip-wrapper" }, CI = /* @__PURE__ */ Ae({
24921
24921
  ], r = [
24922
24922
  { color: "transparent", name: "Default", display: "rgba(55, 53, 47, 0.12)" },
24923
24923
  { color: "var(--editor-content-bg-gray)", name: "Gray", display: "#E0DFE0" },
24924
+ {
24925
+ color: "var(--editor-content-bg-secondary)",
24926
+ name: "Gray Light",
24927
+ display: "var(--editor-content-bg-secondary)"
24928
+ },
24924
24929
  { color: "var(--editor-content-bg-yellow)", name: "Yellow", display: "#FFEEBF" },
24925
24930
  { color: "var(--editor-content-bg-green)", name: "Green", display: "#D0EAC7" },
24926
24931
  { color: "var(--editor-content-bg-blue)", name: "Blue", display: "#B4D6FF" },
24932
+ {
24933
+ color: "var(--editor-content-bg-primary-light)",
24934
+ name: "Blue Light",
24935
+ display: "var(--editor-content-bg-primary-light)"
24936
+ },
24927
24937
  { color: "var(--editor-content-bg-purple)", name: "Purple", display: "rgba(105, 64, 165, 0.4)" },
24928
24938
  { color: "var(--editor-content-bg-pink)", name: "Pink", display: "#FECBE2" },
24929
24939
  { color: "var(--editor-content-bg-red)", name: "Red", display: "#F7C4C6" },
@@ -25012,7 +25022,7 @@ const EI = { class: "tooltip-wrapper" }, CI = /* @__PURE__ */ Ae({
25012
25022
  key: d,
25013
25023
  title: h,
25014
25024
  class: Fe([
25015
- "group relative w-6 h-6 rounded-md transition-all duration-150 focus:outline-none focus:ring-[0.5px] border",
25025
+ "group relative w-6.5 h-6.5 rounded-md transition-all duration-150 focus:outline-none focus:ring-[0.5px] border",
25016
25026
  s.value === d ? "ring-[0.5px] ring-gray-400 ring-offset-1 " : ""
25017
25027
  ]),
25018
25028
  style: Kt({
@@ -35227,7 +35237,7 @@ const Sz = /* @__PURE__ */ Ae({
35227
35237
  }, e.click();
35228
35238
  }), r6 = async (t) => new Promise(async (e, n) => {
35229
35239
  try {
35230
- (await import("./papaparse.min-DHoLTMmN.js").then((i) => i.p)).default.parse(t, {
35240
+ (await import("./papaparse.min-BH1g5Q7h.js").then((i) => i.p)).default.parse(t, {
35231
35241
  complete: (i) => {
35232
35242
  try {
35233
35243
  const s = i.data;
@@ -38584,13 +38594,12 @@ const DF = { class: "masonry-item-controls" }, LF = {
38584
38594
  };
38585
38595
  },
38586
38596
  addAttributes() {
38587
- return this.options.persist ? {
38588
- open: {
38589
- default: !1,
38590
- parseHTML: (t) => t.hasAttribute("open"),
38591
- renderHTML: ({ open: t }) => t ? { open: "" } : {}
38592
- }
38593
- } : [];
38597
+ const t = {};
38598
+ return this.options.persist && (t.open = {
38599
+ default: !1,
38600
+ parseHTML: (e) => e.hasAttribute("open"),
38601
+ renderHTML: ({ open: e }) => e ? { open: "" } : {}
38602
+ }), t;
38594
38603
  },
38595
38604
  parseHTML() {
38596
38605
  return [
@@ -38611,35 +38620,39 @@ const DF = { class: "masonry-item-controls" }, LF = {
38611
38620
  const i = document.createElement("div"), s = ot(this.options.HTMLAttributes, r, {
38612
38621
  "data-type": this.name
38613
38622
  });
38614
- Object.entries(s).forEach(([c, u]) => i.setAttribute(c, u));
38623
+ Object.entries(s).forEach(([u, d]) => i.setAttribute(u, d));
38615
38624
  const o = document.createElement("button");
38616
38625
  o.type = "button", o.setAttribute("aria-label", "Toggle content"), i.append(o);
38617
38626
  const a = document.createElement("div");
38618
38627
  i.append(a);
38619
- const l = (c) => {
38620
- const u = i.classList.contains(this.options.openClassName);
38621
- (c !== void 0 ? c : !u) ? i.classList.add(this.options.openClassName) : i.classList.remove(this.options.openClassName);
38628
+ const l = (u) => {
38629
+ u ? (i.style.textAlign = u, i.setAttribute("data-text-align", u)) : (i.style.textAlign = "", i.removeAttribute("data-text-align"));
38630
+ };
38631
+ n.attrs.textAlign && l(n.attrs.textAlign);
38632
+ const c = (u) => {
38633
+ const d = i.classList.contains(this.options.openClassName);
38634
+ (u !== void 0 ? u : !d) ? i.classList.add(this.options.openClassName) : i.classList.remove(this.options.openClassName);
38622
38635
  };
38623
- return n.attrs.open && i.classList.add(this.options.openClassName), o.addEventListener("click", (c) => {
38624
- if (c.preventDefault(), c.stopPropagation(), l(), t.isEditable && typeof e == "function") {
38625
- const { from: u, to: d } = t.state.selection, h = i.classList.contains(this.options.openClassName);
38626
- t.chain().command(({ tr: f }) => {
38627
- const p = e();
38628
- if (p === void 0) return !1;
38629
- const m = f.doc.nodeAt(p);
38630
- return (m == null ? void 0 : m.type) !== this.type ? !1 : (f.setNodeMarkup(p, void 0, {
38631
- ...m.attrs,
38632
- open: h
38636
+ return n.attrs.open && i.classList.add(this.options.openClassName), o.addEventListener("click", (u) => {
38637
+ if (u.preventDefault(), u.stopPropagation(), c(), t.isEditable && typeof e == "function") {
38638
+ const { from: d, to: h } = t.state.selection, f = i.classList.contains(this.options.openClassName);
38639
+ t.chain().command(({ tr: p }) => {
38640
+ const m = e();
38641
+ if (m === void 0) return !1;
38642
+ const g = p.doc.nodeAt(m);
38643
+ return (g == null ? void 0 : g.type) !== this.type ? !1 : (p.setNodeMarkup(m, void 0, {
38644
+ ...g.attrs,
38645
+ open: f
38633
38646
  }), !0);
38634
- }).setTextSelection({ from: u, to: d }).focus(void 0, { scrollIntoView: !1 }).run();
38647
+ }).setTextSelection({ from: d, to: h }).focus(void 0, { scrollIntoView: !1 }).run();
38635
38648
  }
38636
38649
  }), {
38637
38650
  dom: i,
38638
38651
  contentDOM: a,
38639
- ignoreMutation(c) {
38640
- return c.type === "selection" ? !1 : !i.contains(c.target) || i === c.target;
38652
+ ignoreMutation(u) {
38653
+ return u.type === "selection" ? !1 : !i.contains(u.target) || i === u.target;
38641
38654
  },
38642
- update: (c) => c.type !== this.type ? !1 : (c.attrs.open !== i.classList.contains(this.options.openClassName) && l(c.attrs.open), !0)
38655
+ update: (u) => u.type !== this.type ? !1 : (u.attrs.open !== i.classList.contains(this.options.openClassName) && c(u.attrs.open), (u.attrs.textAlign !== n.attrs.textAlign || u.attrs.textAlign && i.getAttribute("data-text-align") !== u.attrs.textAlign) && l(u.attrs.textAlign), !0)
38643
38656
  };
38644
38657
  };
38645
38658
  },
@@ -65181,7 +65194,8 @@ const NW = SW.extend({
65181
65194
  }
65182
65195
  }),
65183
65196
  sR.configure({
65184
- types: ["heading", "paragraph"],
65197
+ // Updated to include taskList
65198
+ types: ["heading", "paragraph", "details", "bulletList", "orderedList", "taskList"],
65185
65199
  alignments: ["left", "center", "right", "justify"]
65186
65200
  }),
65187
65201
  LT,
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as t, b as i, a as r } from "./index-DfQx9YxI.js";
1
+ import { _ as t, b as i, a as r } from "./index-BHVWpndl.js";
2
2
  export {
3
3
  t as NotionEditor,
4
4
  i as NotionReadMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-notion-editor",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "A Notion-style Vue 3 editor.",
5
5
  "type": "module",
6
6
  "author": "safdar-azeem",
@@ -1,4 +1,4 @@
1
- import { g as me, c as ye } from "./index-DfQx9YxI.js";
1
+ import { g as me, c as ye } from "./index-BHVWpndl.js";
2
2
  var ce = { exports: {} };
3
3
  /* @license
4
4
  Papa Parse