@clevertask/scribe 0.0.14 → 0.0.15
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 +5 -10
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.d.ts.map +1 -1
- package/dist/components/Menu/BarMenu.js +39 -18
- package/dist/components/Menu/BubbleMenu.js +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.js +3 -15
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.js +25 -14
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-link.d.ts.map +1 -1
- package/dist/components/Scribe/extension/extension-link.js +2 -4
- package/dist/components/Scribe/extension/extension-markdown-paste.d.ts +4 -0
- package/dist/components/Scribe/extension/extension-markdown-paste.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-markdown-paste.js +46 -0
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +25 -23
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +6 -5
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +34 -44
- package/dist/{index-flsxByQS.js → index-BKFDqQPh.js} +9 -3
- package/dist/{index-BfaHEr44.js → index-CL2WLiGu.js} +1 -1
- package/dist/{index-DAuPG8ME.js → index-Cxf4VEm1.js} +1102 -1064
- package/dist/{index-Bvgjhwaj.js → index-PzbCrHp0.js} +1 -1
- package/dist/main.css +3 -0
- package/dist/main.js +1 -1
- package/dist/{marked.esm-H7n4rMcO.js → markdown-to-html-__93dwok.js} +50 -47
- package/dist/{purify.es-BRDuGiV2.js → purify.es-BPDBzHtc.js} +1 -1
- package/dist/utils/convert-legacy-math-delimiters.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.d.ts +1 -1
- package/dist/utils/create-scribe-editor.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.js +8 -4
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/markdown-to-html.js +3 -4
- package/package.json +52 -52
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Wr, P as kr, H as Fr, A as Ur, J as qr, a as zr } from "./index-
|
|
1
|
+
import { b as Wr, P as kr, H as Fr, A as Ur, J as qr, a as zr } from "./index-BKFDqQPh.js";
|
|
2
2
|
import B, { forwardRef as Kr, useState as ur, useDebugValue as Gr, version as Pt, useLayoutEffect as Yr, useEffect as cr, useContext as fr, createContext as lr } from "react";
|
|
3
3
|
import Xr, { flushSync as Jr } from "react-dom";
|
|
4
4
|
var k = "top", G = "bottom", Y = "right", F = "left", Dt = "auto", Fe = [k, G, Y, F], De = "start", Ie = "end", Qr = "clippingParents", pr = "viewport", je = "popper", Zr = "reference", Bt = /* @__PURE__ */ Fe.reduce(function(e, t) {
|
package/dist/main.css
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Scribe as o } from "./components/Scribe/index.js";
|
|
2
2
|
import { html2md as m } from "./utils/html-to-markdown.js";
|
|
3
|
-
import {
|
|
3
|
+
import { m as p } from "./markdown-to-html-__93dwok.js";
|
|
4
4
|
import { isInViewport as x } from "./utils/is-in-viewport.js";
|
|
5
5
|
import { convertLegacyMathDelimiters as a } from "./utils/convert-legacy-math-delimiters.js";
|
|
6
6
|
import { createScribeEditor as h } from "./utils/create-scribe-editor.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { p as xe } from "./purify.es-BPDBzHtc.js";
|
|
1
2
|
function O() {
|
|
2
3
|
return {
|
|
3
4
|
async: !1,
|
|
@@ -85,31 +86,31 @@ var x = {
|
|
|
85
86
|
fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`),
|
|
86
87
|
headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`),
|
|
87
88
|
htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
88
|
-
},
|
|
89
|
+
}, be = /^(?:[ \t]*(?:\n|$))+/, me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, _ = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = /(?:[*+-]|\d{1,9}[.)])/, le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = u(le).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Re = u(le).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Se = /^[^\n]+/, H = /(?!\s*\])(?:\\.|[^\[\]\\])+/, $e = u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", H).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Te = u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), B = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Q = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ve = u(
|
|
89
90
|
"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
|
|
90
91
|
"i"
|
|
91
|
-
).replace("comment", Q).replace("tag", B).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oe = u(j).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex(),
|
|
92
|
-
blockquote:
|
|
93
|
-
code:
|
|
94
|
-
def:
|
|
95
|
-
fences:
|
|
96
|
-
heading:
|
|
92
|
+
).replace("comment", Q).replace("tag", B).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oe = u(j).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex(), ze = u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(), F = {
|
|
93
|
+
blockquote: ze,
|
|
94
|
+
code: me,
|
|
95
|
+
def: $e,
|
|
96
|
+
fences: we,
|
|
97
|
+
heading: ye,
|
|
97
98
|
hr: _,
|
|
98
|
-
html:
|
|
99
|
+
html: ve,
|
|
99
100
|
lheading: ae,
|
|
100
|
-
list:
|
|
101
|
-
newline:
|
|
101
|
+
list: Te,
|
|
102
|
+
newline: be,
|
|
102
103
|
paragraph: oe,
|
|
103
104
|
table: z,
|
|
104
|
-
text:
|
|
105
|
+
text: Se
|
|
105
106
|
}, ee = u(
|
|
106
107
|
"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
107
|
-
).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex(),
|
|
108
|
+
).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex(), _e = {
|
|
108
109
|
...F,
|
|
109
|
-
lheading:
|
|
110
|
+
lheading: Re,
|
|
110
111
|
table: ee,
|
|
111
112
|
paragraph: u(j).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ee).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex()
|
|
112
|
-
},
|
|
113
|
+
}, Ae = {
|
|
113
114
|
...F,
|
|
114
115
|
html: u(
|
|
115
116
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
@@ -121,64 +122,64 @@ var x = {
|
|
|
121
122
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
122
123
|
paragraph: u(j).replace("hr", _).replace("heading", ` *#{1,6} *[^
|
|
123
124
|
]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
124
|
-
},
|
|
125
|
+
}, Le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ce = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, E = /[\p{P}\p{S}]/u, U = /[\s\p{P}\p{S}]/u, he = /[^\s\p{P}\p{S}]/u, Pe = u(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, U).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, qe = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = u(ue, "u").replace(/punct/g, E).getRegex(), De = u(ue, "u").replace(/punct/g, pe).getRegex(), ge = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Me = u(ge, "gu").replace(/notPunctSpace/g, he).replace(/punctSpace/g, U).replace(/punct/g, E).getRegex(), Ge = u(ge, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex(), Oe = u(
|
|
125
126
|
"^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
|
|
126
127
|
"gu"
|
|
127
|
-
).replace(/notPunctSpace/g, he).replace(/punctSpace/g, U).replace(/punct/g, E).getRegex(),
|
|
128
|
+
).replace(/notPunctSpace/g, he).replace(/punctSpace/g, U).replace(/punct/g, E).getRegex(), Ne = u(/\\(punct)/, "gu").replace(/punct/g, E).getRegex(), je = u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), He = u(Q).replace("(?:-->|$)", "-->").getRegex(), Qe = u(
|
|
128
129
|
"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
|
|
129
|
-
).replace("comment",
|
|
130
|
+
).replace("comment", He).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), C = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Fe = u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", C).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), fe = u(/^!?\[(label)\]\[(ref)\]/).replace("label", C).replace("ref", H).getRegex(), ke = u(/^!?\[(ref)\](?:\[\])?/).replace("ref", H).getRegex(), Ue = u("reflink|nolink(?!\\()", "g").replace("reflink", fe).replace("nolink", ke).getRegex(), X = {
|
|
130
131
|
_backpedal: z,
|
|
131
132
|
// only used for GFM url
|
|
132
|
-
anyPunctuation:
|
|
133
|
-
autolink:
|
|
134
|
-
blockSkip:
|
|
133
|
+
anyPunctuation: Ne,
|
|
134
|
+
autolink: je,
|
|
135
|
+
blockSkip: qe,
|
|
135
136
|
br: ce,
|
|
136
|
-
code:
|
|
137
|
+
code: Ce,
|
|
137
138
|
del: z,
|
|
138
|
-
emStrongLDelim:
|
|
139
|
-
emStrongRDelimAst:
|
|
140
|
-
emStrongRDelimUnd:
|
|
141
|
-
escape:
|
|
142
|
-
link:
|
|
139
|
+
emStrongLDelim: Ze,
|
|
140
|
+
emStrongRDelimAst: Me,
|
|
141
|
+
emStrongRDelimUnd: Oe,
|
|
142
|
+
escape: Le,
|
|
143
|
+
link: Fe,
|
|
143
144
|
nolink: ke,
|
|
144
|
-
punctuation:
|
|
145
|
+
punctuation: Pe,
|
|
145
146
|
reflink: fe,
|
|
146
|
-
reflinkSearch:
|
|
147
|
-
tag:
|
|
148
|
-
text:
|
|
147
|
+
reflinkSearch: Ue,
|
|
148
|
+
tag: Qe,
|
|
149
|
+
text: Ie,
|
|
149
150
|
url: z
|
|
150
|
-
},
|
|
151
|
+
}, Xe = {
|
|
151
152
|
...X,
|
|
152
153
|
link: u(/^!?\[(label)\]\((.*?)\)/).replace("label", C).getRegex(),
|
|
153
154
|
reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", C).getRegex()
|
|
154
155
|
}, D = {
|
|
155
156
|
...X,
|
|
156
|
-
emStrongRDelimAst:
|
|
157
|
-
emStrongLDelim:
|
|
157
|
+
emStrongRDelimAst: Ge,
|
|
158
|
+
emStrongLDelim: De,
|
|
158
159
|
url: u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
159
160
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
160
161
|
del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
|
|
161
162
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
162
|
-
},
|
|
163
|
+
}, We = {
|
|
163
164
|
...D,
|
|
164
165
|
br: u(ce).replace("{2,}", "*").getRegex(),
|
|
165
166
|
text: u(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
166
167
|
}, A = {
|
|
167
168
|
normal: F,
|
|
168
|
-
gfm:
|
|
169
|
-
pedantic:
|
|
169
|
+
gfm: _e,
|
|
170
|
+
pedantic: Ae
|
|
170
171
|
}, T = {
|
|
171
172
|
normal: X,
|
|
172
173
|
gfm: D,
|
|
173
|
-
breaks:
|
|
174
|
-
pedantic:
|
|
175
|
-
},
|
|
174
|
+
breaks: We,
|
|
175
|
+
pedantic: Xe
|
|
176
|
+
}, Je = {
|
|
176
177
|
"&": "&",
|
|
177
178
|
"<": "<",
|
|
178
179
|
">": ">",
|
|
179
180
|
'"': """,
|
|
180
181
|
"'": "'"
|
|
181
|
-
}, te = (n) =>
|
|
182
|
+
}, te = (n) => Je[n];
|
|
182
183
|
function m(n, e) {
|
|
183
184
|
if (e) {
|
|
184
185
|
if (x.escapeTest.test(n))
|
|
@@ -220,7 +221,7 @@ function v(n, e, t) {
|
|
|
220
221
|
r++;
|
|
221
222
|
return n.slice(0, s - r);
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function Ke(n, e) {
|
|
224
225
|
if (n.indexOf(e[1]) === -1)
|
|
225
226
|
return -1;
|
|
226
227
|
let t = 0;
|
|
@@ -246,7 +247,7 @@ function se(n, e, t, s, r) {
|
|
|
246
247
|
};
|
|
247
248
|
return s.state.inLink = !1, c;
|
|
248
249
|
}
|
|
249
|
-
function
|
|
250
|
+
function Ve(n, e, t) {
|
|
250
251
|
const s = n.match(t.other.indentCodeCompensation);
|
|
251
252
|
if (s === null)
|
|
252
253
|
return e;
|
|
@@ -294,7 +295,7 @@ var I = class {
|
|
|
294
295
|
fences(n) {
|
|
295
296
|
const e = this.rules.block.fences.exec(n);
|
|
296
297
|
if (e) {
|
|
297
|
-
const t = e[0], s =
|
|
298
|
+
const t = e[0], s = Ve(t, e[3] || "", this.rules);
|
|
298
299
|
return {
|
|
299
300
|
type: "code",
|
|
300
301
|
raw: t,
|
|
@@ -579,7 +580,7 @@ ${h}` : h;
|
|
|
579
580
|
if ((t.length - i.length) % 2 === 0)
|
|
580
581
|
return;
|
|
581
582
|
} else {
|
|
582
|
-
const i =
|
|
583
|
+
const i = Ke(e[2], "()");
|
|
583
584
|
if (i === -2)
|
|
584
585
|
return;
|
|
585
586
|
if (i > -1) {
|
|
@@ -1346,7 +1347,7 @@ ${n}</tr>
|
|
|
1346
1347
|
provideParser() {
|
|
1347
1348
|
return this.block ? y.parse : y.parseInline;
|
|
1348
1349
|
}
|
|
1349
|
-
},
|
|
1350
|
+
}, Ye = class {
|
|
1350
1351
|
defaults = O();
|
|
1351
1352
|
options = this.setOptions;
|
|
1352
1353
|
parse = this.parseMarkdown(!0);
|
|
@@ -1517,7 +1518,7 @@ Please report this to https://github.com/markedjs/marked.`, n) {
|
|
|
1517
1518
|
throw t;
|
|
1518
1519
|
};
|
|
1519
1520
|
}
|
|
1520
|
-
}, R = new
|
|
1521
|
+
}, R = new Ye();
|
|
1521
1522
|
function g(n, e) {
|
|
1522
1523
|
return R.parse(n, e);
|
|
1523
1524
|
}
|
|
@@ -1549,6 +1550,8 @@ g.walkTokens;
|
|
|
1549
1550
|
g.parseInline;
|
|
1550
1551
|
y.parse;
|
|
1551
1552
|
w.lex;
|
|
1553
|
+
const tt = (n) => xe.sanitize(g.parse(n, { async: !1 }));
|
|
1552
1554
|
export {
|
|
1553
|
-
g as
|
|
1555
|
+
g as a,
|
|
1556
|
+
tt as m
|
|
1554
1557
|
};
|
|
@@ -150,7 +150,7 @@ const Q = {
|
|
|
150
150
|
function ht() {
|
|
151
151
|
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fn();
|
|
152
152
|
const o = (i) => ht(i);
|
|
153
|
-
if (o.version = "3.3.
|
|
153
|
+
if (o.version = "3.3.3", o.removed = [], !s || !s.document || s.document.nodeType !== Q.document || !s.Element)
|
|
154
154
|
return o.isSupported = !1, o;
|
|
155
155
|
let {
|
|
156
156
|
document: l
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-math-delimiters.d.ts","sourceRoot":"","sources":["../../lib/utils/convert-legacy-math-delimiters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-legacy-math-delimiters.d.ts","sourceRoot":"","sources":["../../lib/utils/convert-legacy-math-delimiters.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,2BAA2B,GAAI,OAAO,MAAM,WAOxD,CAAC"}
|
|
@@ -8,5 +8,5 @@ export type CreateEditorOptions = {
|
|
|
8
8
|
markdownContent: string;
|
|
9
9
|
}) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare function createScribeEditor({ content, editable, onContentChange }: CreateEditorOptions): Editor;
|
|
11
|
+
export declare function createScribeEditor({ content, editable, onContentChange, }: CreateEditorOptions): Editor;
|
|
12
12
|
//# sourceMappingURL=create-scribe-editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-scribe-editor.d.ts","sourceRoot":"","sources":["../../lib/utils/create-scribe-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"create-scribe-editor.d.ts","sourceRoot":"","sources":["../../lib/utils/create-scribe-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE;QAC1B,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,GAAG,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;KACzB,KAAK,IAAI,CAAC;CACZ,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,OAAY,EACZ,QAAgB,EAChB,eAAe,GAChB,EAAE,mBAAmB,GAAG,MAAM,CAoB9B"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { E as i } from "../index-
|
|
1
|
+
import { E as i } from "../index-BKFDqQPh.js";
|
|
2
2
|
import { initExtensions as n } from "../components/Scribe/extension/index.js";
|
|
3
3
|
import { html2md as m } from "./html-to-markdown.js";
|
|
4
|
-
import "../
|
|
5
|
-
import "../purify.es-
|
|
6
|
-
function d({
|
|
4
|
+
import "../markdown-to-html-__93dwok.js";
|
|
5
|
+
import "../purify.es-BPDBzHtc.js";
|
|
6
|
+
function d({
|
|
7
|
+
content: r = "",
|
|
8
|
+
editable: e = !1,
|
|
9
|
+
onContentChange: o
|
|
10
|
+
}) {
|
|
7
11
|
return new i({
|
|
8
12
|
content: r,
|
|
9
13
|
editable: e,
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./html-to-markdown";
|
|
2
2
|
export * from "./markdown-to-html";
|
|
3
3
|
export * from "./is-in-viewport";
|
|
4
|
-
export * from
|
|
4
|
+
export * from "./convert-legacy-math-delimiters";
|
|
5
5
|
export * from "./create-scribe-editor";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { html2md as o } from "./html-to-markdown.js";
|
|
2
|
-
import {
|
|
2
|
+
import { m } from "../markdown-to-html-__93dwok.js";
|
|
3
3
|
import { isInViewport as p } from "./is-in-viewport.js";
|
|
4
4
|
import { convertLegacyMathDelimiters as x } from "./convert-legacy-math-delimiters.js";
|
|
5
|
-
import { createScribeEditor as
|
|
5
|
+
import { createScribeEditor as c } from "./create-scribe-editor.js";
|
|
6
6
|
export {
|
|
7
7
|
x as convertLegacyMathDelimiters,
|
|
8
|
-
|
|
8
|
+
c as createScribeEditor,
|
|
9
9
|
o as html2md,
|
|
10
10
|
p as isInViewport,
|
|
11
11
|
m as md2html
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { m as
|
|
2
|
-
import
|
|
3
|
-
const p = (m) => a.sanitize(r.parse(m, { async: !1 }));
|
|
1
|
+
import { m as t } from "../markdown-to-html-__93dwok.js";
|
|
2
|
+
import "../purify.es-BPDBzHtc.js";
|
|
4
3
|
export {
|
|
5
|
-
|
|
4
|
+
t as md2html
|
|
6
5
|
};
|
package/package.json
CHANGED
|
@@ -1,66 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clevertask/scribe",
|
|
3
|
-
"
|
|
4
|
-
"author": "CleverTask",
|
|
3
|
+
"version": "0.0.15",
|
|
5
4
|
"private": false,
|
|
6
|
-
"
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "dist/main.js",
|
|
9
|
-
"types": "dist/main.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
5
|
+
"description": "A Tiptap-based rich text editor with a Notion-style block interface for viewing and creating content. Perfect for diverse needs like notes, documents, AI chat, Markdown parsing, and comments.",
|
|
13
6
|
"keywords": [
|
|
14
|
-
"
|
|
15
|
-
"javascript",
|
|
7
|
+
"block-based",
|
|
16
8
|
"editor",
|
|
17
|
-
"
|
|
9
|
+
"javascript",
|
|
10
|
+
"notion",
|
|
18
11
|
"prosemirror",
|
|
19
|
-
"
|
|
12
|
+
"react",
|
|
20
13
|
"rich-text-editor",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
14
|
+
"tiptap",
|
|
15
|
+
"typescript",
|
|
16
|
+
"wysiwyg"
|
|
24
17
|
],
|
|
25
|
-
"license": "MIT",
|
|
26
18
|
"homepage": "https://github.com/clevertask/scribe#readme",
|
|
27
19
|
"bugs": {
|
|
28
20
|
"url": "https://github.com/clevertask/scribe/issues"
|
|
29
21
|
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "CleverTask",
|
|
30
24
|
"repository": {
|
|
31
25
|
"type": "git",
|
|
32
26
|
"url": "git+https://github.com/clevertask/scribe.git"
|
|
33
27
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"@tailwindcss/typography": "^0.5.19",
|
|
41
|
-
"@types/lodash": "^4.17.24",
|
|
42
|
-
"@types/node": "^24.12.0",
|
|
43
|
-
"@types/react": "^19.2.14",
|
|
44
|
-
"@types/react-dom": "^19.2.3",
|
|
45
|
-
"@types/turndown": "^5.0.6",
|
|
46
|
-
"@vitejs/plugin-react": "^5.1.4",
|
|
47
|
-
"autoprefixer": "^10.4.27",
|
|
48
|
-
"eslint": "^9.39.4",
|
|
49
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
50
|
-
"eslint-plugin-react-refresh": "^0.5.2",
|
|
51
|
-
"glob": "^13.0.6",
|
|
52
|
-
"globals": "^17.4.0",
|
|
53
|
-
"lodash": "^4.17.23",
|
|
54
|
-
"postcss": "^8.5.8",
|
|
55
|
-
"postcss-cli": "^11.0.1",
|
|
56
|
-
"prettier": "3.4.2",
|
|
57
|
-
"tailwindcss": "^3.4.19",
|
|
58
|
-
"typescript": "~5.9.3",
|
|
59
|
-
"typescript-eslint": "^8.57.0",
|
|
60
|
-
"vite": "^7.3.1",
|
|
61
|
-
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
62
|
-
},
|
|
63
|
-
"prepublishOnly": "npm run build",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"main": "dist/main.js",
|
|
33
|
+
"types": "dist/main.d.ts",
|
|
64
34
|
"publishConfig": {
|
|
65
35
|
"access": "public",
|
|
66
36
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -72,7 +42,7 @@
|
|
|
72
42
|
"@tiptap/extension-highlight": "^2.27.2",
|
|
73
43
|
"@tiptap/extension-image": "^2.27.2",
|
|
74
44
|
"@tiptap/extension-link": "^2.27.2",
|
|
75
|
-
"@tiptap/extension-mathematics": "^3.
|
|
45
|
+
"@tiptap/extension-mathematics": "^3.21.0",
|
|
76
46
|
"@tiptap/extension-placeholder": "^2.27.2",
|
|
77
47
|
"@tiptap/extension-table": "^2.27.2",
|
|
78
48
|
"@tiptap/extension-table-cell": "^2.27.2",
|
|
@@ -86,19 +56,49 @@
|
|
|
86
56
|
"@tiptap/starter-kit": "^2.27.2",
|
|
87
57
|
"@tiptap/suggestion": "^2.27.2",
|
|
88
58
|
"clsx": "^2.1.1",
|
|
89
|
-
"dompurify": "^3.3.
|
|
90
|
-
"katex": "^0.16.
|
|
59
|
+
"dompurify": "^3.3.3",
|
|
60
|
+
"katex": "^0.16.44",
|
|
91
61
|
"marked": "^15.0.12",
|
|
92
62
|
"tippy.js": "^6.3.7",
|
|
93
63
|
"turndown": "^7.2.2"
|
|
94
64
|
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@eslint/js": "^9.39.4",
|
|
67
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
68
|
+
"@types/lodash": "^4.17.24",
|
|
69
|
+
"@types/node": "^24.12.0",
|
|
70
|
+
"@types/react": "^19.2.14",
|
|
71
|
+
"@types/react-dom": "^19.2.3",
|
|
72
|
+
"@types/turndown": "^5.0.6",
|
|
73
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
74
|
+
"autoprefixer": "^10.4.27",
|
|
75
|
+
"eslint": "^9.39.4",
|
|
76
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
77
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
78
|
+
"glob": "^13.0.6",
|
|
79
|
+
"globals": "^17.4.0",
|
|
80
|
+
"lodash": "^4.17.23",
|
|
81
|
+
"oxfmt": "^0.37.0",
|
|
82
|
+
"postcss": "^8.5.8",
|
|
83
|
+
"postcss-cli": "^11.0.1",
|
|
84
|
+
"tailwindcss": "^3.4.19",
|
|
85
|
+
"typescript": "~5.9.3",
|
|
86
|
+
"typescript-eslint": "^8.57.2",
|
|
87
|
+
"vite": "^7.3.1",
|
|
88
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": ">=18.3.1 <20.0.0",
|
|
92
|
+
"react-dom": ">=18.3.1 <20.0.0"
|
|
93
|
+
},
|
|
94
|
+
"prepublishOnly": "npm run build",
|
|
95
95
|
"scripts": {
|
|
96
96
|
"dev": "vite",
|
|
97
97
|
"build": "vite build && npm run build:style && tsc -p tsconfig.types.json --noCheck",
|
|
98
98
|
"build:style": "postcss ./lib/styles/main.css -o ./dist/main.css",
|
|
99
99
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
100
100
|
"preview": "vite preview",
|
|
101
|
-
"
|
|
102
|
-
"
|
|
101
|
+
"fmt": "oxfmt",
|
|
102
|
+
"fmt:check": "oxfmt --check"
|
|
103
103
|
}
|
|
104
104
|
}
|