quoin-editor 2.0.2 → 2.0.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.
- package/CHANGELOG.md +19 -0
- package/dist/ai.cjs +34 -34
- package/dist/ai.js +3 -3
- package/dist/catalogue.cjs +21 -21
- package/dist/catalogue.js +12 -12
- package/dist/{chunk-SE36LU6G.js → chunk-2BPXVQBP.js} +28 -11
- package/dist/chunk-2BPXVQBP.js.map +1 -0
- package/dist/{chunk-UKUAQJME.cjs → chunk-2QKFRKOP.cjs} +29 -8
- package/dist/{chunk-NZFGAV3L.cjs → chunk-3HW3WRYC.cjs} +2 -2
- package/dist/{chunk-TDXQSNFS.cjs → chunk-3INFNIGN.cjs} +19 -19
- package/dist/{chunk-5A2MHCYI.js → chunk-4G645EYO.js} +8 -5
- package/dist/{chunk-5A2MHCYI.js.map → chunk-4G645EYO.js.map} +1 -1
- package/dist/{chunk-Z3GLEAOI.js → chunk-556PFYES.js} +15 -10
- package/dist/{chunk-Z3GLEAOI.js.map → chunk-556PFYES.js.map} +1 -1
- package/dist/{chunk-LBP64GKQ.cjs → chunk-7J63427U.cjs} +70 -65
- package/dist/{chunk-DT3ODGZ7.js → chunk-A2IQHMIH.js} +6 -5
- package/dist/chunk-A2IQHMIH.js.map +1 -0
- package/dist/{chunk-M7L444WV.js → chunk-AJT54OMZ.js} +4 -4
- package/dist/{chunk-M7L444WV.js.map → chunk-AJT54OMZ.js.map} +1 -1
- package/dist/{chunk-YYBPQ4TY.cjs → chunk-BE2YHZXA.cjs} +2 -2
- package/dist/{chunk-5VBDRJ5Y.cjs → chunk-EBSDPHPS.cjs} +140 -118
- package/dist/{chunk-OBOIZ7L3.js → chunk-EIWPJWY3.js} +3 -3
- package/dist/{chunk-OBOIZ7L3.js.map → chunk-EIWPJWY3.js.map} +1 -1
- package/dist/{chunk-AVD2AI47.js → chunk-F2ZK6Z52.js} +3 -3
- package/dist/{chunk-AVD2AI47.js.map → chunk-F2ZK6Z52.js.map} +1 -1
- package/dist/{chunk-QIGZ5JAY.js → chunk-G6NBQYMM.js} +43 -20
- package/dist/chunk-G6NBQYMM.js.map +1 -0
- package/dist/{chunk-XC4WZTMY.cjs → chunk-JGEDJYIV.cjs} +50 -50
- package/dist/{chunk-F3BC5ITU.cjs → chunk-JZF6UQH5.cjs} +8 -5
- package/dist/{chunk-JM5TRLEC.cjs → chunk-KHRVCTQQ.cjs} +30 -30
- package/dist/{chunk-ZHLNPNE2.js → chunk-LU3T3JB4.js} +5 -5
- package/dist/{chunk-ZHLNPNE2.js.map → chunk-LU3T3JB4.js.map} +1 -1
- package/dist/{chunk-SHZGRFYY.cjs → chunk-N7BSFDDM.cjs} +14 -14
- package/dist/{chunk-ZDNYIQKM.js → chunk-NHNW5DK3.js} +4 -4
- package/dist/{chunk-ZDNYIQKM.js.map → chunk-NHNW5DK3.js.map} +1 -1
- package/dist/{chunk-RWSC47L7.cjs → chunk-NUQ64S5B.cjs} +18 -18
- package/dist/{chunk-DGKIKXB7.js → chunk-QLVX7MPS.js} +3 -3
- package/dist/{chunk-DGKIKXB7.js.map → chunk-QLVX7MPS.js.map} +1 -1
- package/dist/{chunk-XLR2O4OK.js → chunk-W376L2GM.js} +5 -5
- package/dist/{chunk-XLR2O4OK.js.map → chunk-W376L2GM.js.map} +1 -1
- package/dist/{chunk-RR67AKP6.cjs → chunk-WDBFGX3U.cjs} +27 -26
- package/dist/{chunk-4VCCGBXW.js → chunk-XE3IYW5B.js} +4 -4
- package/dist/{chunk-4VCCGBXW.js.map → chunk-XE3IYW5B.js.map} +1 -1
- package/dist/{chunk-YETMZ27Q.cjs → chunk-YYW33WUL.cjs} +3 -3
- package/dist/comments.cjs +30 -30
- package/dist/comments.js +3 -3
- package/dist/diagram.cjs +6 -6
- package/dist/diagram.js +3 -3
- package/dist/embed.cjs +5 -5
- package/dist/embed.js +3 -3
- package/dist/emoji.cjs +6 -6
- package/dist/emoji.js +3 -3
- package/dist/find.cjs +7 -7
- package/dist/find.js +3 -3
- package/dist/headless.cjs +11 -11
- package/dist/headless.js +1 -1
- package/dist/highlight.cjs +3 -3
- package/dist/highlight.js +2 -2
- package/dist/index.cjs +23 -23
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/math.cjs +6 -6
- package/dist/math.js +4 -4
- package/dist/mention.cjs +6 -6
- package/dist/mention.js +4 -4
- package/dist/presence.cjs +12 -12
- package/dist/presence.js +3 -3
- package/dist/source.cjs +2 -2
- package/dist/source.js +2 -2
- package/dist/stats.cjs +6 -6
- package/dist/stats.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/table.cjs +22 -22
- package/dist/table.js +3 -3
- package/dist/toc.cjs +6 -6
- package/dist/toc.js +3 -3
- package/package.json +3 -2
- package/dist/chunk-DT3ODGZ7.js.map +0 -1
- package/dist/chunk-QIGZ5JAY.js.map +0 -1
- package/dist/chunk-SE36LU6G.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of `quoin-editor` is listed here, newest first, in the spirit of [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). From 1.0.0 the package follows [semantic versioning](https://semver.org/): a breaking change waits for the next major version. Until then, Quoin was 0.x and a minor version could contain breaking changes; those known at release were marked "Breaking". The 0.x sections are kept as they were released, "Docs" headings included. Moving from 0.4 to 1.0, and from 1.x to 2.0, is covered step by step in [MIGRATION.md](MIGRATION.md). Review finding ids such as F-17 are those of the 0.4.0 review in [#73](https://github.com/AmineSeboui/quoin-editor/issues/73).
|
|
4
4
|
|
|
5
|
+
## 2.0.4 (2026-11-10)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- An upload a host answers with an empty key fails the way one that answers with no key already did, so the block says so rather than sitting empty with nothing reported. The guard asked whether the key was a string, and an empty string is one.
|
|
9
|
+
- A quote block is a `blockquote` in the canvas, as it already was in the HTML the engine renders. It was a `div` whose accessible name said "Quote", so a reader moving by quotation found nothing.
|
|
10
|
+
|
|
11
|
+
## 2.0.3 (2026-11-09)
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- A closed toggle points the way the text runs on, so on a right to left page its chevron points left rather than right. Open points down whichever way the page runs, as it did. The badge on an image with no alt text moves to the inline start with it.
|
|
15
|
+
- The horizontal arrows walk the text the way it runs on a right to left page. A caret at the edge of a block left it towards the wrong neighbour, so the left arrow at the end of an Arabic or Hebrew line went back to the block before rather than on to the next, and Shift with an arrow beside a formula or a mention took the atom on the wrong side. The arrows in the bubble toolbar and in the emoji picker's grid moved against the page too. An arrow names a side of the screen rather than a movement, so the view now reads one as it would be written on a left to right page, once, and the moves and the keymaps behind it are unchanged. The arrows that resize an image or a table column stay as they are, since a handle should move the way the key under the finger points.
|
|
16
|
+
- The table's column menu puts a column where it says on a right to left page. `Insert column left` added it before this one in the document, which the page then drew on the right, and `Move column left` moved it right; the two move items were also disabled at the wrong ends, so the column a reader saw at the left edge could still be moved further left. The wording stays physical, since that is what the writer is looking at, and the indices turn round behind it.
|
|
17
|
+
- Every menu, toolbar and popover opens on the correct side of a canvas whose page runs right to left. The twenty places that open one already asked to be placed at the inline start or end rather than at a left or a right, but whoever places them reads the direction through React rather than from the DOM, because they are drawn in a portal outside the canvas, and nothing ever told it. All twenty therefore resolved against a left to right default, so an Arabic, Hebrew, Persian or Urdu document had every menu on the wrong side and the arrow keys inside them mirrored. The canvas now reports the direction it is laid out in, read from its root, which also covers a page turned round with CSS rather than with a `dir` attribute. This adds `@radix-ui/react-direction` to the package's dependencies, a context provider of a few hundred bytes that draws nothing.
|
|
18
|
+
- A callout whose tone the editor does not know is drawn as `info` in the read-only view, which is the tone the canvas already falls back to. The two renderers disagreed: the canvas normalised anything outside the five tones, while the view passed the stored value straight into `data-tone` and into the region's accessible name, so a document carrying a tone from untyped host code, or from a version that knew another one, drew unstyled in the view and read its raw value aloud. Both now take the one list.
|
|
19
|
+
- A host renaming one entry of a label that holds a record keeps the English wording of every other entry in it. `blockNames`, `groups`, `colors` and `calloutTones` are maps of names rather than single names, and an override replaced the whole map, so renaming one slash group left the others undefined and the menu drew their headings blank.
|
|
20
|
+
- `englishLabels` is frozen, with the records inside it. Every canvas on the page shares that one object, so a host writing to it, by accident or to patch a string, changed the wording under every other canvas and under the locale packs that fall back to it.
|
|
21
|
+
- A composition over a formula, a mention or another atom is left alone. The guard that keeps a selection out of an atom read only the view's own composing flag, which the view sets after the key, while the browser reports the composition on the key itself. A first keystroke of a Japanese or Pinyin input beside an atom could therefore move the selection out mid-composition and drop the text being composed.
|
|
22
|
+
- A host predicate passed to `useAutosave` as `isRetryable` that throws ends the retries instead of escaping into the save loop. The throw replaced the save's own failure, so the document stayed unsaved and nothing was reported.
|
|
23
|
+
|
|
5
24
|
## 2.0.2 (2026-11-09)
|
|
6
25
|
|
|
7
26
|
### Fixed
|
package/dist/ai.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkLE5XMIFJ_cjs = require('./chunk-LE5XMIFJ.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunk3HW3WRYC_cjs = require('./chunk-3HW3WRYC.cjs');
|
|
6
|
+
var chunkEBSDPHPS_cjs = require('./chunk-EBSDPHPS.cjs');
|
|
7
|
+
var chunk2QKFRKOP_cjs = require('./chunk-2QKFRKOP.cjs');
|
|
8
8
|
var chunkZWTIRGY5_cjs = require('./chunk-ZWTIRGY5.cjs');
|
|
9
9
|
require('./chunk-A6PGQVTR.cjs');
|
|
10
10
|
var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
|
|
@@ -377,7 +377,7 @@ async function read(editor, link, run, stream, request) {
|
|
|
377
377
|
} catch (error) {
|
|
378
378
|
if (!live()) return;
|
|
379
379
|
end("error");
|
|
380
|
-
link.report(
|
|
380
|
+
link.report(chunkEBSDPHPS_cjs.toError(error));
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
function startStream(editor, link, stream, request, replace) {
|
|
@@ -474,7 +474,7 @@ function aiSlashItems(labels, stream) {
|
|
|
474
474
|
title: labels.askAi,
|
|
475
475
|
description: labels.askAiDescription,
|
|
476
476
|
group: "ai",
|
|
477
|
-
icon:
|
|
477
|
+
icon: chunkEBSDPHPS_cjs.Sparkles,
|
|
478
478
|
keywords: KEYWORDS,
|
|
479
479
|
run: ({ controller }) => void openFor(controller)
|
|
480
480
|
},
|
|
@@ -482,7 +482,7 @@ function aiSlashItems(labels, stream) {
|
|
|
482
482
|
id: "ai-continue",
|
|
483
483
|
title: labels.actions.continue,
|
|
484
484
|
group: "ai",
|
|
485
|
-
icon:
|
|
485
|
+
icon: chunkEBSDPHPS_cjs.PenLine,
|
|
486
486
|
keywords: [...KEYWORDS, "continue"],
|
|
487
487
|
run: ({ controller }) => {
|
|
488
488
|
if (openFor(controller)) askFrom({ controller, stream}, "continue");
|
|
@@ -493,14 +493,14 @@ function aiSlashItems(labels, stream) {
|
|
|
493
493
|
var aiBubbleItem = (labels) => ({
|
|
494
494
|
id: "ai",
|
|
495
495
|
title: labels.askAi,
|
|
496
|
-
icon:
|
|
496
|
+
icon: chunkEBSDPHPS_cjs.Sparkles,
|
|
497
497
|
available: (state) => aiState(state).ghost === null,
|
|
498
498
|
run: (controller) => void openFor(controller)
|
|
499
499
|
});
|
|
500
500
|
var aiBlockMenuItem = (labels) => ({
|
|
501
501
|
id: "ai",
|
|
502
502
|
label: labels.askAi,
|
|
503
|
-
icon:
|
|
503
|
+
icon: chunkEBSDPHPS_cjs.Sparkles,
|
|
504
504
|
available: (state, blockIds) => targetOfBlocks(state, blockIds) !== null,
|
|
505
505
|
run: (controller, blockIds) => {
|
|
506
506
|
const target = targetOfBlocks(controller.editor.state, blockIds);
|
|
@@ -605,12 +605,12 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
605
605
|
const [next, setNext] = react.useState("");
|
|
606
606
|
const { phase } = ghost;
|
|
607
607
|
const focusPrimary = () => content.current?.querySelector(`[${PRIMARY}]`)?.focus();
|
|
608
|
-
|
|
608
|
+
chunk2QKFRKOP_cjs.useIsomorphicLayoutEffect(() => {
|
|
609
609
|
const active = content.current?.ownerDocument.activeElement;
|
|
610
610
|
inside.current = active == null || active === active.ownerDocument.body;
|
|
611
611
|
if (inside.current) focusPrimary();
|
|
612
612
|
}, []);
|
|
613
|
-
|
|
613
|
+
chunk2QKFRKOP_cjs.useIsomorphicLayoutEffect(() => {
|
|
614
614
|
const active = content.current?.ownerDocument.activeElement;
|
|
615
615
|
if (inside.current && !content.current?.contains(active ?? null)) focusPrimary();
|
|
616
616
|
}, [phase, ghost.key]);
|
|
@@ -658,21 +658,21 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
658
658
|
children: [
|
|
659
659
|
phase === "streaming" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
660
660
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.writing }),
|
|
661
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
661
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.Button, { ...primary, size: "sm", variant: "outline", onClick: () => stop(editor), children: labels.stop })
|
|
662
662
|
] }),
|
|
663
663
|
phase === "error" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
664
664
|
/* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: labels.failed }),
|
|
665
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
666
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
665
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.Button, { ...primary, size: "sm", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
666
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard })
|
|
667
667
|
] }),
|
|
668
668
|
(phase === "done" || phase === "stopped") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
669
669
|
phase === "stopped" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.stopped }),
|
|
670
670
|
gone && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "w-full text-xs text-muted-foreground", children: labels.targetGone }),
|
|
671
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
672
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
673
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
671
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.Button, { ...primary, size: "sm", onClick: onAccept, children: labels.accept }),
|
|
672
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard }),
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.Button, { size: "sm", variant: "ghost", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
674
674
|
/* @__PURE__ */ jsxRuntime.jsx("form", { className: "w-full", onSubmit: onFollowUp, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
675
|
-
|
|
675
|
+
chunkEBSDPHPS_cjs.Input,
|
|
676
676
|
{
|
|
677
677
|
"aria-label": labels.followUp,
|
|
678
678
|
placeholder: labels.followUp,
|
|
@@ -711,7 +711,7 @@ function fillGhost(ghost, markdown) {
|
|
|
711
711
|
if (piece.indent > 0) element.style.setProperty("--quoin-ai-indent", String(piece.indent));
|
|
712
712
|
const region = chunkFK7EBZPX_cjs.primaryRegion(schema, piece);
|
|
713
713
|
if (region === null) element.textContent = chunkFK7EBZPX_cjs.toPlainText([codec.toQuoin(piece)], { schema });
|
|
714
|
-
else
|
|
714
|
+
else chunk2QKFRKOP_cjs.renderInline(element, piece.regions[region], []);
|
|
715
715
|
drawn2.push(element);
|
|
716
716
|
}
|
|
717
717
|
}
|
|
@@ -788,7 +788,7 @@ function clipAside(layer, text, areas, scale) {
|
|
|
788
788
|
function useGhostPlace(controller, layer, block, region) {
|
|
789
789
|
const placeNow = react.useRef(() => {
|
|
790
790
|
});
|
|
791
|
-
|
|
791
|
+
chunk2QKFRKOP_cjs.useIsomorphicLayoutEffect(() => {
|
|
792
792
|
const root = controller.root;
|
|
793
793
|
const element = layer.current;
|
|
794
794
|
const view = root?.ownerDocument.defaultView;
|
|
@@ -827,7 +827,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
|
|
|
827
827
|
const layer = react.useRef(null);
|
|
828
828
|
const drawn2 = react.useRef(null);
|
|
829
829
|
const place2 = useGhostPlace(env.controller, layer, target.to.block, target.to.region);
|
|
830
|
-
|
|
830
|
+
chunk2QKFRKOP_cjs.useIsomorphicLayoutEffect(() => {
|
|
831
831
|
const element = drawn2.current;
|
|
832
832
|
if (element === null) return;
|
|
833
833
|
element.setAttribute("inert", "");
|
|
@@ -841,7 +841,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
|
|
|
841
841
|
}
|
|
842
842
|
function useTargetAnchor(controller, target) {
|
|
843
843
|
const latest = react.useRef(target);
|
|
844
|
-
|
|
844
|
+
chunk2QKFRKOP_cjs.useIsomorphicLayoutEffect(() => {
|
|
845
845
|
latest.current = target;
|
|
846
846
|
});
|
|
847
847
|
return react.useMemo(() => {
|
|
@@ -850,8 +850,8 @@ function useTargetAnchor(controller, target) {
|
|
|
850
850
|
return { block: to.block, region: to.region, from: to.offset, to: to.offset };
|
|
851
851
|
};
|
|
852
852
|
return {
|
|
853
|
-
current:
|
|
854
|
-
() =>
|
|
853
|
+
current: chunkEBSDPHPS_cjs.virtualAnchor(
|
|
854
|
+
() => chunkEBSDPHPS_cjs.rangeRect(controller, end()),
|
|
855
855
|
() => controller.registry.get(end().block, end().region)
|
|
856
856
|
)
|
|
857
857
|
};
|
|
@@ -905,7 +905,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
905
905
|
};
|
|
906
906
|
const fieldLabel = asking === "tone" ? labels.tonePrompt : asking === "translate" ? labels.translatePrompt : labels.prompt;
|
|
907
907
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
908
|
-
|
|
908
|
+
chunkEBSDPHPS_cjs.Popover,
|
|
909
909
|
{
|
|
910
910
|
open: true,
|
|
911
911
|
modal: false,
|
|
@@ -913,9 +913,9 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
913
913
|
if (!next) closeMenu(controller.editor);
|
|
914
914
|
},
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
916
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkEBSDPHPS_cjs.PopoverAnchor, { virtualRef: anchor }),
|
|
917
917
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
918
|
-
|
|
918
|
+
chunkEBSDPHPS_cjs.PopoverContent,
|
|
919
919
|
{
|
|
920
920
|
"aria-label": labels.askAi,
|
|
921
921
|
side: "bottom",
|
|
@@ -932,7 +932,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
932
932
|
},
|
|
933
933
|
children: [
|
|
934
934
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
935
|
-
|
|
935
|
+
chunkEBSDPHPS_cjs.Input,
|
|
936
936
|
{
|
|
937
937
|
ref: field,
|
|
938
938
|
role: "combobox",
|
|
@@ -956,7 +956,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
956
956
|
id: optionId(index),
|
|
957
957
|
role: "option",
|
|
958
958
|
"aria-selected": index === current,
|
|
959
|
-
className:
|
|
959
|
+
className: chunkEBSDPHPS_cjs.cn(chunkEBSDPHPS_cjs.MENU_ITEM, index === current && "bg-accent text-accent-foreground"),
|
|
960
960
|
onMouseDown: (event) => event.preventDefault(),
|
|
961
961
|
onClick: () => choose(choice),
|
|
962
962
|
children: choice.label
|
|
@@ -976,15 +976,15 @@ var goneOf = (state) => {
|
|
|
976
976
|
};
|
|
977
977
|
var plainText = (markdown) => chunkFK7EBZPX_cjs.toPlainText(chunkI7X7B3WD_cjs.fromMarkdown(markdown));
|
|
978
978
|
function AiOverlay({ controller, stream, labels }) {
|
|
979
|
-
const { onError } =
|
|
979
|
+
const { onError } = chunkEBSDPHPS_cjs.useQuoin();
|
|
980
980
|
const link = linkOf(controller.editor);
|
|
981
|
-
|
|
981
|
+
chunk2QKFRKOP_cjs.useIsomorphicLayoutEffect(() => {
|
|
982
982
|
link.report = onError;
|
|
983
983
|
link.ended = (phase, output) => controller.announce((phase === "done" ? labels.written : labels.halted)(plainText(output)));
|
|
984
984
|
}, [link, onError, controller, labels]);
|
|
985
|
-
const value =
|
|
986
|
-
const gone =
|
|
987
|
-
const readOnly =
|
|
985
|
+
const value = chunk2QKFRKOP_cjs.useEditorState(controller, aiState);
|
|
986
|
+
const gone = chunk2QKFRKOP_cjs.useEditorState(controller, goneOf);
|
|
987
|
+
const readOnly = chunk2QKFRKOP_cjs.useReadOnly(controller);
|
|
988
988
|
const env = react.useMemo(() => ({ controller, stream, labels }), [controller, stream, labels]);
|
|
989
989
|
const barId = react.useId();
|
|
990
990
|
const showing = value.ghost !== null;
|
|
@@ -1003,7 +1003,7 @@ function AiOverlay({ controller, stream, labels }) {
|
|
|
1003
1003
|
const root = controller.root;
|
|
1004
1004
|
if (!root) return;
|
|
1005
1005
|
let away = true;
|
|
1006
|
-
return
|
|
1006
|
+
return chunk3HW3WRYC_cjs.watchCanvasFocus(controller, root.ownerDocument, (inside, node) => {
|
|
1007
1007
|
if (!inside) away = true;
|
|
1008
1008
|
else if (root.contains(node)) {
|
|
1009
1009
|
if (away) noteFocus(controller.editor);
|
package/dist/ai.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { clipBoxes } from './chunk-MQUCCSWG.js';
|
|
3
|
-
import { watchCanvasFocus } from './chunk-
|
|
4
|
-
import { Sparkles, PenLine, useQuoin, Popover, PopoverAnchor, PopoverContent, Input, cn, MENU_ITEM, virtualAnchor, rangeRect, Button, toError } from './chunk-
|
|
5
|
-
import { useIsomorphicLayoutEffect, useEditorState, useReadOnly, renderInline } from './chunk-
|
|
3
|
+
import { watchCanvasFocus } from './chunk-F2ZK6Z52.js';
|
|
4
|
+
import { Sparkles, PenLine, useQuoin, Popover, PopoverAnchor, PopoverContent, Input, cn, MENU_ITEM, virtualAnchor, rangeRect, Button, toError } from './chunk-G6NBQYMM.js';
|
|
5
|
+
import { useIsomorphicLayoutEffect, useEditorState, useReadOnly, renderInline } from './chunk-2BPXVQBP.js';
|
|
6
6
|
import { mergeLabels } from './chunk-DLQCTGC3.js';
|
|
7
7
|
import './chunk-HDJ653LM.js';
|
|
8
8
|
import { createPluginKey, defineExtension, isCollapsed, regionLength, primaryRegion, getPluginState, Transaction, toPlainText, selectedBlockIds, orderedRange, comparePos, sliceFromSelection, textSelection, deleteRange, pasteAtCaret, toMarkdown, descendantsEnd, freshBlocks, insertBlocksStep, capIndents, endOf } from './chunk-5RBMZGKV.js';
|
package/dist/catalogue.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var chunkNUQ64S5B_cjs = require('./chunk-NUQ64S5B.cjs');
|
|
5
|
+
var chunkWDBFGX3U_cjs = require('./chunk-WDBFGX3U.cjs');
|
|
6
|
+
var chunk3INFNIGN_cjs = require('./chunk-3INFNIGN.cjs');
|
|
7
|
+
var chunkBE2YHZXA_cjs = require('./chunk-BE2YHZXA.cjs');
|
|
8
8
|
require('./chunk-2SWLD6R5.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
9
|
+
var chunk7J63427U_cjs = require('./chunk-7J63427U.cjs');
|
|
10
|
+
var chunkJGEDJYIV_cjs = require('./chunk-JGEDJYIV.cjs');
|
|
11
|
+
var chunkKHRVCTQQ_cjs = require('./chunk-KHRVCTQQ.cjs');
|
|
12
|
+
require('./chunk-JZF6UQH5.cjs');
|
|
13
13
|
require('./chunk-YEDPBYO5.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkYYW33WUL_cjs = require('./chunk-YYW33WUL.cjs');
|
|
15
|
+
var chunkN7BSFDDM_cjs = require('./chunk-N7BSFDDM.cjs');
|
|
16
16
|
require('./chunk-LM3DHROX.cjs');
|
|
17
|
-
require('./chunk-
|
|
18
|
-
require('./chunk-
|
|
17
|
+
require('./chunk-EBSDPHPS.cjs');
|
|
18
|
+
require('./chunk-2QKFRKOP.cjs');
|
|
19
19
|
require('./chunk-ZWTIRGY5.cjs');
|
|
20
20
|
require('./chunk-A6PGQVTR.cjs');
|
|
21
21
|
require('./chunk-FK7EBZPX.cjs');
|
|
@@ -32,15 +32,15 @@ function createCatalogue(features2) {
|
|
|
32
32
|
|
|
33
33
|
// src/catalogue.ts
|
|
34
34
|
var features = {
|
|
35
|
-
table:
|
|
36
|
-
embed:
|
|
37
|
-
math:
|
|
38
|
-
diagram:
|
|
39
|
-
toc:
|
|
40
|
-
mention:
|
|
41
|
-
emoji:
|
|
42
|
-
find:
|
|
43
|
-
stats:
|
|
35
|
+
table: chunk7J63427U_cjs.tableExtension,
|
|
36
|
+
embed: chunkJGEDJYIV_cjs.embedExtension,
|
|
37
|
+
math: chunkKHRVCTQQ_cjs.mathExtension,
|
|
38
|
+
diagram: chunkYYW33WUL_cjs.diagramExtension,
|
|
39
|
+
toc: chunkN7BSFDDM_cjs.tocExtension,
|
|
40
|
+
mention: chunkNUQ64S5B_cjs.mentionExtension,
|
|
41
|
+
emoji: chunkWDBFGX3U_cjs.emojiExtension,
|
|
42
|
+
find: chunk3INFNIGN_cjs.findExtension,
|
|
43
|
+
stats: chunkBE2YHZXA_cjs.statsExtension
|
|
44
44
|
};
|
|
45
45
|
var catalogue = createCatalogue(features);
|
|
46
46
|
|
package/dist/catalogue.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { mentionExtension } from './chunk-
|
|
3
|
-
import { emojiExtension } from './chunk-
|
|
4
|
-
import { findExtension } from './chunk-
|
|
5
|
-
import { statsExtension } from './chunk-
|
|
2
|
+
import { mentionExtension } from './chunk-W376L2GM.js';
|
|
3
|
+
import { emojiExtension } from './chunk-A2IQHMIH.js';
|
|
4
|
+
import { findExtension } from './chunk-XE3IYW5B.js';
|
|
5
|
+
import { statsExtension } from './chunk-QLVX7MPS.js';
|
|
6
6
|
import './chunk-KTUOPDVO.js';
|
|
7
|
-
import { tableExtension } from './chunk-
|
|
8
|
-
import { embedExtension } from './chunk-
|
|
9
|
-
import { mathExtension } from './chunk-
|
|
10
|
-
import './chunk-
|
|
7
|
+
import { tableExtension } from './chunk-556PFYES.js';
|
|
8
|
+
import { embedExtension } from './chunk-AJT54OMZ.js';
|
|
9
|
+
import { mathExtension } from './chunk-LU3T3JB4.js';
|
|
10
|
+
import './chunk-4G645EYO.js';
|
|
11
11
|
import './chunk-LSI4RMTY.js';
|
|
12
|
-
import { diagramExtension } from './chunk-
|
|
13
|
-
import { tocExtension } from './chunk-
|
|
12
|
+
import { diagramExtension } from './chunk-EIWPJWY3.js';
|
|
13
|
+
import { tocExtension } from './chunk-NHNW5DK3.js';
|
|
14
14
|
import './chunk-DBOZFNWU.js';
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
15
|
+
import './chunk-G6NBQYMM.js';
|
|
16
|
+
import './chunk-2BPXVQBP.js';
|
|
17
17
|
import './chunk-DLQCTGC3.js';
|
|
18
18
|
import './chunk-HDJ653LM.js';
|
|
19
19
|
import './chunk-5RBMZGKV.js';
|
|
@@ -2040,6 +2040,11 @@ function createDomInputFallback(controller) {
|
|
|
2040
2040
|
};
|
|
2041
2041
|
}
|
|
2042
2042
|
|
|
2043
|
+
// src/ui/direction.ts
|
|
2044
|
+
var inlineDirection = (element) => getComputedStyle(element).direction === "rtl" ? "rtl" : "ltr";
|
|
2045
|
+
var MIRRORED = { ArrowLeft: "ArrowRight", ArrowRight: "ArrowLeft" };
|
|
2046
|
+
var arrowAsWritten = (key, direction) => direction === "rtl" && Object.hasOwn(MIRRORED, key) ? MIRRORED[key] : key;
|
|
2047
|
+
|
|
2043
2048
|
// src/view/navigation/cross-moves.ts
|
|
2044
2049
|
function moveHead(controller, { anchor }, head) {
|
|
2045
2050
|
dispatchSelection(controller, textSelection(anchor, head));
|
|
@@ -2286,13 +2291,19 @@ var ARROWS = {
|
|
|
2286
2291
|
ArrowLeft: [moveHorizontally, -1],
|
|
2287
2292
|
ArrowRight: [moveHorizontally, 1]
|
|
2288
2293
|
};
|
|
2294
|
+
var written = (controller, key) => controller.root === null ? key : arrowAsWritten(key, inlineDirection(controller.root));
|
|
2289
2295
|
function isComposingKey(controller, event) {
|
|
2290
2296
|
return event.isComposing || event.keyCode === 229 || controller.composingKey !== null;
|
|
2291
2297
|
}
|
|
2292
|
-
var runKeymap = (controller, event) =>
|
|
2298
|
+
var runKeymap = (controller, event) => {
|
|
2299
|
+
const name = written(controller, event.key);
|
|
2300
|
+
const { altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
2301
|
+
const key = name === event.key ? event : { key: name, altKey, ctrlKey, metaKey, shiftKey };
|
|
2302
|
+
return controller.edit(() => controller.editor.handleKey(key));
|
|
2303
|
+
};
|
|
2293
2304
|
function arrow(controller, event) {
|
|
2294
2305
|
if (!Object.hasOwn(ARROWS, event.key) || event.ctrlKey || event.metaKey) return false;
|
|
2295
|
-
const [move, direction] = ARROWS[event.key];
|
|
2306
|
+
const [move, direction] = ARROWS[written(controller, event.key)];
|
|
2296
2307
|
return move(controller, direction, event.shiftKey);
|
|
2297
2308
|
}
|
|
2298
2309
|
var isMod = (controller, event) => controller.isMac ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;
|
|
@@ -2449,15 +2460,15 @@ var selectionPoints = (selection) => [
|
|
|
2449
2460
|
];
|
|
2450
2461
|
var samePoints = (a, b) => a.every((point, index) => point === b[index]);
|
|
2451
2462
|
function createSelectionSync(doc, onChange) {
|
|
2452
|
-
let
|
|
2463
|
+
let written2 = null;
|
|
2453
2464
|
let expiry = null;
|
|
2454
2465
|
function release() {
|
|
2455
|
-
|
|
2466
|
+
written2 = null;
|
|
2456
2467
|
if (expiry !== null) clearTimeout(expiry);
|
|
2457
2468
|
expiry = null;
|
|
2458
2469
|
}
|
|
2459
2470
|
function handle2() {
|
|
2460
|
-
const suppressed =
|
|
2471
|
+
const suppressed = written2;
|
|
2461
2472
|
release();
|
|
2462
2473
|
if (suppressed === null || !samePoints(suppressed, selectionPoints(doc.getSelection()))) onChange();
|
|
2463
2474
|
}
|
|
@@ -2468,7 +2479,7 @@ function createSelectionSync(doc, onChange) {
|
|
|
2468
2479
|
release();
|
|
2469
2480
|
},
|
|
2470
2481
|
suppressNext() {
|
|
2471
|
-
|
|
2482
|
+
written2 = selectionPoints(doc.getSelection());
|
|
2472
2483
|
expiry ??= setTimeout(release, 0);
|
|
2473
2484
|
}
|
|
2474
2485
|
};
|
|
@@ -3022,8 +3033,14 @@ function blockStatus(state, id, choices = NO_CHOICES) {
|
|
|
3022
3033
|
if (isHiddenAt(state.doc, index, choices)) return "hidden";
|
|
3023
3034
|
return covers(state, id, index) ? "selected" : "plain";
|
|
3024
3035
|
}
|
|
3036
|
+
|
|
3037
|
+
// src/view/react/callout-tones.ts
|
|
3038
|
+
var CALLOUT_TONES = ["info", "tip", "success", "warning", "danger"];
|
|
3039
|
+
function calloutTone(value) {
|
|
3040
|
+
return CALLOUT_TONES.find((tone) => tone === value) ?? "info";
|
|
3041
|
+
}
|
|
3025
3042
|
var CalloutBlock = ({ block }) => {
|
|
3026
|
-
const tone =
|
|
3043
|
+
const tone = calloutTone(block.attrs.tone);
|
|
3027
3044
|
return /* @__PURE__ */ jsx("div", { className: "quoin-callout", "data-tone": tone, children: /* @__PURE__ */ jsx(EditableRegion, { block: block.id, region: "body", label: `Callout, ${tone}` }) });
|
|
3028
3045
|
};
|
|
3029
3046
|
|
|
@@ -3135,7 +3152,7 @@ var MarkdownBlock = (props) => {
|
|
|
3135
3152
|
/* @__PURE__ */ jsx(TextRegion, { block, label: "Task" })
|
|
3136
3153
|
] });
|
|
3137
3154
|
case "quote":
|
|
3138
|
-
return /* @__PURE__ */ jsx("
|
|
3155
|
+
return /* @__PURE__ */ jsx("blockquote", { className: "quoin-quote", children: /* @__PURE__ */ jsx(TextRegion, { block, label: "Quote" }) });
|
|
3139
3156
|
default:
|
|
3140
3157
|
return /* @__PURE__ */ jsx(TextRegion, { block, label: "Paragraph" });
|
|
3141
3158
|
}
|
|
@@ -3303,6 +3320,6 @@ function EditorView({
|
|
|
3303
3320
|
) });
|
|
3304
3321
|
}
|
|
3305
3322
|
|
|
3306
|
-
export { BlockErrorContext, EditableRegion, EditorView, NATIVE_INTERACTION, NODE_ENTRY, TaskCheckbox, ToggleChevron, ViewController, caretClientRect, caretFromPoint, createAutoScroll, dispatchSelection, domMapOf, domToPos, drawnBlockCount, focusOwners, handleCopy, hostKey, isComposingKey, isOnFirstLine, isOnLastLine, lineEdgeRect, listen, moveToNeighbour, neighbourBlock, onBlock, posToDom, regionInline, renderInline, textDiff, useBlockDomId, useEditorState, useIsomorphicLayoutEffect, useOrderedNumber, useQuoinEditor, useReadOnly, useRegionDomId, useToggleOpen, useViewController, visibleBlockIndexes, wholeState };
|
|
3307
|
-
//# sourceMappingURL=chunk-
|
|
3308
|
-
//# sourceMappingURL=chunk-
|
|
3323
|
+
export { BlockErrorContext, CALLOUT_TONES, EditableRegion, EditorView, NATIVE_INTERACTION, NODE_ENTRY, TaskCheckbox, ToggleChevron, ViewController, arrowAsWritten, calloutTone, caretClientRect, caretFromPoint, createAutoScroll, dispatchSelection, domMapOf, domToPos, drawnBlockCount, focusOwners, handleCopy, hostKey, inlineDirection, isComposingKey, isOnFirstLine, isOnLastLine, lineEdgeRect, listen, moveToNeighbour, neighbourBlock, onBlock, posToDom, regionInline, renderInline, textDiff, useBlockDomId, useEditorState, useIsomorphicLayoutEffect, useOrderedNumber, useQuoinEditor, useReadOnly, useRegionDomId, useToggleOpen, useViewController, visibleBlockIndexes, wholeState };
|
|
3324
|
+
//# sourceMappingURL=chunk-2BPXVQBP.js.map
|
|
3325
|
+
//# sourceMappingURL=chunk-2BPXVQBP.js.map
|