@rtif-sdk/web 1.0.0 → 1.3.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/dist/block-drag-handler.d.ts +5 -0
- package/dist/block-drag-handler.d.ts.map +1 -1
- package/dist/block-drag-handler.js +32 -3
- package/dist/block-drag-handler.js.map +1 -1
- package/dist/block-renderer.d.ts +12 -6
- package/dist/block-renderer.d.ts.map +1 -1
- package/dist/block-renderer.js +98 -9
- package/dist/block-renderer.js.map +1 -1
- package/dist/block-type-dropdown.d.ts +78 -0
- package/dist/block-type-dropdown.d.ts.map +1 -0
- package/dist/block-type-dropdown.js +276 -0
- package/dist/block-type-dropdown.js.map +1 -0
- package/dist/color-picker.d.ts +91 -0
- package/dist/color-picker.d.ts.map +1 -0
- package/dist/color-picker.js +346 -0
- package/dist/color-picker.js.map +1 -0
- package/dist/content-handlers.d.ts +7 -8
- package/dist/content-handlers.d.ts.map +1 -1
- package/dist/content-handlers.js +122 -93
- package/dist/content-handlers.js.map +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +224 -15
- package/dist/editor.js.map +1 -1
- package/dist/embed-utils.d.ts +148 -0
- package/dist/embed-utils.d.ts.map +1 -0
- package/dist/embed-utils.js +197 -0
- package/dist/embed-utils.js.map +1 -0
- package/dist/font-family-picker.d.ts +105 -0
- package/dist/font-family-picker.d.ts.map +1 -0
- package/dist/font-family-picker.js +314 -0
- package/dist/font-family-picker.js.map +1 -0
- package/dist/font-size-picker.d.ts +82 -0
- package/dist/font-size-picker.d.ts.map +1 -0
- package/dist/font-size-picker.js +290 -0
- package/dist/font-size-picker.js.map +1 -0
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.d.ts +2 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/link-plugin.d.ts +4 -0
- package/dist/plugins/link-plugin.d.ts.map +1 -1
- package/dist/plugins/link-plugin.js +17 -0
- package/dist/plugins/link-plugin.js.map +1 -1
- package/dist/plugins/mark-utils.d.ts +31 -0
- package/dist/plugins/mark-utils.d.ts.map +1 -1
- package/dist/plugins/mark-utils.js +46 -0
- package/dist/plugins/mark-utils.js.map +1 -1
- package/dist/renderer.d.ts +31 -2
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +131 -55
- package/dist/renderer.js.map +1 -1
- package/dist/selection-sync.d.ts +2 -26
- package/dist/selection-sync.d.ts.map +1 -1
- package/dist/selection-sync.js +49 -13
- package/dist/selection-sync.js.map +1 -1
- package/dist/spatial-index.d.ts +203 -0
- package/dist/spatial-index.d.ts.map +1 -0
- package/dist/spatial-index.js +211 -0
- package/dist/spatial-index.js.map +1 -0
- package/dist/types.d.ts +93 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/virtual-viewport.d.ts +241 -0
- package/dist/virtual-viewport.d.ts.map +1 -0
- package/dist/virtual-viewport.js +584 -0
- package/dist/virtual-viewport.js.map +1 -0
- package/package.json +17 -5
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual viewport for block-level DOM virtualization.
|
|
3
|
+
*
|
|
4
|
+
* Manages which blocks are rendered into the DOM based on scroll position,
|
|
5
|
+
* using spacer elements to maintain correct scroll height. Only blocks
|
|
6
|
+
* within the visible range (plus a configurable buffer) are present in the
|
|
7
|
+
* DOM at any time, enabling smooth editing of documents with thousands of
|
|
8
|
+
* blocks.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
import { createSpatialIndex } from './spatial-index.js';
|
|
13
|
+
import { createBlockElement, reconcileBlock } from './renderer.js';
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Helpers
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
/**
|
|
18
|
+
* Walk DOM ancestors of an element to find the nearest scrollable container.
|
|
19
|
+
*
|
|
20
|
+
* Checks `getComputedStyle(el).overflowY` for `auto` or `scroll`. If no
|
|
21
|
+
* scrollable ancestor is found (including `document.body` and
|
|
22
|
+
* `document.documentElement`), returns `window`.
|
|
23
|
+
*
|
|
24
|
+
* @param el - The element to start searching from
|
|
25
|
+
* @returns The nearest scrollable ancestor, or `window`
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const scroller = findScrollParent(editorRoot);
|
|
30
|
+
* scroller.addEventListener('scroll', onScroll);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function findScrollParent(el) {
|
|
34
|
+
let current = el.parentElement;
|
|
35
|
+
while (current && current !== document.body && current !== document.documentElement) {
|
|
36
|
+
const overflow = getComputedStyle(current).overflowY;
|
|
37
|
+
if (overflow === 'auto' || overflow === 'scroll') {
|
|
38
|
+
return current;
|
|
39
|
+
}
|
|
40
|
+
current = current.parentElement;
|
|
41
|
+
}
|
|
42
|
+
return window;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a spacer div element for the virtual viewport.
|
|
46
|
+
*
|
|
47
|
+
* Spacers are invisible, non-interactive, non-editable elements that
|
|
48
|
+
* maintain scroll height for blocks not rendered in the DOM.
|
|
49
|
+
*/
|
|
50
|
+
function createSpacer(position) {
|
|
51
|
+
const el = document.createElement('div');
|
|
52
|
+
el.setAttribute('data-rtif-spacer', position);
|
|
53
|
+
el.setAttribute('contenteditable', 'false');
|
|
54
|
+
el.setAttribute('aria-hidden', 'true');
|
|
55
|
+
el.style.visibility = 'hidden';
|
|
56
|
+
el.style.overflow = 'hidden';
|
|
57
|
+
el.style.pointerEvents = 'none';
|
|
58
|
+
el.style.height = '0px';
|
|
59
|
+
return el;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Read scroll metrics from a scroll container, adjusted for the root
|
|
63
|
+
* element's offset within the container.
|
|
64
|
+
*
|
|
65
|
+
* When the root has siblings above it (e.g., a toolbar), we subtract
|
|
66
|
+
* the root's top offset so that scrollTop=0 corresponds to the top of
|
|
67
|
+
* the editor content, not the top of the scroll container.
|
|
68
|
+
*/
|
|
69
|
+
function getScrollMetrics(scrollContainer, root) {
|
|
70
|
+
if (scrollContainer === window) {
|
|
71
|
+
// Root's top in viewport coordinates; negative means scrolled past the top
|
|
72
|
+
const rootRect = root.getBoundingClientRect();
|
|
73
|
+
return {
|
|
74
|
+
scrollTop: Math.max(0, -rootRect.top),
|
|
75
|
+
viewportHeight: window.innerHeight,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const el = scrollContainer;
|
|
79
|
+
// Compute root's offset relative to the scroll container's content origin
|
|
80
|
+
const rootOffset = root.offsetTop - el.offsetTop;
|
|
81
|
+
return {
|
|
82
|
+
scrollTop: Math.max(0, el.scrollTop - rootOffset),
|
|
83
|
+
viewportHeight: el.clientHeight,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Update spacer element heights based on the current rendered range
|
|
88
|
+
* and spatial index.
|
|
89
|
+
*/
|
|
90
|
+
function updateSpacerHeights(topSpacer, bottomSpacer, renderedRange, spatialIndex) {
|
|
91
|
+
const blockCount = spatialIndex.blockCount();
|
|
92
|
+
const topHeight = renderedRange.start > 0
|
|
93
|
+
? spatialIndex.blockTop(renderedRange.start)
|
|
94
|
+
: 0;
|
|
95
|
+
const bottomHeight = renderedRange.end < blockCount
|
|
96
|
+
? spatialIndex.totalHeight() - spatialIndex.blockTop(renderedRange.end)
|
|
97
|
+
: 0;
|
|
98
|
+
topSpacer.style.height = `${topHeight}px`;
|
|
99
|
+
bottomSpacer.style.height = `${bottomHeight}px`;
|
|
100
|
+
}
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Factory
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
/**
|
|
105
|
+
* Create a virtual viewport for block-level DOM virtualization.
|
|
106
|
+
*
|
|
107
|
+
* The viewport renders only blocks within the visible scroll region (plus
|
|
108
|
+
* a configurable buffer), using spacer elements to maintain correct scroll
|
|
109
|
+
* height. As the user scrolls, blocks entering the viewport are created
|
|
110
|
+
* and blocks leaving are removed.
|
|
111
|
+
*
|
|
112
|
+
* @param config - Viewport configuration (root element, buffer size, etc.)
|
|
113
|
+
* @param doc - The initial RTIF document
|
|
114
|
+
* @returns A {@link VirtualViewport} instance
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { createVirtualViewport } from '@rtif-sdk/web';
|
|
119
|
+
*
|
|
120
|
+
* const vp = createVirtualViewport({ root: editorEl, bufferSize: 15 }, doc);
|
|
121
|
+
* vp.renderInitial(doc, markRenderers, blockRenderers, blockElementMap);
|
|
122
|
+
*
|
|
123
|
+
* // On document change:
|
|
124
|
+
* vp.reconcile(prevDoc, nextDoc, null, markRenderers, blockRenderers, blockElementMap);
|
|
125
|
+
*
|
|
126
|
+
* // Cleanup:
|
|
127
|
+
* vp.destroy();
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export function createVirtualViewport(config, doc) {
|
|
131
|
+
const root = config.root;
|
|
132
|
+
const bufferSize = config.bufferSize ?? 10;
|
|
133
|
+
// Hysteresis: blocks are removed when they're this many blocks beyond the
|
|
134
|
+
// buffer, but added at the normal buffer distance. Prevents DOM thrashing
|
|
135
|
+
// at scroll boundaries.
|
|
136
|
+
const evictMargin = 5;
|
|
137
|
+
// Build spatial index
|
|
138
|
+
const spatialIndex = createSpatialIndex(doc, {
|
|
139
|
+
estimatedBlockHeight: config.estimatedBlockHeight,
|
|
140
|
+
blockTypeHeights: config.blockTypeHeights,
|
|
141
|
+
});
|
|
142
|
+
// Internal state
|
|
143
|
+
let _doc = doc;
|
|
144
|
+
let _renderedRange = { start: 0, end: 0 };
|
|
145
|
+
const _pinnedBlockIds = new Set();
|
|
146
|
+
let _topSpacer = createSpacer('top');
|
|
147
|
+
let _bottomSpacer = createSpacer('bottom');
|
|
148
|
+
let _scrollRAF = null;
|
|
149
|
+
let _destroyed = false;
|
|
150
|
+
let _expanded = false;
|
|
151
|
+
// Stored renderer references (updated on renderInitial/reconcile calls)
|
|
152
|
+
let _markRenderers;
|
|
153
|
+
let _blockRenderers;
|
|
154
|
+
let _blockElementMap;
|
|
155
|
+
// Persistent blockId → index map. Rebuilt when _doc changes.
|
|
156
|
+
// Avoids O(n) map construction in measureRenderedHeights and reconcile.
|
|
157
|
+
let _blockIdToIndex = new Map();
|
|
158
|
+
function rebuildBlockIdToIndex() {
|
|
159
|
+
_blockIdToIndex = new Map();
|
|
160
|
+
for (let i = 0; i < _doc.blocks.length; i++) {
|
|
161
|
+
_blockIdToIndex.set(_doc.blocks[i].id, i);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Build the initial index
|
|
165
|
+
rebuildBlockIdToIndex();
|
|
166
|
+
// Scroll container
|
|
167
|
+
const _scrollContainer = config.scrollContainer ?? findScrollParent(root);
|
|
168
|
+
// -------------------------------------------------------------------
|
|
169
|
+
// Scroll listener
|
|
170
|
+
// -------------------------------------------------------------------
|
|
171
|
+
function handleScroll() {
|
|
172
|
+
if (_destroyed || _expanded)
|
|
173
|
+
return;
|
|
174
|
+
if (_scrollRAF !== null)
|
|
175
|
+
return;
|
|
176
|
+
_scrollRAF = requestAnimationFrame(() => {
|
|
177
|
+
_scrollRAF = null;
|
|
178
|
+
if (_destroyed || _expanded)
|
|
179
|
+
return;
|
|
180
|
+
applyVisibleRange();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Attach scroll listener
|
|
184
|
+
_scrollContainer.addEventListener('scroll', handleScroll, { passive: true });
|
|
185
|
+
// -------------------------------------------------------------------
|
|
186
|
+
// O(1) insertion helper
|
|
187
|
+
// -------------------------------------------------------------------
|
|
188
|
+
/**
|
|
189
|
+
* Insert a block element at the correct position in the root, maintaining
|
|
190
|
+
* document order. Uses the rendered range and blockElementMap to find the
|
|
191
|
+
* insertion point in O(1) for the common case (sequential insertion at
|
|
192
|
+
* range edges), falling back to O(k) scan of rendered blocks for
|
|
193
|
+
* out-of-order insertions.
|
|
194
|
+
*/
|
|
195
|
+
function insertBlockElement(el, blockIndex) {
|
|
196
|
+
// Fast path: inserting at the end of the rendered range — insert before
|
|
197
|
+
// the bottom spacer.
|
|
198
|
+
if (blockIndex >= _renderedRange.end - 1) {
|
|
199
|
+
root.insertBefore(el, _bottomSpacer);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
// Fast path: inserting at the start of the rendered range — insert after
|
|
203
|
+
// the top spacer.
|
|
204
|
+
if (blockIndex <= _renderedRange.start) {
|
|
205
|
+
const afterTopSpacer = _topSpacer.nextSibling;
|
|
206
|
+
root.insertBefore(el, afterTopSpacer);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
// General case: find the first rendered block after this index.
|
|
210
|
+
// Only scan within the rendered range (not the full doc).
|
|
211
|
+
const scanEnd = Math.min(_renderedRange.end, _doc.blocks.length);
|
|
212
|
+
for (let i = blockIndex + 1; i < scanEnd; i++) {
|
|
213
|
+
const block = _doc.blocks[i];
|
|
214
|
+
const existingEl = _blockElementMap?.get(block.id);
|
|
215
|
+
if (existingEl && existingEl.parentNode === root) {
|
|
216
|
+
root.insertBefore(el, existingEl);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// No later block found in DOM -- insert before bottom spacer
|
|
221
|
+
root.insertBefore(el, _bottomSpacer);
|
|
222
|
+
}
|
|
223
|
+
// -------------------------------------------------------------------
|
|
224
|
+
// Core range computation and DOM sync
|
|
225
|
+
// -------------------------------------------------------------------
|
|
226
|
+
/**
|
|
227
|
+
* Compute the visible range and synchronize the DOM accordingly.
|
|
228
|
+
* Adds blocks entering the range, removes blocks leaving the range
|
|
229
|
+
* (with hysteresis to prevent thrashing), and updates spacer heights.
|
|
230
|
+
*/
|
|
231
|
+
function applyVisibleRange() {
|
|
232
|
+
const { scrollTop, viewportHeight } = getScrollMetrics(_scrollContainer, root);
|
|
233
|
+
const newRange = spatialIndex.computeVisibleRange(scrollTop, viewportHeight, bufferSize);
|
|
234
|
+
const prevStart = _renderedRange.start;
|
|
235
|
+
const prevEnd = _renderedRange.end;
|
|
236
|
+
const nextStart = newRange.start;
|
|
237
|
+
const nextEnd = newRange.end;
|
|
238
|
+
// Hysteresis: only remove blocks that are evictMargin beyond the new range.
|
|
239
|
+
// This prevents DOM thrashing when scrolling right at the buffer boundary.
|
|
240
|
+
const evictStart = Math.max(0, nextStart - evictMargin);
|
|
241
|
+
const evictEnd = Math.min(_doc.blocks.length, nextEnd + evictMargin);
|
|
242
|
+
// Remove blocks that have scrolled far out of range (from the top)
|
|
243
|
+
for (let i = prevStart; i < Math.min(prevEnd, evictStart); i++) {
|
|
244
|
+
removeBlockAtIndex(i);
|
|
245
|
+
}
|
|
246
|
+
// Remove blocks that have scrolled far out of range (from the bottom)
|
|
247
|
+
for (let i = Math.max(prevStart, evictEnd); i < prevEnd; i++) {
|
|
248
|
+
removeBlockAtIndex(i);
|
|
249
|
+
}
|
|
250
|
+
// Add blocks that have scrolled into range (at the top)
|
|
251
|
+
for (let i = nextStart; i < Math.min(nextEnd, prevStart); i++) {
|
|
252
|
+
addBlockAtIndex(i);
|
|
253
|
+
}
|
|
254
|
+
// Add blocks that have scrolled into range (at the bottom)
|
|
255
|
+
for (let i = Math.max(nextStart, prevEnd); i < nextEnd; i++) {
|
|
256
|
+
addBlockAtIndex(i);
|
|
257
|
+
}
|
|
258
|
+
_renderedRange = { start: nextStart, end: nextEnd };
|
|
259
|
+
updateSpacerHeights(_topSpacer, _bottomSpacer, _renderedRange, spatialIndex);
|
|
260
|
+
measureRenderedHeights();
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Remove a block element at the given document index from the DOM,
|
|
264
|
+
* unless it is pinned.
|
|
265
|
+
*/
|
|
266
|
+
function removeBlockAtIndex(index) {
|
|
267
|
+
if (index < 0 || index >= _doc.blocks.length)
|
|
268
|
+
return;
|
|
269
|
+
const block = _doc.blocks[index];
|
|
270
|
+
if (_pinnedBlockIds.has(block.id))
|
|
271
|
+
return;
|
|
272
|
+
const el = _blockElementMap?.get(block.id);
|
|
273
|
+
if (el && el.parentNode === root) {
|
|
274
|
+
root.removeChild(el);
|
|
275
|
+
_blockElementMap?.delete(block.id);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Create and insert a block element at the given document index.
|
|
280
|
+
* Skips if the block is already in the DOM.
|
|
281
|
+
*/
|
|
282
|
+
function addBlockAtIndex(index) {
|
|
283
|
+
if (index < 0 || index >= _doc.blocks.length)
|
|
284
|
+
return;
|
|
285
|
+
const block = _doc.blocks[index];
|
|
286
|
+
// Skip if already rendered
|
|
287
|
+
if (_blockElementMap?.get(block.id)?.parentNode === root)
|
|
288
|
+
return;
|
|
289
|
+
const el = createBlockElement(block, _markRenderers, _blockRenderers);
|
|
290
|
+
insertBlockElement(el, index);
|
|
291
|
+
_blockElementMap?.set(block.id, el);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Measure DOM heights of all currently rendered block elements and
|
|
295
|
+
* update the spatial index. Uses the persistent _blockIdToIndex map
|
|
296
|
+
* to avoid O(n) map construction on every call.
|
|
297
|
+
*/
|
|
298
|
+
function measureRenderedHeights() {
|
|
299
|
+
if (!_blockElementMap)
|
|
300
|
+
return;
|
|
301
|
+
const updates = [];
|
|
302
|
+
for (const [blockId, el] of _blockElementMap) {
|
|
303
|
+
if (el.parentNode !== root)
|
|
304
|
+
continue;
|
|
305
|
+
const idx = _blockIdToIndex.get(blockId);
|
|
306
|
+
if (idx === undefined)
|
|
307
|
+
continue;
|
|
308
|
+
const height = el.offsetHeight;
|
|
309
|
+
if (height > 0 && height !== spatialIndex.blockHeight(idx)) {
|
|
310
|
+
updates.push({ index: idx, height });
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (updates.length > 0) {
|
|
314
|
+
spatialIndex.setBlockHeights(updates);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
// -------------------------------------------------------------------
|
|
318
|
+
// Public API
|
|
319
|
+
// -------------------------------------------------------------------
|
|
320
|
+
const viewport = {
|
|
321
|
+
get spatialIndex() {
|
|
322
|
+
return spatialIndex;
|
|
323
|
+
},
|
|
324
|
+
get renderedRange() {
|
|
325
|
+
return _renderedRange;
|
|
326
|
+
},
|
|
327
|
+
get pinnedBlockIds() {
|
|
328
|
+
return _pinnedBlockIds;
|
|
329
|
+
},
|
|
330
|
+
renderInitial(doc, markRenderers, blockRenderers, blockElementMap) {
|
|
331
|
+
_doc = doc;
|
|
332
|
+
_markRenderers = markRenderers;
|
|
333
|
+
_blockRenderers = blockRenderers;
|
|
334
|
+
_blockElementMap = blockElementMap;
|
|
335
|
+
// Rebuild spatial index and block ID map for the new document
|
|
336
|
+
spatialIndex.rebuild(doc);
|
|
337
|
+
rebuildBlockIdToIndex();
|
|
338
|
+
// Clear root children
|
|
339
|
+
while (root.firstChild) {
|
|
340
|
+
root.removeChild(root.firstChild);
|
|
341
|
+
}
|
|
342
|
+
if (_blockElementMap) {
|
|
343
|
+
_blockElementMap.clear();
|
|
344
|
+
}
|
|
345
|
+
// Create spacers
|
|
346
|
+
_topSpacer = createSpacer('top');
|
|
347
|
+
_bottomSpacer = createSpacer('bottom');
|
|
348
|
+
root.appendChild(_topSpacer);
|
|
349
|
+
root.appendChild(_bottomSpacer);
|
|
350
|
+
// Compute initial visible range
|
|
351
|
+
const { scrollTop, viewportHeight } = getScrollMetrics(_scrollContainer, root);
|
|
352
|
+
const range = spatialIndex.computeVisibleRange(scrollTop, viewportHeight, bufferSize);
|
|
353
|
+
_renderedRange = { start: range.start, end: range.end };
|
|
354
|
+
// Render blocks in the visible range
|
|
355
|
+
for (let i = range.start; i < range.end; i++) {
|
|
356
|
+
const block = doc.blocks[i];
|
|
357
|
+
const el = createBlockElement(block, markRenderers, blockRenderers);
|
|
358
|
+
root.insertBefore(el, _bottomSpacer);
|
|
359
|
+
if (_blockElementMap) {
|
|
360
|
+
_blockElementMap.set(block.id, el);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Update spacer heights
|
|
364
|
+
updateSpacerHeights(_topSpacer, _bottomSpacer, _renderedRange, spatialIndex);
|
|
365
|
+
// Measure actual heights and update spatial index
|
|
366
|
+
measureRenderedHeights();
|
|
367
|
+
},
|
|
368
|
+
reconcile(prevDoc, nextDoc, composingBlockId, markRenderers, blockRenderers, blockElementMap) {
|
|
369
|
+
// Update stored references
|
|
370
|
+
_markRenderers = markRenderers;
|
|
371
|
+
_blockRenderers = blockRenderers;
|
|
372
|
+
_blockElementMap = blockElementMap;
|
|
373
|
+
// Build a map of measured heights from prevDoc blocks for preservation.
|
|
374
|
+
// Uses the still-valid _blockIdToIndex from the previous doc.
|
|
375
|
+
const preserveHeights = new Map();
|
|
376
|
+
for (let i = 0; i < prevDoc.blocks.length; i++) {
|
|
377
|
+
const block = prevDoc.blocks[i];
|
|
378
|
+
const idx = _blockIdToIndex.get(block.id);
|
|
379
|
+
if (idx !== undefined && idx < spatialIndex.blockCount()) {
|
|
380
|
+
preserveHeights.set(block.id, spatialIndex.blockHeight(idx));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// Rebuild spatial index and block ID map from nextDoc
|
|
384
|
+
spatialIndex.rebuild(nextDoc, preserveHeights);
|
|
385
|
+
_doc = nextDoc;
|
|
386
|
+
rebuildBlockIdToIndex();
|
|
387
|
+
// Build prev block lookup
|
|
388
|
+
const prevBlockById = new Map();
|
|
389
|
+
for (const block of prevDoc.blocks) {
|
|
390
|
+
prevBlockById.set(block.id, block);
|
|
391
|
+
}
|
|
392
|
+
// Compute new visible range
|
|
393
|
+
const { scrollTop, viewportHeight } = getScrollMetrics(_scrollContainer, root);
|
|
394
|
+
const newRange = _expanded
|
|
395
|
+
? { start: 0, end: nextDoc.blocks.length }
|
|
396
|
+
: spatialIndex.computeVisibleRange(scrollTop, viewportHeight, bufferSize);
|
|
397
|
+
// Build set of block IDs that should be rendered
|
|
398
|
+
const shouldRender = new Set();
|
|
399
|
+
for (let i = newRange.start; i < newRange.end; i++) {
|
|
400
|
+
shouldRender.add(nextDoc.blocks[i].id);
|
|
401
|
+
}
|
|
402
|
+
// Also include pinned blocks and the composing block
|
|
403
|
+
for (const pinnedId of _pinnedBlockIds) {
|
|
404
|
+
shouldRender.add(pinnedId);
|
|
405
|
+
}
|
|
406
|
+
if (composingBlockId !== null) {
|
|
407
|
+
shouldRender.add(composingBlockId);
|
|
408
|
+
}
|
|
409
|
+
// Build set of next doc block IDs for removal detection
|
|
410
|
+
const nextBlockIds = _blockIdToIndex; // reuse — same keys
|
|
411
|
+
// Remove blocks no longer in the document or outside the render range
|
|
412
|
+
if (_blockElementMap) {
|
|
413
|
+
const toRemove = [];
|
|
414
|
+
for (const [blockId] of _blockElementMap) {
|
|
415
|
+
if (!nextBlockIds.has(blockId) || !shouldRender.has(blockId)) {
|
|
416
|
+
toRemove.push(blockId);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
for (const blockId of toRemove) {
|
|
420
|
+
// Don't remove pinned blocks even if outside range
|
|
421
|
+
if (_pinnedBlockIds.has(blockId) && nextBlockIds.has(blockId))
|
|
422
|
+
continue;
|
|
423
|
+
const el = _blockElementMap.get(blockId);
|
|
424
|
+
if (el && el.parentNode === root) {
|
|
425
|
+
root.removeChild(el);
|
|
426
|
+
}
|
|
427
|
+
_blockElementMap.delete(blockId);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
// Reconcile or create blocks in the rendered range
|
|
431
|
+
for (let i = newRange.start; i < newRange.end; i++) {
|
|
432
|
+
const nextBlock = nextDoc.blocks[i];
|
|
433
|
+
const prevBlock = prevBlockById.get(nextBlock.id);
|
|
434
|
+
const existingEl = _blockElementMap?.get(nextBlock.id);
|
|
435
|
+
if (existingEl && existingEl.parentNode === root) {
|
|
436
|
+
// Block exists -- reconcile it
|
|
437
|
+
const result = reconcileBlock(root, existingEl, prevBlock, nextBlock, composingBlockId, markRenderers, blockRenderers);
|
|
438
|
+
if (result !== existingEl) {
|
|
439
|
+
_blockElementMap?.set(nextBlock.id, result);
|
|
440
|
+
}
|
|
441
|
+
// Ensure correct position
|
|
442
|
+
insertBlockElement(result, i);
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
// New block or block re-entering range -- create and insert
|
|
446
|
+
const el = createBlockElement(nextBlock, markRenderers, blockRenderers);
|
|
447
|
+
insertBlockElement(el, i);
|
|
448
|
+
_blockElementMap?.set(nextBlock.id, el);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
// Also reconcile pinned blocks that are outside the newRange
|
|
452
|
+
for (const pinnedId of _pinnedBlockIds) {
|
|
453
|
+
if (!nextBlockIds.has(pinnedId))
|
|
454
|
+
continue;
|
|
455
|
+
const pinnedIndex = _blockIdToIndex.get(pinnedId);
|
|
456
|
+
if (pinnedIndex === undefined)
|
|
457
|
+
continue;
|
|
458
|
+
if (pinnedIndex >= newRange.start && pinnedIndex < newRange.end)
|
|
459
|
+
continue; // Already handled
|
|
460
|
+
const nextBlock = nextDoc.blocks[pinnedIndex];
|
|
461
|
+
const prevBlock = prevBlockById.get(pinnedId);
|
|
462
|
+
const existingEl = _blockElementMap?.get(pinnedId);
|
|
463
|
+
if (existingEl && existingEl.parentNode === root) {
|
|
464
|
+
const result = reconcileBlock(root, existingEl, prevBlock, nextBlock, composingBlockId, markRenderers, blockRenderers);
|
|
465
|
+
if (result !== existingEl) {
|
|
466
|
+
_blockElementMap?.set(pinnedId, result);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
const el = createBlockElement(nextBlock, markRenderers, blockRenderers);
|
|
471
|
+
insertBlockElement(el, pinnedIndex);
|
|
472
|
+
_blockElementMap?.set(pinnedId, el);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
_renderedRange = { start: newRange.start, end: newRange.end };
|
|
476
|
+
// Update spacer heights
|
|
477
|
+
if (!_expanded) {
|
|
478
|
+
updateSpacerHeights(_topSpacer, _bottomSpacer, _renderedRange, spatialIndex);
|
|
479
|
+
}
|
|
480
|
+
// Measure heights
|
|
481
|
+
measureRenderedHeights();
|
|
482
|
+
},
|
|
483
|
+
ensureRendered(blockIndex) {
|
|
484
|
+
if (blockIndex < 0 || blockIndex >= _doc.blocks.length) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
const block = _doc.blocks[blockIndex];
|
|
488
|
+
// Already rendered?
|
|
489
|
+
const existing = _blockElementMap?.get(block.id);
|
|
490
|
+
if (existing && existing.parentNode === root) {
|
|
491
|
+
return existing;
|
|
492
|
+
}
|
|
493
|
+
// Create and insert
|
|
494
|
+
const el = createBlockElement(block, _markRenderers, _blockRenderers);
|
|
495
|
+
insertBlockElement(el, blockIndex);
|
|
496
|
+
_blockElementMap?.set(block.id, el);
|
|
497
|
+
// Expand rendered range to include this index
|
|
498
|
+
const newStart = Math.min(_renderedRange.start, blockIndex);
|
|
499
|
+
const newEnd = Math.max(_renderedRange.end, blockIndex + 1);
|
|
500
|
+
_renderedRange = { start: newStart, end: newEnd };
|
|
501
|
+
// Update spacers to account for the expanded range
|
|
502
|
+
if (!_expanded) {
|
|
503
|
+
updateSpacerHeights(_topSpacer, _bottomSpacer, _renderedRange, spatialIndex);
|
|
504
|
+
}
|
|
505
|
+
return el;
|
|
506
|
+
},
|
|
507
|
+
pin(blockId) {
|
|
508
|
+
_pinnedBlockIds.add(blockId);
|
|
509
|
+
},
|
|
510
|
+
unpin(blockId) {
|
|
511
|
+
_pinnedBlockIds.delete(blockId);
|
|
512
|
+
},
|
|
513
|
+
onScroll() {
|
|
514
|
+
handleScroll();
|
|
515
|
+
},
|
|
516
|
+
measureHeights() {
|
|
517
|
+
measureRenderedHeights();
|
|
518
|
+
},
|
|
519
|
+
expandAll() {
|
|
520
|
+
if (_expanded) {
|
|
521
|
+
// Already expanded -- return no-op restore
|
|
522
|
+
return () => { };
|
|
523
|
+
}
|
|
524
|
+
_expanded = true;
|
|
525
|
+
// Use a DocumentFragment to batch all new block insertions,
|
|
526
|
+
// avoiding per-element reflow during the expand.
|
|
527
|
+
const fragment = document.createDocumentFragment();
|
|
528
|
+
const blocksToInsert = [];
|
|
529
|
+
for (let i = 0; i < _doc.blocks.length; i++) {
|
|
530
|
+
const block = _doc.blocks[i];
|
|
531
|
+
const existing = _blockElementMap?.get(block.id);
|
|
532
|
+
if (existing && existing.parentNode === root)
|
|
533
|
+
continue;
|
|
534
|
+
const el = createBlockElement(block, _markRenderers, _blockRenderers);
|
|
535
|
+
blocksToInsert.push({ el, index: i });
|
|
536
|
+
_blockElementMap?.set(block.id, el);
|
|
537
|
+
}
|
|
538
|
+
// Insert blocks in document order. Since we're using a fragment,
|
|
539
|
+
// we need to insert each batch at the correct position.
|
|
540
|
+
// For simplicity and correctness, insert directly (the fragment
|
|
541
|
+
// approach is complex with interleaved existing elements).
|
|
542
|
+
// Instead, batch by collecting all new elements and inserting them
|
|
543
|
+
// at their correct positions.
|
|
544
|
+
for (const { el, index } of blocksToInsert) {
|
|
545
|
+
insertBlockElement(el, index);
|
|
546
|
+
}
|
|
547
|
+
_renderedRange = { start: 0, end: _doc.blocks.length };
|
|
548
|
+
// Zero out spacers since all blocks are rendered
|
|
549
|
+
_topSpacer.style.height = '0px';
|
|
550
|
+
_bottomSpacer.style.height = '0px';
|
|
551
|
+
// Measure all heights
|
|
552
|
+
measureRenderedHeights();
|
|
553
|
+
// Return restore function
|
|
554
|
+
return () => {
|
|
555
|
+
_expanded = false;
|
|
556
|
+
// Recompute visible range and remove non-visible blocks
|
|
557
|
+
const { scrollTop, viewportHeight } = getScrollMetrics(_scrollContainer, root);
|
|
558
|
+
const newRange = spatialIndex.computeVisibleRange(scrollTop, viewportHeight, bufferSize);
|
|
559
|
+
// Remove blocks outside the new range (unless pinned)
|
|
560
|
+
for (let i = 0; i < _doc.blocks.length; i++) {
|
|
561
|
+
if (i >= newRange.start && i < newRange.end)
|
|
562
|
+
continue;
|
|
563
|
+
removeBlockAtIndex(i);
|
|
564
|
+
}
|
|
565
|
+
_renderedRange = { start: newRange.start, end: newRange.end };
|
|
566
|
+
updateSpacerHeights(_topSpacer, _bottomSpacer, _renderedRange, spatialIndex);
|
|
567
|
+
};
|
|
568
|
+
},
|
|
569
|
+
destroy() {
|
|
570
|
+
_destroyed = true;
|
|
571
|
+
// Cancel pending rAF
|
|
572
|
+
if (_scrollRAF !== null) {
|
|
573
|
+
cancelAnimationFrame(_scrollRAF);
|
|
574
|
+
_scrollRAF = null;
|
|
575
|
+
}
|
|
576
|
+
// Remove scroll listener
|
|
577
|
+
_scrollContainer.removeEventListener('scroll', handleScroll);
|
|
578
|
+
// Clear pinned set
|
|
579
|
+
_pinnedBlockIds.clear();
|
|
580
|
+
},
|
|
581
|
+
};
|
|
582
|
+
return viewport;
|
|
583
|
+
}
|
|
584
|
+
//# sourceMappingURL=virtual-viewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-viewport.js","sourceRoot":"","sources":["../src/virtual-viewport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAuNnE,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAe;IAC9C,IAAI,OAAO,GAAuB,EAAE,CAAC,aAAa,CAAC;IACnD,OAAO,OAAO,IAAI,OAAO,KAAK,QAAQ,CAAC,IAAI,IAAI,OAAO,KAAK,QAAQ,CAAC,eAAe,EAAE,CAAC;QACpF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,SA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/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "RTIF web platform implementation (contenteditable)",
|
|
5
5
|
"author": "coryrobinson42@gmail.com",
|
|
6
6
|
"type": "module",
|
|
@@ -12,10 +12,21 @@
|
|
|
12
12
|
"import": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"files": [
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
16
18
|
"sideEffects": false,
|
|
17
|
-
"engines": {
|
|
18
|
-
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20.0.0"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"rich-text",
|
|
24
|
+
"editor",
|
|
25
|
+
"contenteditable",
|
|
26
|
+
"web-editor",
|
|
27
|
+
"rtif",
|
|
28
|
+
"wysiwyg"
|
|
29
|
+
],
|
|
19
30
|
"scripts": {
|
|
20
31
|
"build": "tsc --build tsconfig.build.json",
|
|
21
32
|
"test": "vitest run",
|
|
@@ -24,7 +35,8 @@
|
|
|
24
35
|
},
|
|
25
36
|
"dependencies": {
|
|
26
37
|
"@rtif-sdk/core": "^1.0.0",
|
|
27
|
-
"@rtif-sdk/engine": "^1.0.0"
|
|
38
|
+
"@rtif-sdk/engine": "^1.0.0",
|
|
39
|
+
"@rtif-sdk/format-html": "^1.0.0"
|
|
28
40
|
},
|
|
29
41
|
"license": "MIT"
|
|
30
42
|
}
|