@clevertask/scribe 0.0.12 → 0.0.14
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/README.md +80 -4
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.d.ts +3 -2
- package/dist/components/Menu/BarMenu.d.ts.map +1 -0
- package/dist/components/Menu/BarMenu.js +21 -21
- package/dist/components/Menu/BubbleMenu.d.ts +3 -2
- package/dist/components/Menu/BubbleMenu.d.ts.map +1 -0
- package/dist/components/Menu/BubbleMenu.js +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts +2 -1
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -0
- package/dist/components/Menu/Mobile/ListOptionBar.js +35 -38
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +2 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -0
- package/dist/components/Scribe/extension/emoji/suggest.d.ts +1 -0
- package/dist/components/Scribe/extension/emoji/suggest.d.ts.map +1 -0
- package/dist/components/Scribe/extension/emoji/suggest.js +5 -6
- package/dist/components/Scribe/extension/extension-link.d.ts +2 -1
- package/dist/components/Scribe/extension/extension-link.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-link.js +2 -2
- package/dist/components/Scribe/extension/extension-selectedText.d.ts +2 -1
- package/dist/components/Scribe/extension/extension-selectedText.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.d.ts +3 -2
- package/dist/components/Scribe/extension/index.d.ts.map +1 -0
- package/dist/components/Scribe/extension/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts +3 -2
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +4 -4
- package/dist/components/Scribe/extension/slashCommand/index.d.ts +3 -2
- package/dist/components/Scribe/extension/slashCommand/index.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/items.d.ts +3 -2
- package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/items.js +6 -7
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +2 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts.map +1 -0
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +10 -11
- package/dist/components/Scribe/index.d.ts +6 -4
- package/dist/components/Scribe/index.d.ts.map +1 -0
- package/dist/components/Scribe/index.js +78 -79
- package/dist/index-BfaHEr44.js +159 -0
- package/dist/{index-VneQGVTd.js → index-Bvgjhwaj.js} +11 -47
- package/dist/{index-CCS9HOYd.js → index-DAuPG8ME.js} +5313 -5425
- package/dist/{index-DoNRu1rY.js → index-flsxByQS.js} +17 -17
- package/dist/main.d.ts +4 -3
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +8 -6
- package/dist/marked.esm-H7n4rMcO.js +1554 -0
- package/dist/{purify.es-BGaRrCfO.js → purify.es-BRDuGiV2.js} +114 -115
- package/dist/utils/convert-legacy-math-delimiters.d.ts +2 -0
- package/dist/utils/convert-legacy-math-delimiters.d.ts.map +1 -0
- package/dist/utils/convert-legacy-math-delimiters.js +13 -0
- package/dist/utils/create-scribe-editor.d.ts +2 -1
- package/dist/utils/create-scribe-editor.d.ts.map +1 -0
- package/dist/utils/create-scribe-editor.js +3 -3
- package/dist/utils/html-to-markdown.d.ts +1 -0
- package/dist/utils/html-to-markdown.d.ts.map +1 -0
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.d.ts +6 -4
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +8 -6
- package/dist/utils/is-in-viewport.d.ts +1 -0
- package/dist/utils/is-in-viewport.d.ts.map +1 -0
- package/dist/utils/markdown-to-html.d.ts +1 -0
- package/dist/utils/markdown-to-html.d.ts.map +1 -0
- package/dist/utils/markdown-to-html.js +2 -2
- package/package.json +46 -46
- package/dist/index-B0pieAxt.js +0 -160
- package/dist/marked.esm-BS_MmRZC.js +0 -1566
|
@@ -9675,7 +9675,7 @@ function Hs(r) {
|
|
|
9675
9675
|
...s,
|
|
9676
9676
|
...d
|
|
9677
9677
|
};
|
|
9678
|
-
typeof
|
|
9678
|
+
typeof u?.default == "function" && (u.default = u.default()), u?.isRequired && u?.default === void 0 && delete u.default, e.push({
|
|
9679
9679
|
type: o.name,
|
|
9680
9680
|
name: f,
|
|
9681
9681
|
attribute: u
|
|
@@ -9787,7 +9787,7 @@ function gc(r, e) {
|
|
|
9787
9787
|
isolating: N(x(c, "isolating", d)),
|
|
9788
9788
|
attrs: Object.fromEntries(f.map((y) => {
|
|
9789
9789
|
var w;
|
|
9790
|
-
return [y.name, { default: (w = y
|
|
9790
|
+
return [y.name, { default: (w = y?.attribute) === null || w === void 0 ? void 0 : w.default }];
|
|
9791
9791
|
}))
|
|
9792
9792
|
}), p = N(x(c, "parseHTML", d));
|
|
9793
9793
|
p && (h.parseDOM = p.map((y) => di(y, f)));
|
|
@@ -9819,7 +9819,7 @@ function gc(r, e) {
|
|
|
9819
9819
|
code: N(x(c, "code", d)),
|
|
9820
9820
|
attrs: Object.fromEntries(f.map((g) => {
|
|
9821
9821
|
var y;
|
|
9822
|
-
return [g.name, { default: (y = g
|
|
9822
|
+
return [g.name, { default: (y = g?.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
9823
9823
|
}))
|
|
9824
9824
|
}), p = N(x(c, "parseHTML", d));
|
|
9825
9825
|
p && (h.parseDOM = p.map((g) => di(g, f)));
|
|
@@ -9931,7 +9931,7 @@ function kc(r) {
|
|
|
9931
9931
|
if (l)
|
|
9932
9932
|
return l;
|
|
9933
9933
|
const a = i.getMeta("applyInputRules");
|
|
9934
|
-
return
|
|
9934
|
+
return a && setTimeout(() => {
|
|
9935
9935
|
let { text: f } = a;
|
|
9936
9936
|
typeof f == "string" ? f = f : f = lr(b.from(f), o.schema);
|
|
9937
9937
|
const { from: d } = a, u = d + f.length;
|
|
@@ -10042,9 +10042,9 @@ class Jt {
|
|
|
10042
10042
|
const { tr: n } = e.state, i = e.state.selection.$from;
|
|
10043
10043
|
if (i.pos === i.end()) {
|
|
10044
10044
|
const o = i.marks();
|
|
10045
|
-
if (!!!o.find((c) =>
|
|
10045
|
+
if (!!!o.find((c) => c?.type.name === t.name))
|
|
10046
10046
|
return !1;
|
|
10047
|
-
const a = o.find((c) =>
|
|
10047
|
+
const a = o.find((c) => c?.type.name === t.name);
|
|
10048
10048
|
return a && n.removeStoredMark(a), n.insertText(" ", i.pos), e.view.dispatch(n), !0;
|
|
10049
10049
|
}
|
|
10050
10050
|
return !1;
|
|
@@ -10154,7 +10154,7 @@ function Nc(r) {
|
|
|
10154
10154
|
drop: (d, u) => {
|
|
10155
10155
|
if (s = n === d.dom.parentElement, l = u, !s) {
|
|
10156
10156
|
const h = Nt;
|
|
10157
|
-
h
|
|
10157
|
+
h?.isEditable && setTimeout(() => {
|
|
10158
10158
|
const p = h.state.selection;
|
|
10159
10159
|
p && h.commands.deleteRange({ from: p.from, to: p.to });
|
|
10160
10160
|
}, 10);
|
|
@@ -10164,7 +10164,7 @@ function Nc(r) {
|
|
|
10164
10164
|
paste: (d, u) => {
|
|
10165
10165
|
var h;
|
|
10166
10166
|
const p = (h = u.clipboardData) === null || h === void 0 ? void 0 : h.getData("text/html");
|
|
10167
|
-
return o = u, i = !!
|
|
10167
|
+
return o = u, i = !!p?.includes("data-pm-slice"), !1;
|
|
10168
10168
|
}
|
|
10169
10169
|
}
|
|
10170
10170
|
},
|
|
@@ -10407,7 +10407,7 @@ function Gs(r, e, t) {
|
|
|
10407
10407
|
return r.nodesBetween(n, i, (a, c, f, d) => {
|
|
10408
10408
|
var u;
|
|
10409
10409
|
a.isBlock && c > n && (l += s);
|
|
10410
|
-
const h = o
|
|
10410
|
+
const h = o?.[a.type.name];
|
|
10411
10411
|
if (h)
|
|
10412
10412
|
return f && (l += h({
|
|
10413
10413
|
node: a,
|
|
@@ -10416,7 +10416,7 @@ function Gs(r, e, t) {
|
|
|
10416
10416
|
index: d,
|
|
10417
10417
|
range: e
|
|
10418
10418
|
})), !1;
|
|
10419
|
-
a.isText && (l += (u = a
|
|
10419
|
+
a.isText && (l += (u = a?.text) === null || u === void 0 ? void 0 : u.slice(Math.max(n, c) - c, i - c));
|
|
10420
10420
|
}), l;
|
|
10421
10421
|
}
|
|
10422
10422
|
function _s(r) {
|
|
@@ -10447,7 +10447,7 @@ const Ec = ne.create({
|
|
|
10447
10447
|
}
|
|
10448
10448
|
}), Dc = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {
|
|
10449
10449
|
var t;
|
|
10450
|
-
r.isDestroyed || (e.dom.blur(), (t = window
|
|
10450
|
+
r.isDestroyed || (e.dom.blur(), (t = window?.getSelection()) === null || t === void 0 || t.removeAllRanges());
|
|
10451
10451
|
}), !0), Ac = (r = !1) => ({ commands: e }) => e.setContent("", r), Ic = () => ({ state: r, tr: e, dispatch: t }) => {
|
|
10452
10452
|
const { selection: n } = e, { ranges: i } = n;
|
|
10453
10453
|
return t && i.forEach(({ $from: s, $to: o }) => {
|
|
@@ -10793,7 +10793,7 @@ const of = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
|
|
|
10793
10793
|
}), a = e.captureTransaction(() => {
|
|
10794
10794
|
t.someProp("handleKeyDown", (c) => c(t, l));
|
|
10795
10795
|
});
|
|
10796
|
-
return a
|
|
10796
|
+
return a?.steps.forEach((c) => {
|
|
10797
10797
|
const f = c.map(n.mapping);
|
|
10798
10798
|
f && i && n.maybeStep(f);
|
|
10799
10799
|
}), !0;
|
|
@@ -10981,7 +10981,7 @@ function no(r, e, t) {
|
|
|
10981
10981
|
...o
|
|
10982
10982
|
});
|
|
10983
10983
|
}) : t.nodesBetween(r, e, (i, s) => {
|
|
10984
|
-
!i ||
|
|
10984
|
+
!i || i?.nodeSize === void 0 || n.push(...i.marks.map((o) => ({
|
|
10985
10985
|
from: s,
|
|
10986
10986
|
to: s + i.nodeSize,
|
|
10987
10987
|
mark: o
|
|
@@ -11143,7 +11143,7 @@ const Df = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
|
11143
11143
|
function bi(r, e) {
|
|
11144
11144
|
const t = r.storedMarks || r.selection.$to.parentOffset && r.selection.$from.marks();
|
|
11145
11145
|
if (t) {
|
|
11146
|
-
const n = t.filter((i) => e
|
|
11146
|
+
const n = t.filter((i) => e?.includes(i.type.name));
|
|
11147
11147
|
r.tr.ensureMarks(n);
|
|
11148
11148
|
}
|
|
11149
11149
|
}
|
|
@@ -11236,7 +11236,7 @@ const Bf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11236
11236
|
if (n === void 0)
|
|
11237
11237
|
return !0;
|
|
11238
11238
|
const i = r.doc.nodeAt(n);
|
|
11239
|
-
return t.node.type ===
|
|
11239
|
+
return t.node.type === i?.type && Oe(r.doc, t.pos) && r.join(t.pos), !0;
|
|
11240
11240
|
}, Cn = (r, e) => {
|
|
11241
11241
|
const t = fr((o) => o.type === e)(r.selection);
|
|
11242
11242
|
if (!t)
|
|
@@ -11245,7 +11245,7 @@ const Bf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11245
11245
|
if (n === void 0)
|
|
11246
11246
|
return !0;
|
|
11247
11247
|
const i = r.doc.nodeAt(n);
|
|
11248
|
-
return t.node.type ===
|
|
11248
|
+
return t.node.type === i?.type && Oe(r.doc, n) && r.join(n), !0;
|
|
11249
11249
|
}, Ff = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
|
|
11250
11250
|
const { extensions: d, splittableMarks: u } = i.extensionManager, h = F(r, o.schema), p = F(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: w } = m, C = y.blockRange(w), I = g || m.$to.parentOffset && m.$from.marks();
|
|
11251
11251
|
if (!C)
|
|
@@ -11930,7 +11930,7 @@ class cd extends uc {
|
|
|
11930
11930
|
td,
|
|
11931
11931
|
_f,
|
|
11932
11932
|
ed
|
|
11933
|
-
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s
|
|
11933
|
+
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s?.type));
|
|
11934
11934
|
this.extensionManager = new Ue(i, this);
|
|
11935
11935
|
}
|
|
11936
11936
|
/**
|
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export type { Content } from
|
|
1
|
+
export * from "./components/Scribe";
|
|
2
|
+
export * from "./utils";
|
|
3
|
+
export type { Content } from "@tiptap/react";
|
|
4
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Scribe as
|
|
1
|
+
import { Scribe as o } from "./components/Scribe/index.js";
|
|
2
2
|
import { html2md as m } from "./utils/html-to-markdown.js";
|
|
3
|
-
import { md2html as
|
|
3
|
+
import { md2html as p } from "./utils/markdown-to-html.js";
|
|
4
4
|
import { isInViewport as x } from "./utils/is-in-viewport.js";
|
|
5
|
-
import {
|
|
5
|
+
import { convertLegacyMathDelimiters as a } from "./utils/convert-legacy-math-delimiters.js";
|
|
6
|
+
import { createScribeEditor as h } from "./utils/create-scribe-editor.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
o as Scribe,
|
|
9
|
+
a as convertLegacyMathDelimiters,
|
|
10
|
+
h as createScribeEditor,
|
|
9
11
|
m as html2md,
|
|
10
12
|
x as isInViewport,
|
|
11
|
-
|
|
13
|
+
p as md2html
|
|
12
14
|
};
|