quoin-editor 1.4.1 → 1.6.0
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/CHANGELOG.md +18 -0
- package/README.md +8 -6
- package/THIRD_PARTY_NOTICES.md +25 -1
- package/dist/ai.cjs +21 -23
- package/dist/ai.js +1 -1
- package/dist/catalogue.cjs +17 -18
- package/dist/catalogue.js +10 -9
- package/dist/catalogue.js.map +1 -1
- package/dist/{chunk-VVS6JJLI.js → chunk-2AVGGPLT.js} +4 -25
- package/dist/chunk-2AVGGPLT.js.map +1 -0
- package/dist/chunk-2SWLD6R5.cjs +25 -0
- package/dist/{chunk-MQTLZTIM.js → chunk-32OZ2WM2.js} +12 -12
- package/dist/{chunk-MQTLZTIM.js.map → chunk-32OZ2WM2.js.map} +1 -1
- package/dist/{chunk-H5FM6I5W.cjs → chunk-46JH34SR.cjs} +7 -9
- package/dist/chunk-4T4TJ2QS.cjs +0 -2
- package/dist/chunk-A6PGQVTR.cjs +0 -2
- package/dist/chunk-AZF7B2AE.cjs +0 -2
- package/dist/{chunk-AC4AFDTI.js → chunk-B5OMWOVI.js} +3 -3
- package/dist/{chunk-AC4AFDTI.js.map → chunk-B5OMWOVI.js.map} +1 -1
- package/dist/chunk-BM2GRZNM.cjs +0 -2
- package/dist/chunk-H3C3MJW5.cjs +0 -2
- package/dist/{chunk-6LOYAC5N.js → chunk-HT7OF52E.js} +3 -3
- package/dist/{chunk-6LOYAC5N.js.map → chunk-HT7OF52E.js.map} +1 -1
- package/dist/{chunk-3NVFHJFS.cjs → chunk-JVSYEENH.cjs} +17 -19
- package/dist/{chunk-3YA7FYEL.js → chunk-KF3KKN4N.js} +3 -3
- package/dist/{chunk-3YA7FYEL.js.map → chunk-KF3KKN4N.js.map} +1 -1
- package/dist/{chunk-KRLHGVJV.js → chunk-KFYJW7W5.js} +4 -4
- package/dist/{chunk-KRLHGVJV.js.map → chunk-KFYJW7W5.js.map} +1 -1
- package/dist/chunk-KTUOPDVO.js +25 -0
- package/dist/chunk-KTUOPDVO.js.map +1 -0
- package/dist/{chunk-QPOUONJ7.cjs → chunk-L6RB43YM.cjs} +21 -44
- package/dist/chunk-LE5XMIFJ.cjs +0 -2
- package/dist/{chunk-VUYJGFUA.cjs → chunk-LOP66FVU.cjs} +8 -10
- package/dist/{chunk-STCJWXP5.js → chunk-N2SCDXTI.js} +3 -3
- package/dist/{chunk-STCJWXP5.js.map → chunk-N2SCDXTI.js.map} +1 -1
- package/dist/{chunk-YEQEBJPM.js → chunk-O7XZFXPE.js} +3 -3
- package/dist/{chunk-YEQEBJPM.js.map → chunk-O7XZFXPE.js.map} +1 -1
- package/dist/chunk-QJ34MOFV.cjs +0 -2
- package/dist/chunk-QR2NIDUK.cjs +0 -2
- package/dist/chunk-STKGRXSA.cjs +0 -2
- package/dist/{chunk-7WSBPD6Z.cjs → chunk-T7O3BROK.cjs} +38 -40
- package/dist/{chunk-AZ2ZNSFN.cjs → chunk-TKCPXUPP.cjs} +15 -17
- package/dist/{chunk-65WK575V.cjs → chunk-UUSZGUXJ.cjs} +10 -11
- package/dist/chunk-VZZPCYA3.cjs +0 -2
- package/dist/chunk-WN7BZDNH.cjs +0 -2
- package/dist/chunk-WZA5S5EJ.cjs +0 -2
- package/dist/{chunk-FQDNF7MF.cjs → chunk-XFR7QGSN.cjs} +39 -41
- package/dist/chunk-XZ4NC3Q7.cjs +0 -2
- package/dist/code-highlighter-BQDxhRrv.d.cts +14 -0
- package/dist/code-highlighter-BQDxhRrv.d.ts +14 -0
- package/dist/comments.cjs +18 -20
- package/dist/comments.js +1 -1
- package/dist/diff.cjs +0 -2
- package/dist/diff.d.cts +2 -2
- package/dist/diff.d.ts +2 -2
- package/dist/docx.cjs +0 -2
- package/dist/embed.cjs +4 -6
- package/dist/embed.js +2 -2
- package/dist/emoji-data.cjs +0 -2
- package/dist/emoji.cjs +6 -7
- package/dist/emoji.js +3 -2
- package/dist/engine.cjs +0 -2
- package/dist/engine.d.cts +3 -15
- package/dist/engine.d.ts +3 -15
- package/dist/find.cjs +6 -8
- package/dist/find.js +2 -2
- package/dist/headless.cjs +0 -2
- package/dist/headless.d.cts +2 -1
- package/dist/headless.d.ts +2 -1
- package/dist/highlight.cjs +98 -0
- package/dist/highlight.d.cts +10 -0
- package/dist/highlight.d.ts +10 -0
- package/dist/highlight.js +98 -0
- package/dist/highlight.js.map +1 -0
- package/dist/index.cjs +12 -14
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -1
- package/dist/math.cjs +5 -7
- package/dist/math.js +3 -3
- package/dist/mention.cjs +4 -6
- package/dist/mention.js +2 -2
- package/dist/presence.cjs +1 -3
- package/dist/presence.js +1 -1
- package/dist/prism-grammars.cjs +56 -0
- package/dist/prism-grammars.js +52 -0
- package/dist/prism-grammars.js.map +1 -0
- package/dist/{registry-DdQaddP1.d.ts → registry-DZ8LIGt5.d.cts} +2 -15
- package/dist/{registry-DdQaddP1.d.cts → registry-DZ8LIGt5.d.ts} +2 -15
- package/dist/source.cjs +97 -0
- package/dist/source.d.cts +56 -0
- package/dist/source.d.ts +56 -0
- package/dist/source.js +94 -0
- package/dist/source.js.map +1 -0
- package/dist/stats.cjs +1 -3
- package/dist/stats.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/table.cjs +21 -23
- package/dist/table.js +2 -2
- package/dist/to-markdown-BVOzhgVM.d.ts +17 -0
- package/dist/to-markdown-CFPMbbiX.d.cts +17 -0
- package/dist/toc.cjs +5 -7
- package/dist/toc.js +2 -2
- package/dist/view.cjs +0 -2
- package/dist/view.d.cts +2 -2
- package/dist/view.d.ts +2 -2
- package/dist/yjs.cjs +0 -2
- package/package.json +24 -3
- package/dist/ai.cjs.map +0 -1
- package/dist/catalogue.cjs.map +0 -1
- package/dist/chunk-3NVFHJFS.cjs.map +0 -1
- package/dist/chunk-4T4TJ2QS.cjs.map +0 -1
- package/dist/chunk-65WK575V.cjs.map +0 -1
- package/dist/chunk-7WSBPD6Z.cjs.map +0 -1
- package/dist/chunk-A6PGQVTR.cjs.map +0 -1
- package/dist/chunk-AZ2ZNSFN.cjs.map +0 -1
- package/dist/chunk-AZF7B2AE.cjs.map +0 -1
- package/dist/chunk-BM2GRZNM.cjs.map +0 -1
- package/dist/chunk-FQDNF7MF.cjs.map +0 -1
- package/dist/chunk-H3C3MJW5.cjs.map +0 -1
- package/dist/chunk-H5FM6I5W.cjs.map +0 -1
- package/dist/chunk-LE5XMIFJ.cjs.map +0 -1
- package/dist/chunk-QJ34MOFV.cjs.map +0 -1
- package/dist/chunk-QPOUONJ7.cjs.map +0 -1
- package/dist/chunk-QR2NIDUK.cjs.map +0 -1
- package/dist/chunk-STKGRXSA.cjs.map +0 -1
- package/dist/chunk-VUYJGFUA.cjs.map +0 -1
- package/dist/chunk-VVS6JJLI.js.map +0 -1
- package/dist/chunk-VZZPCYA3.cjs.map +0 -1
- package/dist/chunk-WN7BZDNH.cjs.map +0 -1
- package/dist/chunk-WZA5S5EJ.cjs.map +0 -1
- package/dist/chunk-XZ4NC3Q7.cjs.map +0 -1
- package/dist/comments.cjs.map +0 -1
- package/dist/diff.cjs.map +0 -1
- package/dist/docx.cjs.map +0 -1
- package/dist/embed.cjs.map +0 -1
- package/dist/emoji-data.cjs.map +0 -1
- package/dist/emoji.cjs.map +0 -1
- package/dist/engine.cjs.map +0 -1
- package/dist/find.cjs.map +0 -1
- package/dist/headless.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/math.cjs.map +0 -1
- package/dist/mention.cjs.map +0 -1
- package/dist/presence.cjs.map +0 -1
- package/dist/stats.cjs.map +0 -1
- package/dist/table.cjs.map +0 -1
- package/dist/toc.cjs.map +0 -1
- package/dist/view.cjs.map +0 -1
- package/dist/yjs.cjs.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A run of code drawn in one colour or class. Its text is drawn as text, never parsed as markup. */
|
|
2
|
+
type CodeToken = {
|
|
3
|
+
text: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Highlights the code of a code block: one array of tokens per line of `code`, split on `\n`, whose texts put together
|
|
9
|
+
* spell the line exactly, since the tokens are drawn under the text the writer types into. Wrap any highlighter, such as
|
|
10
|
+
* Shiki, Prism or highlight.js, in one. `language` is the block's language as stored, which may be an alias such as `ts`.
|
|
11
|
+
*/
|
|
12
|
+
type CodeHighlighter = (code: string, language: string) => CodeToken[][];
|
|
13
|
+
|
|
14
|
+
export type { CodeHighlighter as C, CodeToken as a };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A run of code drawn in one colour or class. Its text is drawn as text, never parsed as markup. */
|
|
2
|
+
type CodeToken = {
|
|
3
|
+
text: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Highlights the code of a code block: one array of tokens per line of `code`, split on `\n`, whose texts put together
|
|
9
|
+
* spell the line exactly, since the tokens are drawn under the text the writer types into. Wrap any highlighter, such as
|
|
10
|
+
* Shiki, Prism or highlight.js, in one. `language` is the block's language as stored, which may be an alias such as `ts`.
|
|
11
|
+
*/
|
|
12
|
+
type CodeHighlighter = (code: string, language: string) => CodeToken[][];
|
|
13
|
+
|
|
14
|
+
export type { CodeHighlighter as C, CodeToken as a };
|
package/dist/comments.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkH3C3MJW5_cjs = require('./chunk-H3C3MJW5.cjs');
|
|
5
5
|
var chunkQR2NIDUK_cjs = require('./chunk-QR2NIDUK.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkUUSZGUXJ_cjs = require('./chunk-UUSZGUXJ.cjs');
|
|
7
7
|
var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
|
|
8
8
|
require('./chunk-A6PGQVTR.cjs');
|
|
9
9
|
var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
|
|
@@ -185,7 +185,7 @@ function create(editor, pending, onCreate, link) {
|
|
|
185
185
|
if (link.mounts === 0) return;
|
|
186
186
|
const tr = settledTransaction(editor, pending.key, id);
|
|
187
187
|
editor.dispatch(tr);
|
|
188
|
-
if (id === null) link.report(
|
|
188
|
+
if (id === null) link.report(chunkUUSZGUXJ_cjs.toError(error));
|
|
189
189
|
else if (!tr.docChanged) link.report(new Error(`Comment thread ${id} has no text: it was deleted meanwhile`));
|
|
190
190
|
};
|
|
191
191
|
new Promise((resolve) => resolve(onCreate(input))).then(
|
|
@@ -336,10 +336,10 @@ function CommentMarkers({ env, box, entries, onOpen }) {
|
|
|
336
336
|
"data-rail-item": "",
|
|
337
337
|
"data-block": block,
|
|
338
338
|
"aria-label": env.labels.showComments(ids.length),
|
|
339
|
-
className:
|
|
339
|
+
className: chunkUUSZGUXJ_cjs.cn("quoin-comments-marker", chunkUUSZGUXJ_cjs.FOCUS_RING),
|
|
340
340
|
onClick: (event) => onOpen(ids[0], event.currentTarget),
|
|
341
341
|
children: [
|
|
342
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.MessageSquare, { "aria-hidden": "true" }),
|
|
343
343
|
ids.length
|
|
344
344
|
]
|
|
345
345
|
},
|
|
@@ -353,7 +353,7 @@ async function called(link, call) {
|
|
|
353
353
|
await call();
|
|
354
354
|
return true;
|
|
355
355
|
} catch (error) {
|
|
356
|
-
link.report(
|
|
356
|
+
link.report(chunkUUSZGUXJ_cjs.toError(error));
|
|
357
357
|
return false;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -446,14 +446,14 @@ function ReplyBox({ env, threadId, first }) {
|
|
|
446
446
|
}
|
|
447
447
|
),
|
|
448
448
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
449
|
-
|
|
449
|
+
chunkUUSZGUXJ_cjs.Button,
|
|
450
450
|
{
|
|
451
451
|
type: "submit",
|
|
452
452
|
variant: "ghost",
|
|
453
453
|
size: "icon-sm",
|
|
454
454
|
"aria-label": labels.send,
|
|
455
455
|
"aria-disabled": text === "" || sending || void 0,
|
|
456
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
456
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.SendHorizontal, {})
|
|
457
457
|
}
|
|
458
458
|
)
|
|
459
459
|
] });
|
|
@@ -485,7 +485,7 @@ function ThreadView({ env, id, thread, onEnded }) {
|
|
|
485
485
|
/* @__PURE__ */ jsxRuntime.jsx(ReplyBox, { env, threadId: id, first: comments.length === 0 }),
|
|
486
486
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-1", children: [
|
|
487
487
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
488
|
-
|
|
488
|
+
chunkUUSZGUXJ_cjs.Button,
|
|
489
489
|
{
|
|
490
490
|
type: "button",
|
|
491
491
|
variant: "ghost",
|
|
@@ -496,7 +496,7 @@ function ThreadView({ env, id, thread, onEnded }) {
|
|
|
496
496
|
}
|
|
497
497
|
),
|
|
498
498
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
499
|
-
|
|
499
|
+
chunkUUSZGUXJ_cjs.Button,
|
|
500
500
|
{
|
|
501
501
|
type: "button",
|
|
502
502
|
variant: "ghost",
|
|
@@ -533,7 +533,7 @@ function ThreadCard({ env, entry, active, expanded, onToggle }) {
|
|
|
533
533
|
ref: header,
|
|
534
534
|
type: "button",
|
|
535
535
|
"aria-expanded": expanded,
|
|
536
|
-
className:
|
|
536
|
+
className: chunkUUSZGUXJ_cjs.cn("flex w-full flex-col items-start gap-1 rounded-sm text-start", chunkUUSZGUXJ_cjs.FOCUS_RING),
|
|
537
537
|
onClick: () => onToggle(expanded ? null : thread.id),
|
|
538
538
|
children: [
|
|
539
539
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: removed ? "text-xs text-muted-foreground italic" : "quoin-comments-quote", children: removed ? labels.textRemoved : anchorText2 }),
|
|
@@ -599,7 +599,7 @@ function CommentsSheet({ env, entries, value, onToggle, onClose, returnFocus })
|
|
|
599
599
|
children: [
|
|
600
600
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
601
601
|
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "text-sm font-semibold", children: labels.comments }),
|
|
602
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
602
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.close, children: /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.X, {}) }) })
|
|
603
603
|
] }),
|
|
604
604
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { "aria-label": labels.comments, className: "flex flex-col gap-2", children: entries.map((entry) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
605
605
|
ThreadCard,
|
|
@@ -660,8 +660,8 @@ function ThreadPopover({ env, open, threads, onChoose, onClose }) {
|
|
|
660
660
|
});
|
|
661
661
|
const anchor = react.useMemo(
|
|
662
662
|
() => ({
|
|
663
|
-
current:
|
|
664
|
-
() => latest.current ?
|
|
663
|
+
current: chunkUUSZGUXJ_cjs.virtualAnchor(
|
|
664
|
+
() => latest.current ? chunkUUSZGUXJ_cjs.rangeRect(controller, latest.current) : null,
|
|
665
665
|
() => latest.current && controller.registry.get(latest.current.block, latest.current.region)
|
|
666
666
|
)
|
|
667
667
|
}),
|
|
@@ -695,7 +695,7 @@ function ThreadPopover({ env, open, threads, onChoose, onClose }) {
|
|
|
695
695
|
};
|
|
696
696
|
const choices = ids.map((id) => ({ id, anchorText: textOf(id), preview: threads.find(id)?.comments[0]?.body ?? "" }));
|
|
697
697
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
698
|
-
|
|
698
|
+
chunkUUSZGUXJ_cjs.Popover,
|
|
699
699
|
{
|
|
700
700
|
open: true,
|
|
701
701
|
modal: false,
|
|
@@ -703,9 +703,9 @@ function ThreadPopover({ env, open, threads, onChoose, onClose }) {
|
|
|
703
703
|
if (!next) onClose();
|
|
704
704
|
},
|
|
705
705
|
children: [
|
|
706
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
706
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.PopoverAnchor, { virtualRef: anchor }),
|
|
707
707
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
708
|
-
|
|
708
|
+
chunkUUSZGUXJ_cjs.PopoverContent,
|
|
709
709
|
{
|
|
710
710
|
ref: content,
|
|
711
711
|
"aria-label": gone ? labels.textRemoved : single ? labels.thread(textOf(ids[0])) : labels.threadsHere,
|
|
@@ -770,7 +770,7 @@ function useThreads(threads) {
|
|
|
770
770
|
var commentsOf = (state) => chunkVZZPCYA3_cjs.getPluginState(state, commentsKey);
|
|
771
771
|
var docOf2 = (state) => state.doc;
|
|
772
772
|
function CommentsOverlay({ controller, host, labels }) {
|
|
773
|
-
const { onError } =
|
|
773
|
+
const { onError } = chunkUUSZGUXJ_cjs.useQuoin();
|
|
774
774
|
const link = linkOf(controller.editor);
|
|
775
775
|
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
776
776
|
link.report = onError;
|
|
@@ -858,7 +858,7 @@ function watchEnded(editor, threads) {
|
|
|
858
858
|
var commentItem = (labels) => ({
|
|
859
859
|
id: "comment",
|
|
860
860
|
title: labels.comment,
|
|
861
|
-
icon:
|
|
861
|
+
icon: chunkUUSZGUXJ_cjs.MessageSquarePlus,
|
|
862
862
|
shortcut: "Mod-Alt-m",
|
|
863
863
|
available: (state) => hasCommentableText(state) && chunkVZZPCYA3_cjs.getPluginState(state, commentsKey).pending.length === 0,
|
|
864
864
|
// Focus goes back to the text first: the button leaves the toolbar while the thread is being asked for.
|
|
@@ -924,5 +924,3 @@ function createCommentThreads(initial = NO_THREADS) {
|
|
|
924
924
|
exports.commentsExtension = commentsExtension;
|
|
925
925
|
exports.createCommentThreads = createCommentThreads;
|
|
926
926
|
exports.englishCommentsLabels = englishCommentsLabels;
|
|
927
|
-
//# sourceMappingURL=comments.cjs.map
|
|
928
|
-
//# sourceMappingURL=comments.cjs.map
|
package/dist/comments.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { webAddress } from './chunk-GHNQKJMD.js';
|
|
3
3
|
import { ownsNode } from './chunk-R7MYG522.js';
|
|
4
|
-
import { MessageSquarePlus, useQuoin, MessageSquare, cn, FOCUS_RING, Button, X, virtualAnchor, rangeRect, Popover, PopoverAnchor, PopoverContent, toError, SendHorizontal } from './chunk-
|
|
4
|
+
import { MessageSquarePlus, useQuoin, MessageSquare, cn, FOCUS_RING, Button, X, virtualAnchor, rangeRect, Popover, PopoverAnchor, PopoverContent, toError, SendHorizontal } from './chunk-32OZ2WM2.js';
|
|
5
5
|
import { useIsomorphicLayoutEffect, useEditorState, useReadOnly } from './chunk-XFEDJEJF.js';
|
|
6
6
|
import './chunk-HDJ653LM.js';
|
|
7
7
|
import { createPluginKey, defineExtension, getPluginState, isCollapsed, markRanges, Transaction, comparePos, textSelection, addMarkStep, sameSelection, removeMarkStep } from './chunk-OS2O6IKX.js';
|
package/dist/diff.cjs
CHANGED
package/dist/diff.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { A as AnyBlockDefinition } from './registry-DdQaddP1.cjs';
|
|
3
2
|
import { CodeHighlighter } from './index.cjs';
|
|
4
|
-
export { B as BlockDefinition, d as defineBlock } from './registry-DdQaddP1.cjs';
|
|
5
3
|
import { QuoinBlock } from './engine.cjs';
|
|
6
4
|
import { HTMLOptions } from './engine.cjs';
|
|
5
|
+
import { A as AnyBlockDefinition } from './registry-DZ8LIGt5.cjs';
|
|
6
|
+
export { B as BlockDefinition, d as defineBlock } from './registry-DZ8LIGt5.cjs';
|
|
7
7
|
import './embed-provider-jXwlRmnp.cjs';
|
|
8
8
|
|
|
9
9
|
/** Every string the diff view shows or speaks. */
|
package/dist/diff.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { A as AnyBlockDefinition } from './registry-DdQaddP1.js';
|
|
3
2
|
import { CodeHighlighter } from './index.js';
|
|
4
|
-
export { B as BlockDefinition, d as defineBlock } from './registry-DdQaddP1.js';
|
|
5
3
|
import { QuoinBlock } from './engine.js';
|
|
6
4
|
import { HTMLOptions } from './engine.js';
|
|
5
|
+
import { A as AnyBlockDefinition } from './registry-DZ8LIGt5.js';
|
|
6
|
+
export { B as BlockDefinition, d as defineBlock } from './registry-DZ8LIGt5.js';
|
|
7
7
|
import './embed-provider-jXwlRmnp.js';
|
|
8
8
|
|
|
9
9
|
/** Every string the diff view shows or speaks. */
|
package/dist/docx.cjs
CHANGED
package/dist/embed.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkXFR7QGSN_cjs = require('./chunk-XFR7QGSN.cjs');
|
|
5
5
|
require('./chunk-H3C3MJW5.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-UUSZGUXJ.cjs');
|
|
7
7
|
require('./chunk-QJ34MOFV.cjs');
|
|
8
8
|
require('./chunk-A6PGQVTR.cjs');
|
|
9
9
|
require('./chunk-VZZPCYA3.cjs');
|
|
@@ -14,11 +14,9 @@ require('./chunk-WZA5S5EJ.cjs');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "embedExtension", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkXFR7QGSN_cjs.embedExtension; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "englishEmbedLabels", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkXFR7QGSN_cjs.englishEmbedLabels; }
|
|
22
22
|
});
|
|
23
|
-
//# sourceMappingURL=embed.cjs.map
|
|
24
|
-
//# sourceMappingURL=embed.cjs.map
|
package/dist/embed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { embedExtension, englishEmbedLabels } from './chunk-
|
|
2
|
+
export { embedExtension, englishEmbedLabels } from './chunk-O7XZFXPE.js';
|
|
3
3
|
import './chunk-GHNQKJMD.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-32OZ2WM2.js';
|
|
5
5
|
import './chunk-XFEDJEJF.js';
|
|
6
6
|
import './chunk-HDJ653LM.js';
|
|
7
7
|
import './chunk-OS2O6IKX.js';
|
package/dist/emoji-data.cjs
CHANGED
|
@@ -1975,5 +1975,3 @@ var skinTones = ["\u{1F3FB}", "\u{1F3FC}", "\u{1F3FD}", "\u{1F3FE}", "\u{1F3FF}"
|
|
|
1975
1975
|
exports.emojiByShortcode = emojiByShortcode;
|
|
1976
1976
|
exports.searchEmoji = searchEmoji;
|
|
1977
1977
|
exports.skinTones = skinTones;
|
|
1978
|
-
//# sourceMappingURL=emoji-data.cjs.map
|
|
1979
|
-
//# sourceMappingURL=emoji-data.cjs.map
|
package/dist/emoji.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunkL6RB43YM_cjs = require('./chunk-L6RB43YM.cjs');
|
|
5
|
+
require('./chunk-2SWLD6R5.cjs');
|
|
6
|
+
require('./chunk-UUSZGUXJ.cjs');
|
|
6
7
|
require('./chunk-QJ34MOFV.cjs');
|
|
7
8
|
require('./chunk-A6PGQVTR.cjs');
|
|
8
9
|
require('./chunk-VZZPCYA3.cjs');
|
|
@@ -13,15 +14,13 @@ require('./chunk-WZA5S5EJ.cjs');
|
|
|
13
14
|
|
|
14
15
|
Object.defineProperty(exports, "emojiExtension", {
|
|
15
16
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkL6RB43YM_cjs.emojiExtension; }
|
|
17
18
|
});
|
|
18
19
|
Object.defineProperty(exports, "englishEmojiLabels", {
|
|
19
20
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkL6RB43YM_cjs.englishEmojiLabels; }
|
|
21
22
|
});
|
|
22
23
|
Object.defineProperty(exports, "loadEmojiData", {
|
|
23
24
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkL6RB43YM_cjs.loadEmojiData; }
|
|
25
26
|
});
|
|
26
|
-
//# sourceMappingURL=emoji.cjs.map
|
|
27
|
-
//# sourceMappingURL=emoji.cjs.map
|
package/dist/emoji.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { emojiExtension, englishEmojiLabels, loadEmojiData } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { emojiExtension, englishEmojiLabels, loadEmojiData } from './chunk-2AVGGPLT.js';
|
|
3
|
+
import './chunk-KTUOPDVO.js';
|
|
4
|
+
import './chunk-32OZ2WM2.js';
|
|
4
5
|
import './chunk-XFEDJEJF.js';
|
|
5
6
|
import './chunk-HDJ653LM.js';
|
|
6
7
|
import './chunk-OS2O6IKX.js';
|
package/dist/engine.cjs
CHANGED
package/dist/engine.d.cts
CHANGED
|
@@ -2,6 +2,7 @@ import { A as Attrs, M as Mark, c as AtomNode, m as InlineNode, I as Inline, T a
|
|
|
2
2
|
export { d as Assoc, B as BlockAttrs, f as BlockContent, g as BlockFlow, l as InlineCodec, o as MarkdownExportContext, q as PosMap, b as Selection, t as StepResult } from './types-CQ8Vw_7N.cjs';
|
|
3
3
|
import { b as Command, I as InputRule, o as TextStats, E as Extension } from './types-DXF9p4qV.cjs';
|
|
4
4
|
export { A as Align, B as BlockStructureOptions, e as BoundCommands, f as Chain, C as CommandFactories, g as CoreCommands, h as CoreExtensionOptions, i as DOMParserLike, D as Decoration, a as Editor, j as EditorOptions, c as EditorState, F as FromHTMLOptions, k as InputRuleContext, l as InputRuleRange, m as InsertTextOptions, K as KeyLike, M as MarkdownOptions, n as PasteRule, P as PluginKey, d as PluginSpec, S as Slice, T as Transaction, p as TransactionOrigin, q as applyTransaction, r as coreExtensions, s as createEditor, t as createPluginKey, u as createState, v as fromHTML, w as getPluginState, x as insertBlockAfter, y as insertText, z as insertTextWithRules, G as keyName, H as normalizeKey, J as setBlockType, L as toggleMark } from './types-DXF9p4qV.cjs';
|
|
5
|
+
export { T as ToMarkdownOptions, t as toMarkdown } from './to-markdown-CFPMbbiX.cjs';
|
|
5
6
|
export { E as EmbedProvider, a as EmbedUrl } from './embed-provider-jXwlRmnp.cjs';
|
|
6
7
|
export { H as HTMLOptions, t as toHTML } from './to-html-1oD-CDle.cjs';
|
|
7
8
|
|
|
@@ -73,19 +74,6 @@ type FromMarkdownOptions = {
|
|
|
73
74
|
};
|
|
74
75
|
declare function fromMarkdown(markdown: string, options?: FromMarkdownOptions): QuoinBlock[];
|
|
75
76
|
|
|
76
|
-
type ToMarkdownOptions = {
|
|
77
|
-
schema?: Schema;
|
|
78
|
-
resolveAssetUrl?: (storageKey: string) => string;
|
|
79
|
-
comments?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Write every block that markdown cannot hold in full as a quoin comment, so that fromMarkdown reads back all of its
|
|
82
|
-
* data. Plain export, the default, writes native markdown and drops what that form cannot carry: block-level align,
|
|
83
|
-
* colour, background and other extra keys, the indent no container explains, and the data of the other block types.
|
|
84
|
-
*/
|
|
85
|
-
lossless?: boolean;
|
|
86
|
-
};
|
|
87
|
-
declare function toMarkdown(blocks: readonly QuoinBlock[], options?: ToMarkdownOptions): string;
|
|
88
|
-
|
|
89
77
|
declare function parseInline(markdown: string, options?: ParseInlineOptions): Inline;
|
|
90
78
|
|
|
91
79
|
declare function serializeInline(inline: Inline, options?: SerializeInlineOptions): string;
|
|
@@ -144,5 +132,5 @@ declare function diffBlocks(a: readonly QuoinBlock[], b: readonly QuoinBlock[],
|
|
|
144
132
|
|
|
145
133
|
declare function defineExtension<E extends Extension>(extension: E): E;
|
|
146
134
|
|
|
147
|
-
export { AtomNode, AtomSpec, Attrs, BlockRangeSelection, BlockSpec, CodecContext, Command, CreatedBlock, EngineBlock, EngineDoc, Extension, Inline, InlineNode, InputRule, Mark, MarkSpec, NodeSelection, PALETTE, ParseInlineOptions, Pos, QuoinBlock, Schema, SerializeInlineOptions, Step, StepJSON, TextNode, TextSelection, TextStats, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection,
|
|
148
|
-
export type { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, SchemaInput
|
|
135
|
+
export { AtomNode, AtomSpec, Attrs, BlockRangeSelection, BlockSpec, CodecContext, Command, CreatedBlock, EngineBlock, EngineDoc, Extension, Inline, InlineNode, InputRule, Mark, MarkSpec, NodeSelection, PALETTE, ParseInlineOptions, Pos, QuoinBlock, Schema, SerializeInlineOptions, Step, StepJSON, TextNode, TextSelection, TextStats, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection, toPlainText, typographyRules, undo };
|
|
136
|
+
export type { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, SchemaInput };
|
package/dist/engine.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { A as Attrs, M as Mark, c as AtomNode, m as InlineNode, I as Inline, T a
|
|
|
2
2
|
export { d as Assoc, B as BlockAttrs, f as BlockContent, g as BlockFlow, l as InlineCodec, o as MarkdownExportContext, q as PosMap, b as Selection, t as StepResult } from './types-CQ8Vw_7N.js';
|
|
3
3
|
import { b as Command, I as InputRule, o as TextStats, E as Extension } from './types-BjLcmV00.js';
|
|
4
4
|
export { A as Align, B as BlockStructureOptions, e as BoundCommands, f as Chain, C as CommandFactories, g as CoreCommands, h as CoreExtensionOptions, i as DOMParserLike, D as Decoration, a as Editor, j as EditorOptions, c as EditorState, F as FromHTMLOptions, k as InputRuleContext, l as InputRuleRange, m as InsertTextOptions, K as KeyLike, M as MarkdownOptions, n as PasteRule, P as PluginKey, d as PluginSpec, S as Slice, T as Transaction, p as TransactionOrigin, q as applyTransaction, r as coreExtensions, s as createEditor, t as createPluginKey, u as createState, v as fromHTML, w as getPluginState, x as insertBlockAfter, y as insertText, z as insertTextWithRules, G as keyName, H as normalizeKey, J as setBlockType, L as toggleMark } from './types-BjLcmV00.js';
|
|
5
|
+
export { T as ToMarkdownOptions, t as toMarkdown } from './to-markdown-BVOzhgVM.js';
|
|
5
6
|
export { E as EmbedProvider, a as EmbedUrl } from './embed-provider-jXwlRmnp.js';
|
|
6
7
|
export { H as HTMLOptions, t as toHTML } from './to-html-CLRBCX0I.js';
|
|
7
8
|
|
|
@@ -73,19 +74,6 @@ type FromMarkdownOptions = {
|
|
|
73
74
|
};
|
|
74
75
|
declare function fromMarkdown(markdown: string, options?: FromMarkdownOptions): QuoinBlock[];
|
|
75
76
|
|
|
76
|
-
type ToMarkdownOptions = {
|
|
77
|
-
schema?: Schema;
|
|
78
|
-
resolveAssetUrl?: (storageKey: string) => string;
|
|
79
|
-
comments?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Write every block that markdown cannot hold in full as a quoin comment, so that fromMarkdown reads back all of its
|
|
82
|
-
* data. Plain export, the default, writes native markdown and drops what that form cannot carry: block-level align,
|
|
83
|
-
* colour, background and other extra keys, the indent no container explains, and the data of the other block types.
|
|
84
|
-
*/
|
|
85
|
-
lossless?: boolean;
|
|
86
|
-
};
|
|
87
|
-
declare function toMarkdown(blocks: readonly QuoinBlock[], options?: ToMarkdownOptions): string;
|
|
88
|
-
|
|
89
77
|
declare function parseInline(markdown: string, options?: ParseInlineOptions): Inline;
|
|
90
78
|
|
|
91
79
|
declare function serializeInline(inline: Inline, options?: SerializeInlineOptions): string;
|
|
@@ -144,5 +132,5 @@ declare function diffBlocks(a: readonly QuoinBlock[], b: readonly QuoinBlock[],
|
|
|
144
132
|
|
|
145
133
|
declare function defineExtension<E extends Extension>(extension: E): E;
|
|
146
134
|
|
|
147
|
-
export { AtomNode, AtomSpec, Attrs, BlockRangeSelection, BlockSpec, CodecContext, Command, CreatedBlock, EngineBlock, EngineDoc, Extension, Inline, InlineNode, InputRule, Mark, MarkSpec, NodeSelection, PALETTE, ParseInlineOptions, Pos, QuoinBlock, Schema, SerializeInlineOptions, Step, StepJSON, TextNode, TextSelection, TextStats, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection,
|
|
148
|
-
export type { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, SchemaInput
|
|
135
|
+
export { AtomNode, AtomSpec, Attrs, BlockRangeSelection, BlockSpec, CodecContext, Command, CreatedBlock, EngineBlock, EngineDoc, Extension, Inline, InlineNode, InputRule, Mark, MarkSpec, NodeSelection, PALETTE, ParseInlineOptions, Pos, QuoinBlock, Schema, SerializeInlineOptions, Step, StepJSON, TextNode, TextSelection, TextStats, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection, toPlainText, typographyRules, undo };
|
|
136
|
+
export type { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, SchemaInput };
|
package/dist/find.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunkTKCPXUPP_cjs = require('./chunk-TKCPXUPP.cjs');
|
|
5
|
+
require('./chunk-UUSZGUXJ.cjs');
|
|
6
6
|
require('./chunk-QJ34MOFV.cjs');
|
|
7
7
|
require('./chunk-A6PGQVTR.cjs');
|
|
8
8
|
require('./chunk-VZZPCYA3.cjs');
|
|
@@ -13,19 +13,17 @@ require('./chunk-WZA5S5EJ.cjs');
|
|
|
13
13
|
|
|
14
14
|
Object.defineProperty(exports, "englishFindLabels", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkTKCPXUPP_cjs.englishFindLabels; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "findExtension", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkTKCPXUPP_cjs.findExtension; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "findMatches", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkTKCPXUPP_cjs.findMatches; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "replaceMatches", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkTKCPXUPP_cjs.replaceMatches; }
|
|
29
29
|
});
|
|
30
|
-
//# sourceMappingURL=find.cjs.map
|
|
31
|
-
//# sourceMappingURL=find.cjs.map
|
package/dist/find.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { englishFindLabels, findExtension, findMatches, replaceMatches } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { englishFindLabels, findExtension, findMatches, replaceMatches } from './chunk-N2SCDXTI.js';
|
|
3
|
+
import './chunk-32OZ2WM2.js';
|
|
4
4
|
import './chunk-XFEDJEJF.js';
|
|
5
5
|
import './chunk-HDJ653LM.js';
|
|
6
6
|
import './chunk-OS2O6IKX.js';
|
package/dist/headless.cjs
CHANGED
package/dist/headless.d.cts
CHANGED
|
@@ -6,7 +6,8 @@ import { D as Decoration, c as EditorState, E as Extension, T as Transaction } f
|
|
|
6
6
|
export { A as Align, B as BlockStructureOptions, e as BoundCommands, f as Chain, b as Command, C as CommandFactories, g as CoreCommands, h as CoreExtensionOptions, i as DOMParserLike, a as Editor, j as EditorOptions, F as FromHTMLOptions, I as InputRule, k as InputRuleContext, l as InputRuleRange, m as InsertTextOptions, K as KeyLike, M as MarkdownOptions, n as PasteRule, P as PluginKey, d as PluginSpec, S as Slice, o as TextStats, p as TransactionOrigin, q as applyTransaction, r as coreExtensions, s as createEditor, t as createPluginKey, u as createState, v as fromHTML, w as getPluginState, x as insertBlockAfter, y as insertText, z as insertTextWithRules, G as keyName, H as normalizeKey, J as setBlockType, L as toggleMark } from './types-DXF9p4qV.cjs';
|
|
7
7
|
import * as react from 'react';
|
|
8
8
|
import { ComponentType, ReactNode } from 'react';
|
|
9
|
-
export { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, PALETTE, SchemaInput,
|
|
9
|
+
export { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, PALETTE, SchemaInput, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection, toPlainText, typographyRules, undo } from './engine.cjs';
|
|
10
|
+
export { T as ToMarkdownOptions, t as toMarkdown } from './to-markdown-CFPMbbiX.cjs';
|
|
10
11
|
export { E as EmbedProvider, a as EmbedUrl } from './embed-provider-jXwlRmnp.cjs';
|
|
11
12
|
export { H as HTMLOptions, t as toHTML } from './to-html-1oD-CDle.cjs';
|
|
12
13
|
|
package/dist/headless.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { D as Decoration, c as EditorState, E as Extension, T as Transaction } f
|
|
|
6
6
|
export { A as Align, B as BlockStructureOptions, e as BoundCommands, f as Chain, b as Command, C as CommandFactories, g as CoreCommands, h as CoreExtensionOptions, i as DOMParserLike, a as Editor, j as EditorOptions, F as FromHTMLOptions, I as InputRule, k as InputRuleContext, l as InputRuleRange, m as InsertTextOptions, K as KeyLike, M as MarkdownOptions, n as PasteRule, P as PluginKey, d as PluginSpec, S as Slice, o as TextStats, p as TransactionOrigin, q as applyTransaction, r as coreExtensions, s as createEditor, t as createPluginKey, u as createState, v as fromHTML, w as getPluginState, x as insertBlockAfter, y as insertText, z as insertTextWithRules, G as keyName, H as normalizeKey, J as setBlockType, L as toggleMark } from './types-BjLcmV00.js';
|
|
7
7
|
import * as react from 'react';
|
|
8
8
|
import { ComponentType, ReactNode } from 'react';
|
|
9
|
-
export { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, PALETTE, SchemaInput,
|
|
9
|
+
export { AttrsPatch, BlockChange, BlockCodec, BlockDiff, FromMarkdownOptions, InlineChange, PALETTE, SchemaInput, addMarkStep, atom, blockInputRules, blockRangeSelection, coreBlockSpecs, countDoc, countText, createBlockCodec, createSchema, defineExtension, diffBlocks, diffInline, fromMarkdown, insertBlocksStep, joinBlocksStep, markInputRules, moveBlocksStep, nodeSelection, normalizeInline, parseInline, redo, removeBlocksStep, removeMarkStep, replaceBlockStep, replaceDocStep, replaceInlineStep, sanitizeHref, serializeInline, setAttrsStep, setIndentStep, splitBlockStep, stepFromJSON, text, textSelection, toPlainText, typographyRules, undo } from './engine.js';
|
|
10
|
+
export { T as ToMarkdownOptions, t as toMarkdown } from './to-markdown-BVOzhgVM.js';
|
|
10
11
|
export { E as EmbedProvider, a as EmbedUrl } from './embed-provider-jXwlRmnp.js';
|
|
11
12
|
export { H as HTMLOptions, t as toHTML } from './to-html-CLRBCX0I.js';
|
|
12
13
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunk2SWLD6R5_cjs = require('./chunk-2SWLD6R5.cjs');
|
|
5
|
+
var chunkUUSZGUXJ_cjs = require('./chunk-UUSZGUXJ.cjs');
|
|
6
|
+
require('./chunk-QJ34MOFV.cjs');
|
|
7
|
+
require('./chunk-A6PGQVTR.cjs');
|
|
8
|
+
require('./chunk-VZZPCYA3.cjs');
|
|
9
|
+
require('./chunk-BM2GRZNM.cjs');
|
|
10
|
+
require('./chunk-WZA5S5EJ.cjs');
|
|
11
|
+
var react = require('react');
|
|
12
|
+
|
|
13
|
+
// src/blocks/code/prism/grammar-name.ts
|
|
14
|
+
var NEAREST = { dockerfile: "docker", html: "markup", xml: "markup", shell: "bash" };
|
|
15
|
+
function grammarName(language) {
|
|
16
|
+
const key = language.trim().toLowerCase();
|
|
17
|
+
if (key === "") return void 0;
|
|
18
|
+
const known = chunkUUSZGUXJ_cjs.CODE_LANGUAGES.find(({ id, aliases = [] }) => id === key || aliases.includes(key));
|
|
19
|
+
return known && (NEAREST[known.id] ?? known.id);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/blocks/code/prism/prism-tokens.ts
|
|
23
|
+
var WORD = /^[a-z][a-z0-9-]*$/;
|
|
24
|
+
function className(token) {
|
|
25
|
+
const alias = typeof token.alias === "string" ? token.alias : token.alias?.[0];
|
|
26
|
+
const name = alias ?? token.type;
|
|
27
|
+
return WORD.test(name) ? `quoin-tok-${name}` : void 0;
|
|
28
|
+
}
|
|
29
|
+
function pushText(lines, text, drawn) {
|
|
30
|
+
text.split("\n").forEach((part, index) => {
|
|
31
|
+
if (index > 0) lines.push([]);
|
|
32
|
+
if (part === "") return;
|
|
33
|
+
lines[lines.length - 1].push(drawn === void 0 ? { text: part } : { text: part, className: drawn });
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function walk(node, drawn, lines) {
|
|
37
|
+
if (typeof node === "string") return pushText(lines, node, drawn);
|
|
38
|
+
if (Array.isArray(node)) return node.forEach((child) => walk(child, drawn, lines));
|
|
39
|
+
const token = node;
|
|
40
|
+
walk(token.content, className(token) ?? drawn, lines);
|
|
41
|
+
}
|
|
42
|
+
function codeLines(nodes) {
|
|
43
|
+
const lines = [[]];
|
|
44
|
+
nodes.forEach((node) => walk(node, void 0, lines));
|
|
45
|
+
return lines;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/blocks/code/prism/prism-highlight.ts
|
|
49
|
+
function nodesOf(tokenize, code, grammar) {
|
|
50
|
+
try {
|
|
51
|
+
return tokenize(code, grammar);
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function highlightWith(tokenize, code, language) {
|
|
57
|
+
const grammar = grammarName(language);
|
|
58
|
+
const nodes = grammar === void 0 ? null : nodesOf(tokenize, code, grammar);
|
|
59
|
+
return codeLines(nodes ?? [code]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/blocks/code/prism/prism-source.ts
|
|
63
|
+
async function importTokenize() {
|
|
64
|
+
const globals = globalThis;
|
|
65
|
+
const theirs = globals.Prism;
|
|
66
|
+
globals.Prism = { manual: true };
|
|
67
|
+
try {
|
|
68
|
+
const { tokenize } = await import('./prism-grammars.cjs');
|
|
69
|
+
return tokenize;
|
|
70
|
+
} finally {
|
|
71
|
+
if (theirs === void 0) delete globals.Prism;
|
|
72
|
+
else globals.Prism = theirs;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
var prismSource = chunk2SWLD6R5_cjs.lazyLoad(importTokenize);
|
|
76
|
+
|
|
77
|
+
// src/blocks/code/prism/use-prism-highlighter.ts
|
|
78
|
+
function usePrismHighlighter() {
|
|
79
|
+
const [tokenize, setTokenize] = react.useState(prismSource.loaded);
|
|
80
|
+
react.useEffect(() => {
|
|
81
|
+
if (tokenize !== void 0) return;
|
|
82
|
+
let live = true;
|
|
83
|
+
void prismSource.load().then(
|
|
84
|
+
(loaded) => void (live && setTokenize(() => loaded)),
|
|
85
|
+
() => {
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
return () => {
|
|
89
|
+
live = false;
|
|
90
|
+
};
|
|
91
|
+
}, [tokenize]);
|
|
92
|
+
return react.useMemo(
|
|
93
|
+
() => tokenize === void 0 ? void 0 : (code, language) => highlightWith(tokenize, code, language),
|
|
94
|
+
[tokenize]
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
exports.usePrismHighlighter = usePrismHighlighter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeHighlighter } from './index.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A `highlight` for `BlockCanvas`, drawn by Prism. It is undefined until the grammars have loaded, which draws code
|
|
5
|
+
* plainly for that first render, and the canvas redraws with the highlighter once they arrive. A canvas mounted after
|
|
6
|
+
* they have loaded gets it on its first render.
|
|
7
|
+
*/
|
|
8
|
+
declare function usePrismHighlighter(): CodeHighlighter | undefined;
|
|
9
|
+
|
|
10
|
+
export { usePrismHighlighter };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeHighlighter } from './index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A `highlight` for `BlockCanvas`, drawn by Prism. It is undefined until the grammars have loaded, which draws code
|
|
5
|
+
* plainly for that first render, and the canvas redraws with the highlighter once they arrive. A canvas mounted after
|
|
6
|
+
* they have loaded gets it on its first render.
|
|
7
|
+
*/
|
|
8
|
+
declare function usePrismHighlighter(): CodeHighlighter | undefined;
|
|
9
|
+
|
|
10
|
+
export { usePrismHighlighter };
|