quoin-editor 1.1.1 → 1.2.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 +25 -0
- package/dist/ai.cjs +78 -78
- package/dist/ai.js +6 -6
- package/dist/catalogue.cjs +24 -24
- package/dist/catalogue.js +16 -16
- package/dist/{chunk-DYWU4SQ2.js → chunk-3BCP6ZUM.js} +5 -6
- package/dist/chunk-3BCP6ZUM.js.map +1 -0
- package/dist/{chunk-L4D23LM2.js → chunk-4EU4BTLZ.js} +82 -34
- package/dist/chunk-4EU4BTLZ.js.map +1 -0
- package/dist/{chunk-VFSVN5IQ.cjs → chunk-4F2IWBFM.cjs} +294 -244
- package/dist/chunk-4F2IWBFM.cjs.map +1 -0
- package/dist/{chunk-HQ43EIYO.cjs → chunk-4T4TJ2QS.cjs} +9 -9
- package/dist/{chunk-HQ43EIYO.cjs.map → chunk-4T4TJ2QS.cjs.map} +1 -1
- package/dist/{chunk-7XQGOCUG.cjs → chunk-6X5A4DUQ.cjs} +290 -291
- package/dist/chunk-6X5A4DUQ.cjs.map +1 -0
- package/dist/{chunk-7FAVFJAS.js → chunk-AD3NY7NA.js} +3 -3
- package/dist/{chunk-7FAVFJAS.js.map → chunk-AD3NY7NA.js.map} +1 -1
- package/dist/{chunk-L6OW2FL3.js → chunk-BJTOLCRR.js} +84 -10
- package/dist/chunk-BJTOLCRR.js.map +1 -0
- package/dist/{chunk-HTLWPSMU.js → chunk-BKEHG4QV.js} +4 -4
- package/dist/{chunk-HTLWPSMU.js.map → chunk-BKEHG4QV.js.map} +1 -1
- package/dist/{chunk-7SVKLWDT.cjs → chunk-BM2GRZNM.cjs} +47 -43
- package/dist/chunk-BM2GRZNM.cjs.map +1 -0
- package/dist/{chunk-2EQ6FKSK.js → chunk-BXSWZEA5.js} +3 -3
- package/dist/{chunk-2EQ6FKSK.js.map → chunk-BXSWZEA5.js.map} +1 -1
- package/dist/{chunk-3BXUGX5F.js → chunk-CSKKSXCE.js} +38 -31
- package/dist/chunk-CSKKSXCE.js.map +1 -0
- package/dist/{chunk-U5BSCAMP.cjs → chunk-EQKFQK3C.cjs} +13 -13
- package/dist/{chunk-U5BSCAMP.cjs.map → chunk-EQKFQK3C.cjs.map} +1 -1
- package/dist/{chunk-TYZSB7JT.js → chunk-GHNQKJMD.js} +3 -3
- package/dist/{chunk-TYZSB7JT.js.map → chunk-GHNQKJMD.js.map} +1 -1
- package/dist/{chunk-RIIXJWBR.cjs → chunk-H3C3MJW5.cjs} +4 -4
- package/dist/{chunk-RIIXJWBR.cjs.map → chunk-H3C3MJW5.cjs.map} +1 -1
- package/dist/{chunk-UEVR4B5S.js → chunk-I4CSCA3O.js} +6 -6
- package/dist/{chunk-UEVR4B5S.js.map → chunk-I4CSCA3O.js.map} +1 -1
- package/dist/{chunk-SFMORPWB.js → chunk-I4NEX6SZ.js} +7 -7
- package/dist/{chunk-SFMORPWB.js.map → chunk-I4NEX6SZ.js.map} +1 -1
- package/dist/{chunk-L2QA2UTY.js → chunk-IHTHOAUY.js} +7 -7
- package/dist/{chunk-L2QA2UTY.js.map → chunk-IHTHOAUY.js.map} +1 -1
- package/dist/{chunk-KXRGY5LK.cjs → chunk-IQ2DE3Y3.cjs} +90 -90
- package/dist/{chunk-KXRGY5LK.cjs.map → chunk-IQ2DE3Y3.cjs.map} +1 -1
- package/dist/{chunk-W7B4WQ3L.cjs → chunk-K7E2DR5W.cjs} +24 -24
- package/dist/{chunk-W7B4WQ3L.cjs.map → chunk-K7E2DR5W.cjs.map} +1 -1
- package/dist/{chunk-QSXPKZ2F.js → chunk-KIU5MPZ4.js} +3 -3
- package/dist/{chunk-QSXPKZ2F.js.map → chunk-KIU5MPZ4.js.map} +1 -1
- package/dist/{chunk-MUIPM26J.js → chunk-MEXDDWJF.js} +6 -6
- package/dist/{chunk-MUIPM26J.js.map → chunk-MEXDDWJF.js.map} +1 -1
- package/dist/{chunk-IGZRZIAF.cjs → chunk-NNDLIP2C.cjs} +161 -136
- package/dist/chunk-NNDLIP2C.cjs.map +1 -0
- package/dist/{chunk-CKHKCPGL.js → chunk-OWX3Y5UU.js} +6 -6
- package/dist/{chunk-CKHKCPGL.js.map → chunk-OWX3Y5UU.js.map} +1 -1
- package/dist/{chunk-WAGBELKA.js → chunk-PMJ3VCSR.js} +5 -5
- package/dist/{chunk-WAGBELKA.js.map → chunk-PMJ3VCSR.js.map} +1 -1
- package/dist/{chunk-IEP7BPFN.js → chunk-PVCXTSUO.js} +49 -24
- package/dist/chunk-PVCXTSUO.js.map +1 -0
- package/dist/{chunk-7NAONESM.cjs → chunk-R45RJQRD.cjs} +31 -31
- package/dist/{chunk-7NAONESM.cjs.map → chunk-R45RJQRD.cjs.map} +1 -1
- package/dist/{chunk-VNRI5DAL.cjs → chunk-RENKFSFD.cjs} +28 -28
- package/dist/{chunk-VNRI5DAL.cjs.map → chunk-RENKFSFD.cjs.map} +1 -1
- package/dist/{chunk-KZ6ZFCGO.js → chunk-TG5T7BEJ.js} +8 -8
- package/dist/{chunk-KZ6ZFCGO.js.map → chunk-TG5T7BEJ.js.map} +1 -1
- package/dist/{chunk-WH56EW3H.cjs → chunk-TLMO46OV.cjs} +15 -15
- package/dist/{chunk-WH56EW3H.cjs.map → chunk-TLMO46OV.cjs.map} +1 -1
- package/dist/{chunk-XAS7LANM.cjs → chunk-TN32PKUI.cjs} +98 -98
- package/dist/{chunk-XAS7LANM.cjs.map → chunk-TN32PKUI.cjs.map} +1 -1
- package/dist/{chunk-JCEFSTVG.cjs → chunk-TWFMNDOC.cjs} +55 -55
- package/dist/{chunk-JCEFSTVG.cjs.map → chunk-TWFMNDOC.cjs.map} +1 -1
- package/dist/{chunk-OKWER2RV.cjs → chunk-UHAAYYMX.cjs} +45 -45
- package/dist/{chunk-OKWER2RV.cjs.map → chunk-UHAAYYMX.cjs.map} +1 -1
- package/dist/{chunk-EFRQMYZ6.cjs → chunk-UMTKQVOX.cjs} +4 -4
- package/dist/{chunk-EFRQMYZ6.cjs.map → chunk-UMTKQVOX.cjs.map} +1 -1
- package/dist/{chunk-OM7E43ZN.cjs → chunk-VNRBCUBV.cjs} +15 -15
- package/dist/{chunk-OM7E43ZN.cjs.map → chunk-VNRBCUBV.cjs.map} +1 -1
- package/dist/{chunk-RFLFRIPV.js → chunk-WCAUPASG.js} +6 -6
- package/dist/{chunk-RFLFRIPV.js.map → chunk-WCAUPASG.js.map} +1 -1
- package/dist/{chunk-AIS37SL2.cjs → chunk-WZA5S5EJ.cjs} +84 -9
- package/dist/chunk-WZA5S5EJ.cjs.map +1 -0
- package/dist/{chunk-VBJY2CSK.js → chunk-X4FDLUXJ.js} +6 -6
- package/dist/{chunk-VBJY2CSK.js.map → chunk-X4FDLUXJ.js.map} +1 -1
- package/dist/{chunk-3QRVAI53.cjs → chunk-XZ4NC3Q7.cjs} +6 -6
- package/dist/{chunk-3QRVAI53.cjs.map → chunk-XZ4NC3Q7.cjs.map} +1 -1
- package/dist/comments.cjs +58 -58
- package/dist/comments.js +7 -7
- package/dist/diff.cjs +29 -32
- package/dist/diff.cjs.map +1 -1
- package/dist/diff.js +8 -11
- package/dist/diff.js.map +1 -1
- package/dist/docx.cjs +30 -30
- package/dist/docx.js +3 -3
- package/dist/embed.cjs +9 -9
- package/dist/embed.js +7 -7
- package/dist/emoji.cjs +9 -9
- package/dist/emoji.js +6 -6
- package/dist/engine.cjs +58 -58
- package/dist/engine.d.cts +4 -1
- package/dist/engine.d.ts +4 -1
- package/dist/engine.js +3 -3
- package/dist/find.cjs +10 -10
- package/dist/find.js +6 -6
- package/dist/headless.cjs +74 -74
- package/dist/headless.js +4 -4
- package/dist/index.cjs +86 -86
- package/dist/index.js +5 -5
- package/dist/math.cjs +10 -10
- package/dist/math.js +8 -8
- package/dist/mention.cjs +10 -10
- package/dist/mention.js +8 -8
- package/dist/presence.cjs +38 -38
- package/dist/presence.js +7 -7
- package/dist/stats.cjs +10 -10
- package/dist/stats.js +7 -7
- package/dist/table.cjs +25 -25
- package/dist/table.js +6 -6
- package/dist/toc.cjs +9 -9
- package/dist/toc.js +6 -6
- package/dist/view.cjs +4 -4
- package/dist/view.js +2 -2
- package/dist/yjs.cjs +125 -120
- package/dist/yjs.cjs.map +1 -1
- package/dist/yjs.js +11 -6
- package/dist/yjs.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3BXUGX5F.js.map +0 -1
- package/dist/chunk-7SVKLWDT.cjs.map +0 -1
- package/dist/chunk-7XQGOCUG.cjs.map +0 -1
- package/dist/chunk-AIS37SL2.cjs.map +0 -1
- package/dist/chunk-DYWU4SQ2.js.map +0 -1
- package/dist/chunk-IEP7BPFN.js.map +0 -1
- package/dist/chunk-IGZRZIAF.cjs.map +0 -1
- package/dist/chunk-L4D23LM2.js.map +0 -1
- package/dist/chunk-L6OW2FL3.js.map +0 -1
- package/dist/chunk-VFSVN5IQ.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
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 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
|
+
## 1.2.0 (2026-10-31)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- An extension's `priority` means one thing for blocks, marks, atoms, keys and commands: the higher wins. A block, mark or atom spec from an extension at a lower priority than another extension, core included, no longer replaces it, where the lower priority won for schema entries and the higher for keys and commands. Extensions at the default priority resolve as before. `priority` is now described in the extensions docs.
|
|
9
|
+
- Undo separates edits made in two places: typing at the start of a block and then at its end within the grouping delay is two undo steps, as it is in a collaboration, and a caret that lands where the last edit ended still groups. Undoing a formatting change no longer collapses positions inside the range, so collaborators' carets, highlights and comment ranges stay where they were.
|
|
10
|
+
- Undoing formatting is now a step of a new kind, `restoreMarks`, in step JSON; a host that relays steps between clients of different versions needs the same version on both ends, as older versions cannot read it. This is the one change to the step wire format.
|
|
11
|
+
- A legacy block beside a real block named like one of its derived ids, such as `a` beside `a-2`, is diffed under the same ids the editor gives its pieces, so the diff no longer reports a deletion, a change and an insertion for an unchanged document.
|
|
12
|
+
- A codec that has loaded a document with such a real block gives the same ids to a later document without it as a new codec does.
|
|
13
|
+
- Typing right after a local change that is not recorded and moves no text, such as opening a toggle or an upload result filling an image, is its own undo step instead of joining the step before it. A remote or reconciled change of that kind leaves the step open.
|
|
14
|
+
- `diffBlocks` reports the word changes of a block that moved and was edited: its `insert` now holds a `change`, as an edited block in place is reported. `QuoinDiff` showed them already and is unchanged.
|
|
15
|
+
- A change inside Chinese, Japanese or Thai text, written without spaces, marks only the changed words where the runtime has `Intl.Segmenter`, where it marked the whole run.
|
|
16
|
+
- Diffing two versions that differ in more than 2,000 blocks, or two texts in more than 2,000 words, reports the older version as deleted and the newer as inserted, whole and with no block marked as moved, so the time and memory stay bounded: two documents of 5,000 blocks with nothing in common diff in a fraction of a second, where it took seconds and hundreds of megabytes.
|
|
17
|
+
- On a read-only canvas whose text a page translator or another script rewrote, a drag across blocks no longer throws on every pointer move.
|
|
18
|
+
- Text a script or a browser extension rewrites in one block while a composition runs in another reaches the document when the composition ends, where the document kept the old text while the page showed the new one.
|
|
19
|
+
- Command with Up or Down on a Mac, and Control with Home or End elsewhere, go to the start or the end of the document, where they stopped at the edge of the block. These keys also leave a selected divider, image or other block for that edge, where on a Mac Command with Up or Down did nothing. Shift with Control+Home or Control+End extends the selection there; on a Mac, Command with Shift and Up or Down moves the block where it can, and extends the selection to the edge where it cannot, such as in the first block. Shift with Up or Down across blocks keeps the caret's horizontal position, where it kept the character offset and drifted sideways between a heading and a paragraph.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- `BlockCodec.toEngineBlocks(block, taken?)` takes the ids of the other blocks of the document, so the ids it gives the pieces of a legacy block avoid theirs.
|
|
23
|
+
|
|
24
|
+
## 1.1.2 (2026-10-30)
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- A block whose content returns to what was stored is reported as the stored object, whether by undo or by retyping, so `getBlocks()` and `onChange` give back the host's own object. A block written in a legacy form, such as `*old style*`, is not rewritten as `_old style_`, and an intact 0.4 multi-paragraph group is emitted as the original block.
|
|
28
|
+
- A mark that spans more of the text is written outside the marks it contains, so nested emphasis such as `_a **b** c_` is stored without HTML tags in more cases. Inline code stays innermost.
|
|
29
|
+
|
|
5
30
|
## 1.1.1 (2026-10-29)
|
|
6
31
|
|
|
7
32
|
### Fixed
|
package/dist/ai.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkLE5XMIFJ_cjs = require('./chunk-LE5XMIFJ.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkUMTKQVOX_cjs = require('./chunk-UMTKQVOX.cjs');
|
|
6
|
+
var chunk6X5A4DUQ_cjs = require('./chunk-6X5A4DUQ.cjs');
|
|
7
|
+
var chunkNNDLIP2C_cjs = require('./chunk-NNDLIP2C.cjs');
|
|
8
8
|
require('./chunk-A6PGQVTR.cjs');
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
11
|
-
var
|
|
9
|
+
var chunk4F2IWBFM_cjs = require('./chunk-4F2IWBFM.cjs');
|
|
10
|
+
require('./chunk-BM2GRZNM.cjs');
|
|
11
|
+
var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
|
|
12
12
|
var lucideReact = require('lucide-react');
|
|
13
13
|
var react = require('react');
|
|
14
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -110,30 +110,30 @@ function closeStreaming(markdown) {
|
|
|
110
110
|
// src/extensions/ai/ai-target.ts
|
|
111
111
|
function targetOfBlocks(state, ids) {
|
|
112
112
|
const { doc, schema } = state;
|
|
113
|
-
const first =
|
|
114
|
-
const last =
|
|
113
|
+
const first = chunkWZA5S5EJ_cjs.blockById(doc, ids[0]);
|
|
114
|
+
const last = chunkWZA5S5EJ_cjs.blockById(doc, ids[ids.length - 1]);
|
|
115
115
|
if (first === void 0 || last === void 0) return null;
|
|
116
|
-
const start =
|
|
117
|
-
const end =
|
|
116
|
+
const start = chunk4F2IWBFM_cjs.primaryRegion(schema, first);
|
|
117
|
+
const end = chunk4F2IWBFM_cjs.primaryRegion(schema, last);
|
|
118
118
|
if (start === null || end === null) return null;
|
|
119
119
|
const from = { block: first.id, region: start, offset: 0 };
|
|
120
|
-
return { from, to: { block: last.id, region: end, offset:
|
|
120
|
+
return { from, to: { block: last.id, region: end, offset: chunk4F2IWBFM_cjs.regionLength(last, end) }, selected: ids.length > 1 };
|
|
121
121
|
}
|
|
122
122
|
function targetOfSelection(state) {
|
|
123
123
|
const { doc, selection } = state;
|
|
124
124
|
if (selection === null) return null;
|
|
125
|
-
if (selection.kind !== "text") return targetOfBlocks(state,
|
|
126
|
-
const { from, to } =
|
|
127
|
-
if (
|
|
125
|
+
if (selection.kind !== "text") return targetOfBlocks(state, chunk4F2IWBFM_cjs.selectedBlockIds(doc, selection));
|
|
126
|
+
const { from, to } = chunk4F2IWBFM_cjs.orderedRange(doc, selection.anchor, selection.head);
|
|
127
|
+
if (chunk4F2IWBFM_cjs.comparePos(doc, from, to) !== 0) return { from, to, selected: true };
|
|
128
128
|
const block = doc.blocks[doc.index.get(from.block)];
|
|
129
129
|
const whole = { block: from.block, region: from.region };
|
|
130
|
-
return { from: { ...whole, offset: 0 }, to: { ...whole, offset:
|
|
130
|
+
return { from: { ...whole, offset: 0 }, to: { ...whole, offset: chunk4F2IWBFM_cjs.regionLength(block, from.region) }, selected: false };
|
|
131
131
|
}
|
|
132
132
|
function nearestKept(tr, target) {
|
|
133
133
|
const { doc } = tr.before;
|
|
134
134
|
const first = doc.index.get(target.from.block) ?? 0;
|
|
135
135
|
const last = doc.index.get(target.to.block) ?? first;
|
|
136
|
-
const kept = (block) => block &&
|
|
136
|
+
const kept = (block) => block && chunkWZA5S5EJ_cjs.blockById(tr.doc, block.id);
|
|
137
137
|
for (let step = 1; first - step >= 0 || last + step < doc.blocks.length; step++) {
|
|
138
138
|
const found = kept(doc.blocks[first - step]) ?? kept(doc.blocks[last + step]);
|
|
139
139
|
if (found) return found;
|
|
@@ -142,10 +142,10 @@ function nearestKept(tr, target) {
|
|
|
142
142
|
}
|
|
143
143
|
function edgeOf(tr, target) {
|
|
144
144
|
const point = tr.mapPos(target.from, -1);
|
|
145
|
-
const block =
|
|
145
|
+
const block = chunkWZA5S5EJ_cjs.blockById(tr.doc, point.block) ?? nearestKept(tr, target);
|
|
146
146
|
if (block === void 0) return null;
|
|
147
|
-
const region =
|
|
148
|
-
const length = region === "" ? 0 :
|
|
147
|
+
const region = chunk4F2IWBFM_cjs.primaryRegion(tr.before.schema, block) ?? "";
|
|
148
|
+
const length = region === "" ? 0 : chunk4F2IWBFM_cjs.regionLength(block, region);
|
|
149
149
|
const offset = block.id === point.block ? Math.min(point.offset, length) : length;
|
|
150
150
|
const after = offset > 0 || length === 0;
|
|
151
151
|
const at = { block: block.id, region, offset: after ? length : 0 };
|
|
@@ -157,29 +157,29 @@ function mapTarget(tr, target) {
|
|
|
157
157
|
const from = tr.mapPos(target.from, inside);
|
|
158
158
|
const mapped2 = tr.mapPos(target.to, -inside);
|
|
159
159
|
if (!tr.doc.index.has(from.block) || !tr.doc.index.has(mapped2.block)) return edgeOf(tr, target);
|
|
160
|
-
const to =
|
|
160
|
+
const to = chunk4F2IWBFM_cjs.comparePos(tr.doc, from, mapped2) > 0 ? from : mapped2;
|
|
161
161
|
return from === target.from && to === target.to ? target : { ...target, from, to };
|
|
162
162
|
}
|
|
163
|
-
var targetGone = (doc, target) => target.lost !== void 0 || target.selected &&
|
|
163
|
+
var targetGone = (doc, target) => target.lost !== void 0 || target.selected && chunk4F2IWBFM_cjs.comparePos(doc, target.from, target.to) === 0;
|
|
164
164
|
function targetRanges(state, { from, to }) {
|
|
165
165
|
const { doc, schema } = state;
|
|
166
166
|
const start = doc.index.get(from.block);
|
|
167
167
|
const end = doc.index.get(to.block);
|
|
168
168
|
return doc.blocks.slice(start, end + 1).flatMap((block, i) => {
|
|
169
|
-
const region = i === 0 ? from.region : block.id === to.block ? to.region :
|
|
169
|
+
const region = i === 0 ? from.region : block.id === to.block ? to.region : chunk4F2IWBFM_cjs.primaryRegion(schema, block);
|
|
170
170
|
if (region === null || !Object.hasOwn(block.regions, region)) return [];
|
|
171
171
|
const left = i === 0 ? from.offset : 0;
|
|
172
|
-
const right = block.id === to.block ? to.offset :
|
|
172
|
+
const right = block.id === to.block ? to.offset : chunk4F2IWBFM_cjs.regionLength(block, region);
|
|
173
173
|
return right > left ? [{ block: block.id, region, from: left, to: right }] : [];
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
// src/extensions/ai/ai-plugin.ts
|
|
178
|
-
var aiKey =
|
|
178
|
+
var aiKey = chunk4F2IWBFM_cjs.createPluginKey("ai");
|
|
179
179
|
var AI = "ai";
|
|
180
180
|
var IDLE = { target: null, menu: null, ghost: null, held: [] };
|
|
181
|
-
var aiState = (state) =>
|
|
182
|
-
var aiTransaction = (state, act2) => new
|
|
181
|
+
var aiState = (state) => chunk4F2IWBFM_cjs.getPluginState(state, aiKey);
|
|
182
|
+
var aiTransaction = (state, act2) => new chunk4F2IWBFM_cjs.Transaction(state).setMeta(AI, act2).setMeta("addToHistory", false);
|
|
183
183
|
function written(ghost, key, phase, output) {
|
|
184
184
|
return ghost.key !== key ? ghost : { ...ghost, phase, output, shown: closeStreaming(output) };
|
|
185
185
|
}
|
|
@@ -211,8 +211,8 @@ function caretBlock(state) {
|
|
|
211
211
|
return selection?.kind === "text" ? selection.head.block : null;
|
|
212
212
|
}
|
|
213
213
|
function hasText(state, id) {
|
|
214
|
-
const block =
|
|
215
|
-
return block !== void 0 && Object.keys(block.regions).some((region) =>
|
|
214
|
+
const block = chunkWZA5S5EJ_cjs.blockById(state.doc, id);
|
|
215
|
+
return block !== void 0 && Object.keys(block.regions).some((region) => chunk4F2IWBFM_cjs.regionLength(block, region) > 0);
|
|
216
216
|
}
|
|
217
217
|
function heldText(tr, value, before, after) {
|
|
218
218
|
if (!tr.docChanged) return value.held;
|
|
@@ -310,13 +310,13 @@ function aroundSelection(text, start, end, limit = CONTEXT_LIMIT) {
|
|
|
310
310
|
}
|
|
311
311
|
var WHITESPACE_ENTITY = /(?<!\\)&#(32|9);/g;
|
|
312
312
|
var plain = (markdown) => markdown.replace(WHITESPACE_ENTITY, (_, code) => code === "32" ? " " : " ");
|
|
313
|
-
var markdownOf = (state, blocks) =>
|
|
313
|
+
var markdownOf = (state, blocks) => chunk4F2IWBFM_cjs.toMarkdown(blocks, { schema: state.schema, comments: false });
|
|
314
314
|
function rangeMarkdown(state, from, to) {
|
|
315
|
-
const slice =
|
|
315
|
+
const slice = chunk4F2IWBFM_cjs.sliceFromSelection({ ...state, selection: chunk4F2IWBFM_cjs.textSelection(from, to) }, chunkWZA5S5EJ_cjs.createBlockCodec(state.schema));
|
|
316
316
|
return slice === null ? "" : markdownOf(state, slice.blocks).replace(/\n$/, "");
|
|
317
317
|
}
|
|
318
318
|
function documentContext(state, target, selection) {
|
|
319
|
-
const blocks =
|
|
319
|
+
const blocks = chunkWZA5S5EJ_cjs.createBlockCodec(state.schema).blocksFromDoc(state.doc);
|
|
320
320
|
const full = plain(markdownOf(state, blocks));
|
|
321
321
|
if (full.length <= CONTEXT_LIMIT) return full;
|
|
322
322
|
const index = state.doc.index.get(target.from.block) ?? 0;
|
|
@@ -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(chunk6X5A4DUQ_cjs.toError(error));
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
function startStream(editor, link, stream, request, replace) {
|
|
@@ -552,25 +552,25 @@ function resolveAiLabels(overrides) {
|
|
|
552
552
|
var openOnSpace = (state, dispatch) => {
|
|
553
553
|
const { selection, doc } = state;
|
|
554
554
|
const ai = aiState(state);
|
|
555
|
-
if (selection?.kind !== "text" || !
|
|
555
|
+
if (selection?.kind !== "text" || !chunk4F2IWBFM_cjs.isCollapsed(selection) || ai.menu !== null || ai.ghost !== null) return false;
|
|
556
556
|
const { head } = selection;
|
|
557
557
|
const block = doc.blocks[doc.index.get(head.block)];
|
|
558
558
|
const paragraph = block.type === "MARKDOWN" && block.attrs.kind === "paragraph";
|
|
559
|
-
if (!paragraph ||
|
|
559
|
+
if (!paragraph || chunk4F2IWBFM_cjs.regionLength(block, head.region) > 0 || ai.held.includes(block.id)) return false;
|
|
560
560
|
dispatch?.(aiTransaction(state, { type: "open", target: { from: head, to: head, selected: false }, fromSpace: true }));
|
|
561
561
|
return true;
|
|
562
562
|
};
|
|
563
563
|
|
|
564
564
|
// src/extensions/ai/ai-accept.ts
|
|
565
|
-
var isParagraph = (block) => block?.type === "MARKDOWN" &&
|
|
565
|
+
var isParagraph = (block) => block?.type === "MARKDOWN" && chunkWZA5S5EJ_cjs.parseLine(String(block.data.markdown ?? "")).kind === "paragraph";
|
|
566
566
|
var DISCARD = { type: "discard" };
|
|
567
567
|
function insertBeside(tr, schema, target, pieces, makeId) {
|
|
568
568
|
const index = tr.doc.index.get(target.to.block);
|
|
569
|
-
const at = target.lost?.after ?
|
|
570
|
-
const fresh =
|
|
571
|
-
tr.step(
|
|
572
|
-
|
|
573
|
-
tr.setSelection(
|
|
569
|
+
const at = target.lost?.after ? chunk4F2IWBFM_cjs.descendantsEnd(tr.doc, index) : index;
|
|
570
|
+
const fresh = chunk4F2IWBFM_cjs.freshBlocks(pieces, tr.doc.blocks[index].indent, makeId);
|
|
571
|
+
tr.step(chunk4F2IWBFM_cjs.insertBlocksStep(at, fresh));
|
|
572
|
+
chunk4F2IWBFM_cjs.capIndents(tr, at, at + fresh.length);
|
|
573
|
+
tr.setSelection(chunk4F2IWBFM_cjs.endOf(tr.doc, schema, fresh[fresh.length - 1].id));
|
|
574
574
|
}
|
|
575
575
|
function acceptAnswer(editor) {
|
|
576
576
|
const { state } = editor;
|
|
@@ -578,7 +578,7 @@ function acceptAnswer(editor) {
|
|
|
578
578
|
if (target === null || ghost === null || ghost.phase === "streaming" || ghost.phase === "error") return null;
|
|
579
579
|
const { codec } = editor;
|
|
580
580
|
const makeId = codec.context.newId;
|
|
581
|
-
const blocks =
|
|
581
|
+
const blocks = chunkWZA5S5EJ_cjs.fromMarkdown(ghost.output, { newId: makeId });
|
|
582
582
|
const pieces = blocks.flatMap((block) => codec.toEngineBlocks(block));
|
|
583
583
|
const tr = editor.createTransaction().setOrigin("ai").setMeta(AI, DISCARD);
|
|
584
584
|
const gone = targetGone(state.doc, target);
|
|
@@ -588,12 +588,12 @@ function acceptAnswer(editor) {
|
|
|
588
588
|
const { schema } = state;
|
|
589
589
|
const open = { openStart: isParagraph(blocks[0]), openEnd: isParagraph(blocks[blocks.length - 1]) };
|
|
590
590
|
if (ghost.replace || gone) {
|
|
591
|
-
const caret = ghost.replace && !gone ?
|
|
592
|
-
|
|
591
|
+
const caret = ghost.replace && !gone ? chunk4F2IWBFM_cjs.deleteRange(tr, schema, target.from, target.to, makeId) : target.to;
|
|
592
|
+
chunk4F2IWBFM_cjs.pasteAtCaret(tr, schema, caret, open, pieces, makeId);
|
|
593
593
|
} else {
|
|
594
594
|
const block = tr.doc.blocks[tr.doc.index.get(target.to.block)];
|
|
595
|
-
const end = { ...target.to, offset:
|
|
596
|
-
|
|
595
|
+
const end = { ...target.to, offset: chunk4F2IWBFM_cjs.regionLength(block, target.to.region) };
|
|
596
|
+
chunk4F2IWBFM_cjs.pasteAtCaret(tr, schema, end, { openStart: false, openEnd: false }, pieces, makeId);
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
editor.dispatch(tr);
|
|
@@ -608,12 +608,12 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
608
608
|
const [next, setNext] = react.useState("");
|
|
609
609
|
const { phase } = ghost;
|
|
610
610
|
const focusPrimary = () => content.current?.querySelector(`[${PRIMARY}]`)?.focus();
|
|
611
|
-
|
|
611
|
+
chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
|
|
612
612
|
const active = content.current?.ownerDocument.activeElement;
|
|
613
613
|
inside.current = active == null || active === active.ownerDocument.body;
|
|
614
614
|
if (inside.current) focusPrimary();
|
|
615
615
|
}, []);
|
|
616
|
-
|
|
616
|
+
chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
|
|
617
617
|
const active = content.current?.ownerDocument.activeElement;
|
|
618
618
|
if (inside.current && !content.current?.contains(active ?? null)) focusPrimary();
|
|
619
619
|
}, [phase, ghost.key]);
|
|
@@ -661,21 +661,21 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
661
661
|
children: [
|
|
662
662
|
phase === "streaming" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
663
663
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.writing }),
|
|
664
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
664
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { ...primary, size: "sm", variant: "outline", onClick: () => stop(editor), children: labels.stop })
|
|
665
665
|
] }),
|
|
666
666
|
phase === "error" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
667
667
|
/* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: labels.failed }),
|
|
668
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
669
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
668
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { ...primary, size: "sm", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
669
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard })
|
|
670
670
|
] }),
|
|
671
671
|
(phase === "done" || phase === "stopped") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
672
672
|
phase === "stopped" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.stopped }),
|
|
673
673
|
gone && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "w-full text-xs text-muted-foreground", children: labels.targetGone }),
|
|
674
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
675
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
676
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { ...primary, size: "sm", onClick: onAccept, children: labels.accept }),
|
|
675
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard }),
|
|
676
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.Button, { size: "sm", variant: "ghost", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
677
677
|
/* @__PURE__ */ jsxRuntime.jsx("form", { className: "w-full", onSubmit: onFollowUp, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
678
|
-
|
|
678
|
+
chunk6X5A4DUQ_cjs.Input,
|
|
679
679
|
{
|
|
680
680
|
"aria-label": labels.followUp,
|
|
681
681
|
placeholder: labels.followUp,
|
|
@@ -696,8 +696,8 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
696
696
|
var reader = null;
|
|
697
697
|
function readerOf() {
|
|
698
698
|
if (reader === null) {
|
|
699
|
-
const schema =
|
|
700
|
-
reader = { schema, codec:
|
|
699
|
+
const schema = chunkWZA5S5EJ_cjs.createSchema();
|
|
700
|
+
reader = { schema, codec: chunkWZA5S5EJ_cjs.createBlockCodec(schema) };
|
|
701
701
|
}
|
|
702
702
|
return reader;
|
|
703
703
|
}
|
|
@@ -705,16 +705,16 @@ function fillGhost(ghost, markdown) {
|
|
|
705
705
|
const doc = ghost.ownerDocument;
|
|
706
706
|
const { schema, codec } = readerOf();
|
|
707
707
|
const drawn2 = [];
|
|
708
|
-
for (const block of
|
|
708
|
+
for (const block of chunkWZA5S5EJ_cjs.fromMarkdown(markdown)) {
|
|
709
709
|
for (const piece of codec.toEngineBlocks(block)) {
|
|
710
710
|
const element = doc.createElement("div");
|
|
711
711
|
element.className = "quoin-ai-ghost-block";
|
|
712
712
|
element.dataset.kind = String(piece.attrs.kind ?? piece.type.toLowerCase());
|
|
713
713
|
if (piece.attrs.level !== void 0) element.dataset.level = String(piece.attrs.level);
|
|
714
714
|
if (piece.indent > 0) element.style.setProperty("--quoin-ai-indent", String(piece.indent));
|
|
715
|
-
const region =
|
|
716
|
-
if (region === null) element.textContent =
|
|
717
|
-
else
|
|
715
|
+
const region = chunk4F2IWBFM_cjs.primaryRegion(schema, piece);
|
|
716
|
+
if (region === null) element.textContent = chunk4F2IWBFM_cjs.toPlainText([codec.toQuoin(piece)], { schema });
|
|
717
|
+
else chunkNNDLIP2C_cjs.renderInline(element, piece.regions[region], []);
|
|
718
718
|
drawn2.push(element);
|
|
719
719
|
}
|
|
720
720
|
}
|
|
@@ -791,7 +791,7 @@ function clipAside(layer, text, areas, scale) {
|
|
|
791
791
|
function useGhostPlace(controller, layer, block, region) {
|
|
792
792
|
const placeNow = react.useRef(() => {
|
|
793
793
|
});
|
|
794
|
-
|
|
794
|
+
chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
|
|
795
795
|
const root = controller.root;
|
|
796
796
|
const element = layer.current;
|
|
797
797
|
const view = root?.ownerDocument.defaultView;
|
|
@@ -830,7 +830,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
|
|
|
830
830
|
const layer = react.useRef(null);
|
|
831
831
|
const drawn2 = react.useRef(null);
|
|
832
832
|
const place2 = useGhostPlace(env.controller, layer, target.to.block, target.to.region);
|
|
833
|
-
|
|
833
|
+
chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
|
|
834
834
|
const element = drawn2.current;
|
|
835
835
|
if (element === null) return;
|
|
836
836
|
element.setAttribute("inert", "");
|
|
@@ -844,7 +844,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
|
|
|
844
844
|
}
|
|
845
845
|
function useTargetAnchor(controller, target) {
|
|
846
846
|
const latest = react.useRef(target);
|
|
847
|
-
|
|
847
|
+
chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
|
|
848
848
|
latest.current = target;
|
|
849
849
|
});
|
|
850
850
|
return react.useMemo(() => {
|
|
@@ -853,8 +853,8 @@ function useTargetAnchor(controller, target) {
|
|
|
853
853
|
return { block: to.block, region: to.region, from: to.offset, to: to.offset };
|
|
854
854
|
};
|
|
855
855
|
return {
|
|
856
|
-
current:
|
|
857
|
-
() =>
|
|
856
|
+
current: chunk6X5A4DUQ_cjs.virtualAnchor(
|
|
857
|
+
() => chunk6X5A4DUQ_cjs.rangeRect(controller, end()),
|
|
858
858
|
() => controller.registry.get(end().block, end().region)
|
|
859
859
|
)
|
|
860
860
|
};
|
|
@@ -908,7 +908,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
908
908
|
};
|
|
909
909
|
const fieldLabel = asking === "tone" ? labels.tonePrompt : asking === "translate" ? labels.translatePrompt : labels.prompt;
|
|
910
910
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
911
|
-
|
|
911
|
+
chunk6X5A4DUQ_cjs.Popover,
|
|
912
912
|
{
|
|
913
913
|
open: true,
|
|
914
914
|
modal: false,
|
|
@@ -916,9 +916,9 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
916
916
|
if (!next) closeMenu(controller.editor);
|
|
917
917
|
},
|
|
918
918
|
children: [
|
|
919
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
919
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6X5A4DUQ_cjs.PopoverAnchor, { virtualRef: anchor }),
|
|
920
920
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
921
|
-
|
|
921
|
+
chunk6X5A4DUQ_cjs.PopoverContent,
|
|
922
922
|
{
|
|
923
923
|
"aria-label": labels.askAi,
|
|
924
924
|
side: "bottom",
|
|
@@ -935,7 +935,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
935
935
|
},
|
|
936
936
|
children: [
|
|
937
937
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
938
|
-
|
|
938
|
+
chunk6X5A4DUQ_cjs.Input,
|
|
939
939
|
{
|
|
940
940
|
ref: field,
|
|
941
941
|
role: "combobox",
|
|
@@ -959,7 +959,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
959
959
|
id: optionId(index),
|
|
960
960
|
role: "option",
|
|
961
961
|
"aria-selected": index === current,
|
|
962
|
-
className:
|
|
962
|
+
className: chunk6X5A4DUQ_cjs.cn(chunk6X5A4DUQ_cjs.MENU_ITEM, index === current && "bg-accent text-accent-foreground"),
|
|
963
963
|
onMouseDown: (event) => event.preventDefault(),
|
|
964
964
|
onClick: () => choose(choice),
|
|
965
965
|
children: choice.label
|
|
@@ -977,17 +977,17 @@ var goneOf = (state) => {
|
|
|
977
977
|
const { target, ghost } = aiState(state);
|
|
978
978
|
return target !== null && ghost !== null && targetGone(state.doc, target);
|
|
979
979
|
};
|
|
980
|
-
var plainText = (markdown) =>
|
|
980
|
+
var plainText = (markdown) => chunk4F2IWBFM_cjs.toPlainText(chunkWZA5S5EJ_cjs.fromMarkdown(markdown));
|
|
981
981
|
function AiOverlay({ controller, stream, labels }) {
|
|
982
|
-
const { onError } =
|
|
982
|
+
const { onError } = chunk6X5A4DUQ_cjs.useQuoin();
|
|
983
983
|
const link = linkOf(controller.editor);
|
|
984
|
-
|
|
984
|
+
chunkNNDLIP2C_cjs.useIsomorphicLayoutEffect(() => {
|
|
985
985
|
link.report = onError;
|
|
986
986
|
link.ended = (phase, output) => controller.announce((phase === "done" ? labels.written : labels.halted)(plainText(output)));
|
|
987
987
|
}, [link, onError, controller, labels]);
|
|
988
|
-
const value =
|
|
989
|
-
const gone =
|
|
990
|
-
const readOnly =
|
|
988
|
+
const value = chunkNNDLIP2C_cjs.useEditorState(controller, aiState);
|
|
989
|
+
const gone = chunkNNDLIP2C_cjs.useEditorState(controller, goneOf);
|
|
990
|
+
const readOnly = chunkNNDLIP2C_cjs.useReadOnly(controller);
|
|
991
991
|
const env = react.useMemo(() => ({ controller, stream, labels }), [controller, stream, labels]);
|
|
992
992
|
const barId = react.useId();
|
|
993
993
|
const showing = value.ghost !== null;
|
|
@@ -1006,7 +1006,7 @@ function AiOverlay({ controller, stream, labels }) {
|
|
|
1006
1006
|
const root = controller.root;
|
|
1007
1007
|
if (!root) return;
|
|
1008
1008
|
let away = true;
|
|
1009
|
-
return
|
|
1009
|
+
return chunkUMTKQVOX_cjs.watchCanvasFocus(controller, root.ownerDocument, (inside, node) => {
|
|
1010
1010
|
if (!inside) away = true;
|
|
1011
1011
|
else if (root.contains(node)) {
|
|
1012
1012
|
if (away) noteFocus(controller.editor);
|
|
@@ -1042,7 +1042,7 @@ function aiExtension(options) {
|
|
|
1042
1042
|
blockMenuItems: [aiBlockMenuItem(labels)],
|
|
1043
1043
|
overlays: [Overlay]
|
|
1044
1044
|
};
|
|
1045
|
-
return
|
|
1045
|
+
return chunk4F2IWBFM_cjs.defineExtension({
|
|
1046
1046
|
name: "ai",
|
|
1047
1047
|
plugins: [aiPlugin],
|
|
1048
1048
|
decorations: aiDecorations,
|
package/dist/ai.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { clipBoxes } from './chunk-MQUCCSWG.js';
|
|
3
|
-
import { watchCanvasFocus } from './chunk-
|
|
4
|
-
import { 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-KIU5MPZ4.js';
|
|
4
|
+
import { useQuoin, Popover, PopoverAnchor, PopoverContent, Input, cn, MENU_ITEM, virtualAnchor, rangeRect, Button, toError } from './chunk-3BCP6ZUM.js';
|
|
5
|
+
import { useIsomorphicLayoutEffect, useEditorState, useReadOnly, renderInline } from './chunk-PVCXTSUO.js';
|
|
6
6
|
import './chunk-HDJ653LM.js';
|
|
7
|
-
import { createPluginKey, defineExtension, isCollapsed, regionLength, primaryRegion, getPluginState, Transaction, toPlainText, selectedBlockIds, orderedRange, comparePos, sliceFromSelection, textSelection, deleteRange, pasteAtCaret, toMarkdown, descendantsEnd, freshBlocks, insertBlocksStep, capIndents, endOf } from './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import { blockById, fromMarkdown, createSchema, createBlockCodec, parseLine } from './chunk-
|
|
7
|
+
import { createPluginKey, defineExtension, isCollapsed, regionLength, primaryRegion, getPluginState, Transaction, toPlainText, selectedBlockIds, orderedRange, comparePos, sliceFromSelection, textSelection, deleteRange, pasteAtCaret, toMarkdown, descendantsEnd, freshBlocks, insertBlocksStep, capIndents, endOf } from './chunk-4EU4BTLZ.js';
|
|
8
|
+
import './chunk-CSKKSXCE.js';
|
|
9
|
+
import { blockById, fromMarkdown, createSchema, createBlockCodec, parseLine } from './chunk-BJTOLCRR.js';
|
|
10
10
|
import { Sparkles, PenLine } from 'lucide-react';
|
|
11
11
|
import { useMemo, useId, useEffect, useState, useRef, useCallback } from 'react';
|
|
12
12
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
package/dist/catalogue.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
14
|
-
var
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
4
|
+
var chunkUHAAYYMX_cjs = require('./chunk-UHAAYYMX.cjs');
|
|
5
|
+
var chunkTLMO46OV_cjs = require('./chunk-TLMO46OV.cjs');
|
|
6
|
+
var chunkTN32PKUI_cjs = require('./chunk-TN32PKUI.cjs');
|
|
7
|
+
var chunkIQ2DE3Y3_cjs = require('./chunk-IQ2DE3Y3.cjs');
|
|
8
|
+
var chunkTWFMNDOC_cjs = require('./chunk-TWFMNDOC.cjs');
|
|
9
|
+
require('./chunk-XZ4NC3Q7.cjs');
|
|
10
|
+
var chunkK7E2DR5W_cjs = require('./chunk-K7E2DR5W.cjs');
|
|
11
|
+
var chunkRENKFSFD_cjs = require('./chunk-RENKFSFD.cjs');
|
|
12
|
+
require('./chunk-H3C3MJW5.cjs');
|
|
13
|
+
require('./chunk-EQKFQK3C.cjs');
|
|
14
|
+
var chunkR45RJQRD_cjs = require('./chunk-R45RJQRD.cjs');
|
|
15
|
+
require('./chunk-6X5A4DUQ.cjs');
|
|
16
|
+
require('./chunk-NNDLIP2C.cjs');
|
|
17
17
|
require('./chunk-A6PGQVTR.cjs');
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-
|
|
20
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-4F2IWBFM.cjs');
|
|
19
|
+
require('./chunk-BM2GRZNM.cjs');
|
|
20
|
+
require('./chunk-WZA5S5EJ.cjs');
|
|
21
21
|
|
|
22
22
|
// src/extensions/create-catalogue.ts
|
|
23
23
|
function createCatalogue(features2) {
|
|
@@ -29,14 +29,14 @@ function createCatalogue(features2) {
|
|
|
29
29
|
|
|
30
30
|
// src/catalogue.ts
|
|
31
31
|
var features = {
|
|
32
|
-
table:
|
|
33
|
-
embed:
|
|
34
|
-
math:
|
|
35
|
-
toc:
|
|
36
|
-
mention:
|
|
37
|
-
emoji:
|
|
38
|
-
find:
|
|
39
|
-
stats:
|
|
32
|
+
table: chunkTN32PKUI_cjs.tableExtension,
|
|
33
|
+
embed: chunkIQ2DE3Y3_cjs.embedExtension,
|
|
34
|
+
math: chunkTWFMNDOC_cjs.mathExtension,
|
|
35
|
+
toc: chunkK7E2DR5W_cjs.tocExtension,
|
|
36
|
+
mention: chunkRENKFSFD_cjs.mentionExtension,
|
|
37
|
+
emoji: chunkR45RJQRD_cjs.emojiExtension,
|
|
38
|
+
find: chunkUHAAYYMX_cjs.findExtension,
|
|
39
|
+
stats: chunkTLMO46OV_cjs.statsExtension
|
|
40
40
|
};
|
|
41
41
|
var catalogue = createCatalogue(features);
|
|
42
42
|
|
package/dist/catalogue.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { findExtension } from './chunk-
|
|
3
|
-
import { statsExtension } from './chunk-
|
|
4
|
-
import { tableExtension } from './chunk-
|
|
5
|
-
import { embedExtension } from './chunk-
|
|
6
|
-
import { mathExtension } from './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import { tocExtension } from './chunk-
|
|
9
|
-
import { mentionExtension } from './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
12
|
-
import { emojiExtension } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
2
|
+
import { findExtension } from './chunk-OWX3Y5UU.js';
|
|
3
|
+
import { statsExtension } from './chunk-I4CSCA3O.js';
|
|
4
|
+
import { tableExtension } from './chunk-MEXDDWJF.js';
|
|
5
|
+
import { embedExtension } from './chunk-I4NEX6SZ.js';
|
|
6
|
+
import { mathExtension } from './chunk-TG5T7BEJ.js';
|
|
7
|
+
import './chunk-AD3NY7NA.js';
|
|
8
|
+
import { tocExtension } from './chunk-WCAUPASG.js';
|
|
9
|
+
import { mentionExtension } from './chunk-IHTHOAUY.js';
|
|
10
|
+
import './chunk-GHNQKJMD.js';
|
|
11
|
+
import './chunk-PMJ3VCSR.js';
|
|
12
|
+
import { emojiExtension } from './chunk-X4FDLUXJ.js';
|
|
13
|
+
import './chunk-3BCP6ZUM.js';
|
|
14
|
+
import './chunk-PVCXTSUO.js';
|
|
15
15
|
import './chunk-HDJ653LM.js';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
18
|
-
import './chunk-
|
|
16
|
+
import './chunk-4EU4BTLZ.js';
|
|
17
|
+
import './chunk-CSKKSXCE.js';
|
|
18
|
+
import './chunk-BJTOLCRR.js';
|
|
19
19
|
|
|
20
20
|
// src/extensions/create-catalogue.ts
|
|
21
21
|
function createCatalogue(features2) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useQuoinEditor, EditorView, useIsomorphicLayoutEffect, useReadOnly, useEditorState, listen, wholeState, NODE_ENTRY, useBlockDomId, useToggleOpen, ToggleChevron, EditableRegion, drawnBlockCount, isComposingKey, NATIVE_INTERACTION, useRegionDomId, TaskCheckbox, useOrderedNumber, createAutoScroll, domMapOf, dispatchSelection, regionInline, onBlock, hostKey, BlockErrorContext, textDiff, moveToNeighbour, visibleBlockIndexes } from './chunk-
|
|
1
|
+
import { useQuoinEditor, EditorView, useIsomorphicLayoutEffect, useReadOnly, useEditorState, listen, wholeState, NODE_ENTRY, useBlockDomId, useToggleOpen, ToggleChevron, EditableRegion, drawnBlockCount, isComposingKey, NATIVE_INTERACTION, useRegionDomId, TaskCheckbox, useOrderedNumber, createAutoScroll, domMapOf, dispatchSelection, regionInline, onBlock, hostKey, BlockErrorContext, textDiff, moveToNeighbour, visibleBlockIndexes } from './chunk-PVCXTSUO.js';
|
|
2
2
|
import { defineBlock, devWarn, highlightedLines, blockByType, paletteBlocks, tokenColour, seedData, parsedData } from './chunk-HDJ653LM.js';
|
|
3
|
-
import { createPluginKey, coreExtensions, defineExtension, duplicateBlocks, primaryRegion, regionLength, headBlockId, sameSelection, Transaction, insertBlocksStep, startOf, replaceBlockStep, descendantsEnd, LINE_JOIN, detectMac, selectedBlockIds, blockRangeSelection, runCommands, setSelection, selectedBlockRange, toMarkdown, isCollapsed, createBlock, isParagraph, nodeSelection, setAttrsStep, LINE_SPLIT, validateSelection, endOf, insertBlockAfter, insertText, isTextFlow, markRanges, setTextAlign, orderedRange, unsetLink, textSelection, toggleMark, isActive, setBlockType, getPluginState, rangeContent, unsetMark, setMark, markExtent, setLink, deleteBlocks, setAttrs, HISTORY_GROUP, setBlockColor, removeMarkStep, caretMarks, replaceInlineStep, keyName, normalizeKey, movedBlockIds, moveBlocksUp, moveBlocksDown, selectAll, redo, undo, moveBlocksTo, indent, outdent } from './chunk-
|
|
4
|
-
import { sameValue } from './chunk-
|
|
5
|
-
import { str, blockPlainText, sanitizeHref, inlineText, parseInline, newId, createDoc, sameItems, headingLevel, sanitizeAssetUrl, blockById, sliceInline, specFor, createBlockCodec, hasMark, alignOrUndefined, optionalNumber, requireBlockIndex, SCHEME, inlineLength, paletteOrUndefined, PALETTE, addMark, text } from './chunk-L6OW2FL3.js';
|
|
3
|
+
import { createPluginKey, coreExtensions, defineExtension, duplicateBlocks, primaryRegion, regionLength, headBlockId, sameSelection, Transaction, insertBlocksStep, startOf, replaceBlockStep, descendantsEnd, LINE_JOIN, detectMac, selectedBlockIds, blockRangeSelection, runCommands, setSelection, selectedBlockRange, toMarkdown, isCollapsed, createBlock, isParagraph, nodeSelection, setAttrsStep, LINE_SPLIT, validateSelection, endOf, insertBlockAfter, insertText, isTextFlow, markRanges, setTextAlign, orderedRange, unsetLink, textSelection, toggleMark, isActive, setBlockType, getPluginState, rangeContent, unsetMark, setMark, markExtent, setLink, deleteBlocks, setAttrs, HISTORY_GROUP, setBlockColor, removeMarkStep, caretMarks, replaceInlineStep, keyName, normalizeKey, movedBlockIds, moveBlocksUp, moveBlocksDown, selectAll, redo, undo, moveBlocksTo, indent, outdent } from './chunk-4EU4BTLZ.js';
|
|
4
|
+
import { str, blockPlainText, sanitizeHref, inlineText, parseInline, newId, createDoc, sameItems, headingLevel, sanitizeAssetUrl, blockById, sliceInline, specFor, createBlockCodec, hasMark, alignOrUndefined, optionalNumber, requireBlockIndex, SCHEME, inlineLength, paletteOrUndefined, PALETTE, addMark, text, sameValue } from './chunk-BJTOLCRR.js';
|
|
6
5
|
import * as React7 from 'react';
|
|
7
6
|
import { createContext, forwardRef, useRef, useImperativeHandle, useState, useMemo, useEffect, Fragment as Fragment$1, useContext, useSyncExternalStore, useCallback, useId, createElement } from 'react';
|
|
8
7
|
import { FileText, MessageSquare, Code, Image, Paperclip, CopyPlus, Copy, Link, ArrowUp, ArrowDown, Trash, Keyboard, Plus, GripVertical, Minus, Check, ExternalLink, Unlink, ChevronRightIcon, CircleIcon, ChevronDown, ListCollapse, Heading1, Heading2, Heading3, Baseline, AlignLeft, AlignJustify, AlignRight, AlignCenter, CheckIcon, Pencil, XIcon, Upload, Download, Repeat2, Palette, Droplet, Sticker, FileIcon, FileImage, FileMusic, FilePlay, FileArchive, Subscript, Superscript, Bold, Italic, Underline, Strikethrough, Type, List, ListOrdered, ListTodo, TextQuote, ListIndentIncrease, ListIndentDecrease, Undo2, Redo2 } from 'lucide-react';
|
|
@@ -6109,5 +6108,5 @@ function useAutosave({
|
|
|
6109
6108
|
}
|
|
6110
6109
|
|
|
6111
6110
|
export { BlockCanvas, Button, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, FLOATING_TOOLBAR, FOCUS_RING, FilePickerButton, Input, MENU_ITEM, MenuIcon, Popover, PopoverAnchor, PopoverContent, QuoinProvider, SuggestionMenu, UploadField, blockFragment, bubblePart, cn, coreBlocks, dismissSuggestion, englishLabels, focusNode, formatShortcut, inlineDirection, insertBlockToWrite, insertBlocks, interceptKeys, keepFocus, linkAddress, linkedBlockId, noChange, preventDefault, rangeRect, replaceTrigger, resolveLabels, returnFocusToText, runOnBlocks, selectHandlers, selectNode, styleTargets, suggestionPlugin, toError, useAutosave, useFocusKey, useLabels, useNodeKeys, useOutsidePress, usePartAnchor, useQuoin, useRangeAnchor, useRovingFocus, virtualAnchor };
|
|
6112
|
-
//# sourceMappingURL=chunk-
|
|
6113
|
-
//# sourceMappingURL=chunk-
|
|
6111
|
+
//# sourceMappingURL=chunk-3BCP6ZUM.js.map
|
|
6112
|
+
//# sourceMappingURL=chunk-3BCP6ZUM.js.map
|