quoin-editor 2.0.2 → 2.0.3
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 +13 -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-NZFGAV3L.cjs → chunk-3B5VEXVQ.cjs} +2 -2
- package/dist/{chunk-RWSC47L7.cjs → chunk-4EJJ4ZNC.cjs} +18 -18
- package/dist/{chunk-F3BC5ITU.cjs → chunk-55MN4QZU.cjs} +8 -5
- package/dist/{chunk-TDXQSNFS.cjs → chunk-5URH2Y2L.cjs} +19 -19
- package/dist/{chunk-XLR2O4OK.js → chunk-77THE3KY.js} +5 -5
- package/dist/{chunk-XLR2O4OK.js.map → chunk-77THE3KY.js.map} +1 -1
- package/dist/{chunk-LBP64GKQ.cjs → chunk-BCCFJINI.cjs} +70 -65
- package/dist/{chunk-SE36LU6G.js → chunk-BNTRGV4A.js} +27 -10
- package/dist/chunk-BNTRGV4A.js.map +1 -0
- package/dist/{chunk-AVD2AI47.js → chunk-C4SRLMQJ.js} +3 -3
- package/dist/{chunk-AVD2AI47.js.map → chunk-C4SRLMQJ.js.map} +1 -1
- package/dist/{chunk-5VBDRJ5Y.cjs → chunk-DZ5XR4O6.cjs} +139 -117
- package/dist/{chunk-QIGZ5JAY.js → chunk-FGVTDIHT.js} +42 -19
- package/dist/chunk-FGVTDIHT.js.map +1 -0
- package/dist/{chunk-XC4WZTMY.cjs → chunk-H3TRVI44.cjs} +50 -50
- package/dist/{chunk-Z3GLEAOI.js → chunk-LCGOFL7S.js} +15 -10
- package/dist/{chunk-Z3GLEAOI.js.map → chunk-LCGOFL7S.js.map} +1 -1
- package/dist/{chunk-OBOIZ7L3.js → chunk-MDIXI7DM.js} +3 -3
- package/dist/{chunk-OBOIZ7L3.js.map → chunk-MDIXI7DM.js.map} +1 -1
- package/dist/{chunk-UKUAQJME.cjs → chunk-MGN332NY.cjs} +28 -7
- package/dist/{chunk-SHZGRFYY.cjs → chunk-NAMZA4NW.cjs} +14 -14
- package/dist/{chunk-ZHLNPNE2.js → chunk-NLRSAOCK.js} +5 -5
- package/dist/{chunk-ZHLNPNE2.js.map → chunk-NLRSAOCK.js.map} +1 -1
- package/dist/{chunk-RR67AKP6.cjs → chunk-OMUXPNCX.cjs} +27 -26
- package/dist/{chunk-DGKIKXB7.js → chunk-QVWNUUMJ.js} +3 -3
- package/dist/{chunk-DGKIKXB7.js.map → chunk-QVWNUUMJ.js.map} +1 -1
- package/dist/{chunk-4VCCGBXW.js → chunk-RNYETN6X.js} +4 -4
- package/dist/{chunk-4VCCGBXW.js.map → chunk-RNYETN6X.js.map} +1 -1
- package/dist/{chunk-YETMZ27Q.cjs → chunk-SDFJZNYB.cjs} +3 -3
- package/dist/{chunk-YYBPQ4TY.cjs → chunk-SQHEZ3JY.cjs} +2 -2
- package/dist/{chunk-JM5TRLEC.cjs → chunk-UWCU6PJY.cjs} +30 -30
- package/dist/{chunk-M7L444WV.js → chunk-VQDQBMQY.js} +4 -4
- package/dist/{chunk-M7L444WV.js.map → chunk-VQDQBMQY.js.map} +1 -1
- package/dist/{chunk-5A2MHCYI.js → chunk-WMM56LIB.js} +8 -5
- package/dist/{chunk-5A2MHCYI.js.map → chunk-WMM56LIB.js.map} +1 -1
- package/dist/{chunk-DT3ODGZ7.js → chunk-YHAVXOAA.js} +6 -5
- package/dist/chunk-YHAVXOAA.js.map +1 -0
- package/dist/{chunk-ZDNYIQKM.js → chunk-YWYTLNAO.js} +4 -4
- package/dist/{chunk-ZDNYIQKM.js.map → chunk-YWYTLNAO.js.map} +1 -1
- 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,19 @@
|
|
|
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.3 (2026-11-09)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- 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.
|
|
9
|
+
- 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.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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.
|
|
12
|
+
- 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.
|
|
13
|
+
- 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.
|
|
14
|
+
- `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.
|
|
15
|
+
- 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.
|
|
16
|
+
- 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.
|
|
17
|
+
|
|
5
18
|
## 2.0.2 (2026-11-09)
|
|
6
19
|
|
|
7
20
|
### 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 chunk3B5VEXVQ_cjs = require('./chunk-3B5VEXVQ.cjs');
|
|
6
|
+
var chunkDZ5XR4O6_cjs = require('./chunk-DZ5XR4O6.cjs');
|
|
7
|
+
var chunkMGN332NY_cjs = require('./chunk-MGN332NY.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(chunkDZ5XR4O6_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: chunkDZ5XR4O6_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: chunkDZ5XR4O6_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: chunkDZ5XR4O6_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: chunkDZ5XR4O6_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
|
+
chunkMGN332NY_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
|
+
chunkMGN332NY_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(chunkDZ5XR4O6_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(chunkDZ5XR4O6_cjs.Button, { ...primary, size: "sm", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
666
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_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(chunkDZ5XR4O6_cjs.Button, { ...primary, size: "sm", onClick: onAccept, children: labels.accept }),
|
|
672
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard }),
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_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
|
+
chunkDZ5XR4O6_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 chunkMGN332NY_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
|
+
chunkMGN332NY_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
|
+
chunkMGN332NY_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
|
+
chunkMGN332NY_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: chunkDZ5XR4O6_cjs.virtualAnchor(
|
|
854
|
+
() => chunkDZ5XR4O6_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
|
+
chunkDZ5XR4O6_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(chunkDZ5XR4O6_cjs.PopoverAnchor, { virtualRef: anchor }),
|
|
917
917
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
918
|
-
|
|
918
|
+
chunkDZ5XR4O6_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
|
+
chunkDZ5XR4O6_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: chunkDZ5XR4O6_cjs.cn(chunkDZ5XR4O6_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 } = chunkDZ5XR4O6_cjs.useQuoin();
|
|
980
980
|
const link = linkOf(controller.editor);
|
|
981
|
-
|
|
981
|
+
chunkMGN332NY_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 = chunkMGN332NY_cjs.useEditorState(controller, aiState);
|
|
986
|
+
const gone = chunkMGN332NY_cjs.useEditorState(controller, goneOf);
|
|
987
|
+
const readOnly = chunkMGN332NY_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 chunk3B5VEXVQ_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-C4SRLMQJ.js';
|
|
4
|
+
import { Sparkles, PenLine, useQuoin, Popover, PopoverAnchor, PopoverContent, Input, cn, MENU_ITEM, virtualAnchor, rangeRect, Button, toError } from './chunk-FGVTDIHT.js';
|
|
5
|
+
import { useIsomorphicLayoutEffect, useEditorState, useReadOnly, renderInline } from './chunk-BNTRGV4A.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 chunk4EJJ4ZNC_cjs = require('./chunk-4EJJ4ZNC.cjs');
|
|
5
|
+
var chunkOMUXPNCX_cjs = require('./chunk-OMUXPNCX.cjs');
|
|
6
|
+
var chunk5URH2Y2L_cjs = require('./chunk-5URH2Y2L.cjs');
|
|
7
|
+
var chunkSQHEZ3JY_cjs = require('./chunk-SQHEZ3JY.cjs');
|
|
8
8
|
require('./chunk-2SWLD6R5.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
9
|
+
var chunkBCCFJINI_cjs = require('./chunk-BCCFJINI.cjs');
|
|
10
|
+
var chunkH3TRVI44_cjs = require('./chunk-H3TRVI44.cjs');
|
|
11
|
+
var chunkUWCU6PJY_cjs = require('./chunk-UWCU6PJY.cjs');
|
|
12
|
+
require('./chunk-55MN4QZU.cjs');
|
|
13
13
|
require('./chunk-YEDPBYO5.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkSDFJZNYB_cjs = require('./chunk-SDFJZNYB.cjs');
|
|
15
|
+
var chunkNAMZA4NW_cjs = require('./chunk-NAMZA4NW.cjs');
|
|
16
16
|
require('./chunk-LM3DHROX.cjs');
|
|
17
|
-
require('./chunk-
|
|
18
|
-
require('./chunk-
|
|
17
|
+
require('./chunk-DZ5XR4O6.cjs');
|
|
18
|
+
require('./chunk-MGN332NY.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: chunkBCCFJINI_cjs.tableExtension,
|
|
36
|
+
embed: chunkH3TRVI44_cjs.embedExtension,
|
|
37
|
+
math: chunkUWCU6PJY_cjs.mathExtension,
|
|
38
|
+
diagram: chunkSDFJZNYB_cjs.diagramExtension,
|
|
39
|
+
toc: chunkNAMZA4NW_cjs.tocExtension,
|
|
40
|
+
mention: chunk4EJJ4ZNC_cjs.mentionExtension,
|
|
41
|
+
emoji: chunkOMUXPNCX_cjs.emojiExtension,
|
|
42
|
+
find: chunk5URH2Y2L_cjs.findExtension,
|
|
43
|
+
stats: chunkSQHEZ3JY_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-77THE3KY.js';
|
|
3
|
+
import { emojiExtension } from './chunk-YHAVXOAA.js';
|
|
4
|
+
import { findExtension } from './chunk-RNYETN6X.js';
|
|
5
|
+
import { statsExtension } from './chunk-QVWNUUMJ.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-LCGOFL7S.js';
|
|
8
|
+
import { embedExtension } from './chunk-VQDQBMQY.js';
|
|
9
|
+
import { mathExtension } from './chunk-NLRSAOCK.js';
|
|
10
|
+
import './chunk-WMM56LIB.js';
|
|
11
11
|
import './chunk-LSI4RMTY.js';
|
|
12
|
-
import { diagramExtension } from './chunk-
|
|
13
|
-
import { tocExtension } from './chunk-
|
|
12
|
+
import { diagramExtension } from './chunk-MDIXI7DM.js';
|
|
13
|
+
import { tocExtension } from './chunk-YWYTLNAO.js';
|
|
14
14
|
import './chunk-DBOZFNWU.js';
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
15
|
+
import './chunk-FGVTDIHT.js';
|
|
16
|
+
import './chunk-BNTRGV4A.js';
|
|
17
17
|
import './chunk-DLQCTGC3.js';
|
|
18
18
|
import './chunk-HDJ653LM.js';
|
|
19
19
|
import './chunk-5RBMZGKV.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMGN332NY_cjs = require('./chunk-MGN332NY.cjs');
|
|
4
4
|
|
|
5
5
|
// src/extensions/canvas-focus.ts
|
|
6
6
|
function ownsNode(controller, node) {
|
|
7
|
-
const owner =
|
|
7
|
+
const owner = chunkMGN332NY_cjs.focusOwners.get(node);
|
|
8
8
|
return owner ? owner === controller : !!controller.root?.contains(node);
|
|
9
9
|
}
|
|
10
10
|
function watchCanvasFocus(controller, doc, listener) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk55MN4QZU_cjs = require('./chunk-55MN4QZU.cjs');
|
|
4
4
|
var chunkLM3DHROX_cjs = require('./chunk-LM3DHROX.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkDZ5XR4O6_cjs = require('./chunk-DZ5XR4O6.cjs');
|
|
6
|
+
var chunkMGN332NY_cjs = require('./chunk-MGN332NY.cjs');
|
|
7
7
|
var chunkZWTIRGY5_cjs = require('./chunk-ZWTIRGY5.cjs');
|
|
8
8
|
var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
|
|
9
9
|
var react = require('react');
|
|
@@ -48,7 +48,7 @@ var mentionAndSpace = ({ id, label, kind }) => (state, dispatch) => {
|
|
|
48
48
|
return ok;
|
|
49
49
|
};
|
|
50
50
|
function chooseMention(controller, result, range) {
|
|
51
|
-
|
|
51
|
+
chunkDZ5XR4O6_cjs.replaceTrigger(controller, range, mentionAndSpace(result));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// src/extensions/mention/mention-results.ts
|
|
@@ -97,7 +97,7 @@ function createMentionSource({ search, isAsked, onError }) {
|
|
|
97
97
|
new Promise((answer) => answer(search(query))).then(
|
|
98
98
|
(answer) => answered(mentionResults(answer)),
|
|
99
99
|
(reason) => {
|
|
100
|
-
onError(
|
|
100
|
+
onError(chunkDZ5XR4O6_cjs.toError(reason));
|
|
101
101
|
answered([]);
|
|
102
102
|
}
|
|
103
103
|
);
|
|
@@ -113,7 +113,7 @@ function useCloseOnSpace(controller, foundNothing) {
|
|
|
113
113
|
const onBeforeInput = (event) => {
|
|
114
114
|
if (event.inputType !== "insertText" || event.isComposing || !STARTS_WITH_SPACE.test(event.data ?? "")) return;
|
|
115
115
|
const query = chunkFK7EBZPX_cjs.getPluginState(controller.editor.state, mentionKey).active?.query;
|
|
116
|
-
if (query === "" || query !== void 0 && foundNothing(query)) controller.run(
|
|
116
|
+
if (query === "" || query !== void 0 && foundNothing(query)) controller.run(chunkDZ5XR4O6_cjs.dismissSuggestion(mentionKey));
|
|
117
117
|
};
|
|
118
118
|
root.addEventListener("beforeinput", onBeforeInput, true);
|
|
119
119
|
return () => root.removeEventListener("beforeinput", onBeforeInput, true);
|
|
@@ -143,10 +143,10 @@ function MentionItem({ result }) {
|
|
|
143
143
|
}
|
|
144
144
|
var renderItem = (result) => /* @__PURE__ */ jsxRuntime.jsx(MentionItem, { result });
|
|
145
145
|
function MentionMenu({ controller, labels, search }) {
|
|
146
|
-
const { onError } =
|
|
146
|
+
const { onError } = chunkDZ5XR4O6_cjs.useQuoin();
|
|
147
147
|
const latest = react.useRef({ search, onError });
|
|
148
148
|
const mounted = react.useRef(false);
|
|
149
|
-
|
|
149
|
+
chunkMGN332NY_cjs.useIsomorphicLayoutEffect(() => {
|
|
150
150
|
latest.current = { search, onError };
|
|
151
151
|
});
|
|
152
152
|
const mentions = react.useMemo(
|
|
@@ -172,7 +172,7 @@ function MentionMenu({ controller, labels, search }) {
|
|
|
172
172
|
[controller]
|
|
173
173
|
);
|
|
174
174
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
-
|
|
175
|
+
chunkDZ5XR4O6_cjs.SuggestionMenu,
|
|
176
176
|
{
|
|
177
177
|
controller,
|
|
178
178
|
pluginKey: mentionKey,
|
|
@@ -192,12 +192,12 @@ function useMentionOpening(controller, onOpen, editable) {
|
|
|
192
192
|
if (onOpen === void 0 || root === null) return;
|
|
193
193
|
const onClick = (event) => {
|
|
194
194
|
const once = !event.shiftKey && event.detail <= 1;
|
|
195
|
-
const place = once ?
|
|
195
|
+
const place = once ? chunk55MN4QZU_cjs.atomAtTarget(controller, event.target, MENTION_ATOMS) : null;
|
|
196
196
|
if (place !== null) onOpen(mentionOf(place.node));
|
|
197
197
|
};
|
|
198
198
|
const intercept = (event) => {
|
|
199
|
-
if (!
|
|
200
|
-
const place =
|
|
199
|
+
if (!chunk55MN4QZU_cjs.plainEnter(event) || chunkMGN332NY_cjs.isComposingKey(controller, event)) return false;
|
|
200
|
+
const place = chunk55MN4QZU_cjs.selectedAtom(controller.editor.state, MENTION_ATOMS);
|
|
201
201
|
if (place === null) return false;
|
|
202
202
|
event.preventDefault();
|
|
203
203
|
onOpen(mentionOf(place.node));
|
|
@@ -232,7 +232,7 @@ function useReadOnlyChips(controller, onOpen, readOnly) {
|
|
|
232
232
|
const observer = new MutationObserver(() => setButtons(root, true));
|
|
233
233
|
observer.observe(root, { childList: true, subtree: true });
|
|
234
234
|
const onKeyDown = (event) => {
|
|
235
|
-
const place = opensChip(event) ?
|
|
235
|
+
const place = opensChip(event) ? chunk55MN4QZU_cjs.atomAtTarget(controller, event.target, MENTION_ATOMS) : null;
|
|
236
236
|
if (place === null) return;
|
|
237
237
|
event.preventDefault();
|
|
238
238
|
onOpen(mentionOf(place.node));
|
|
@@ -246,10 +246,10 @@ function useReadOnlyChips(controller, onOpen, readOnly) {
|
|
|
246
246
|
}, [controller, onOpen, readOnly]);
|
|
247
247
|
}
|
|
248
248
|
function MentionOverlay({ controller, feature }) {
|
|
249
|
-
const readOnly =
|
|
249
|
+
const readOnly = chunkMGN332NY_cjs.useReadOnly(controller);
|
|
250
250
|
useMentionOpening(controller, feature.onOpen, !readOnly);
|
|
251
251
|
useReadOnlyChips(controller, feature.onOpen, readOnly);
|
|
252
|
-
|
|
252
|
+
chunk55MN4QZU_cjs.useSelectionOutOfAtoms(controller, MENTION_ATOMS, !readOnly);
|
|
253
253
|
if (feature.search === void 0) return null;
|
|
254
254
|
return /* @__PURE__ */ jsxRuntime.jsx(MentionMenu, { controller, labels: feature.labels, search: feature.search });
|
|
255
255
|
}
|
|
@@ -262,9 +262,9 @@ function mentionExtension(options = {}) {
|
|
|
262
262
|
return chunkFK7EBZPX_cjs.defineExtension({
|
|
263
263
|
name: "mention",
|
|
264
264
|
priority: ABOVE_CORE_KEYS,
|
|
265
|
-
plugins: search === void 0 ? [] : [
|
|
266
|
-
keymap:
|
|
267
|
-
decorations:
|
|
265
|
+
plugins: search === void 0 ? [] : [chunkDZ5XR4O6_cjs.suggestionPlugin(mentionKey, { char: "@", allowSpaces: true })],
|
|
266
|
+
keymap: chunk55MN4QZU_cjs.atomKeymap(MENTION_ATOMS),
|
|
267
|
+
decorations: chunk55MN4QZU_cjs.selectedAtomDecorations(MENTION_ATOMS),
|
|
268
268
|
ui
|
|
269
269
|
});
|
|
270
270
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMGN332NY_cjs = require('./chunk-MGN332NY.cjs');
|
|
4
4
|
var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
|
|
5
5
|
var chunkI7X7B3WD_cjs = require('./chunk-I7X7B3WD.cjs');
|
|
6
6
|
var react = require('react');
|
|
@@ -91,7 +91,7 @@ function follows(atom, { node, offset }) {
|
|
|
91
91
|
}
|
|
92
92
|
function mapOf(atom, hostOf) {
|
|
93
93
|
const host = hostOf(atom);
|
|
94
|
-
return host === null ? void 0 :
|
|
94
|
+
return host === null ? void 0 : chunkMGN332NY_cjs.domMapOf(host);
|
|
95
95
|
}
|
|
96
96
|
function beside(atom, after, hostOf) {
|
|
97
97
|
const map = mapOf(atom, hostOf);
|
|
@@ -141,11 +141,14 @@ function useSelectionOutOfAtoms(controller, types, editable) {
|
|
|
141
141
|
if (selection === null || controller.composingKey !== null) return;
|
|
142
142
|
if (root.contains(root.ownerDocument.activeElement)) moveSelectionOutOfAtoms(selection, hostOf, types);
|
|
143
143
|
};
|
|
144
|
+
const onKeyDown = (event) => {
|
|
145
|
+
if (!chunkMGN332NY_cjs.isComposingKey(controller, event)) moveOut();
|
|
146
|
+
};
|
|
144
147
|
view.addEventListener("selectionchange", moveOut, true);
|
|
145
|
-
root.addEventListener("keydown",
|
|
148
|
+
root.addEventListener("keydown", onKeyDown, true);
|
|
146
149
|
return () => {
|
|
147
150
|
view.removeEventListener("selectionchange", moveOut, true);
|
|
148
|
-
root.removeEventListener("keydown",
|
|
151
|
+
root.removeEventListener("keydown", onKeyDown, true);
|
|
149
152
|
};
|
|
150
153
|
}, [controller, types, editable]);
|
|
151
154
|
}
|
|
@@ -155,7 +158,7 @@ function atomAtTarget(controller, target, types) {
|
|
|
155
158
|
const element = target?.closest?.("[data-quoin-atom]");
|
|
156
159
|
if (!element) return null;
|
|
157
160
|
const host = controller.registry.locate(element);
|
|
158
|
-
const offset = host === null ? null :
|
|
161
|
+
const offset = host === null ? null : chunkMGN332NY_cjs.domMapOf(host.element)?.fromDom(element, 0);
|
|
159
162
|
if (host === null || offset === null || offset === void 0) return null;
|
|
160
163
|
return atomPlaceAt(controller.editor.state, { block: host.block, region: host.region, offset }, types);
|
|
161
164
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDZ5XR4O6_cjs = require('./chunk-DZ5XR4O6.cjs');
|
|
4
|
+
var chunkMGN332NY_cjs = require('./chunk-MGN332NY.cjs');
|
|
5
5
|
var chunkZWTIRGY5_cjs = require('./chunk-ZWTIRGY5.cjs');
|
|
6
6
|
var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
|
|
7
7
|
var chunkI7X7B3WD_cjs = require('./chunk-I7X7B3WD.cjs');
|
|
@@ -338,15 +338,15 @@ function FindStatus({ labels, value }) {
|
|
|
338
338
|
] });
|
|
339
339
|
}
|
|
340
340
|
var TOGGLES = [
|
|
341
|
-
{ option: "caseSensitive", label: "matchCase", icon:
|
|
342
|
-
{ option: "wholeWord", label: "wholeWord", icon:
|
|
343
|
-
{ option: "regex", label: "regularExpression", icon:
|
|
341
|
+
{ option: "caseSensitive", label: "matchCase", icon: chunkDZ5XR4O6_cjs.CaseSensitive },
|
|
342
|
+
{ option: "wholeWord", label: "wholeWord", icon: chunkDZ5XR4O6_cjs.WholeWord },
|
|
343
|
+
{ option: "regex", label: "regularExpression", icon: chunkDZ5XR4O6_cjs.Regex }
|
|
344
344
|
];
|
|
345
345
|
function FindToggles({ labels, options, onToggle }) {
|
|
346
346
|
return TOGGLES.map(({ option, label, icon: Icon }) => {
|
|
347
347
|
const name = labels[label];
|
|
348
348
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
349
|
-
|
|
349
|
+
chunkDZ5XR4O6_cjs.Button,
|
|
350
350
|
{
|
|
351
351
|
type: "button",
|
|
352
352
|
variant: "ghost",
|
|
@@ -368,7 +368,7 @@ function useFindShortcut(controller) {
|
|
|
368
368
|
const root = controller.root;
|
|
369
369
|
if (root === null) return;
|
|
370
370
|
const onKeyDown = (event) => {
|
|
371
|
-
if (
|
|
371
|
+
if (chunkMGN332NY_cjs.isComposingKey(controller, event) || !isFindShortcut(event, controller.isMac)) return;
|
|
372
372
|
event.preventDefault();
|
|
373
373
|
const { editor } = controller;
|
|
374
374
|
openFind(editor.state, (tr) => editor.dispatch(tr));
|
|
@@ -447,7 +447,7 @@ function FindPanel({ controller, labels, value, readOnly }) {
|
|
|
447
447
|
children: [
|
|
448
448
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
449
449
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
450
|
-
|
|
450
|
+
chunkDZ5XR4O6_cjs.Input,
|
|
451
451
|
{
|
|
452
452
|
ref: query,
|
|
453
453
|
"aria-label": labels.find,
|
|
@@ -462,7 +462,7 @@ function FindPanel({ controller, labels, value, readOnly }) {
|
|
|
462
462
|
/* @__PURE__ */ jsxRuntime.jsx(FindStatus, { labels, value }),
|
|
463
463
|
/* @__PURE__ */ jsxRuntime.jsx(FindToggles, { labels, options: value.search, onToggle: actions.toggle }),
|
|
464
464
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
-
|
|
465
|
+
chunkDZ5XR4O6_cjs.Button,
|
|
466
466
|
{
|
|
467
467
|
type: "button",
|
|
468
468
|
variant: "ghost",
|
|
@@ -470,11 +470,11 @@ function FindPanel({ controller, labels, value, readOnly }) {
|
|
|
470
470
|
"aria-label": labels.previousMatch,
|
|
471
471
|
title: labels.previousMatch,
|
|
472
472
|
onClick: () => actions.step(-1),
|
|
473
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
473
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_cjs.ChevronUp, { "aria-hidden": true })
|
|
474
474
|
}
|
|
475
475
|
),
|
|
476
476
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
477
|
-
|
|
477
|
+
chunkDZ5XR4O6_cjs.Button,
|
|
478
478
|
{
|
|
479
479
|
type: "button",
|
|
480
480
|
variant: "ghost",
|
|
@@ -482,11 +482,11 @@ function FindPanel({ controller, labels, value, readOnly }) {
|
|
|
482
482
|
"aria-label": labels.nextMatch,
|
|
483
483
|
title: labels.nextMatch,
|
|
484
484
|
onClick: () => actions.step(1),
|
|
485
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
485
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_cjs.ChevronDown, { "aria-hidden": true })
|
|
486
486
|
}
|
|
487
487
|
),
|
|
488
488
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
489
|
-
|
|
489
|
+
chunkDZ5XR4O6_cjs.Button,
|
|
490
490
|
{
|
|
491
491
|
type: "button",
|
|
492
492
|
variant: "ghost",
|
|
@@ -494,13 +494,13 @@ function FindPanel({ controller, labels, value, readOnly }) {
|
|
|
494
494
|
"aria-label": labels.close,
|
|
495
495
|
title: labels.close,
|
|
496
496
|
onClick: actions.close,
|
|
497
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
497
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_cjs.X, { "aria-hidden": true })
|
|
498
498
|
}
|
|
499
499
|
)
|
|
500
500
|
] }),
|
|
501
501
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
502
502
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
503
|
-
|
|
503
|
+
chunkDZ5XR4O6_cjs.Input,
|
|
504
504
|
{
|
|
505
505
|
"aria-label": labels.replaceWith,
|
|
506
506
|
placeholder: labels.replaceWith,
|
|
@@ -510,16 +510,16 @@ function FindPanel({ controller, labels, value, readOnly }) {
|
|
|
510
510
|
className: "h-8 w-48"
|
|
511
511
|
}
|
|
512
512
|
),
|
|
513
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
514
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
513
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_cjs.Button, { type: "button", variant: "outline", size: "sm", onClick: () => actions.replace(replacement), children: labels.replace }),
|
|
514
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkDZ5XR4O6_cjs.Button, { type: "button", variant: "outline", size: "sm", onClick: () => actions.replaceAll(replacement), children: labels.replaceAll })
|
|
515
515
|
] })
|
|
516
516
|
]
|
|
517
517
|
}
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
520
|
function FindOverlay({ controller, labels }) {
|
|
521
|
-
const readOnly =
|
|
522
|
-
const value =
|
|
521
|
+
const readOnly = chunkMGN332NY_cjs.useReadOnly(controller);
|
|
522
|
+
const value = chunkMGN332NY_cjs.useEditorState(
|
|
523
523
|
controller,
|
|
524
524
|
react.useCallback((state) => chunkFK7EBZPX_cjs.getPluginState(state, findKey), [])
|
|
525
525
|
);
|