quoin-editor 1.0.1 → 1.0.2
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 +12 -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-BTBHHBVR.cjs → chunk-4SLJNZSM.cjs} +11 -7
- package/dist/chunk-4SLJNZSM.cjs.map +1 -0
- package/dist/{chunk-62WKUAQY.js → chunk-4XFXB37X.js} +7 -3
- package/dist/chunk-4XFXB37X.js.map +1 -0
- package/dist/{chunk-56C7GCKO.cjs → chunk-5MAYUGTE.cjs} +97 -97
- package/dist/{chunk-56C7GCKO.cjs.map → chunk-5MAYUGTE.cjs.map} +1 -1
- package/dist/{chunk-QXG3HWDS.js → chunk-623AOJM2.js} +4 -4
- package/dist/{chunk-6YSGUAVW.js → chunk-6NULZPVC.js} +6 -8
- package/dist/chunk-6NULZPVC.js.map +1 -0
- package/dist/{chunk-XX5FTPJR.cjs → chunk-6V6GGBDK.cjs} +10 -10
- package/dist/{chunk-XX5FTPJR.cjs.map → chunk-6V6GGBDK.cjs.map} +1 -1
- package/dist/{chunk-CLTHD5GO.cjs → chunk-73653CJ4.cjs} +3 -3
- package/dist/{chunk-CLTHD5GO.cjs.map → chunk-73653CJ4.cjs.map} +1 -1
- package/dist/{chunk-UBNG5YCG.js → chunk-ADSJ42DO.js} +6 -6
- package/dist/{chunk-PX6LZMH4.cjs → chunk-AUOEM3SF.cjs} +44 -44
- package/dist/{chunk-PX6LZMH4.cjs.map → chunk-AUOEM3SF.cjs.map} +1 -1
- package/dist/{chunk-ESMAW4NK.cjs → chunk-BQANU5BH.cjs} +12 -12
- package/dist/{chunk-ESMAW4NK.cjs.map → chunk-BQANU5BH.cjs.map} +1 -1
- package/dist/{chunk-UCXLRRWY.js → chunk-C23RQVRK.js} +5 -5
- package/dist/{chunk-5R3ISX4A.cjs → chunk-CW3AFJBR.cjs} +288 -295
- package/dist/chunk-CW3AFJBR.cjs.map +1 -0
- package/dist/{chunk-26Q4LSIU.js → chunk-DUE3HCZD.js} +2 -2
- package/dist/{chunk-SSIRYUCK.js → chunk-EPARJI4V.js} +6 -5
- package/dist/chunk-EPARJI4V.js.map +1 -0
- package/dist/{chunk-V3KLMSRO.cjs → chunk-FDRUAL3Z.cjs} +30 -30
- package/dist/{chunk-V3KLMSRO.cjs.map → chunk-FDRUAL3Z.cjs.map} +1 -1
- package/dist/{chunk-A4IJSJKL.js → chunk-IQBMAE3F.js} +5 -5
- package/dist/{chunk-PIWRSX7U.js → chunk-JHQUHFLX.js} +7 -7
- package/dist/{chunk-6PKVJZQV.cjs → chunk-KUYZMSMF.cjs} +8 -8
- package/dist/{chunk-6PKVJZQV.cjs.map → chunk-KUYZMSMF.cjs.map} +1 -1
- package/dist/{chunk-UDAVVEFC.cjs → chunk-LLTEGXWZ.cjs} +54 -54
- package/dist/{chunk-UDAVVEFC.cjs.map → chunk-LLTEGXWZ.cjs.map} +1 -1
- package/dist/{chunk-RQW3P3GH.js → chunk-N4FGA3H4.js} +5 -5
- package/dist/{chunk-LV6EYPJO.js → chunk-NEZJ7ZP5.js} +2 -2
- package/dist/{chunk-UPSLDTLT.js → chunk-OBMBSU2S.js} +3 -3
- package/dist/{chunk-WMN6566P.js → chunk-OSHZQR3W.js} +5 -5
- package/dist/{chunk-5M4QG3ZC.cjs → chunk-P6KYXFZC.cjs} +116 -115
- package/dist/chunk-P6KYXFZC.cjs.map +1 -0
- package/dist/{chunk-75C6PX2L.cjs → chunk-R2BLBV43.cjs} +23 -23
- package/dist/{chunk-75C6PX2L.cjs.map → chunk-R2BLBV43.cjs.map} +1 -1
- package/dist/{chunk-6LMS5J3Y.js → chunk-RJRX34BZ.js} +2 -2
- package/dist/{chunk-LE3F7WIP.js → chunk-T43RZTUT.js} +148 -155
- package/dist/chunk-T43RZTUT.js.map +1 -0
- package/dist/{chunk-MLRAVUFG.cjs → chunk-TLGX43P6.cjs} +17 -19
- package/dist/chunk-TLGX43P6.cjs.map +1 -0
- package/dist/{chunk-LMAEPFTX.js → chunk-U3LOLYAU.js} +2 -2
- package/dist/{chunk-JJ3RASQS.cjs → chunk-UEKXVCKC.cjs} +101 -91
- package/dist/chunk-UEKXVCKC.cjs.map +1 -0
- package/dist/{chunk-GPIDU3GN.js → chunk-VCLL5C7J.js} +5 -5
- package/dist/{chunk-PGSS4IOS.js → chunk-VRS6WCEK.js} +19 -9
- package/dist/chunk-VRS6WCEK.js.map +1 -0
- package/dist/{chunk-VACTAZWS.cjs → chunk-WEYDDIBQ.cjs} +14 -14
- package/dist/{chunk-VACTAZWS.cjs.map → chunk-WEYDDIBQ.cjs.map} +1 -1
- package/dist/{chunk-F5V3IEEE.cjs → chunk-X4HDKFW5.cjs} +27 -27
- package/dist/{chunk-F5V3IEEE.cjs.map → chunk-X4HDKFW5.cjs.map} +1 -1
- package/dist/{chunk-EYFCOV3T.cjs → chunk-X4P4TQXH.cjs} +5 -5
- package/dist/{chunk-EYFCOV3T.cjs.map → chunk-X4P4TQXH.cjs.map} +1 -1
- package/dist/{chunk-UWNZG2SD.cjs → chunk-XA3UEJIW.cjs} +3 -3
- package/dist/{chunk-UWNZG2SD.cjs.map → chunk-XA3UEJIW.cjs.map} +1 -1
- package/dist/{chunk-OCCKQHCY.js → chunk-YBMUEEM5.js} +2 -2
- package/dist/{chunk-HOIDJEVI.cjs → chunk-ZKVOS57Q.cjs} +217 -217
- package/dist/{chunk-HOIDJEVI.cjs.map → chunk-ZKVOS57Q.cjs.map} +1 -1
- package/dist/comments.cjs +58 -58
- package/dist/comments.js +7 -7
- package/dist/diff.cjs +28 -27
- package/dist/diff.cjs.map +1 -1
- package/dist/diff.js +5 -4
- package/dist/diff.js.map +1 -1
- package/dist/docx.cjs +30 -30
- package/dist/docx.js +3 -3
- package/dist/embed.cjs +8 -8
- package/dist/embed.js +7 -7
- package/dist/emoji.cjs +7 -7
- package/dist/emoji.js +6 -6
- package/dist/engine.cjs +4 -4
- package/dist/engine.js +3 -3
- package/dist/find.cjs +7 -7
- package/dist/find.js +6 -6
- package/dist/headless.cjs +5 -5
- package/dist/headless.js +4 -4
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/math.cjs +9 -9
- package/dist/math.js +8 -8
- package/dist/mention.cjs +9 -9
- package/dist/mention.js +8 -8
- package/dist/presence.cjs +39 -42
- package/dist/presence.cjs.map +1 -1
- package/dist/presence.js +9 -12
- package/dist/presence.js.map +1 -1
- package/dist/stats.cjs +8 -8
- package/dist/stats.js +7 -7
- package/dist/table.cjs +7 -7
- package/dist/table.js +6 -6
- package/dist/toc.cjs +7 -7
- package/dist/toc.js +6 -6
- package/dist/view.cjs +4 -4
- package/dist/view.js +2 -2
- package/dist/yjs.cjs +223 -171
- package/dist/yjs.cjs.map +1 -1
- package/dist/yjs.js +104 -52
- package/dist/yjs.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-5M4QG3ZC.cjs.map +0 -1
- package/dist/chunk-5R3ISX4A.cjs.map +0 -1
- package/dist/chunk-62WKUAQY.js.map +0 -1
- package/dist/chunk-6YSGUAVW.js.map +0 -1
- package/dist/chunk-BTBHHBVR.cjs.map +0 -1
- package/dist/chunk-JJ3RASQS.cjs.map +0 -1
- package/dist/chunk-LE3F7WIP.js.map +0 -1
- package/dist/chunk-MLRAVUFG.cjs.map +0 -1
- package/dist/chunk-PGSS4IOS.js.map +0 -1
- package/dist/chunk-SSIRYUCK.js.map +0 -1
- /package/dist/{chunk-QXG3HWDS.js.map → chunk-623AOJM2.js.map} +0 -0
- /package/dist/{chunk-UBNG5YCG.js.map → chunk-ADSJ42DO.js.map} +0 -0
- /package/dist/{chunk-UCXLRRWY.js.map → chunk-C23RQVRK.js.map} +0 -0
- /package/dist/{chunk-26Q4LSIU.js.map → chunk-DUE3HCZD.js.map} +0 -0
- /package/dist/{chunk-A4IJSJKL.js.map → chunk-IQBMAE3F.js.map} +0 -0
- /package/dist/{chunk-PIWRSX7U.js.map → chunk-JHQUHFLX.js.map} +0 -0
- /package/dist/{chunk-RQW3P3GH.js.map → chunk-N4FGA3H4.js.map} +0 -0
- /package/dist/{chunk-LV6EYPJO.js.map → chunk-NEZJ7ZP5.js.map} +0 -0
- /package/dist/{chunk-UPSLDTLT.js.map → chunk-OBMBSU2S.js.map} +0 -0
- /package/dist/{chunk-WMN6566P.js.map → chunk-OSHZQR3W.js.map} +0 -0
- /package/dist/{chunk-6LMS5J3Y.js.map → chunk-RJRX34BZ.js.map} +0 -0
- /package/dist/{chunk-LMAEPFTX.js.map → chunk-U3LOLYAU.js.map} +0 -0
- /package/dist/{chunk-GPIDU3GN.js.map → chunk-VCLL5C7J.js.map} +0 -0
- /package/dist/{chunk-OCCKQHCY.js.map → chunk-YBMUEEM5.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.0.2 (2026-10-27)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- A task's checkbox and an embed's frame are never left with an empty or blank name. In the canvas, a `task` label that is empty or only white space names the checkbox `Task`, and a `frameTitle` label that returns one titles the frame with its provider's name, or with its page's address when the provider has no name. `toHTML`, `QuoinView` and `QuoinDiff` treat a `taskLabel`, an `emptyTask` label, a `frameTitle` or a provider name of only white space as empty too, rather than writing it as the name.
|
|
9
|
+
- With `quoin-editor/yjs`, a collaborator's change to a block's type reads only that block again from the shared document, rather than the whole document, as does a collaborator's change to the rows or columns of a table, or any other change that only puts in or takes out the start of a region: at 20,000 blocks a type change takes about 8 ms, against about 75 ms before, close to the 5 ms of a collaborator's typing. A block that concurrent edits left out of shape still reads the whole document, as before.
|
|
10
|
+
- With `quoin-editor/yjs`, the caret stays on its character when a collaborator's change reads blocks of the shared document again, such as turning the paragraph above it into a code block: it was put back by the layout from before the change and could jump within its block or into another one.
|
|
11
|
+
- With `quoin-editor/yjs`, a change another writer makes to the `id` in a block's marker in the shared `Y.Text` is read: the editor takes the document as the text now reads, where it kept showing the block under its old id.
|
|
12
|
+
- With `quoin-editor/yjs`, content in the shared `Y.Text` that the `Y.Text` API never writes, such as values put in through `Y.Array` on the same name, counts as one skipped embed per value, rather than being dropped, so the positions the editor holds match those of Yjs.
|
|
13
|
+
|
|
14
|
+
### Known limits
|
|
15
|
+
- In the canvas, a task's text box still takes a `task` label that is empty or only white space as its name.
|
|
16
|
+
|
|
5
17
|
## 1.0.1 (2026-10-26)
|
|
6
18
|
|
|
7
19
|
### Added
|
package/dist/ai.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkLE5XMIFJcjs = require('./chunk-LE5XMIFJ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk73653CJ4cjs = require('./chunk-73653CJ4.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -17,13 +17,13 @@ var _chunkCLTHD5GOcjs = require('./chunk-CLTHD5GO.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkCW3AFJBRcjs = require('./chunk-CW3AFJBR.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkP6KYXFZCcjs = require('./chunk-P6KYXFZC.cjs');
|
|
27
27
|
require('./chunk-EH5KXQXY.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
@@ -47,15 +47,15 @@ require('./chunk-EH5KXQXY.cjs');
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
51
|
-
require('./chunk-
|
|
50
|
+
var _chunkZKVOS57Qcjs = require('./chunk-ZKVOS57Q.cjs');
|
|
51
|
+
require('./chunk-6V6GGBDK.cjs');
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _chunk4SLJNZSMcjs = require('./chunk-4SLJNZSM.cjs');
|
|
59
59
|
|
|
60
60
|
// src/extensions/ai/streaming-markdown.ts
|
|
61
61
|
var FENCE = /^ {0,3}(`{3,}|~{3,})/;
|
|
@@ -154,30 +154,30 @@ function closeStreaming(markdown) {
|
|
|
154
154
|
// src/extensions/ai/ai-target.ts
|
|
155
155
|
function targetOfBlocks(state, ids) {
|
|
156
156
|
const { doc, schema } = state;
|
|
157
|
-
const first =
|
|
158
|
-
const last =
|
|
157
|
+
const first = _chunk4SLJNZSMcjs.blockById.call(void 0, doc, ids[0]);
|
|
158
|
+
const last = _chunk4SLJNZSMcjs.blockById.call(void 0, doc, ids[ids.length - 1]);
|
|
159
159
|
if (first === void 0 || last === void 0) return null;
|
|
160
|
-
const start =
|
|
161
|
-
const end =
|
|
160
|
+
const start = _chunkZKVOS57Qcjs.primaryRegion.call(void 0, schema, first);
|
|
161
|
+
const end = _chunkZKVOS57Qcjs.primaryRegion.call(void 0, schema, last);
|
|
162
162
|
if (start === null || end === null) return null;
|
|
163
163
|
const from = { block: first.id, region: start, offset: 0 };
|
|
164
|
-
return { from, to: { block: last.id, region: end, offset:
|
|
164
|
+
return { from, to: { block: last.id, region: end, offset: _chunkZKVOS57Qcjs.regionLength.call(void 0, last, end) }, selected: ids.length > 1 };
|
|
165
165
|
}
|
|
166
166
|
function targetOfSelection(state) {
|
|
167
167
|
const { doc, selection } = state;
|
|
168
168
|
if (selection === null) return null;
|
|
169
|
-
if (selection.kind !== "text") return targetOfBlocks(state,
|
|
170
|
-
const { from, to } =
|
|
171
|
-
if (
|
|
169
|
+
if (selection.kind !== "text") return targetOfBlocks(state, _chunkZKVOS57Qcjs.selectedBlockIds.call(void 0, doc, selection));
|
|
170
|
+
const { from, to } = _chunkZKVOS57Qcjs.orderedRange.call(void 0, doc, selection.anchor, selection.head);
|
|
171
|
+
if (_chunkZKVOS57Qcjs.comparePos.call(void 0, doc, from, to) !== 0) return { from, to, selected: true };
|
|
172
172
|
const block = doc.blocks[doc.index.get(from.block)];
|
|
173
173
|
const whole = { block: from.block, region: from.region };
|
|
174
|
-
return { from: { ...whole, offset: 0 }, to: { ...whole, offset:
|
|
174
|
+
return { from: { ...whole, offset: 0 }, to: { ...whole, offset: _chunkZKVOS57Qcjs.regionLength.call(void 0, block, from.region) }, selected: false };
|
|
175
175
|
}
|
|
176
176
|
function nearestKept(tr, target) {
|
|
177
177
|
const { doc } = tr.before;
|
|
178
178
|
const first = _nullishCoalesce(doc.index.get(target.from.block), () => ( 0));
|
|
179
179
|
const last = _nullishCoalesce(doc.index.get(target.to.block), () => ( first));
|
|
180
|
-
const kept = (block) => block &&
|
|
180
|
+
const kept = (block) => block && _chunk4SLJNZSMcjs.blockById.call(void 0, tr.doc, block.id);
|
|
181
181
|
for (let step = 1; first - step >= 0 || last + step < doc.blocks.length; step++) {
|
|
182
182
|
const found = _nullishCoalesce(kept(doc.blocks[first - step]), () => ( kept(doc.blocks[last + step])));
|
|
183
183
|
if (found) return found;
|
|
@@ -186,10 +186,10 @@ function nearestKept(tr, target) {
|
|
|
186
186
|
}
|
|
187
187
|
function edgeOf(tr, target) {
|
|
188
188
|
const point = tr.mapPos(target.from, -1);
|
|
189
|
-
const block = _nullishCoalesce(
|
|
189
|
+
const block = _nullishCoalesce(_chunk4SLJNZSMcjs.blockById.call(void 0, tr.doc, point.block), () => ( nearestKept(tr, target)));
|
|
190
190
|
if (block === void 0) return null;
|
|
191
|
-
const region = _nullishCoalesce(
|
|
192
|
-
const length = region === "" ? 0 :
|
|
191
|
+
const region = _nullishCoalesce(_chunkZKVOS57Qcjs.primaryRegion.call(void 0, tr.before.schema, block), () => ( ""));
|
|
192
|
+
const length = region === "" ? 0 : _chunkZKVOS57Qcjs.regionLength.call(void 0, block, region);
|
|
193
193
|
const offset = block.id === point.block ? Math.min(point.offset, length) : length;
|
|
194
194
|
const after = offset > 0 || length === 0;
|
|
195
195
|
const at = { block: block.id, region, offset: after ? length : 0 };
|
|
@@ -201,29 +201,29 @@ function mapTarget(tr, target) {
|
|
|
201
201
|
const from = tr.mapPos(target.from, inside);
|
|
202
202
|
const mapped2 = tr.mapPos(target.to, -inside);
|
|
203
203
|
if (!tr.doc.index.has(from.block) || !tr.doc.index.has(mapped2.block)) return edgeOf(tr, target);
|
|
204
|
-
const to =
|
|
204
|
+
const to = _chunkZKVOS57Qcjs.comparePos.call(void 0, tr.doc, from, mapped2) > 0 ? from : mapped2;
|
|
205
205
|
return from === target.from && to === target.to ? target : { ...target, from, to };
|
|
206
206
|
}
|
|
207
|
-
var targetGone = (doc, target) => target.lost !== void 0 || target.selected &&
|
|
207
|
+
var targetGone = (doc, target) => target.lost !== void 0 || target.selected && _chunkZKVOS57Qcjs.comparePos.call(void 0, doc, target.from, target.to) === 0;
|
|
208
208
|
function targetRanges(state, { from, to }) {
|
|
209
209
|
const { doc, schema } = state;
|
|
210
210
|
const start = doc.index.get(from.block);
|
|
211
211
|
const end = doc.index.get(to.block);
|
|
212
212
|
return doc.blocks.slice(start, end + 1).flatMap((block, i) => {
|
|
213
|
-
const region = i === 0 ? from.region : block.id === to.block ? to.region :
|
|
213
|
+
const region = i === 0 ? from.region : block.id === to.block ? to.region : _chunkZKVOS57Qcjs.primaryRegion.call(void 0, schema, block);
|
|
214
214
|
if (region === null || !Object.hasOwn(block.regions, region)) return [];
|
|
215
215
|
const left = i === 0 ? from.offset : 0;
|
|
216
|
-
const right = block.id === to.block ? to.offset :
|
|
216
|
+
const right = block.id === to.block ? to.offset : _chunkZKVOS57Qcjs.regionLength.call(void 0, block, region);
|
|
217
217
|
return right > left ? [{ block: block.id, region, from: left, to: right }] : [];
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
// src/extensions/ai/ai-plugin.ts
|
|
222
|
-
var aiKey =
|
|
222
|
+
var aiKey = _chunkZKVOS57Qcjs.createPluginKey.call(void 0, "ai");
|
|
223
223
|
var AI = "ai";
|
|
224
224
|
var IDLE = { target: null, menu: null, ghost: null, held: [] };
|
|
225
|
-
var aiState = (state) =>
|
|
226
|
-
var aiTransaction = (state, act2) => new (0,
|
|
225
|
+
var aiState = (state) => _chunkZKVOS57Qcjs.getPluginState.call(void 0, state, aiKey);
|
|
226
|
+
var aiTransaction = (state, act2) => new (0, _chunkZKVOS57Qcjs.Transaction)(state).setMeta(AI, act2).setMeta("addToHistory", false);
|
|
227
227
|
function written(ghost, key, phase, output) {
|
|
228
228
|
return ghost.key !== key ? ghost : { ...ghost, phase, output, shown: closeStreaming(output) };
|
|
229
229
|
}
|
|
@@ -255,8 +255,8 @@ function caretBlock(state) {
|
|
|
255
255
|
return _optionalChain([selection, 'optionalAccess', _11 => _11.kind]) === "text" ? selection.head.block : null;
|
|
256
256
|
}
|
|
257
257
|
function hasText(state, id) {
|
|
258
|
-
const block =
|
|
259
|
-
return block !== void 0 && Object.keys(block.regions).some((region) =>
|
|
258
|
+
const block = _chunk4SLJNZSMcjs.blockById.call(void 0, state.doc, id);
|
|
259
|
+
return block !== void 0 && Object.keys(block.regions).some((region) => _chunkZKVOS57Qcjs.regionLength.call(void 0, block, region) > 0);
|
|
260
260
|
}
|
|
261
261
|
function heldText(tr, value, before, after) {
|
|
262
262
|
if (!tr.docChanged) return value.held;
|
|
@@ -357,13 +357,13 @@ function aroundSelection(text, start, end, limit = CONTEXT_LIMIT) {
|
|
|
357
357
|
}
|
|
358
358
|
var WHITESPACE_ENTITY = /(?<!\\)&#(32|9);/g;
|
|
359
359
|
var plain = (markdown) => markdown.replace(WHITESPACE_ENTITY, (_, code) => code === "32" ? " " : " ");
|
|
360
|
-
var markdownOf = (state, blocks) =>
|
|
360
|
+
var markdownOf = (state, blocks) => _chunkZKVOS57Qcjs.toMarkdown.call(void 0, blocks, { schema: state.schema, comments: false });
|
|
361
361
|
function rangeMarkdown(state, from, to) {
|
|
362
|
-
const slice =
|
|
362
|
+
const slice = _chunkZKVOS57Qcjs.sliceFromSelection.call(void 0, { ...state, selection: _chunkZKVOS57Qcjs.textSelection.call(void 0, from, to) }, _chunk4SLJNZSMcjs.createBlockCodec.call(void 0, state.schema));
|
|
363
363
|
return slice === null ? "" : markdownOf(state, slice.blocks).replace(/\n$/, "");
|
|
364
364
|
}
|
|
365
365
|
function documentContext(state, target, selection) {
|
|
366
|
-
const blocks =
|
|
366
|
+
const blocks = _chunk4SLJNZSMcjs.createBlockCodec.call(void 0, state.schema).blocksFromDoc(state.doc);
|
|
367
367
|
const full = plain(markdownOf(state, blocks));
|
|
368
368
|
if (full.length <= CONTEXT_LIMIT) return full;
|
|
369
369
|
const index = _nullishCoalesce(state.doc.index.get(target.from.block), () => ( 0));
|
|
@@ -424,7 +424,7 @@ async function read(editor, link, run, stream, request) {
|
|
|
424
424
|
} catch (error) {
|
|
425
425
|
if (!live()) return;
|
|
426
426
|
end("error");
|
|
427
|
-
link.report(
|
|
427
|
+
link.report(_chunkCW3AFJBRcjs.toError.call(void 0, error));
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
function startStream(editor, link, stream, request, replace) {
|
|
@@ -599,11 +599,11 @@ function resolveAiLabels(overrides) {
|
|
|
599
599
|
var openOnSpace = (state, dispatch) => {
|
|
600
600
|
const { selection, doc } = state;
|
|
601
601
|
const ai = aiState(state);
|
|
602
|
-
if (_optionalChain([selection, 'optionalAccess', _26 => _26.kind]) !== "text" || !
|
|
602
|
+
if (_optionalChain([selection, 'optionalAccess', _26 => _26.kind]) !== "text" || !_chunkZKVOS57Qcjs.isCollapsed.call(void 0, selection) || ai.menu !== null || ai.ghost !== null) return false;
|
|
603
603
|
const { head } = selection;
|
|
604
604
|
const block = doc.blocks[doc.index.get(head.block)];
|
|
605
605
|
const paragraph = block.type === "MARKDOWN" && block.attrs.kind === "paragraph";
|
|
606
|
-
if (!paragraph ||
|
|
606
|
+
if (!paragraph || _chunkZKVOS57Qcjs.regionLength.call(void 0, block, head.region) > 0 || ai.held.includes(block.id)) return false;
|
|
607
607
|
_optionalChain([dispatch, 'optionalCall', _27 => _27(aiTransaction(state, { type: "open", target: { from: head, to: head, selected: false }, fromSpace: true }))]);
|
|
608
608
|
return true;
|
|
609
609
|
};
|
|
@@ -615,15 +615,15 @@ var _react = require('react');
|
|
|
615
615
|
|
|
616
616
|
|
|
617
617
|
// src/extensions/ai/ai-accept.ts
|
|
618
|
-
var isParagraph = (block) => _optionalChain([block, 'optionalAccess', _28 => _28.type]) === "MARKDOWN" &&
|
|
618
|
+
var isParagraph = (block) => _optionalChain([block, 'optionalAccess', _28 => _28.type]) === "MARKDOWN" && _chunk4SLJNZSMcjs.parseLine.call(void 0, String(_nullishCoalesce(block.data.markdown, () => ( "")))).kind === "paragraph";
|
|
619
619
|
var DISCARD = { type: "discard" };
|
|
620
620
|
function insertBeside(tr, schema, target, pieces, makeId) {
|
|
621
621
|
const index = tr.doc.index.get(target.to.block);
|
|
622
|
-
const at = _optionalChain([target, 'access', _29 => _29.lost, 'optionalAccess', _30 => _30.after]) ?
|
|
623
|
-
const fresh =
|
|
624
|
-
tr.step(
|
|
625
|
-
|
|
626
|
-
tr.setSelection(
|
|
622
|
+
const at = _optionalChain([target, 'access', _29 => _29.lost, 'optionalAccess', _30 => _30.after]) ? _chunkZKVOS57Qcjs.descendantsEnd.call(void 0, tr.doc, index) : index;
|
|
623
|
+
const fresh = _chunkZKVOS57Qcjs.freshBlocks.call(void 0, pieces, tr.doc.blocks[index].indent, makeId);
|
|
624
|
+
tr.step(_chunkZKVOS57Qcjs.insertBlocksStep.call(void 0, at, fresh));
|
|
625
|
+
_chunkZKVOS57Qcjs.capIndents.call(void 0, tr, at, at + fresh.length);
|
|
626
|
+
tr.setSelection(_chunkZKVOS57Qcjs.endOf.call(void 0, tr.doc, schema, fresh[fresh.length - 1].id));
|
|
627
627
|
}
|
|
628
628
|
function acceptAnswer(editor) {
|
|
629
629
|
const { state } = editor;
|
|
@@ -631,7 +631,7 @@ function acceptAnswer(editor) {
|
|
|
631
631
|
if (target === null || ghost === null || ghost.phase === "streaming" || ghost.phase === "error") return null;
|
|
632
632
|
const { codec } = editor;
|
|
633
633
|
const makeId = codec.context.newId;
|
|
634
|
-
const blocks =
|
|
634
|
+
const blocks = _chunk4SLJNZSMcjs.fromMarkdown.call(void 0, ghost.output, { newId: makeId });
|
|
635
635
|
const pieces = blocks.flatMap((block) => codec.toEngineBlocks(block));
|
|
636
636
|
const tr = editor.createTransaction().setOrigin("ai").setMeta(AI, DISCARD);
|
|
637
637
|
const gone = targetGone(state.doc, target);
|
|
@@ -641,12 +641,12 @@ function acceptAnswer(editor) {
|
|
|
641
641
|
const { schema } = state;
|
|
642
642
|
const open = { openStart: isParagraph(blocks[0]), openEnd: isParagraph(blocks[blocks.length - 1]) };
|
|
643
643
|
if (ghost.replace || gone) {
|
|
644
|
-
const caret = ghost.replace && !gone ?
|
|
645
|
-
|
|
644
|
+
const caret = ghost.replace && !gone ? _chunkZKVOS57Qcjs.deleteRange.call(void 0, tr, schema, target.from, target.to, makeId) : target.to;
|
|
645
|
+
_chunkZKVOS57Qcjs.pasteAtCaret.call(void 0, tr, schema, caret, open, pieces, makeId);
|
|
646
646
|
} else {
|
|
647
647
|
const block = tr.doc.blocks[tr.doc.index.get(target.to.block)];
|
|
648
|
-
const end = { ...target.to, offset:
|
|
649
|
-
|
|
648
|
+
const end = { ...target.to, offset: _chunkZKVOS57Qcjs.regionLength.call(void 0, block, target.to.region) };
|
|
649
|
+
_chunkZKVOS57Qcjs.pasteAtCaret.call(void 0, tr, schema, end, { openStart: false, openEnd: false }, pieces, makeId);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
editor.dispatch(tr);
|
|
@@ -664,12 +664,12 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
664
664
|
const [next, setNext] = _react.useState.call(void 0, "");
|
|
665
665
|
const { phase } = ghost;
|
|
666
666
|
const focusPrimary = () => _optionalChain([content, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.querySelector, 'call', _33 => _33(`[${PRIMARY}]`), 'optionalAccess', _34 => _34.focus, 'call', _35 => _35()]);
|
|
667
|
-
|
|
667
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
668
668
|
const active = _optionalChain([content, 'access', _36 => _36.current, 'optionalAccess', _37 => _37.ownerDocument, 'access', _38 => _38.activeElement]);
|
|
669
669
|
inside.current = active == null || active === active.ownerDocument.body;
|
|
670
670
|
if (inside.current) focusPrimary();
|
|
671
671
|
}, []);
|
|
672
|
-
|
|
672
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
673
673
|
const active = _optionalChain([content, 'access', _39 => _39.current, 'optionalAccess', _40 => _40.ownerDocument, 'access', _41 => _41.activeElement]);
|
|
674
674
|
if (inside.current && !_optionalChain([content, 'access', _42 => _42.current, 'optionalAccess', _43 => _43.contains, 'call', _44 => _44(_nullishCoalesce(active, () => ( null)))])) focusPrimary();
|
|
675
675
|
}, [phase, ghost.key]);
|
|
@@ -717,21 +717,21 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
717
717
|
children: [
|
|
718
718
|
phase === "streaming" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
719
719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: labels.writing }),
|
|
720
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
720
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.Button, { ...primary, size: "sm", variant: "outline", onClick: () => stop(editor), children: labels.stop })
|
|
721
721
|
] }),
|
|
722
722
|
phase === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
723
723
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { role: "alert", className: "text-sm text-destructive", children: labels.failed }),
|
|
724
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
725
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
724
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.Button, { ...primary, size: "sm", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
725
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard })
|
|
726
726
|
] }),
|
|
727
727
|
(phase === "done" || phase === "stopped") && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
728
728
|
phase === "stopped" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: labels.stopped }),
|
|
729
729
|
gone && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "w-full text-xs text-muted-foreground", children: labels.targetGone }),
|
|
730
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
731
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
732
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
730
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.Button, { ...primary, size: "sm", onClick: onAccept, children: labels.accept }),
|
|
731
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.Button, { size: "sm", variant: "ghost", onClick: onDiscard, children: labels.discard }),
|
|
732
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.Button, { size: "sm", variant: "ghost", onClick: () => retry(editor, stream), children: labels.retry }),
|
|
733
733
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "form", { className: "w-full", onSubmit: onFollowUp, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
734
|
-
|
|
734
|
+
_chunkCW3AFJBRcjs.Input,
|
|
735
735
|
{
|
|
736
736
|
"aria-label": labels.followUp,
|
|
737
737
|
placeholder: labels.followUp,
|
|
@@ -755,8 +755,8 @@ function AiBar({ env, ghost, gone, barId }) {
|
|
|
755
755
|
var reader = null;
|
|
756
756
|
function readerOf() {
|
|
757
757
|
if (reader === null) {
|
|
758
|
-
const schema =
|
|
759
|
-
reader = { schema, codec:
|
|
758
|
+
const schema = _chunk4SLJNZSMcjs.createSchema.call(void 0, );
|
|
759
|
+
reader = { schema, codec: _chunk4SLJNZSMcjs.createBlockCodec.call(void 0, schema) };
|
|
760
760
|
}
|
|
761
761
|
return reader;
|
|
762
762
|
}
|
|
@@ -764,16 +764,16 @@ function fillGhost(ghost, markdown) {
|
|
|
764
764
|
const doc = ghost.ownerDocument;
|
|
765
765
|
const { schema, codec } = readerOf();
|
|
766
766
|
const drawn2 = [];
|
|
767
|
-
for (const block of
|
|
767
|
+
for (const block of _chunk4SLJNZSMcjs.fromMarkdown.call(void 0, markdown)) {
|
|
768
768
|
for (const piece of codec.toEngineBlocks(block)) {
|
|
769
769
|
const element = doc.createElement("div");
|
|
770
770
|
element.className = "quoin-ai-ghost-block";
|
|
771
771
|
element.dataset.kind = String(_nullishCoalesce(piece.attrs.kind, () => ( piece.type.toLowerCase())));
|
|
772
772
|
if (piece.attrs.level !== void 0) element.dataset.level = String(piece.attrs.level);
|
|
773
773
|
if (piece.indent > 0) element.style.setProperty("--quoin-ai-indent", String(piece.indent));
|
|
774
|
-
const region =
|
|
775
|
-
if (region === null) element.textContent =
|
|
776
|
-
else
|
|
774
|
+
const region = _chunkZKVOS57Qcjs.primaryRegion.call(void 0, schema, piece);
|
|
775
|
+
if (region === null) element.textContent = _chunkZKVOS57Qcjs.toPlainText.call(void 0, [codec.toQuoin(piece)], { schema });
|
|
776
|
+
else _chunkP6KYXFZCcjs.renderInline.call(void 0, element, piece.regions[region], []);
|
|
777
777
|
drawn2.push(element);
|
|
778
778
|
}
|
|
779
779
|
}
|
|
@@ -853,7 +853,7 @@ function clipAside(layer, text, areas, scale) {
|
|
|
853
853
|
function useGhostPlace(controller, layer, block, region) {
|
|
854
854
|
const placeNow = _react.useRef.call(void 0, () => {
|
|
855
855
|
});
|
|
856
|
-
|
|
856
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
857
857
|
const root = controller.root;
|
|
858
858
|
const element = layer.current;
|
|
859
859
|
const view = _optionalChain([root, 'optionalAccess', _52 => _52.ownerDocument, 'access', _53 => _53.defaultView]);
|
|
@@ -895,7 +895,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
|
|
|
895
895
|
const layer = _react.useRef.call(void 0, null);
|
|
896
896
|
const drawn2 = _react.useRef.call(void 0, null);
|
|
897
897
|
const place2 = useGhostPlace(env.controller, layer, target.to.block, target.to.region);
|
|
898
|
-
|
|
898
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
899
899
|
const element = drawn2.current;
|
|
900
900
|
if (element === null) return;
|
|
901
901
|
element.setAttribute("inert", "");
|
|
@@ -915,7 +915,7 @@ function AiGhost({ env, ghost, target, gone, barId }) {
|
|
|
915
915
|
|
|
916
916
|
function useTargetAnchor(controller, target) {
|
|
917
917
|
const latest = _react.useRef.call(void 0, target);
|
|
918
|
-
|
|
918
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
919
919
|
latest.current = target;
|
|
920
920
|
});
|
|
921
921
|
return _react.useMemo.call(void 0, () => {
|
|
@@ -924,8 +924,8 @@ function useTargetAnchor(controller, target) {
|
|
|
924
924
|
return { block: to.block, region: to.region, from: to.offset, to: to.offset };
|
|
925
925
|
};
|
|
926
926
|
return {
|
|
927
|
-
current:
|
|
928
|
-
() =>
|
|
927
|
+
current: _chunkCW3AFJBRcjs.virtualAnchor.call(void 0,
|
|
928
|
+
() => _chunkCW3AFJBRcjs.rangeRect.call(void 0, controller, end()),
|
|
929
929
|
() => controller.registry.get(end().block, end().region)
|
|
930
930
|
)
|
|
931
931
|
};
|
|
@@ -982,7 +982,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
982
982
|
};
|
|
983
983
|
const fieldLabel = asking === "tone" ? labels.tonePrompt : asking === "translate" ? labels.translatePrompt : labels.prompt;
|
|
984
984
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
985
|
-
|
|
985
|
+
_chunkCW3AFJBRcjs.Popover,
|
|
986
986
|
{
|
|
987
987
|
open: true,
|
|
988
988
|
modal: false,
|
|
@@ -990,9 +990,9 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
990
990
|
if (!next) closeMenu(controller.editor);
|
|
991
991
|
},
|
|
992
992
|
children: [
|
|
993
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
993
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCW3AFJBRcjs.PopoverAnchor, { virtualRef: anchor }),
|
|
994
994
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
995
|
-
|
|
995
|
+
_chunkCW3AFJBRcjs.PopoverContent,
|
|
996
996
|
{
|
|
997
997
|
"aria-label": labels.askAi,
|
|
998
998
|
side: "bottom",
|
|
@@ -1009,7 +1009,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
1009
1009
|
},
|
|
1010
1010
|
children: [
|
|
1011
1011
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1012
|
-
|
|
1012
|
+
_chunkCW3AFJBRcjs.Input,
|
|
1013
1013
|
{
|
|
1014
1014
|
ref: field,
|
|
1015
1015
|
role: "combobox",
|
|
@@ -1033,7 +1033,7 @@ function AiMenu({ env, target, fromSpace }) {
|
|
|
1033
1033
|
id: optionId(index),
|
|
1034
1034
|
role: "option",
|
|
1035
1035
|
"aria-selected": index === current,
|
|
1036
|
-
className:
|
|
1036
|
+
className: _chunkCW3AFJBRcjs.cn.call(void 0, _chunkCW3AFJBRcjs.MENU_ITEM, index === current && "bg-accent text-accent-foreground"),
|
|
1037
1037
|
onMouseDown: (event) => event.preventDefault(),
|
|
1038
1038
|
onClick: () => choose(choice),
|
|
1039
1039
|
children: choice.label
|
|
@@ -1054,17 +1054,17 @@ var goneOf = (state) => {
|
|
|
1054
1054
|
const { target, ghost } = aiState(state);
|
|
1055
1055
|
return target !== null && ghost !== null && targetGone(state.doc, target);
|
|
1056
1056
|
};
|
|
1057
|
-
var plainText = (markdown) =>
|
|
1057
|
+
var plainText = (markdown) => _chunkZKVOS57Qcjs.toPlainText.call(void 0, _chunk4SLJNZSMcjs.fromMarkdown.call(void 0, markdown));
|
|
1058
1058
|
function AiOverlay({ controller, stream, labels }) {
|
|
1059
|
-
const { onError } =
|
|
1059
|
+
const { onError } = _chunkCW3AFJBRcjs.useQuoin.call(void 0, );
|
|
1060
1060
|
const link = linkOf(controller.editor);
|
|
1061
|
-
|
|
1061
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
1062
1062
|
link.report = onError;
|
|
1063
1063
|
link.ended = (phase, output) => controller.announce((phase === "done" ? labels.written : labels.halted)(plainText(output)));
|
|
1064
1064
|
}, [link, onError, controller, labels]);
|
|
1065
|
-
const value =
|
|
1066
|
-
const gone =
|
|
1067
|
-
const readOnly =
|
|
1065
|
+
const value = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, aiState);
|
|
1066
|
+
const gone = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, goneOf);
|
|
1067
|
+
const readOnly = _chunkP6KYXFZCcjs.useReadOnly.call(void 0, controller);
|
|
1068
1068
|
const env = _react.useMemo.call(void 0, () => ({ controller, stream, labels }), [controller, stream, labels]);
|
|
1069
1069
|
const barId = _react.useId.call(void 0, );
|
|
1070
1070
|
const showing = value.ghost !== null;
|
|
@@ -1083,7 +1083,7 @@ function AiOverlay({ controller, stream, labels }) {
|
|
|
1083
1083
|
const root = controller.root;
|
|
1084
1084
|
if (!root) return;
|
|
1085
1085
|
let away = true;
|
|
1086
|
-
return
|
|
1086
|
+
return _chunk73653CJ4cjs.watchCanvasFocus.call(void 0, controller, root.ownerDocument, (inside, node) => {
|
|
1087
1087
|
if (!inside) away = true;
|
|
1088
1088
|
else if (root.contains(node)) {
|
|
1089
1089
|
if (away) noteFocus(controller.editor);
|
|
@@ -1122,7 +1122,7 @@ function aiExtension(options) {
|
|
|
1122
1122
|
blockMenuItems: [aiBlockMenuItem(labels)],
|
|
1123
1123
|
overlays: [Overlay]
|
|
1124
1124
|
};
|
|
1125
|
-
return
|
|
1125
|
+
return _chunkZKVOS57Qcjs.defineExtension.call(void 0, {
|
|
1126
1126
|
name: "ai",
|
|
1127
1127
|
plugins: [aiPlugin],
|
|
1128
1128
|
decorations: aiDecorations,
|
package/dist/ai.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-MQUCCSWG.js";
|
|
5
5
|
import {
|
|
6
6
|
watchCanvasFocus
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NEZJ7ZP5.js";
|
|
8
8
|
import {
|
|
9
9
|
Button,
|
|
10
10
|
Input,
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
toError,
|
|
18
18
|
useQuoin,
|
|
19
19
|
virtualAnchor
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-T43RZTUT.js";
|
|
21
21
|
import {
|
|
22
22
|
renderInline,
|
|
23
23
|
useEditorState,
|
|
24
24
|
useIsomorphicLayoutEffect,
|
|
25
25
|
useReadOnly
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EPARJI4V.js";
|
|
27
27
|
import "./chunk-O4Z2WMFF.js";
|
|
28
28
|
import {
|
|
29
29
|
Transaction,
|
|
@@ -47,15 +47,15 @@ import {
|
|
|
47
47
|
textSelection,
|
|
48
48
|
toMarkdown,
|
|
49
49
|
toPlainText
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-OBMBSU2S.js";
|
|
51
|
+
import "./chunk-RJRX34BZ.js";
|
|
52
52
|
import {
|
|
53
53
|
blockById,
|
|
54
54
|
createBlockCodec,
|
|
55
55
|
createSchema,
|
|
56
56
|
fromMarkdown,
|
|
57
57
|
parseLine
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-4XFXB37X.js";
|
|
59
59
|
|
|
60
60
|
// src/extensions/ai/streaming-markdown.ts
|
|
61
61
|
var FENCE = /^ {0,3}(`{3,}|~{3,})/;
|
package/dist/catalogue.cjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
'use client';"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkAUOEM3SFcjs = require('./chunk-AUOEM3SF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkWEYDDIBQcjs = require('./chunk-WEYDDIBQ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk5MAYUGTEcjs = require('./chunk-5MAYUGTE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkUEKXVCKCcjs = require('./chunk-UEKXVCKC.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('./chunk-
|
|
16
|
+
var _chunkLLTEGXWZcjs = require('./chunk-LLTEGXWZ.cjs');
|
|
17
|
+
require('./chunk-X4P4TQXH.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkR2BLBV43cjs = require('./chunk-R2BLBV43.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
require('./chunk-
|
|
25
|
-
require('./chunk-
|
|
23
|
+
var _chunkX4HDKFW5cjs = require('./chunk-X4HDKFW5.cjs');
|
|
24
|
+
require('./chunk-XA3UEJIW.cjs');
|
|
25
|
+
require('./chunk-BQANU5BH.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
require('./chunk-
|
|
30
|
-
require('./chunk-
|
|
28
|
+
var _chunkFDRUAL3Zcjs = require('./chunk-FDRUAL3Z.cjs');
|
|
29
|
+
require('./chunk-CW3AFJBR.cjs');
|
|
30
|
+
require('./chunk-P6KYXFZC.cjs');
|
|
31
31
|
require('./chunk-EH5KXQXY.cjs');
|
|
32
|
-
require('./chunk-
|
|
33
|
-
require('./chunk-
|
|
34
|
-
require('./chunk-
|
|
32
|
+
require('./chunk-ZKVOS57Q.cjs');
|
|
33
|
+
require('./chunk-6V6GGBDK.cjs');
|
|
34
|
+
require('./chunk-4SLJNZSM.cjs');
|
|
35
35
|
|
|
36
36
|
// src/extensions/create-catalogue.ts
|
|
37
37
|
function createCatalogue(features2) {
|
|
@@ -43,14 +43,14 @@ function createCatalogue(features2) {
|
|
|
43
43
|
|
|
44
44
|
// src/catalogue.ts
|
|
45
45
|
var features = {
|
|
46
|
-
table:
|
|
47
|
-
embed:
|
|
48
|
-
math:
|
|
49
|
-
toc:
|
|
50
|
-
mention:
|
|
51
|
-
emoji:
|
|
52
|
-
find:
|
|
53
|
-
stats:
|
|
46
|
+
table: _chunk5MAYUGTEcjs.tableExtension,
|
|
47
|
+
embed: _chunkUEKXVCKCcjs.embedExtension,
|
|
48
|
+
math: _chunkLLTEGXWZcjs.mathExtension,
|
|
49
|
+
toc: _chunkR2BLBV43cjs.tocExtension,
|
|
50
|
+
mention: _chunkX4HDKFW5cjs.mentionExtension,
|
|
51
|
+
emoji: _chunkFDRUAL3Zcjs.emojiExtension,
|
|
52
|
+
find: _chunkAUOEM3SFcjs.findExtension,
|
|
53
|
+
stats: _chunkWEYDDIBQcjs.statsExtension
|
|
54
54
|
};
|
|
55
55
|
var catalogue = createCatalogue(features);
|
|
56
56
|
|
package/dist/catalogue.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
findExtension
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IQBMAE3F.js";
|
|
5
5
|
import {
|
|
6
6
|
statsExtension
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OSHZQR3W.js";
|
|
8
8
|
import {
|
|
9
9
|
tableExtension
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-C23RQVRK.js";
|
|
11
11
|
import {
|
|
12
12
|
embedExtension
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VRS6WCEK.js";
|
|
14
14
|
import {
|
|
15
15
|
mathExtension
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-JHQUHFLX.js";
|
|
17
|
+
import "./chunk-U3LOLYAU.js";
|
|
18
18
|
import {
|
|
19
19
|
tocExtension
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VCLL5C7J.js";
|
|
21
21
|
import {
|
|
22
22
|
mentionExtension
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-ADSJ42DO.js";
|
|
24
|
+
import "./chunk-YBMUEEM5.js";
|
|
25
|
+
import "./chunk-623AOJM2.js";
|
|
26
26
|
import {
|
|
27
27
|
emojiExtension
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-N4FGA3H4.js";
|
|
29
|
+
import "./chunk-T43RZTUT.js";
|
|
30
|
+
import "./chunk-EPARJI4V.js";
|
|
31
31
|
import "./chunk-O4Z2WMFF.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-OBMBSU2S.js";
|
|
33
|
+
import "./chunk-RJRX34BZ.js";
|
|
34
|
+
import "./chunk-4XFXB37X.js";
|
|
35
35
|
|
|
36
36
|
// src/extensions/create-catalogue.ts
|
|
37
37
|
function createCatalogue(features2) {
|