@stesura/wordgard-view 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -343,6 +343,15 @@ type Editor = EditorValue & {
|
|
|
343
343
|
flushing: boolean;
|
|
344
344
|
batch: (change: () => void) => void;
|
|
345
345
|
};
|
|
346
|
+
/**
|
|
347
|
+
* Runs `change` and commits what the editor's components draw from it before
|
|
348
|
+
* returning, through its renderer (React's `flushSync`, Vue's pending
|
|
349
|
+
* updates): a store set in a bare `wg.scheduleDOMWrite` is in the DOM for the
|
|
350
|
+
* read phase after it. Only the components the editor draws (its document's
|
|
351
|
+
* app context, in Vue) commit. Throws where the renderer can't commit: inside
|
|
352
|
+
* a component's render.
|
|
353
|
+
*/
|
|
354
|
+
declare const batch: (wg: Wordgard, change: () => void) => void;
|
|
346
355
|
declare const editorOf: (wg: Wordgard) => Editor;
|
|
347
356
|
declare const findEditor: (wg: Wordgard) => EditorValue | undefined;
|
|
348
357
|
|
|
@@ -408,4 +417,4 @@ declare class RenderedDocTile extends DocTile {
|
|
|
408
417
|
declare const viewRoot: (dom: Element | null) => void;
|
|
409
418
|
declare const drawnRoot: (dom: Element | null) => void;
|
|
410
419
|
|
|
411
|
-
export { type ChildView, type ComponentShape, type DecoElt, type DecorationHandlers, DocTile, type EditorEvent, type EditorValue, type HostedRenderer, type MarkShape, type NodeCell, type NodeView, type NodeWrappers, RefusedUpdate, RenderedDocTile, RenderedWordgard, type Renderer, type RendererContext, type SelectTypes, type StateField, type Tile, TileFlag, VOID, type Words, type WrapperView, atomRef, attributedWidget, attrsToRecord, cellOf, childViewKeys, createDecorationHandlers, createDocTile, createNodeWrappers, createShapeHandle, createWrapperHandle, decorationRoot, defineMarkShape, defineNodeWrappers, defineShape, defineWidgetType, defineWrapper, drawnRoot, editorOf, findEditor, hostDocTile, idOf, isComponentMark, isComponentShape, isComponentWidget, isComponentWrapper, isTrailingBreak, listenersOf, localTagName, namespaced, nodePos, nodeViewOf, rootReplaced, shapeAttributes, shapeOf, staticCopy, uneditable, viewRoot, widgetRoot };
|
|
420
|
+
export { type ChildView, type ComponentShape, type DecoElt, type DecorationHandlers, DocTile, type EditorEvent, type EditorValue, type HostedRenderer, type MarkShape, type NodeCell, type NodeView, type NodeWrappers, RefusedUpdate, RenderedDocTile, RenderedWordgard, type Renderer, type RendererContext, type SelectTypes, type StateField, type Tile, TileFlag, VOID, type Words, type WrapperView, atomRef, attributedWidget, attrsToRecord, batch, cellOf, childViewKeys, createDecorationHandlers, createDocTile, createNodeWrappers, createShapeHandle, createWrapperHandle, decorationRoot, defineMarkShape, defineNodeWrappers, defineShape, defineWidgetType, defineWrapper, drawnRoot, editorOf, findEditor, hostDocTile, idOf, isComponentMark, isComponentShape, isComponentWidget, isComponentWrapper, isTrailingBreak, listenersOf, localTagName, namespaced, nodePos, nodeViewOf, rootReplaced, shapeAttributes, shapeOf, staticCopy, uneditable, viewRoot, widgetRoot };
|
package/dist/index.js
CHANGED
|
@@ -1444,6 +1444,7 @@ var notifyFields = (fields, before, after) => {
|
|
|
1444
1444
|
for (const listener of pending) listener();
|
|
1445
1445
|
};
|
|
1446
1446
|
var editors = /* @__PURE__ */ new WeakMap();
|
|
1447
|
+
var batch = (wg, change) => editorOf(wg).batch(change);
|
|
1447
1448
|
var editorOf = (wg) => {
|
|
1448
1449
|
const found = editors.get(wg);
|
|
1449
1450
|
if (found) return found;
|
|
@@ -2866,6 +2867,7 @@ export {
|
|
|
2866
2867
|
atomRef,
|
|
2867
2868
|
attributedWidget,
|
|
2868
2869
|
attrsToRecord,
|
|
2870
|
+
batch,
|
|
2869
2871
|
cellOf,
|
|
2870
2872
|
childViewKeys,
|
|
2871
2873
|
createDecorationHandlers,
|