@fileverse-dev/ddoc 2.0.9-patch-7 → 2.0.9-patch-8

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.es.js CHANGED
@@ -77338,10 +77338,7 @@ const bZe = ({
77338
77338
  onTouchEnd: f,
77339
77339
  isActive: e
77340
77340
  };
77341
- }, wZe = ({
77342
- editor: t,
77343
- elementRef: e
77344
- }) => {
77341
+ }, wZe = ({ editor: t, elementRef: e }) => {
77345
77342
  const n = [
77346
77343
  {
77347
77344
  name: "Text",
@@ -77404,16 +77401,10 @@ const bZe = ({
77404
77401
  Ro,
77405
77402
  {
77406
77403
  sideOffset: 15,
77407
- anchorTrigger: /* @__PURE__ */ P.jsxs(
77408
- "button",
77409
- {
77410
- className: "bg-transparent hover:!bg-[#F2F4F5] !text-[#363B3F] rounded p-1 flex items-center justify-between gap-2 w-fit max-w-36",
77411
- children: [
77412
- /* @__PURE__ */ P.jsx("span", { className: "text-body-sm !text-[#363B3F] truncate", children: r.name }),
77413
- /* @__PURE__ */ P.jsx($e, { name: "ChevronDown", size: "sm", className: "mt-1" })
77414
- ]
77415
- }
77416
- ),
77404
+ anchorTrigger: /* @__PURE__ */ P.jsxs("button", { className: "bg-transparent hover:!bg-[#F2F4F5] !text-[#363B3F] rounded p-1 flex items-center justify-between gap-2 w-fit max-w-36", children: [
77405
+ /* @__PURE__ */ P.jsx("span", { className: "text-body-sm !text-[#363B3F] truncate", children: r.name }),
77406
+ /* @__PURE__ */ P.jsx($e, { name: "ChevronDown", size: "sm", className: "mt-1" })
77407
+ ] }),
77417
77408
  content: /* @__PURE__ */ P.jsx(
77418
77409
  "div",
77419
77410
  {
@@ -77639,7 +77630,12 @@ async function Xm(t, e, n, r) {
77639
77630
  r,
77640
77631
  t,
77641
77632
  l
77642
- ), h = await OZe(f, u, $x(c), d), p = o.nodes.resizableMedia.create({
77633
+ ), h = await OZe(
77634
+ f,
77635
+ u,
77636
+ $x(c),
77637
+ d
77638
+ ), p = o.nodes.resizableMedia.create({
77643
77639
  encryptedKey: u,
77644
77640
  url: f,
77645
77641
  iv: d,
@@ -79804,7 +79800,11 @@ const s5 = [
79804
79800
  const p = h.target.value;
79805
79801
  a(p), s({ inlineCommentText: p });
79806
79802
  }, u = () => {
79807
- e.chain().unsetHighlight().run(), a(""), s({ inlineCommentText: "", highlightedTextContent: "", handleClick: !1 }), r(!1);
79803
+ e.chain().unsetHighlight().run(), a(""), s({
79804
+ inlineCommentText: "",
79805
+ highlightedTextContent: "",
79806
+ handleClick: !1
79807
+ }), r(!1);
79808
79808
  };
79809
79809
  Ue(() => {
79810
79810
  const h = (m) => {
@@ -79848,18 +79848,13 @@ const s5 = [
79848
79848
  ),
79849
79849
  o.trim() !== "" && /* @__PURE__ */ P.jsxs("div", { className: "h-full flex items-center gap-2 p-3", children: [
79850
79850
  /* @__PURE__ */ P.jsxs("span", { className: "w-full text-[12px] text-[#77818A]", children: [
79851
- "Press ",
79851
+ "Press",
79852
+ " ",
79852
79853
  /* @__PURE__ */ P.jsx("span", { className: "font-semibold", children: l ? "Send" : "Enter" }),
79853
- " to send a comment"
79854
+ " ",
79855
+ "to send a comment"
79854
79856
  ] }),
79855
- /* @__PURE__ */ P.jsx(
79856
- zn,
79857
- {
79858
- className: "!min-w-[10px] !h-8 !px-2",
79859
- onClick: f,
79860
- children: /* @__PURE__ */ P.jsx($e, { name: "SendHorizontal", size: "md" })
79861
- }
79862
- )
79857
+ /* @__PURE__ */ P.jsx(zn, { className: "!min-w-[10px] !h-8 !px-2", onClick: f, children: /* @__PURE__ */ P.jsx($e, { name: "SendHorizontal", size: "md" }) })
79863
79858
  ] })
79864
79859
  ]
79865
79860
  }
@@ -80363,15 +80358,7 @@ const s5 = [
80363
80358
  ] })
80364
80359
  }
80365
80360
  );
80366
- }, Si = nn(({
80367
- icon: t,
80368
- isActive: e,
80369
- onClick: n,
80370
- tooltip: r,
80371
- classNames: i,
80372
- disabled: s,
80373
- size: o
80374
- }, a) => r ? /* @__PURE__ */ P.jsx(Td, { text: r, children: /* @__PURE__ */ P.jsx(
80361
+ }, Si = nn(({ icon: t, isActive: e, onClick: n, tooltip: r, classNames: i, disabled: s, size: o }, a) => r ? /* @__PURE__ */ P.jsx(Td, { text: r, children: /* @__PURE__ */ P.jsx(
80375
80362
  J1,
80376
80363
  {
80377
80364
  ref: a,
@@ -80854,7 +80841,7 @@ const u$ = /* @__PURE__ */ sy(EYe), TYe = (t) => {
80854
80841
  }
80855
80842
  );
80856
80843
  case "InlineComment":
80857
- return /* @__PURE__ */ P.jsx(
80844
+ return t.username || t.walletAddress ? /* @__PURE__ */ P.jsx(
80858
80845
  CYe,
80859
80846
  {
80860
80847
  editor: t.editor,
@@ -80867,7 +80854,7 @@ const u$ = /* @__PURE__ */ sy(EYe), TYe = (t) => {
80867
80854
  return (v = t.setInlineCommentData) == null ? void 0 : v.call(t, (k) => ({ ...k, ...g }));
80868
80855
  }
80869
80856
  }
80870
- );
80857
+ ) : null;
80871
80858
  case "Scripts":
80872
80859
  return /* @__PURE__ */ P.jsx(AYe, { editor: t.editor, elementRef: l });
80873
80860
  default:
@@ -81593,14 +81580,7 @@ const y$ = {
81593
81580
  c.map((x, S) => (x == null ? void 0 : x.title) === "Markdown" || (x == null ? void 0 : x.title) === "Highlight" || (x == null ? void 0 : x.title) === "Text Color" || (x == null ? void 0 : x.title) === "Alignment" || (x == null ? void 0 : x.title) === "Link" ? /* @__PURE__ */ P.jsx(
81594
81581
  Ro,
81595
81582
  {
81596
- anchorTrigger: /* @__PURE__ */ P.jsx(Td, { text: x.title, children: /* @__PURE__ */ P.jsx(
81597
- J1,
81598
- {
81599
- icon: x.icon,
81600
- variant: "ghost",
81601
- size: "md"
81602
- }
81603
- ) }),
81583
+ anchorTrigger: /* @__PURE__ */ P.jsx(Td, { text: x.title, children: /* @__PURE__ */ P.jsx(J1, { icon: x.icon, variant: "ghost", size: "md" }) }),
81604
81584
  content: k(x)
81605
81585
  },
81606
81586
  x.title
@@ -81611,13 +81591,7 @@ const y$ = {
81611
81591
  onClick: x.onClick,
81612
81592
  isActive: x.isActive
81613
81593
  }
81614
- ) }, x.title) : /* @__PURE__ */ P.jsx(
81615
- "div",
81616
- {
81617
- className: "w-[2px] h-4 bg-gray-200 mx-2"
81618
- },
81619
- S
81620
- )),
81594
+ ) }, x.title) : /* @__PURE__ */ P.jsx("div", { className: "w-[2px] h-4 bg-gray-200 mx-2" }, S)),
81621
81595
  /* @__PURE__ */ P.jsx(
81622
81596
  pY,
81623
81597
  {
@@ -95047,7 +95021,10 @@ const eet = ({ node: t, editor: e }) => {
95047
95021
  ];
95048
95022
  },
95049
95023
  renderHTML({ HTMLAttributes: t }) {
95050
- return ["div", qt(this.options.HTMLAttributes, t)];
95024
+ return [
95025
+ "div",
95026
+ qt(this.options.HTMLAttributes, t)
95027
+ ];
95051
95028
  },
95052
95029
  addNodeView() {
95053
95030
  return a0(eet);
@@ -99242,7 +99219,13 @@ const Jg = ({
99242
99219
  default:
99243
99220
  return null;
99244
99221
  }
99245
- }, gO = (t, e) => typeof t == "string" && oU[t] ? /* @__PURE__ */ P.jsx($e, { name: t, className: e }) : typeof t == "string" ? /* @__PURE__ */ P.jsx("span", { className: e, children: t }) : null, Znt = (t) => [
99222
+ }, gO = (t, e) => typeof t == "string" && oU[t] ? /* @__PURE__ */ P.jsx(
99223
+ $e,
99224
+ {
99225
+ name: t,
99226
+ className: e
99227
+ }
99228
+ ) : typeof t == "string" ? /* @__PURE__ */ P.jsx("span", { className: e, children: t }) : null, Znt = (t) => [
99246
99229
  {
99247
99230
  label: "To-do",
99248
99231
  icon: "ListChecks",
@@ -99348,7 +99331,14 @@ const Jg = ({
99348
99331
  onClick: r,
99349
99332
  children: [
99350
99333
  /* @__PURE__ */ P.jsx("span", { children: i ? "Less" : "More" }),
99351
- /* @__PURE__ */ P.jsx($e, { name: "ChevronDown", size: "sm", className: Ie(i ? "rotate-180" : "") })
99334
+ /* @__PURE__ */ P.jsx(
99335
+ $e,
99336
+ {
99337
+ name: "ChevronDown",
99338
+ size: "sm",
99339
+ className: Ie(i ? "rotate-180" : "")
99340
+ }
99341
+ )
99352
99342
  ]
99353
99343
  }
99354
99344
  )
@@ -99356,13 +99346,7 @@ const Jg = ({
99356
99346
  },
99357
99347
  "More Templates"
99358
99348
  )
99359
- ] }), Qnt = ({
99360
- node: t,
99361
- getPos: e,
99362
- editor: n,
99363
- deleteNode: r,
99364
- secureImageUploadUrl: i
99365
- }) => {
99349
+ ] }), Qnt = ({ node: t, getPos: e, editor: n, deleteNode: r, secureImageUploadUrl: i }) => {
99366
99350
  const [s, o] = Ge(!1), a = Gnt(n, t, e()), l = s8(), c = pn(() => {
99367
99351
  const { content: Q } = t.content;
99368
99352
  return Q[0].type.name === "table";
@@ -101693,7 +101677,14 @@ const ait = [
101693
101677
  tabIndex: 0,
101694
101678
  className: Pt("trigger-button", { hidden: o }),
101695
101679
  contentEditable: !1,
101696
- children: /* @__PURE__ */ P.jsx($e, { name: "Ellipsis", className: "color-text-default", size: "sm" })
101680
+ children: /* @__PURE__ */ P.jsx(
101681
+ $e,
101682
+ {
101683
+ name: "Ellipsis",
101684
+ className: "color-text-default",
101685
+ size: "sm"
101686
+ }
101687
+ )
101697
101688
  }
101698
101689
  )
101699
101690
  }
@@ -102027,8 +102018,12 @@ const pit = on.create({
102027
102018
  x && x.length > 0 && (m = x[1]);
102028
102019
  } else
102029
102020
  switch (!0) {
102030
- case /youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/.test(r): {
102031
- const x = r.match(/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/);
102021
+ case /youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/.test(
102022
+ r
102023
+ ): {
102024
+ const x = r.match(
102025
+ /youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/
102026
+ );
102032
102027
  x && x.length > 0 && (m = `https://www.youtube.com/embed/${x[1]}`);
102033
102028
  break;
102034
102029
  }
@@ -102037,8 +102032,12 @@ const pit = on.create({
102037
102032
  x && x.length > 0 && (m = `https://player.vimeo.com/video/${x[1]}`);
102038
102033
  break;
102039
102034
  }
102040
- case /(?:twitter|x)\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/.test(r): {
102041
- const x = r.match(/(?:twitter|x)\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/);
102035
+ case /(?:twitter|x)\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/.test(
102036
+ r
102037
+ ): {
102038
+ const x = r.match(
102039
+ /(?:twitter|x)\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/
102040
+ );
102042
102041
  x && x.length > 0 && (m = x[3], g = "twitter");
102043
102042
  break;
102044
102043
  }
@@ -108332,6 +108331,7 @@ const Yct = on.create({
108332
108331
  }
108333
108332
  }),
108334
108333
  new no({
108334
+ // eslint-disable-next-line no-useless-escape
108335
108335
  find: /(\S*)\^((?:[^\^]|\\\^)+)\^/,
108336
108336
  handler: ({ state: t, range: e, match: n }) => {
108337
108337
  const { tr: r } = t, i = e.from + n[1].length, s = e.to, o = n[2].replace(/\\\^/g, "^");
@@ -141841,7 +141841,10 @@ const Rse = ({ children: t, exitBeforeEnter: e, custom: n, initial: r = !0, onEx
141841
141841
  }).run(), g(!0), p(!0), a(Lt.NONE);
141842
141842
  }, k = () => {
141843
141843
  const { from: b, to: w } = t.state.selection, x = t.state.doc.textBetween(b, w), S = t.getAttributes("link");
141844
- return { text: x || S.text || "", url: S.href || "" };
141844
+ return {
141845
+ text: x || S.text || "",
141846
+ url: S.href || ""
141847
+ };
141845
141848
  };
141846
141849
  return Ue(() => {
141847
141850
  if (!t) return;
@@ -142395,27 +142398,33 @@ const Rse = ({ children: t, exitBeforeEnter: e, custom: n, initial: r = !0, onEx
142395
142398
  const W = (G) => {
142396
142399
  const Y = G.name.split(",").map((re) => {
142397
142400
  const Q = re.trim();
142398
- return (m == null ? void 0 : m.find((de) => de.name.toLowerCase() === Q.toLowerCase())) || { name: Q, color: G.color };
142401
+ return (m == null ? void 0 : m.find(
142402
+ (de) => de.name.toLowerCase() === Q.toLowerCase()
142403
+ )) || { name: Q, color: G.color };
142399
142404
  });
142400
142405
  v == null || v((re) => {
142401
142406
  const Q = [...re];
142402
142407
  return Y.forEach((oe) => {
142403
- Q.some((de) => de.name.toLowerCase() === oe.name.toLowerCase()) || Q.push(oe);
142408
+ Q.some(
142409
+ (de) => de.name.toLowerCase() === oe.name.toLowerCase()
142410
+ ) || Q.push(oe);
142404
142411
  }), Q;
142405
142412
  });
142406
142413
  }, U = (G) => {
142407
- v == null || v((Y) => Y.filter((re) => re.name !== G));
142414
+ v == null || v(
142415
+ (Y) => Y.filter((re) => re.name !== G)
142416
+ );
142408
142417
  };
142409
142418
  return !I || H ? /* @__PURE__ */ P.jsxs("div", { className: "w-auto h-auto flex flex-col gap-4 justify-center items-center", children: [
142410
142419
  /* @__PURE__ */ P.jsx(b$, {}),
142411
142420
  /* @__PURE__ */ P.jsx("p", { children: "Loading Editor..." })
142412
- ] }) : /* @__PURE__ */ P.jsx(
142413
- "div",
142414
- {
142415
- ref: O,
142416
- className: Ie("overflow-x-hidden", k),
142417
- children: /* @__PURE__ */ P.jsxs(v$, { isPreviewMode: t, children: [
142418
- m && m.length > 0 && /* @__PURE__ */ P.jsxs("div", { ref: E, className: "flex flex-wrap px-4 md:px-[80px] lg:!px-[124px] items-center gap-1 mb-4 mt-4 lg:!mt-0", children: [
142421
+ ] }) : /* @__PURE__ */ P.jsx("div", { ref: O, className: Ie("overflow-x-hidden", k), children: /* @__PURE__ */ P.jsxs(v$, { isPreviewMode: t, children: [
142422
+ m && m.length > 0 && /* @__PURE__ */ P.jsxs(
142423
+ "div",
142424
+ {
142425
+ ref: E,
142426
+ className: "flex flex-wrap px-4 md:px-[80px] lg:!px-[124px] items-center gap-1 mb-4 mt-4 lg:!mt-0",
142427
+ children: [
142419
142428
  L.map((G, Y) => /* @__PURE__ */ P.jsx(
142420
142429
  Um,
142421
142430
  {
@@ -142469,18 +142478,18 @@ const Rse = ({ children: t, exitBeforeEnter: e, custom: n, initial: r = !0, onEx
142469
142478
  isPreviewMode: t
142470
142479
  }
142471
142480
  )
142472
- ] }),
142473
- /* @__PURE__ */ P.jsx(
142474
- VV,
142475
- {
142476
- editor: I,
142477
- id: "editor",
142478
- className: "w-full h-auto py-4"
142479
- }
142480
- )
142481
- ] })
142482
- }
142483
- );
142481
+ ]
142482
+ }
142483
+ ),
142484
+ /* @__PURE__ */ P.jsx(
142485
+ VV,
142486
+ {
142487
+ editor: I,
142488
+ id: "editor",
142489
+ className: "w-full h-auto py-4"
142490
+ }
142491
+ )
142492
+ ] }) });
142484
142493
  }
142485
142494
  );
142486
142495
  export {
@@ -8,5 +8,5 @@ export interface TagInputProps {
8
8
  onAddTag: (tag: TagProps) => void;
9
9
  isPreviewMode: boolean;
10
10
  }
11
- declare const TagInput: ({ tags, selectedTags, onAddTag, isPreviewMode }: TagInputProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ declare const TagInput: ({ tags, selectedTags, onAddTag, isPreviewMode, }: TagInputProps) => import("react/jsx-runtime").JSX.Element | null;
12
12
  export { TagInput };
@@ -12,4 +12,4 @@ declare const renderIcon: (icon: IconType, className?: string) => import("react/
12
12
  declare const createTemplateButtons: (addTemplate: (template: JSONContent) => void) => TemplateButtonProps;
13
13
  declare const createMoreTemplates: (addTemplate: (template: JSONContent) => void) => TemplateButtonProps;
14
14
  declare const renderTemplateButtons: (templateButtons: TemplateButtonProps, moreTemplates: TemplateButtonProps, visibleTemplateCount: number, toggleAllTemplates: () => void, isExpanded: boolean) => import("react/jsx-runtime").JSX.Element;
15
- export { renderIcon, createTemplateButtons, createMoreTemplates, renderTemplateButtons };
15
+ export { renderIcon, createTemplateButtons, createMoreTemplates, renderTemplateButtons, };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "2.0.9-patch-7",
5
+ "version": "2.0.9-patch-8",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -22,8 +22,18 @@
22
22
  "scripts": {
23
23
  "dev": "vite",
24
24
  "build": "tsc && vite build",
25
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
26
- "preview": "vite preview"
25
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
26
+ "preview": "vite preview",
27
+ "prepare": "husky install"
28
+ },
29
+ "lint-staged": {
30
+ "**/*.{js,jsx,ts,tsx}": [
31
+ "eslint --fix",
32
+ "prettier --write"
33
+ ],
34
+ "**/*.{json,css,md}": [
35
+ "prettier --write"
36
+ ]
27
37
  },
28
38
  "dependencies": {
29
39
  "@_ueberdosis/prosemirror-tables": "^1.1.3",
@@ -99,9 +109,14 @@
99
109
  "@vitejs/plugin-react": "^4.2.0",
100
110
  "autoprefixer": "^10.4.19",
101
111
  "eslint": "^8.53.0",
112
+ "eslint-config-prettier": "^9.1.0",
113
+ "eslint-plugin-prettier": "^5.2.1",
102
114
  "eslint-plugin-react-hooks": "^4.6.0",
103
115
  "eslint-plugin-react-refresh": "^0.4.4",
116
+ "husky": "^9.1.7",
117
+ "lint-staged": "^15.2.10",
104
118
  "postcss": "^8.4.38",
119
+ "prettier": "^3.4.2",
105
120
  "sass": "^1.77.2",
106
121
  "tailwindcss": "^3.4.3",
107
122
  "typescript": "^5.2.2",