quoin-editor 1.2.3 → 1.4.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 +21 -0
- package/THIRD_PARTY_NOTICES.md +47 -0
- package/dist/ai.cjs +69 -70
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.d.cts +4 -3
- package/dist/ai.d.ts +4 -3
- package/dist/ai.js +4 -5
- package/dist/ai.js.map +1 -1
- package/dist/catalogue.cjs +20 -20
- package/dist/catalogue.d.cts +10 -9
- package/dist/catalogue.d.ts +10 -9
- package/dist/catalogue.js +12 -12
- package/dist/{chunk-35CHEARK.cjs → chunk-3NVFHJFS.cjs} +42 -41
- package/dist/chunk-3NVFHJFS.cjs.map +1 -0
- package/dist/{chunk-BR25RE7U.js → chunk-3YA7FYEL.js} +9 -6
- package/dist/chunk-3YA7FYEL.js.map +1 -0
- package/dist/{chunk-CZ5ZXBWC.cjs → chunk-65WK575V.cjs} +762 -306
- package/dist/chunk-65WK575V.cjs.map +1 -0
- package/dist/{chunk-Y7UKOBSY.js → chunk-6LOYAC5N.js} +7 -6
- package/dist/chunk-6LOYAC5N.js.map +1 -0
- package/dist/{chunk-KMIWUFNM.cjs → chunk-7WSBPD6Z.cjs} +96 -93
- package/dist/chunk-7WSBPD6Z.cjs.map +1 -0
- package/dist/{chunk-TARBFPWC.js → chunk-AC4AFDTI.js} +6 -6
- package/dist/{chunk-TARBFPWC.js.map → chunk-AC4AFDTI.js.map} +1 -1
- package/dist/{chunk-SCFW4JFT.cjs → chunk-AZ2ZNSFN.cjs} +43 -44
- package/dist/chunk-AZ2ZNSFN.cjs.map +1 -0
- package/dist/{chunk-ZVCBTQA3.cjs → chunk-AZF7B2AE.cjs} +10 -10
- package/dist/{chunk-ZVCBTQA3.cjs.map → chunk-AZF7B2AE.cjs.map} +1 -1
- package/dist/{chunk-DQV37F7J.cjs → chunk-FQDNF7MF.cjs} +68 -69
- package/dist/chunk-FQDNF7MF.cjs.map +1 -0
- package/dist/{chunk-25HNTVEI.js → chunk-G25FMFEZ.js} +3 -3
- package/dist/{chunk-25HNTVEI.js.map → chunk-G25FMFEZ.js.map} +1 -1
- package/dist/{chunk-A5LIN7FO.cjs → chunk-H5FM6I5W.cjs} +26 -26
- package/dist/{chunk-A5LIN7FO.cjs.map → chunk-H5FM6I5W.cjs.map} +1 -1
- package/dist/{chunk-YCVNFRL3.js → chunk-IJKGF6SC.js} +4 -4
- package/dist/{chunk-YCVNFRL3.js.map → chunk-IJKGF6SC.js.map} +1 -1
- package/dist/{chunk-4HFE3YFF.js → chunk-KRLHGVJV.js} +8 -7
- package/dist/chunk-KRLHGVJV.js.map +1 -0
- package/dist/{chunk-J552D3A7.js → chunk-MQTLZTIM.js} +448 -25
- package/dist/chunk-MQTLZTIM.js.map +1 -0
- package/dist/{chunk-KXOAV7AT.js → chunk-OS2O6IKX.js} +135 -12
- package/dist/chunk-OS2O6IKX.js.map +1 -0
- package/dist/{chunk-OGBD74IR.cjs → chunk-QJ34MOFV.cjs} +187 -117
- package/dist/chunk-QJ34MOFV.cjs.map +1 -0
- package/dist/{chunk-SAPLIQF2.js → chunk-QOIVLYMW.js} +4 -4
- package/dist/{chunk-SAPLIQF2.js.map → chunk-QOIVLYMW.js.map} +1 -1
- package/dist/{chunk-IGEWAL2J.cjs → chunk-QPOUONJ7.cjs} +32 -31
- package/dist/chunk-QPOUONJ7.cjs.map +1 -0
- package/dist/{chunk-K7JEN3KT.cjs → chunk-QR2NIDUK.cjs} +4 -4
- package/dist/{chunk-K7JEN3KT.cjs.map → chunk-QR2NIDUK.cjs.map} +1 -1
- package/dist/{chunk-4D7HZRNC.js → chunk-R7MYG522.js} +3 -3
- package/dist/{chunk-4D7HZRNC.js.map → chunk-R7MYG522.js.map} +1 -1
- package/dist/{chunk-BNUQ647G.js → chunk-STCJWXP5.js} +5 -6
- package/dist/chunk-STCJWXP5.js.map +1 -0
- package/dist/{chunk-BJIWN7BQ.cjs → chunk-STKGRXSA.cjs} +10 -10
- package/dist/{chunk-BJIWN7BQ.cjs.map → chunk-STKGRXSA.cjs.map} +1 -1
- package/dist/{chunk-5ANJW76W.cjs → chunk-VUYJGFUA.cjs} +23 -22
- package/dist/chunk-VUYJGFUA.cjs.map +1 -0
- package/dist/{chunk-FOEEDJ5R.js → chunk-VVS6JJLI.js} +7 -6
- package/dist/chunk-VVS6JJLI.js.map +1 -0
- package/dist/{chunk-G37GQ5JE.cjs → chunk-VZZPCYA3.cjs} +135 -12
- package/dist/chunk-VZZPCYA3.cjs.map +1 -0
- package/dist/{chunk-JYKSWEXT.cjs → chunk-WN7BZDNH.cjs} +6 -6
- package/dist/{chunk-JYKSWEXT.cjs.map → chunk-WN7BZDNH.cjs.map} +1 -1
- package/dist/{chunk-CCOPHCXX.js → chunk-XFEDJEJF.js} +109 -39
- package/dist/chunk-XFEDJEJF.js.map +1 -0
- package/dist/{chunk-I7OOIEZZ.js → chunk-YEQEBJPM.js} +5 -6
- package/dist/chunk-YEQEBJPM.js.map +1 -0
- package/dist/comments.cjs +54 -54
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.d.cts +4 -3
- package/dist/comments.d.ts +4 -3
- package/dist/comments.js +8 -8
- package/dist/comments.js.map +1 -1
- package/dist/diff.d.cts +7 -5
- package/dist/diff.d.ts +7 -5
- package/dist/docx.cjs +1 -1
- package/dist/docx.d.cts +3 -2
- package/dist/docx.d.ts +3 -2
- package/dist/docx.js +1 -1
- package/dist/embed.cjs +6 -6
- package/dist/embed.d.cts +5 -4
- package/dist/embed.d.ts +5 -4
- package/dist/embed.js +4 -4
- package/dist/emoji-data.cjs +272 -263
- package/dist/emoji-data.cjs.map +1 -1
- package/dist/emoji-data.js +272 -263
- package/dist/emoji-data.js.map +1 -1
- package/dist/{emoji-extension-CmPlRssm.d.ts → emoji-extension-C3o_Y5uC.d.cts} +3 -2
- package/dist/{emoji-extension-zJ6F7hW8.d.cts → emoji-extension-gRKnbW8G.d.ts} +3 -2
- package/dist/emoji.cjs +7 -7
- package/dist/emoji.d.cts +6 -5
- package/dist/emoji.d.ts +6 -5
- package/dist/emoji.js +4 -4
- package/dist/engine.cjs +43 -43
- package/dist/engine.d.cts +7 -6
- package/dist/engine.d.ts +7 -6
- package/dist/engine.js +1 -1
- package/dist/{find-extension-CmFehyul.d.ts → find-extension-BGGsJMu4.d.cts} +3 -2
- package/dist/{find-extension-BcRyE9K4.d.cts → find-extension-B_Ctrs6T.d.ts} +3 -2
- package/dist/find.cjs +8 -8
- package/dist/find.d.cts +5 -4
- package/dist/find.d.ts +5 -4
- package/dist/find.js +4 -4
- package/dist/headless.cjs +59 -59
- package/dist/headless.d.cts +10 -9
- package/dist/headless.d.ts +10 -9
- package/dist/headless.js +2 -2
- package/dist/{index-DiCGV60d.d.ts → index-CsG7OQoq.d.cts} +3 -2
- package/dist/{index-CFPmCee4.d.cts → index-h1llgZM-.d.ts} +3 -2
- package/dist/index.cjs +71 -71
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +3 -3
- package/dist/math.cjs +7 -7
- package/dist/math.d.cts +5 -4
- package/dist/math.d.ts +5 -4
- package/dist/math.js +5 -5
- package/dist/mention.cjs +7 -7
- package/dist/mention.d.cts +4 -3
- package/dist/mention.d.ts +4 -3
- package/dist/mention.js +5 -5
- package/dist/presence.cjs +33 -33
- package/dist/presence.d.cts +5 -4
- package/dist/presence.d.ts +5 -4
- package/dist/presence.js +5 -5
- package/dist/{registry-CXegaw5k.d.ts → registry-DdQaddP1.d.cts} +2 -1
- package/dist/{registry-CXegaw5k.d.cts → registry-DdQaddP1.d.ts} +2 -1
- package/dist/{stats-extension-DisOEbbI.d.ts → stats-extension-XqOTvRaq.d.cts} +3 -2
- package/dist/{stats-extension-Dt1lgP3m.d.cts → stats-extension-oD6D1cYy.d.ts} +3 -2
- package/dist/stats.cjs +7 -7
- package/dist/stats.d.cts +6 -5
- package/dist/stats.d.ts +6 -5
- package/dist/stats.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/{table-extension-DxZz3jqp.d.cts → table-extension-BP47hHoz.d.cts} +3 -2
- package/dist/{table-extension-BTMJnT7J.d.ts → table-extension-v6VB59bF.d.ts} +3 -2
- package/dist/table.cjs +23 -23
- package/dist/table.d.cts +5 -4
- package/dist/table.d.ts +5 -4
- package/dist/table.js +4 -4
- package/dist/{to-html-CNCITCln.d.cts → to-html-1oD-CDle.d.cts} +3 -2
- package/dist/{to-html-C5t7xyaM.d.ts → to-html-CLRBCX0I.d.ts} +3 -2
- package/dist/{toc-extension-DGHywOBv.d.cts → toc-extension-CI6jNOYl.d.cts} +3 -2
- package/dist/{toc-extension-CR9U-l6j.d.ts → toc-extension-CTHWjNJC.d.ts} +3 -2
- package/dist/toc.cjs +7 -7
- package/dist/toc.d.cts +5 -4
- package/dist/toc.d.ts +5 -4
- package/dist/toc.js +4 -4
- package/dist/{types-C6_QkXzy.d.ts → types-BjLcmV00.d.ts} +3 -26
- package/dist/{types-DULc8wwg.d.ts → types-CQ8Vw_7N.d.cts} +27 -1
- package/dist/{types-DULc8wwg.d.cts → types-CQ8Vw_7N.d.ts} +27 -1
- package/dist/{types-CJ7Gq3GX.d.cts → types-DXF9p4qV.d.cts} +3 -26
- package/dist/{view-controller-zNqHm_Qg.d.ts → view-controller-BfVSNZYZ.d.cts} +4 -3
- package/dist/{view-controller-cxQJ5rQb.d.cts → view-controller-p-2x3J7Y.d.ts} +4 -3
- package/dist/view.d.cts +7 -5
- package/dist/view.d.ts +7 -5
- package/dist/yjs.cjs +99 -99
- package/dist/yjs.d.cts +4 -4
- package/dist/yjs.d.ts +4 -4
- package/dist/yjs.js +3 -3
- package/package.json +19 -18
- package/dist/chunk-35CHEARK.cjs.map +0 -1
- package/dist/chunk-4HFE3YFF.js.map +0 -1
- package/dist/chunk-5ANJW76W.cjs.map +0 -1
- package/dist/chunk-BNUQ647G.js.map +0 -1
- package/dist/chunk-BR25RE7U.js.map +0 -1
- package/dist/chunk-CCOPHCXX.js.map +0 -1
- package/dist/chunk-CZ5ZXBWC.cjs.map +0 -1
- package/dist/chunk-DQV37F7J.cjs.map +0 -1
- package/dist/chunk-FOEEDJ5R.js.map +0 -1
- package/dist/chunk-G37GQ5JE.cjs.map +0 -1
- package/dist/chunk-I7OOIEZZ.js.map +0 -1
- package/dist/chunk-IGEWAL2J.cjs.map +0 -1
- package/dist/chunk-J552D3A7.js.map +0 -1
- package/dist/chunk-KMIWUFNM.cjs.map +0 -1
- package/dist/chunk-KXOAV7AT.js.map +0 -1
- package/dist/chunk-OGBD74IR.cjs.map +0 -1
- package/dist/chunk-SCFW4JFT.cjs.map +0 -1
- package/dist/chunk-Y7UKOBSY.js.map +0 -1
package/dist/presence.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkLE5XMIFJ_cjs = require('./chunk-LE5XMIFJ.cjs');
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
7
|
-
var
|
|
5
|
+
var chunkQR2NIDUK_cjs = require('./chunk-QR2NIDUK.cjs');
|
|
6
|
+
require('./chunk-65WK575V.cjs');
|
|
7
|
+
var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
|
|
8
8
|
var chunkA6PGQVTR_cjs = require('./chunk-A6PGQVTR.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkWN7BZDNH_cjs = require('./chunk-WN7BZDNH.cjs');
|
|
10
|
+
var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
|
|
11
11
|
require('./chunk-BM2GRZNM.cjs');
|
|
12
12
|
var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
|
|
13
13
|
var react = require('react');
|
|
@@ -48,8 +48,8 @@ function followLayout(controller, root, place2) {
|
|
|
48
48
|
observer.observe(root);
|
|
49
49
|
const unsubscribe = controller.editor.subscribe(later);
|
|
50
50
|
const fonts = root.ownerDocument.fonts;
|
|
51
|
-
const unlistenScroll =
|
|
52
|
-
const unlistenFonts = fonts &&
|
|
51
|
+
const unlistenScroll = chunkQJ34MOFV_cjs.listen(root, { scroll: update }, { capture: true, passive: true });
|
|
52
|
+
const unlistenFonts = fonts && chunkQJ34MOFV_cjs.listen(fonts, { loadingdone: later });
|
|
53
53
|
return () => {
|
|
54
54
|
view.cancelAnimationFrame(frame);
|
|
55
55
|
unsubscribe();
|
|
@@ -60,9 +60,9 @@ function followLayout(controller, root, place2) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// src/extensions/presence/presence-plugin.ts
|
|
63
|
-
var presenceKey =
|
|
63
|
+
var presenceKey = chunkVZZPCYA3_cjs.createPluginKey("presence");
|
|
64
64
|
var PRESENCE = "presence";
|
|
65
|
-
var samePeer = (a, b) => a.client === b.client && a.name === b.name && a.color === b.color && a.idle === b.idle &&
|
|
65
|
+
var samePeer = (a, b) => a.client === b.client && a.name === b.name && a.color === b.color && a.idle === b.idle && chunkVZZPCYA3_cjs.sameSelection(a.selection, b.selection);
|
|
66
66
|
var samePeers = (a, b) => chunkWZA5S5EJ_cjs.sameItems(a, b, samePeer);
|
|
67
67
|
var NO_PEERS = [];
|
|
68
68
|
var presencePlugin = {
|
|
@@ -74,7 +74,7 @@ var presencePlugin = {
|
|
|
74
74
|
if (!tr.docChanged) return peers;
|
|
75
75
|
let moved = false;
|
|
76
76
|
const next = peers.map((peer) => {
|
|
77
|
-
const selection = peer.selection &&
|
|
77
|
+
const selection = peer.selection && chunkVZZPCYA3_cjs.mapSelection(peer.selection, (pos) => tr.mapPos(pos, -1), tr.before.doc);
|
|
78
78
|
if (selection === peer.selection) return peer;
|
|
79
79
|
moved = true;
|
|
80
80
|
return { ...peer, selection };
|
|
@@ -85,9 +85,9 @@ var presencePlugin = {
|
|
|
85
85
|
var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((word) => Array.from(word)[0]?.toUpperCase() ?? "").join("");
|
|
86
86
|
function groupsOf(state) {
|
|
87
87
|
const byBlock = /* @__PURE__ */ new Map();
|
|
88
|
-
for (const { client, name, color, selection } of
|
|
88
|
+
for (const { client, name, color, selection } of chunkVZZPCYA3_cjs.getPluginState(state, presenceKey)) {
|
|
89
89
|
if (selection === null) continue;
|
|
90
|
-
const block =
|
|
90
|
+
const block = chunkVZZPCYA3_cjs.headBlockId(selection);
|
|
91
91
|
byBlock.set(block, [...byBlock.get(block) ?? [], { client, name, color }]);
|
|
92
92
|
}
|
|
93
93
|
return [...byBlock];
|
|
@@ -100,9 +100,9 @@ function place(controller, root, group) {
|
|
|
100
100
|
group.style.transform = `translateY(${top}px)`;
|
|
101
101
|
}
|
|
102
102
|
function PresenceAvatars({ controller, labels }) {
|
|
103
|
-
const groups =
|
|
103
|
+
const groups = chunkQJ34MOFV_cjs.useEditorState(controller, groupsOf, chunkWZA5S5EJ_cjs.sameValue);
|
|
104
104
|
const box = react.useRef(null);
|
|
105
|
-
|
|
105
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
106
106
|
const root = controller.root;
|
|
107
107
|
if (!root || box.current === null) return void 0;
|
|
108
108
|
const children = Array.from(box.current.children);
|
|
@@ -135,7 +135,7 @@ function tintOf(state, { color, selection }) {
|
|
|
135
135
|
if (![selection.anchor, selection.head].every(({ block }) => state.doc.index.has(block))) return [];
|
|
136
136
|
const attrs = { class: "quoin-presence-selection" };
|
|
137
137
|
if (color !== void 0) attrs.style = `--quoin-presence:${color}`;
|
|
138
|
-
return
|
|
138
|
+
return chunkVZZPCYA3_cjs.markRanges({ ...state, selection }).map((range) => ({ kind: "inline", ...range, attrs }));
|
|
139
139
|
}
|
|
140
140
|
var drawn = /* @__PURE__ */ new WeakMap();
|
|
141
141
|
function peerDecorations(state, peer) {
|
|
@@ -146,7 +146,7 @@ function peerDecorations(state, peer) {
|
|
|
146
146
|
return decorations;
|
|
147
147
|
}
|
|
148
148
|
function presenceDecorations(state) {
|
|
149
|
-
return
|
|
149
|
+
return chunkVZZPCYA3_cjs.getPluginState(state, presenceKey).flatMap((peer) => peerDecorations(state, peer));
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// src/extensions/presence/presence-labels.ts
|
|
@@ -181,7 +181,7 @@ function awarePos(shared, pos) {
|
|
|
181
181
|
try {
|
|
182
182
|
return {
|
|
183
183
|
...pos,
|
|
184
|
-
rel: Y__namespace.relativePositionToJSON(
|
|
184
|
+
rel: Y__namespace.relativePositionToJSON(chunkWN7BZDNH_cjs.relative(shared.text, shared.layout, pos))
|
|
185
185
|
};
|
|
186
186
|
} catch {
|
|
187
187
|
return pos;
|
|
@@ -202,7 +202,7 @@ var blockOf = (doc, value) => typeof value.block === "string" && doc.index.has(v
|
|
|
202
202
|
function textPos(shared, doc, value) {
|
|
203
203
|
if (shared !== null && value.rel !== void 0) {
|
|
204
204
|
try {
|
|
205
|
-
const found =
|
|
205
|
+
const found = chunkWN7BZDNH_cjs.absolute(shared.text, shared.layout, Y__namespace.createRelativePositionFromJSON(value.rel));
|
|
206
206
|
if (found !== null) return found;
|
|
207
207
|
} catch {
|
|
208
208
|
}
|
|
@@ -218,10 +218,10 @@ function fromAware(shared, doc, schema, value) {
|
|
|
218
218
|
if (anchor.region === void 0 && head.region === void 0) {
|
|
219
219
|
const [from2, to2] = [blockOf(doc, anchor), blockOf(doc, head)];
|
|
220
220
|
if (from2 === null || to2 === null) return null;
|
|
221
|
-
return from2 === to2 ?
|
|
221
|
+
return from2 === to2 ? chunkVZZPCYA3_cjs.nodeSelection(from2) : chunkVZZPCYA3_cjs.blockRangeSelection(from2, to2);
|
|
222
222
|
}
|
|
223
223
|
const [from, to] = [textPos(shared, doc, anchor), textPos(shared, doc, head)];
|
|
224
|
-
return from === null || to === null ? null :
|
|
224
|
+
return from === null || to === null ? null : chunkVZZPCYA3_cjs.validateSelection(doc, schema, chunkVZZPCYA3_cjs.textSelection(from, to));
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// src/extensions/presence/presence-session.ts
|
|
@@ -262,7 +262,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
|
|
|
262
262
|
timer ??= setTimeout(tick, 0);
|
|
263
263
|
};
|
|
264
264
|
const refresh = () => {
|
|
265
|
-
const before =
|
|
265
|
+
const before = chunkVZZPCYA3_cjs.getPluginState(editor.state, presenceKey);
|
|
266
266
|
const peers = [];
|
|
267
267
|
const joined = [];
|
|
268
268
|
const gone = new Set(seen.keys());
|
|
@@ -296,7 +296,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
|
|
|
296
296
|
for (const listener of [...link.listeners]) listener({ joined, left });
|
|
297
297
|
heard = true;
|
|
298
298
|
if (samePeers(peers, before)) return;
|
|
299
|
-
editor.dispatch(
|
|
299
|
+
editor.dispatch(chunkWN7BZDNH_cjs.sharedChange(editor, []).setMeta(PRESENCE, peers));
|
|
300
300
|
};
|
|
301
301
|
const changed = () => {
|
|
302
302
|
if (!writing) refresh();
|
|
@@ -305,7 +305,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
|
|
|
305
305
|
if (!transaction.local && seen.size > 0) refresh();
|
|
306
306
|
};
|
|
307
307
|
const stopEditor = editor.subscribe((state, tr) => {
|
|
308
|
-
if (tr !== null && tr.origin !== "remote" && !
|
|
308
|
+
if (tr !== null && tr.origin !== "remote" && !chunkVZZPCYA3_cjs.sameSelection(tr.before.selection, state.selection)) schedule();
|
|
309
309
|
});
|
|
310
310
|
put("user", { name: user.name, color: user.color });
|
|
311
311
|
write(null);
|
|
@@ -338,7 +338,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
|
|
|
338
338
|
|
|
339
339
|
// src/extensions/presence/place-caret.ts
|
|
340
340
|
function caretBox(host, offset) {
|
|
341
|
-
const map =
|
|
341
|
+
const map = chunkQJ34MOFV_cjs.domMapOf(host);
|
|
342
342
|
if (!map || !host.isConnected) return null;
|
|
343
343
|
const doc = host.ownerDocument;
|
|
344
344
|
const spans = [
|
|
@@ -366,7 +366,7 @@ function inside(box, area) {
|
|
|
366
366
|
}
|
|
367
367
|
function placeCaret(controller, root, caret, observer) {
|
|
368
368
|
const client = Number(caret.dataset.client);
|
|
369
|
-
const peer =
|
|
369
|
+
const peer = chunkVZZPCYA3_cjs.getPluginState(controller.editor.state, presenceKey).find((one) => one.client === client);
|
|
370
370
|
const head = peer?.selection?.kind === "text" ? peer.selection.head : null;
|
|
371
371
|
const host = head && controller.registry.get(head.block, head.region);
|
|
372
372
|
const box = host ? caretBox(host, head.offset) : null;
|
|
@@ -384,13 +384,13 @@ function placeCaret(controller, root, caret, observer) {
|
|
|
384
384
|
const cut = (past) => `${Math.max(...areas.map(past)) / scale + 1}px`;
|
|
385
385
|
caret.style.clipPath = areas[0] ? `inset(-99px ${cut((a) => box.left - a.right)} -99px ${cut((a) => a.left - box.left)})` : "";
|
|
386
386
|
}
|
|
387
|
-
var shownOf = (state) =>
|
|
387
|
+
var shownOf = (state) => chunkVZZPCYA3_cjs.getPluginState(state, presenceKey).flatMap(
|
|
388
388
|
({ client, name, color, idle, selection }) => selection?.kind === "text" ? [{ client, name, color, idle }] : []
|
|
389
389
|
);
|
|
390
390
|
function RemoteCarets({ controller, labels }) {
|
|
391
|
-
const shown =
|
|
391
|
+
const shown = chunkQJ34MOFV_cjs.useEditorState(controller, shownOf, chunkWZA5S5EJ_cjs.sameValue);
|
|
392
392
|
const box = react.useRef(null);
|
|
393
|
-
|
|
393
|
+
chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
|
|
394
394
|
const root = controller.root;
|
|
395
395
|
if (!root || box.current === null) return void 0;
|
|
396
396
|
const carets = Array.from(box.current.children);
|
|
@@ -412,9 +412,9 @@ function usePresenceActivity(controller, link) {
|
|
|
412
412
|
react.useEffect(() => {
|
|
413
413
|
const doc = controller.root?.ownerDocument;
|
|
414
414
|
if (!doc) return void 0;
|
|
415
|
-
let focused =
|
|
415
|
+
let focused = chunkQR2NIDUK_cjs.ownsNode(controller, doc.activeElement);
|
|
416
416
|
const update = () => setActive(link, focused && !controller.readOnly);
|
|
417
|
-
const stopFocus =
|
|
417
|
+
const stopFocus = chunkQR2NIDUK_cjs.watchCanvasFocus(controller, doc, (inside2) => {
|
|
418
418
|
focused = inside2;
|
|
419
419
|
update();
|
|
420
420
|
});
|
|
@@ -500,7 +500,7 @@ function presenceExtension(collaboration, options = {}) {
|
|
|
500
500
|
] });
|
|
501
501
|
}
|
|
502
502
|
const ui = { overlays: [Overlay] };
|
|
503
|
-
return
|
|
503
|
+
return chunkVZZPCYA3_cjs.defineExtension({
|
|
504
504
|
name: "presence",
|
|
505
505
|
// Below the default, so the collaboration it reads has connected before it starts.
|
|
506
506
|
priority: 99,
|
|
@@ -508,8 +508,8 @@ function presenceExtension(collaboration, options = {}) {
|
|
|
508
508
|
decorations: presenceDecorations,
|
|
509
509
|
onMount(editor) {
|
|
510
510
|
const link = linkOf(editor);
|
|
511
|
-
if (
|
|
512
|
-
const session = startPresence(editor, collaboration, awareness, link, () =>
|
|
511
|
+
if (chunkWN7BZDNH_cjs.sharedOf(collaboration, editor) === null) chunkA6PGQVTR_cjs.devWarn(UNBOUND);
|
|
512
|
+
const session = startPresence(editor, collaboration, awareness, link, () => chunkWN7BZDNH_cjs.sharedOf(collaboration, editor));
|
|
513
513
|
link.session = session;
|
|
514
514
|
return () => {
|
|
515
515
|
session.stop();
|
package/dist/presence.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import './types-
|
|
1
|
+
import { Extension } from './engine.cjs';
|
|
2
|
+
import { YjsCollaboration } from './yjs.cjs';
|
|
3
|
+
import './types-CQ8Vw_7N.cjs';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
|
|
6
6
|
/** Every string presence shows or speaks. Names come as a list of the people meant, in the order they came. */
|
|
@@ -27,4 +27,5 @@ type PresenceOptions = {
|
|
|
27
27
|
*/
|
|
28
28
|
declare function presenceExtension(collaboration: YjsCollaboration, options?: PresenceOptions): Extension;
|
|
29
29
|
|
|
30
|
-
export {
|
|
30
|
+
export { englishPresenceLabels, presenceExtension };
|
|
31
|
+
export type { PresenceLabels, PresenceOptions };
|
package/dist/presence.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import './types-
|
|
1
|
+
import { Extension } from './engine.js';
|
|
2
|
+
import { YjsCollaboration } from './yjs.js';
|
|
3
|
+
import './types-CQ8Vw_7N.js';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
|
|
6
6
|
/** Every string presence shows or speaks. Names come as a list of the people meant, in the order they came. */
|
|
@@ -27,4 +27,5 @@ type PresenceOptions = {
|
|
|
27
27
|
*/
|
|
28
28
|
declare function presenceExtension(collaboration: YjsCollaboration, options?: PresenceOptions): Extension;
|
|
29
29
|
|
|
30
|
-
export {
|
|
30
|
+
export { englishPresenceLabels, presenceExtension };
|
|
31
|
+
export type { PresenceLabels, PresenceOptions };
|
package/dist/presence.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { clipBoxes } from './chunk-MQUCCSWG.js';
|
|
3
|
-
import { ownsNode, watchCanvasFocus } from './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import { useEditorState, useIsomorphicLayoutEffect, listen, domMapOf } from './chunk-
|
|
3
|
+
import { ownsNode, watchCanvasFocus } from './chunk-R7MYG522.js';
|
|
4
|
+
import './chunk-MQTLZTIM.js';
|
|
5
|
+
import { useEditorState, useIsomorphicLayoutEffect, listen, domMapOf } from './chunk-XFEDJEJF.js';
|
|
6
6
|
import { devWarn } from './chunk-HDJ653LM.js';
|
|
7
|
-
import { sharedOf, sharedChange, absolute, relative } from './chunk-
|
|
8
|
-
import { createPluginKey, defineExtension, getPluginState, mapSelection, sameSelection, headBlockId, markRanges, nodeSelection, blockRangeSelection, validateSelection, textSelection } from './chunk-
|
|
7
|
+
import { sharedOf, sharedChange, absolute, relative } from './chunk-G25FMFEZ.js';
|
|
8
|
+
import { createPluginKey, defineExtension, getPluginState, mapSelection, sameSelection, headBlockId, markRanges, nodeSelection, blockRangeSelection, validateSelection, textSelection } from './chunk-OS2O6IKX.js';
|
|
9
9
|
import './chunk-CSKKSXCE.js';
|
|
10
10
|
import { sameValue, isRecord, sameItems } from './chunk-BJTOLCRR.js';
|
|
11
11
|
import { useEffect, useRef } from 'react';
|
|
@@ -141,4 +141,5 @@ declare function blockByType(definitions: readonly AnyBlockDefinition[], type: s
|
|
|
141
141
|
/** The definitions offered in the slash palette, in registration order, one per type, with the last registration of a type winning. */
|
|
142
142
|
declare function paletteBlocks(definitions: AnyBlockDefinition[]): AnyBlockDefinition[];
|
|
143
143
|
|
|
144
|
-
export {
|
|
144
|
+
export { defineBlock as d, blockByType as f, paletteBlocks as p };
|
|
145
|
+
export type { AnyBlockDefinition as A, BlockDefinition as B, CodeHighlighter as C, UploadFn as U, UploadResult as a, BlockEditorProps as b, BlockPreviewProps as c, CodeToken as e };
|
|
@@ -141,4 +141,5 @@ declare function blockByType(definitions: readonly AnyBlockDefinition[], type: s
|
|
|
141
141
|
/** The definitions offered in the slash palette, in registration order, one per type, with the last registration of a type winning. */
|
|
142
142
|
declare function paletteBlocks(definitions: AnyBlockDefinition[]): AnyBlockDefinition[];
|
|
143
143
|
|
|
144
|
-
export {
|
|
144
|
+
export { defineBlock as d, blockByType as f, paletteBlocks as p };
|
|
145
|
+
export type { AnyBlockDefinition as A, BlockDefinition as B, CodeHighlighter as C, UploadFn as U, UploadResult as a, BlockEditorProps as b, BlockPreviewProps as c, CodeToken as e };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Extension } from './types-
|
|
1
|
+
import { E as Extension } from './types-DXF9p4qV.cjs';
|
|
2
2
|
|
|
3
3
|
/** Every string the stats footer shows and the character limit speaks. */
|
|
4
4
|
type StatsLabels = {
|
|
@@ -37,4 +37,5 @@ type StatsOptions = {
|
|
|
37
37
|
/** Counts of the document under it, and optionally a character limit, focus mode and typographic input rules. */
|
|
38
38
|
declare function statsExtension(options?: StatsOptions): Extension;
|
|
39
39
|
|
|
40
|
-
export {
|
|
40
|
+
export { englishStatsLabels as e, statsExtension as s };
|
|
41
|
+
export type { StatsLabels as S, StatsOptions as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Extension } from './types-
|
|
1
|
+
import { E as Extension } from './types-BjLcmV00.js';
|
|
2
2
|
|
|
3
3
|
/** Every string the stats footer shows and the character limit speaks. */
|
|
4
4
|
type StatsLabels = {
|
|
@@ -37,4 +37,5 @@ type StatsOptions = {
|
|
|
37
37
|
/** Counts of the document under it, and optionally a character limit, focus mode and typographic input rules. */
|
|
38
38
|
declare function statsExtension(options?: StatsOptions): Extension;
|
|
39
39
|
|
|
40
|
-
export {
|
|
40
|
+
export { englishStatsLabels as e, statsExtension as s };
|
|
41
|
+
export type { StatsLabels as S, StatsOptions as a };
|
package/dist/stats.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkSTKGRXSA_cjs = require('./chunk-STKGRXSA.cjs');
|
|
5
5
|
require('./chunk-XZ4NC3Q7.cjs');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-65WK575V.cjs');
|
|
7
|
+
require('./chunk-QJ34MOFV.cjs');
|
|
8
8
|
require('./chunk-A6PGQVTR.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-VZZPCYA3.cjs');
|
|
10
10
|
require('./chunk-BM2GRZNM.cjs');
|
|
11
11
|
require('./chunk-WZA5S5EJ.cjs');
|
|
12
12
|
|
|
@@ -14,15 +14,15 @@ require('./chunk-WZA5S5EJ.cjs');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "englishStatsLabels", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkSTKGRXSA_cjs.englishStatsLabels; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "statsExtension", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkSTKGRXSA_cjs.statsExtension; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "useEditorStats", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkSTKGRXSA_cjs.useEditorStats; }
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=stats.cjs.map
|
|
28
28
|
//# sourceMappingURL=stats.cjs.map
|
package/dist/stats.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as StatsLabels, a as StatsOptions, e as englishStatsLabels, s as statsExtension } from './stats-extension-
|
|
2
|
-
import {
|
|
3
|
-
import './types-
|
|
4
|
-
import './types-
|
|
1
|
+
export { S as StatsLabels, a as StatsOptions, e as englishStatsLabels, s as statsExtension } from './stats-extension-XqOTvRaq.cjs';
|
|
2
|
+
import { ViewController } from './headless.cjs';
|
|
3
|
+
import './types-DXF9p4qV.cjs';
|
|
4
|
+
import './types-CQ8Vw_7N.cjs';
|
|
5
5
|
|
|
6
6
|
type EditorStats = {
|
|
7
7
|
readonly characters: number;
|
|
@@ -16,4 +16,5 @@ type EditorStats = {
|
|
|
16
16
|
*/
|
|
17
17
|
declare function useEditorStats(controller: ViewController): EditorStats;
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { useEditorStats };
|
|
20
|
+
export type { EditorStats };
|
package/dist/stats.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as StatsLabels, a as StatsOptions, e as englishStatsLabels, s as statsExtension } from './stats-extension-
|
|
2
|
-
import {
|
|
3
|
-
import './types-
|
|
4
|
-
import './types-
|
|
1
|
+
export { S as StatsLabels, a as StatsOptions, e as englishStatsLabels, s as statsExtension } from './stats-extension-oD6D1cYy.js';
|
|
2
|
+
import { ViewController } from './headless.js';
|
|
3
|
+
import './types-BjLcmV00.js';
|
|
4
|
+
import './types-CQ8Vw_7N.js';
|
|
5
5
|
|
|
6
6
|
type EditorStats = {
|
|
7
7
|
readonly characters: number;
|
|
@@ -16,4 +16,5 @@ type EditorStats = {
|
|
|
16
16
|
*/
|
|
17
17
|
declare function useEditorStats(controller: ViewController): EditorStats;
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { useEditorStats };
|
|
20
|
+
export type { EditorStats };
|
package/dist/stats.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { englishStatsLabels, statsExtension, useEditorStats } from './chunk-
|
|
2
|
+
export { englishStatsLabels, statsExtension, useEditorStats } from './chunk-IJKGF6SC.js';
|
|
3
3
|
import './chunk-AD3NY7NA.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-MQTLZTIM.js';
|
|
5
|
+
import './chunk-XFEDJEJF.js';
|
|
6
6
|
import './chunk-HDJ653LM.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-OS2O6IKX.js';
|
|
8
8
|
import './chunk-CSKKSXCE.js';
|
|
9
9
|
import './chunk-BJTOLCRR.js';
|
|
10
10
|
//# sourceMappingURL=stats.js.map
|