plitejs 54.0.0-beta.3 → 54.0.0-beta.5
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/annotations/index.d.ts +1 -1
- package/dist/annotations/index.js +1 -1
- package/dist/authored/index.d.ts +2 -2
- package/dist/authored/index.js +168 -46
- package/dist/{authored-veto-DSnQcHGR.js → authored-veto-Cu-5JdVj.js} +1 -1
- package/dist/{comparison-plan-CEQL0ooW.js → comparison-plan-BJxnVPcS.js} +1 -1
- package/dist/{comparison-types-Dt-unJZY.d.ts → comparison-types-Bvvxzxq2.d.ts} +1 -1
- package/dist/{create-editor-CkHtPWXV.js → create-editor-XvI_4sYc.js} +2 -1
- package/dist/diff/index.d.ts +2 -2
- package/dist/diff/index.js +2 -2
- package/dist/dom/index.d.ts +1 -1
- package/dist/dom/index.js +1 -1
- package/dist/{dom-Cgfscvnm.js → dom-BjspML2h.js} +71 -46
- package/dist/{editor-owner-IUmkTeXz.js → editor-owner-CRgIQ625.js} +1 -1
- package/dist/history/index.d.ts +1 -1
- package/dist/history/index.js +2 -2
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/hyperscript/index.js +1 -1
- package/dist/{hyperscript-FPuoArEi.js → hyperscript-BFypA5qW.js} +2 -2
- package/dist/{index-Cw-oC2ps.d.ts → index-BUJsM0oV.d.ts} +1 -1
- package/dist/{index-HPYawTae.d.ts → index-BwmXxqbi.d.ts} +1 -1
- package/dist/{index-DPWyk3lG.d.ts → index-CRmyGzS8.d.ts} +7 -1
- package/dist/{index-K0Za9YXc.d.ts → index-CYac3_ID.d.ts} +26 -22
- package/dist/{index-BpQx2UG4.d.ts → index-DaXz-4c7.d.ts} +10 -8
- package/dist/{index-DpltOCot.d.ts → index-QuqD4Dyj.d.ts} +109 -27
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +4 -4
- package/dist/{mapped-view-store-ld-6uxEU.js → mapped-view-store-XUJ-fnHE.js} +1 -1
- package/dist/{native-grouping-input-DMNcsIaW.js → native-grouping-input-8kO12VK9.js} +1 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/react.d.ts +2 -2
- package/dist/pagination/react.js +5 -5
- package/dist/{pagination-D_A8iPJP.js → pagination-ChDBJtdC.js} +1 -1
- package/dist/{plugin-DWzkJbnJ.js → plugin-BvM4s-Lr.js} +1481 -964
- package/dist/{range-geometry-BjeLHOnl.js → range-geometry-B5CITwMp.js} +2 -2
- package/dist/{range-geometry-BLAHRE11.d.ts → range-geometry-wFuJaBlA.d.ts} +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +6 -6
- package/dist/react/virtualized.d.ts +2 -2
- package/dist/react/virtualized.js +1 -1
- package/dist/{react-DZ15gmz2.js → react-cmFeNP6P.js} +16 -8
- package/dist/{retraction-BMem8Rfk.js → retraction-lXQwo2Ia.js} +1 -1
- package/dist/{src-cT1OTKP_.js → src-BA6F9yxN.js} +195 -3
- package/dist/{store-Cz2mXyDe.js → store-Bllfuqp4.js} +24 -11
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/{use-editor-dom-scope-BbMDSCpW.js → use-editor-dom-scope-B4gF9t_Y.js} +572 -524
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/dist/yjs/react/index.d.ts +3 -3
- package/dist/yjs/react/index.js +3 -3
- package/dist/{yjs-DOK-m7kl.js → yjs-CWdWDrpv.js} +5 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as projectRange } from "./create-editor-
|
|
1
|
+
import { Hc as readAuthoredView, Jf as RangeApi, _l as notifyObservers, mi as subscribeEditorViewState, pu as failInvariant, vp as getDefined } from "./plugin-BvM4s-Lr.js";
|
|
2
|
+
import { p as projectRange } from "./create-editor-XvI_4sYc.js";
|
|
3
3
|
import { n as registerAnnotationStoreMetrics } from "./annotation-store-metrics-Ccjkef45.js";
|
|
4
|
-
import { n as createMappedViewStoreKernel, r as createViewSourceFaultBoundary, t as areMappedViewDataEqual } from "./mapped-view-store-
|
|
4
|
+
import { n as createMappedViewStoreKernel, r as createViewSourceFaultBoundary, t as areMappedViewDataEqual } from "./mapped-view-store-XUJ-fnHE.js";
|
|
5
5
|
//#region src/internal/view/stable-id-mapped-source.ts
|
|
6
6
|
const EMPTY_OUTPUTS = Object.freeze([]);
|
|
7
7
|
const createPersistentReadonlyRecord = (initial, onNodeCopy, onChildEntriesCopy) => {
|
|
@@ -514,7 +514,7 @@ const createPliteAnnotationStoreInternal = (editorInput, source, options, dorman
|
|
|
514
514
|
mappedResolveCount += 1;
|
|
515
515
|
const resolvedRange = annotation.anchor.resolve(editor);
|
|
516
516
|
const mappedRange = resolvedRange ? projectAnnotationRange(editor, resolvedRange) : null;
|
|
517
|
-
const range = mappedRange ? resolvedRange : null;
|
|
517
|
+
const range = resolvedRange && mappedRange && !(options.hideEmpty && editor.read.ranges.isEmpty(resolvedRange)) ? resolvedRange : null;
|
|
518
518
|
return {
|
|
519
519
|
entity: Object.freeze({
|
|
520
520
|
data: annotation.data,
|
|
@@ -555,6 +555,13 @@ const createPliteAnnotationStoreInternal = (editorInput, source, options, dorman
|
|
|
555
555
|
let subscriberCount = 0;
|
|
556
556
|
let lastSnapshot = dormant ? null : editor.read.runtime.snapshot();
|
|
557
557
|
let lastProjection = dormant ? void 0 : authoredPreview(editor);
|
|
558
|
+
let lastSchema = dormant ? void 0 : editor.read.schema.identity();
|
|
559
|
+
const markFresh = () => {
|
|
560
|
+
lastSnapshot = editor.read.runtime.snapshot();
|
|
561
|
+
lastProjection = authoredPreview(editor);
|
|
562
|
+
lastSchema = editor.read.schema.identity();
|
|
563
|
+
};
|
|
564
|
+
const schemaChanged = () => options.hideEmpty === true && editor.read.schema.identity() !== lastSchema;
|
|
558
565
|
const refreshCandidates = (candidateIds = null, forceAll = candidateIds === null, reason = "refresh") => {
|
|
559
566
|
const annotationsResult = faultBoundary.run("read", getAnnotations);
|
|
560
567
|
if (!annotationsResult.ok) return;
|
|
@@ -566,8 +573,7 @@ const createPliteAnnotationStoreInternal = (editorInput, source, options, dorman
|
|
|
566
573
|
} }));
|
|
567
574
|
if (!mappedResult.ok) return;
|
|
568
575
|
currentAnnotations = annotationsResult.value;
|
|
569
|
-
|
|
570
|
-
lastProjection = authoredPreview(editor);
|
|
576
|
+
markFresh();
|
|
571
577
|
const changedIds = mappedResult.value.changedEntityIds;
|
|
572
578
|
const changed = changedIds.length > 0 || mappedResult.value.orderChanged || mappedResult.value.affectedOutputKeys.length > 0;
|
|
573
579
|
const subscriberWakeCount = changed ? annotationsStore.subscriberCount() + changeListeners.size + annotationsStore.countKeySubscribers(changedIds) : 0;
|
|
@@ -592,19 +598,23 @@ const createPliteAnnotationStoreInternal = (editorInput, source, options, dorman
|
|
|
592
598
|
const ensureFresh = () => {
|
|
593
599
|
if (!activated || destroyed) return;
|
|
594
600
|
const snapshot = editor.read.runtime.snapshot();
|
|
595
|
-
if (snapshot.children !== lastSnapshot?.children || snapshot.index !== lastSnapshot?.index || authoredPreview(editor) !== lastProjection) refreshCandidates(null, true, "editor");
|
|
601
|
+
if (snapshot.children !== lastSnapshot?.children || snapshot.index !== lastSnapshot?.index || authoredPreview(editor) !== lastProjection || schemaChanged()) refreshCandidates(null, true, "editor");
|
|
596
602
|
};
|
|
597
603
|
const subscribeToEditor = () => {
|
|
598
604
|
const unsubscribeCommit = editor.subscribeCommit((change) => {
|
|
599
|
-
if (destroyed
|
|
605
|
+
if (destroyed) return;
|
|
606
|
+
if (schemaChanged()) {
|
|
607
|
+
refreshCandidates(null, true, "editor");
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (!shouldRefreshForEditorChange(change)) return;
|
|
600
611
|
if (authoredPreview(editor) !== lastProjection) {
|
|
601
612
|
refreshCandidates(null, true, "editor");
|
|
602
613
|
return;
|
|
603
614
|
}
|
|
604
615
|
const candidateIds = change ? Array.from(/* @__PURE__ */ new Set([...mappedSource.getIdsForOutputKeys(change.changed.nodeKeysAll("decoration")), ...change.changed.hasAny("document") ? mappedSource.getIdsWithoutOutputs() : []])) : null;
|
|
605
616
|
if (candidateIds && candidateIds.length === 0) {
|
|
606
|
-
|
|
607
|
-
lastProjection = authoredPreview(editor);
|
|
617
|
+
markFresh();
|
|
608
618
|
return;
|
|
609
619
|
}
|
|
610
620
|
refreshCandidates(candidateIds, candidateIds === null, "editor");
|
|
@@ -650,7 +660,10 @@ const createPliteAnnotationStoreInternal = (editorInput, source, options, dorman
|
|
|
650
660
|
},
|
|
651
661
|
getAnnotationsAt: (nodeKey) => {
|
|
652
662
|
ensureFresh();
|
|
653
|
-
return Object.freeze(mappedSource.getIdsForOutputKeys([nodeKey]).flatMap((id) =>
|
|
663
|
+
return Object.freeze(mappedSource.getIdsForOutputKeys([nodeKey]).flatMap((id) => {
|
|
664
|
+
const annotation = annotationsStore.getSnapshot().byId.get(id);
|
|
665
|
+
return annotation?.range ? [annotation] : [];
|
|
666
|
+
}));
|
|
654
667
|
},
|
|
655
668
|
getSnapshot: () => {
|
|
656
669
|
ensureFresh();
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $f as
|
|
2
|
-
import { i as createHyperscript, o as createEditor } from "../index-
|
|
1
|
+
import { $f as getSnapshot, Bi as setEditorFocused, Dh as Descendant, Gf as getChildren, If as deleteBackward, Mg as Location, Nf as after, Of as Value, Og as Range, Pf as before, Qf as getSelection, Rf as deleteForward, Rp as replace, Tp as move, Zp as unhangRange, cp as insertText, dh as Selection, fp as isEditor, hh as TextSelection, ip as insertBreak, jc as Editor, jp as positions, nc as Element, qp as string, up as isBlock, vc as Text, wc as AnyEditor, wi as getLiveSelection, zg as Point } from "../index-QuqD4Dyj.js";
|
|
2
|
+
import { i as createHyperscript, o as createEditor } from "../index-BwmXxqbi.js";
|
|
3
3
|
//#region src/testing/createDataTransfer.d.ts
|
|
4
4
|
declare const createDataTransfer: (dataMap?: Map<string, string>) => DataTransfer;
|
|
5
5
|
//#endregion
|
package/dist/testing/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Bt as point, Ft as move, J as deleteForward, Jt as replace, K as deleteBackward, St as isEditor, U as after, Vt as positions, W as before, bt as isBlock, ct as getSelection, lt as getSnapshot, mt as insertBreak,
|
|
2
|
-
import { a as createEditor$1 } from "../create-editor-
|
|
3
|
-
import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx$1 } from "../hyperscript-
|
|
1
|
+
import { Bt as point, Ft as move, J as deleteForward, Jf as RangeApi, Jt as replace, K as deleteBackward, St as isEditor, U as after, Vt as positions, W as before, ar as getLiveSelection, bt as isBlock, ct as getSelection, lt as getSnapshot, mt as insertBreak, ri as setEditorFocused, rn as string, sn as unhangRange, tt as getChildren, vt as insertText } from "../plugin-BvM4s-Lr.js";
|
|
2
|
+
import { a as createEditor$1 } from "../create-editor-XvI_4sYc.js";
|
|
3
|
+
import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx$1 } from "../hyperscript-BFypA5qW.js";
|
|
4
4
|
import { t as BROWSER_HANDLE_KEY } from "../browser-protocol-pvt4HFF7.js";
|
|
5
5
|
//#region src/testing/createDataTransfer.ts
|
|
6
6
|
const createDataTransfer = (dataMap = /* @__PURE__ */ new Map()) => ({
|