@fileverse-dev/ddoc 2.1.9-patch-3 → 2.1.9-patch-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.
@@ -1,4 +1,4 @@
1
- import { B as l, g as m, s as y, d as k, i as b, c as L, a as O, e as E, H as h, b as x } from "./index-DO6QdZBi.mjs";
1
+ import { B as l, g as m, s as y, d as k, i as b, c as L, a as O, e as E, H as h, b as x } from "./index-CIQcYg2P.mjs";
2
2
  class M extends l {
3
3
  constructor({ callbackSelector: r, cause: a, data: o, extraData: i, sender: d, urls: t }) {
4
4
  var n;
@@ -86999,7 +86999,7 @@ async function T6(e, t) {
86999
86999
  });
87000
87000
  return $ === "0x" ? { data: void 0 } : { data: $ };
87001
87001
  } catch (q) {
87002
- const W = v8t(q), { offchainLookup: G, offchainLookupSignature: K } = await import("./ccip-eisPsaAH.mjs");
87002
+ const W = v8t(q), { offchainLookup: G, offchainLookupSignature: K } = await import("./ccip-DtnoTesh.mjs");
87003
87003
  if (e.ccipRead !== !1 && (W == null ? void 0 : W.slice(0, 10)) === K && k)
87004
87004
  return { data: await G(e, { data: W, to: k }) };
87005
87005
  throw N && (W == null ? void 0 : W.slice(0, 10)) === "0x101bb98d" ? new C5t({ factory: u }) : sK(q, {
@@ -96879,18 +96879,18 @@ _n.addRule("strikethrough", {
96879
96879
  return "<s>" + e + "</s>";
96880
96880
  }
96881
96881
  });
96882
- const qxt = Qt.create({
96882
+ const qxt = (e) => Qt.create({
96883
96883
  name: "markdownPasteHandler",
96884
96884
  addProseMirrorPlugins() {
96885
96885
  return [
96886
96886
  new tn({
96887
96887
  props: {
96888
- handlePaste: (e, t) => {
96889
- t.preventDefault();
96890
- const n = t.clipboardData;
96891
- if (!n) return !1;
96892
- const r = n.getData("text/plain");
96893
- return Uxt(r) ? (fI(e, r), !0) : !1;
96888
+ handlePaste: (t, n) => {
96889
+ n.preventDefault();
96890
+ const r = n.clipboardData;
96891
+ if (!r) return !1;
96892
+ const i = r.getData("text/plain");
96893
+ return Uxt(i) ? (fI(t, i, e), !0) : !1;
96894
96894
  }
96895
96895
  }
96896
96896
  })
@@ -96898,37 +96898,37 @@ const qxt = Qt.create({
96898
96898
  },
96899
96899
  addCommands() {
96900
96900
  return {
96901
- uploadMarkdownFile: (e) => async ({ view: t }) => {
96902
- const n = document.createElement("input");
96903
- return n.type = "file", n.accept = ".md, text/markdown", n.onchange = async (r) => {
96904
- const i = r.target.files;
96905
- if (i.length > 0) {
96906
- const a = i[0];
96907
- if (a.type === "text/markdown" || a.name.endsWith(".md")) {
96908
- const o = new FileReader();
96909
- o.onload = async (s) => {
96910
- var c;
96911
- const l = (c = s.target) == null ? void 0 : c.result;
96901
+ uploadMarkdownFile: (t) => async ({ view: n }) => {
96902
+ const r = document.createElement("input");
96903
+ return r.type = "file", r.accept = ".md, text/markdown", r.onchange = async (i) => {
96904
+ const a = i.target.files;
96905
+ if (a.length > 0) {
96906
+ const o = a[0];
96907
+ if (o.type === "text/markdown" || o.name.endsWith(".md")) {
96908
+ const s = new FileReader();
96909
+ s.onload = async (l) => {
96910
+ var u;
96911
+ const c = (u = l.target) == null ? void 0 : u.result;
96912
96912
  await fI(
96913
- t,
96914
- l,
96915
- e
96913
+ n,
96914
+ c,
96915
+ t
96916
96916
  );
96917
- }, o.readAsText(a);
96917
+ }, s.readAsText(o);
96918
96918
  }
96919
96919
  }
96920
- }, n.click(), !0;
96920
+ }, r.click(), !0;
96921
96921
  },
96922
- exportMarkdownFile: () => async ({ editor: e }) => {
96923
- const t = e.state.doc, n = await cA(t), r = new K2({
96924
- extensions: e.extensionManager.extensions.filter(
96925
- (l) => l.name !== "collaboration"
96922
+ exportMarkdownFile: () => async ({ editor: t }) => {
96923
+ const n = t.state.doc, r = await cA(n), i = new K2({
96924
+ extensions: t.extensionManager.extensions.filter(
96925
+ (c) => c.name !== "collaboration"
96926
96926
  ),
96927
- content: n.toJSON()
96928
- }), i = r.getHTML(), a = _n.turndown(i), o = new Blob([a], {
96927
+ content: r.toJSON()
96928
+ }), a = i.getHTML(), o = _n.turndown(a), s = new Blob([o], {
96929
96929
  type: "text/markdown;charset=utf-8"
96930
- }), s = URL.createObjectURL(o);
96931
- return r.destroy(), s;
96930
+ }), l = URL.createObjectURL(s);
96931
+ return i.destroy(), l;
96932
96932
  }
96933
96933
  };
96934
96934
  },
@@ -96936,12 +96936,12 @@ const qxt = Qt.create({
96936
96936
  return [
96937
96937
  new Vi({
96938
96938
  find: /<sup>(.*?)<\/sup>/,
96939
- handler: ({ state: e, range: t, match: n }) => {
96940
- const { tr: r } = e, i = t.from, a = t.to, o = n[1];
96941
- r.replaceWith(
96942
- i,
96939
+ handler: ({ state: t, range: n, match: r }) => {
96940
+ const { tr: i } = t, a = n.from, o = n.to, s = r[1];
96941
+ i.replaceWith(
96943
96942
  a,
96944
- this.editor.schema.text(o, [
96943
+ o,
96944
+ this.editor.schema.text(s, [
96945
96945
  this.editor.schema.marks.superscript.create()
96946
96946
  ])
96947
96947
  );
@@ -96949,12 +96949,12 @@ const qxt = Qt.create({
96949
96949
  }),
96950
96950
  new Vi({
96951
96951
  find: /<sub>(.*?)<\/sub>/,
96952
- handler: ({ state: e, range: t, match: n }) => {
96953
- const { tr: r } = e, i = t.from, a = t.to, o = n[1];
96954
- r.replaceWith(
96955
- i,
96952
+ handler: ({ state: t, range: n, match: r }) => {
96953
+ const { tr: i } = t, a = n.from, o = n.to, s = r[1];
96954
+ i.replaceWith(
96956
96955
  a,
96957
- this.editor.schema.text(o, [
96956
+ o,
96957
+ this.editor.schema.text(s, [
96958
96958
  this.editor.schema.marks.subscript.create()
96959
96959
  ])
96960
96960
  );
@@ -96963,12 +96963,12 @@ const qxt = Qt.create({
96963
96963
  new Vi({
96964
96964
  // eslint-disable-next-line no-useless-escape
96965
96965
  find: /(\S*)\^((?:[^\^]|\\\^)+)\^/,
96966
- handler: ({ state: e, range: t, match: n }) => {
96967
- const { tr: r } = e, i = t.from + n[1].length, a = t.to, o = n[2].replace(/\\\^/g, "^");
96968
- r.replaceWith(
96969
- i,
96966
+ handler: ({ state: t, range: n, match: r }) => {
96967
+ const { tr: i } = t, a = n.from + r[1].length, o = n.to, s = r[2].replace(/\\\^/g, "^");
96968
+ i.replaceWith(
96970
96969
  a,
96971
- this.editor.schema.text(o, [
96970
+ o,
96971
+ this.editor.schema.text(s, [
96972
96972
  this.editor.schema.marks.superscript.create()
96973
96973
  ])
96974
96974
  );
@@ -96976,12 +96976,12 @@ const qxt = Qt.create({
96976
96976
  }),
96977
96977
  new Vi({
96978
96978
  find: /(\S*)~((?:[^~]|\\~)+)~/,
96979
- handler: ({ state: e, range: t, match: n }) => {
96980
- const { tr: r } = e, i = t.from + n[1].length, a = t.to, o = n[2].replace(/\\~/g, "~");
96981
- r.replaceWith(
96982
- i,
96979
+ handler: ({ state: t, range: n, match: r }) => {
96980
+ const { tr: i } = t, a = n.from + r[1].length, o = n.to, s = r[2].replace(/\\~/g, "~");
96981
+ i.replaceWith(
96983
96982
  a,
96984
- this.editor.schema.text(o, [
96983
+ o,
96984
+ this.editor.schema.text(s, [
96985
96985
  this.editor.schema.marks.subscript.create()
96986
96986
  ])
96987
96987
  );
@@ -96989,16 +96989,16 @@ const qxt = Qt.create({
96989
96989
  }),
96990
96990
  new Vi({
96991
96991
  find: /(?:^|\s)\[([^\]]+)\]\((\S+)\)/,
96992
- handler: ({ state: e, range: t, match: n }) => {
96993
- var c;
96994
- const { tr: r } = e, [i, a, o] = n, s = t.from, l = t.to;
96995
- if (i) {
96996
- const u = e.doc.resolve(s).nodeBefore, d = u && u.isText && ((c = u.text) == null ? void 0 : c.endsWith(" "));
96997
- d && r.insertText(" ", s), r.replaceWith(
96998
- d ? s + 1 : s,
96999
- d ? l + 1 : l,
97000
- this.editor.schema.text(a, [
97001
- this.editor.schema.marks.link.create({ href: o })
96992
+ handler: ({ state: t, range: n, match: r }) => {
96993
+ var u;
96994
+ const { tr: i } = t, [a, o, s] = r, l = n.from, c = n.to;
96995
+ if (a) {
96996
+ const d = t.doc.resolve(l).nodeBefore, f = d && d.isText && ((u = d.text) == null ? void 0 : u.endsWith(" "));
96997
+ f && i.insertText(" ", l), i.replaceWith(
96998
+ f ? l + 1 : l,
96999
+ f ? c + 1 : c,
97000
+ this.editor.schema.text(o, [
97001
+ this.editor.schema.marks.link.create({ href: s })
97002
97002
  ])
97003
97003
  );
97004
97004
  }
@@ -97006,12 +97006,12 @@ const qxt = Qt.create({
97006
97006
  }),
97007
97007
  new Vi({
97008
97008
  find: /===\s*$/m,
97009
- handler: ({ state: e, range: t }) => {
97010
- var o;
97011
- const { tr: n } = e, r = t.from - 2, i = t.to;
97012
- ((o = e.doc.nodeAt(r)) == null ? void 0 : o.type.name) === "dBlock" && n.replaceWith(
97013
- r,
97009
+ handler: ({ state: t, range: n }) => {
97010
+ var s;
97011
+ const { tr: r } = t, i = n.from - 2, a = n.to;
97012
+ ((s = t.doc.nodeAt(i)) == null ? void 0 : s.type.name) === "dBlock" && r.replaceWith(
97014
97013
  i,
97014
+ a,
97015
97015
  this.editor.schema.nodes.pageBreak.create()
97016
97016
  );
97017
97017
  }
@@ -136461,7 +136461,7 @@ const tHt = ({
136461
136461
  yDt,
136462
136462
  tzt,
136463
136463
  kTt,
136464
- qxt,
136464
+ qxt(t),
136465
136465
  MPt.configure({
136466
136466
  html: !0,
136467
136467
  // Allow HTML input/output
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, P as r, h as s, u as t } from "./index-DO6QdZBi.mjs";
1
+ import { D as d, P as r, h as s, u as t } from "./index-CIQcYg2P.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as PreviewDdocEditor,
@@ -13,6 +13,6 @@ declare module '@tiptap/core' {
13
13
  };
14
14
  }
15
15
  }
16
- declare const MarkdownPasteHandler: Extension<any, any>;
16
+ declare const MarkdownPasteHandler: (secureImageUploadUrl?: string) => Extension<any, any>;
17
17
  export default MarkdownPasteHandler;
18
18
  export declare function searchForSecureImageNodeAndEmbedImageContent(originalDoc: PMNode): Promise<PMNode>;
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.1.9-patch-3",
5
+ "version": "2.1.9-patch-4",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {