plitejs 54.0.0-beta.2 → 54.0.0-beta.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/dist/{internal/view/annotation-store-metrics.js → annotation-store-metrics-Ccjkef45.js} +1 -1
- package/dist/annotations/index.d.ts +1 -1
- package/dist/annotations/index.js +1 -1
- package/dist/authored/index.d.ts +596 -9
- package/dist/authored/index.js +18557 -4
- package/dist/{core/authored-veto.js → authored-veto-DSnQcHGR.js} +2 -2
- package/dist/{internal/browser-protocol.js → browser-protocol-pvt4HFF7.js} +1 -1
- package/dist/comparison-plan-CEQL0ooW.js +1338 -0
- package/dist/{diff/lib/comparison-types.d.ts → comparison-types-Dt-unJZY.d.ts} +11 -6
- package/dist/create-editor-CkHtPWXV.js +1107 -0
- package/dist/diff/index.d.ts +31 -3
- package/dist/diff/index.js +1747 -1
- package/dist/dom/index.d.ts +2 -19
- package/dist/dom/index.js +2 -16
- package/dist/dom-Cgfscvnm.js +9220 -0
- package/dist/{core/same-result.js → editor-owner-IUmkTeXz.js} +77 -2
- package/dist/{core/editor-view-lifetime.js → editor-view-lifetime-GJKa_QGh.js} +1 -1
- package/dist/history/index.d.ts +169 -3
- package/dist/history/index.js +6717 -2
- package/dist/hyperscript/index.d.ts +1 -19
- package/dist/hyperscript/index.js +1 -8
- package/dist/{hyperscript/creators.js → hyperscript-FPuoArEi.js} +134 -8
- package/dist/index-BpQx2UG4.d.ts +1093 -0
- package/dist/{yjs/core/plugin.d.ts → index-Cw-oC2ps.d.ts} +88 -5
- package/dist/{annotations/store.d.ts → index-DPWyk3lG.d.ts} +21 -6
- package/dist/index-DpltOCot.d.ts +9753 -0
- package/dist/index-HPYawTae.d.ts +119 -0
- package/dist/index-K0Za9YXc.d.ts +1246 -0
- package/dist/index.d.ts +1 -50
- package/dist/index.js +4 -34
- package/dist/internal/index.d.ts +2 -54
- package/dist/internal/index.js +156 -52
- package/dist/{internal/view/mapped-view-store.js → mapped-view-store-ld-6uxEU.js} +2 -3
- package/dist/{core/native-grouping-input.js → native-grouping-input-DMNcsIaW.js} +2 -2
- package/dist/pagination/index.d.ts +1 -7
- package/dist/pagination/index.js +1 -693
- package/dist/pagination/react.d.ts +2 -4
- package/dist/pagination/react.js +436 -30
- package/dist/pagination-D_A8iPJP.js +1021 -0
- package/dist/plugin-DWzkJbnJ.js +50999 -0
- package/dist/{react/range-geometry.d.ts → range-geometry-BLAHRE11.d.ts} +2 -2
- package/dist/{react/range-geometry.js → range-geometry-BjeLHOnl.js} +23 -18
- package/dist/react/index.d.ts +5 -97
- package/dist/react/index.js +7 -72
- package/dist/react/virtualized.d.ts +2 -4
- package/dist/react/virtualized.js +146 -7
- package/dist/react-DZ15gmz2.js +1018 -0
- package/dist/{core/change/retraction.js → retraction-BMem8Rfk.js} +16 -4
- package/dist/src-cT1OTKP_.js +1386 -0
- package/dist/{internal/view/stable-id-mapped-source.js → store-Cz2mXyDe.js} +240 -3
- package/dist/testing/index.d.ts +182 -8
- package/dist/testing/index.js +95 -8
- package/dist/use-editor-dom-scope-BbMDSCpW.js +28354 -0
- package/dist/yjs/index.d.ts +1 -4
- package/dist/yjs/index.js +1 -2
- package/dist/yjs/react/index.d.ts +25 -5
- package/dist/yjs/react/index.js +84 -3
- package/dist/yjs-DOK-m7kl.js +13413 -0
- package/package.json +1 -1
- package/dist/annotations/store.js +0 -244
- package/dist/authored/authored.d.ts +0 -116
- package/dist/authored/authored.js +0 -1271
- package/dist/authored/changes.js +0 -365
- package/dist/authored/comparison.d.ts +0 -41
- package/dist/authored/comparison.js +0 -270
- package/dist/authored/decision-window.js +0 -42
- package/dist/authored/decision.js +0 -306
- package/dist/authored/facts/admission.js +0 -388
- package/dist/authored/facts/compact.d.ts +0 -2
- package/dist/authored/facts/compact.js +0 -91
- package/dist/authored/facts/dependencies.d.ts +0 -5
- package/dist/authored/facts/dependencies.js +0 -66
- package/dist/authored/facts/editing.js +0 -12
- package/dist/authored/facts/facts.d.ts +0 -8
- package/dist/authored/facts/facts.js +0 -535
- package/dist/authored/facts/records.d.ts +0 -28
- package/dist/authored/facts/records.js +0 -226
- package/dist/authored/facts/settle.js +0 -529
- package/dist/authored/format.d.ts +0 -34
- package/dist/authored/format.js +0 -175
- package/dist/authored/ledger/book.js +0 -809
- package/dist/authored/ledger/cards.js +0 -223
- package/dist/authored/ledger/ledger.js +0 -830
- package/dist/authored/ledger/level.js +0 -1081
- package/dist/authored/ledger/links.js +0 -20
- package/dist/authored/ledger/pairs.js +0 -334
- package/dist/authored/ledger/places.js +0 -524
- package/dist/authored/ledger/preview-lens.js +0 -252
- package/dist/authored/ledger/projection.js +0 -163
- package/dist/authored/ledger/roots.js +0 -11
- package/dist/authored/ledger/runs.js +0 -480
- package/dist/authored/ledger/slots.js +0 -330
- package/dist/authored/ledger/work.js +0 -66
- package/dist/authored/refusal.d.ts +0 -33
- package/dist/authored/refusal.js +0 -188
- package/dist/authored/resolve-schema.js +0 -62
- package/dist/authored/tree/alignment.js +0 -456
- package/dist/authored/tree/carried.js +0 -205
- package/dist/authored/tree/command-values.js +0 -344
- package/dist/authored/tree/cuts.js +0 -320
- package/dist/authored/tree/grid.js +0 -49
- package/dist/authored/tree/halves.js +0 -120
- package/dist/authored/tree/holders.js +0 -345
- package/dist/authored/tree/holds.js +0 -135
- package/dist/authored/tree/layers.d.ts +0 -49
- package/dist/authored/tree/layers.js +0 -354
- package/dist/authored/tree/marks.d.ts +0 -136
- package/dist/authored/tree/marks.js +0 -263
- package/dist/authored/tree/proposed.js +0 -212
- package/dist/authored/tree/readiness.js +0 -545
- package/dist/authored/tree/record-completion.js +0 -423
- package/dist/authored/tree/record.js +0 -2908
- package/dist/authored/tree/reserves.js +0 -449
- package/dist/authored/tree/resolve.d.ts +0 -9
- package/dist/authored/tree/resolve.js +0 -1860
- package/dist/authored/tree/shown.js +0 -153
- package/dist/authored/tree/spare-lines.js +0 -119
- package/dist/authored/tree/spares.js +0 -61
- package/dist/authored/types.d.ts +0 -177
- package/dist/core/anchor-state.d.ts +0 -15
- package/dist/core/anchor-state.js +0 -792
- package/dist/core/anchor.d.ts +0 -34
- package/dist/core/anchor.js +0 -843
- package/dist/core/authored-document-capability.d.ts +0 -106
- package/dist/core/authored-document-capability.js +0 -6
- package/dist/core/authored-runtime.d.ts +0 -10
- package/dist/core/authored-runtime.js +0 -67
- package/dist/core/authored-veto.d.ts +0 -30
- package/dist/core/change/builder.d.ts +0 -546
- package/dist/core/change/builder.js +0 -1120
- package/dist/core/change/carried-projection.js +0 -1518
- package/dist/core/change/carried-run.d.ts +0 -26
- package/dist/core/change/carried-run.js +0 -251
- package/dist/core/change/carry-program.js +0 -537
- package/dist/core/change/classification.d.ts +0 -22
- package/dist/core/change/classification.js +0 -205
- package/dist/core/change/cross-rule.js +0 -238
- package/dist/core/change/cross.js +0 -577
- package/dist/core/change/document-change.d.ts +0 -137
- package/dist/core/change/document-change.js +0 -872
- package/dist/core/change/document-index.d.ts +0 -117
- package/dist/core/change/document-index.js +0 -542
- package/dist/core/change/draft-facts.js +0 -323
- package/dist/core/change/enclosure.d.ts +0 -12
- package/dist/core/change/enclosure.js +0 -272
- package/dist/core/change/join.js +0 -751
- package/dist/core/change/json.d.ts +0 -4
- package/dist/core/change/json.js +0 -26
- package/dist/core/change/lazy-root.d.ts +0 -1
- package/dist/core/change/lazy-root.js +0 -73
- package/dist/core/change/lineage.d.ts +0 -49
- package/dist/core/change/lineage.js +0 -390
- package/dist/core/change/mapping.d.ts +0 -31
- package/dist/core/change/mapping.js +0 -186
- package/dist/core/change/new-letters.d.ts +0 -14
- package/dist/core/change/new-letters.js +0 -139
- package/dist/core/change/range-association.js +0 -10
- package/dist/core/change/read-back.d.ts +0 -7
- package/dist/core/change/read-back.js +0 -7
- package/dist/core/change/record.d.ts +0 -59
- package/dist/core/change/record.js +0 -346
- package/dist/core/change/root-change.d.ts +0 -180
- package/dist/core/change/root-change.js +0 -3544
- package/dist/core/change/slice-facts.js +0 -89
- package/dist/core/change/text-splices.js +0 -98
- package/dist/core/change/tokens.d.ts +0 -97
- package/dist/core/change/tokens.js +0 -449
- package/dist/core/change/transform.d.ts +0 -36
- package/dist/core/change/transform.js +0 -97
- package/dist/core/change/wrap-fidelity.js +0 -295
- package/dist/core/change-events.js +0 -223
- package/dist/core/clone.js +0 -28
- package/dist/core/command-definition.d.ts +0 -25
- package/dist/core/command-definition.js +0 -48
- package/dist/core/command-document.d.ts +0 -4
- package/dist/core/command-document.js +0 -20
- package/dist/core/command-frame.js +0 -628
- package/dist/core/command-registry.d.ts +0 -36
- package/dist/core/command-registry.js +0 -283
- package/dist/core/commit-publication.js +0 -40
- package/dist/core/commit.d.ts +0 -26
- package/dist/core/commit.js +0 -686
- package/dist/core/composition-stamp.d.ts +0 -14
- package/dist/core/composition-stamp.js +0 -79
- package/dist/core/content-completion.d.ts +0 -4
- package/dist/core/content-completion.js +0 -343
- package/dist/core/content-landing.js +0 -124
- package/dist/core/content-slice-roots.js +0 -36
- package/dist/core/content-slice.d.ts +0 -38
- package/dist/core/content-slice.js +0 -253
- package/dist/core/content.js +0 -18
- package/dist/core/correction.js +0 -25
- package/dist/core/default-storage.js +0 -53
- package/dist/core/document-admission.d.ts +0 -4
- package/dist/core/document-admission.js +0 -64
- package/dist/core/document-change.d.ts +0 -3
- package/dist/core/document-recorder.d.ts +0 -6
- package/dist/core/document-recorder.js +0 -67
- package/dist/core/document-shape.d.ts +0 -68
- package/dist/core/document-shape.js +0 -173
- package/dist/core/document-view-read.d.ts +0 -16
- package/dist/core/document-view-read.js +0 -36
- package/dist/core/draft-track.d.ts +0 -3
- package/dist/core/draft-track.js +0 -90
- package/dist/core/editor-commands.d.ts +0 -99
- package/dist/core/editor-commands.js +0 -505
- package/dist/core/editor-lifecycle-api.d.ts +0 -8
- package/dist/core/editor-lifecycle-api.js +0 -219
- package/dist/core/editor-lifetime.js +0 -12
- package/dist/core/editor-owner.d.ts +0 -24
- package/dist/core/editor-owner.js +0 -78
- package/dist/core/editor-read-execution.d.ts +0 -6
- package/dist/core/editor-read-execution.js +0 -64
- package/dist/core/editor-read-runtime.js +0 -176
- package/dist/core/editor-reads.d.ts +0 -128
- package/dist/core/editor-reads.js +0 -63
- package/dist/core/editor-runtime.d.ts +0 -112
- package/dist/core/editor-runtime.js +0 -20
- package/dist/core/editor-schema.d.ts +0 -314
- package/dist/core/editor-schema.js +0 -2295
- package/dist/core/element-owned-root-index.d.ts +0 -4
- package/dist/core/element-owned-root-index.js +0 -353
- package/dist/core/get-content-slice.js +0 -118
- package/dist/core/get-fragment.js +0 -22
- package/dist/core/identity-owner.js +0 -697
- package/dist/core/import-content-slice.js +0 -26
- package/dist/core/initial-value.js +0 -87
- package/dist/core/insert-limit.js +0 -81
- package/dist/core/is-empty-element.js +0 -20
- package/dist/core/json-fingerprint.js +0 -16
- package/dist/core/landing.d.ts +0 -11
- package/dist/core/landing.js +0 -279
- package/dist/core/lifecycle-error.d.ts +0 -11
- package/dist/core/lifecycle-error.js +0 -68
- package/dist/core/listener-state.d.ts +0 -1
- package/dist/core/listener-state.js +0 -59
- package/dist/core/measured-sequence.d.ts +0 -43
- package/dist/core/measured-sequence.js +0 -404
- package/dist/core/missing-reference.js +0 -15
- package/dist/core/node-property-mutation.js +0 -10
- package/dist/core/node-selection.js +0 -85
- package/dist/core/node-write-veto.d.ts +0 -37
- package/dist/core/node-write-veto.js +0 -17
- package/dist/core/persisted-document.d.ts +0 -6
- package/dist/core/persisted-document.js +0 -39
- package/dist/core/persistent-map.js +0 -139
- package/dist/core/plain-text.d.ts +0 -32
- package/dist/core/plain-text.js +0 -92
- package/dist/core/plugin-dispatch.d.ts +0 -21
- package/dist/core/plugin-dispatch.js +0 -166
- package/dist/core/plugin-point.d.ts +0 -6
- package/dist/core/plugin-point.js +0 -21
- package/dist/core/plugin-registry.d.ts +0 -78
- package/dist/core/plugin-registry.js +0 -485
- package/dist/core/plugin-slot.d.ts +0 -23
- package/dist/core/plugin-slot.js +0 -30
- package/dist/core/plugin.d.ts +0 -125
- package/dist/core/plugin.js +0 -1485
- package/dist/core/prefix-occupant-join.js +0 -52
- package/dist/core/profiling.js +0 -18
- package/dist/core/property-validity.d.ts +0 -14
- package/dist/core/property-validity.js +0 -65
- package/dist/core/public-root.d.ts +0 -10
- package/dist/core/public-root.js +0 -50
- package/dist/core/public-state.d.ts +0 -191
- package/dist/core/public-state.js +0 -6772
- package/dist/core/read-definition.js +0 -22
- package/dist/core/read-registry.js +0 -127
- package/dist/core/record-store.d.ts +0 -12
- package/dist/core/record-store.js +0 -297
- package/dist/core/refusal.d.ts +0 -1
- package/dist/core/refusal.js +0 -40
- package/dist/core/representation.d.ts +0 -11
- package/dist/core/representation.js +0 -844
- package/dist/core/resolved-token-cursor.d.ts +0 -21
- package/dist/core/resolved-token-cursor.js +0 -294
- package/dist/core/root-entries.js +0 -121
- package/dist/core/root-ownership.d.ts +0 -19
- package/dist/core/root-ownership.js +0 -354
- package/dist/core/root-target.d.ts +0 -7
- package/dist/core/root-target.js +0 -281
- package/dist/core/same-result.d.ts +0 -18
- package/dist/core/schema-compiler.d.ts +0 -345
- package/dist/core/schema-compiler.js +0 -3166
- package/dist/core/schema-contribution-registry.d.ts +0 -12
- package/dist/core/schema-contribution-registry.js +0 -88
- package/dist/core/schema-definition.d.ts +0 -307
- package/dist/core/schema-definition.js +0 -628
- package/dist/core/schema-source.internal.d.ts +0 -49
- package/dist/core/schema-validation.d.ts +0 -11
- package/dist/core/schema-validation.js +0 -85
- package/dist/core/screen-reader-announcement.d.ts +0 -13
- package/dist/core/screen-reader-announcement.js +0 -17
- package/dist/core/selection-protocol.d.ts +0 -38
- package/dist/core/selection-protocol.js +0 -523
- package/dist/core/selection-state.js +0 -9
- package/dist/core/semantic-update-method.d.ts +0 -11
- package/dist/core/semantic-update-method.js +0 -26
- package/dist/core/set-root.d.ts +0 -3
- package/dist/core/set-root.js +0 -244
- package/dist/core/slice-end-matter.js +0 -77
- package/dist/core/slice-fit/compiled-slice-fitter.d.ts +0 -56
- package/dist/core/slice-fit/compiled-slice-fitter.js +0 -2087
- package/dist/core/slice-fit/fit-report.d.ts +0 -36
- package/dist/core/slice-fit/fit-report.js +0 -122
- package/dist/core/slice-fit/frontier.js +0 -98
- package/dist/core/slice-fit/origin.js +0 -57
- package/dist/core/slice-fit/provenance.d.ts +0 -30
- package/dist/core/slice-fit/provenance.js +0 -245
- package/dist/core/slice-identities.js +0 -21
- package/dist/core/slice-landing-types.d.ts +0 -61
- package/dist/core/slice-landing.js +0 -124
- package/dist/core/snapshot-index.d.ts +0 -13
- package/dist/core/snapshot-index.js +0 -860
- package/dist/core/state-field.d.ts +0 -12
- package/dist/core/state-field.js +0 -102
- package/dist/core/state-fields.js +0 -36
- package/dist/core/survival.js +0 -61
- package/dist/core/target-runtime.d.ts +0 -5
- package/dist/core/target-runtime.js +0 -42
- package/dist/core/transaction-values.d.ts +0 -47
- package/dist/core/transaction-values.js +0 -66
- package/dist/core/transfer-guard.js +0 -299
- package/dist/core/transfer-types.d.ts +0 -170
- package/dist/core/transfer.d.ts +0 -72
- package/dist/core/transfer.js +0 -655
- package/dist/core/tx-only.d.ts +0 -64
- package/dist/core/tx-only.js +0 -84
- package/dist/core/unique-values.js +0 -298
- package/dist/core/update-context.js +0 -28
- package/dist/core/update-policy.d.ts +0 -17
- package/dist/core/update-policy.js +0 -45
- package/dist/core/value-codec.d.ts +0 -35
- package/dist/core/value-codec.js +0 -240
- package/dist/core/view-carets.d.ts +0 -39
- package/dist/core/view-carets.js +0 -676
- package/dist/core/view-presentation.d.ts +0 -9
- package/dist/core/view-presentation.js +0 -70
- package/dist/core/work.d.ts +0 -192
- package/dist/core/work.js +0 -122
- package/dist/core/writable-text.js +0 -37
- package/dist/create-editor.d.ts +0 -187
- package/dist/create-editor.js +0 -281
- package/dist/diff/lib/compare.d.ts +0 -33
- package/dist/diff/lib/compare.js +0 -459
- package/dist/diff/lib/comparison-align.js +0 -324
- package/dist/diff/lib/comparison-index.js +0 -160
- package/dist/diff/lib/comparison-internal.js +0 -108
- package/dist/diff/lib/comparison-matcher.js +0 -1221
- package/dist/diff/lib/comparison-moves.js +0 -151
- package/dist/diff/lib/comparison-plan.js +0 -556
- package/dist/diff/lib/index.d.ts +0 -3
- package/dist/dom/dom-soft-line-end.d.ts +0 -3
- package/dist/dom/dom-soft-line-end.js +0 -295
- package/dist/dom/internal/index.d.ts +0 -15
- package/dist/dom/plugin/data-transfer-format.d.ts +0 -90
- package/dist/dom/plugin/data-transfer-format.js +0 -525
- package/dist/dom/plugin/dom-clipboard-runtime.d.ts +0 -50
- package/dist/dom/plugin/dom-clipboard-runtime.js +0 -482
- package/dist/dom/plugin/dom-coverage.d.ts +0 -140
- package/dist/dom/plugin/dom-coverage.js +0 -443
- package/dist/dom/plugin/dom-drag-scroll.js +0 -176
- package/dist/dom/plugin/dom-drag.d.ts +0 -54
- package/dist/dom/plugin/dom-drag.js +0 -507
- package/dist/dom/plugin/dom-editor.d.ts +0 -421
- package/dist/dom/plugin/dom-editor.js +0 -1316
- package/dist/dom/plugin/dom-event-range-targets.js +0 -39
- package/dist/dom/plugin/dom-geometry.d.ts +0 -11
- package/dist/dom/plugin/dom-geometry.js +0 -888
- package/dist/dom/plugin/dom-input-runtime.d.ts +0 -1
- package/dist/dom/plugin/dom-input-runtime.js +0 -571
- package/dist/dom/plugin/dom-integrity-observer.js +0 -436
- package/dist/dom/plugin/dom-node-path.js +0 -61
- package/dist/dom/plugin/dom-phase-scheduler.d.ts +0 -1
- package/dist/dom/plugin/dom-phase-scheduler.js +0 -284
- package/dist/dom/plugin/dom-root-runtime.d.ts +0 -10
- package/dist/dom/plugin/dom-root-runtime.js +0 -716
- package/dist/dom/plugin/dom-sync-mutation-ownership.d.ts +0 -1
- package/dist/dom/plugin/dom-sync-mutation-ownership.js +0 -120
- package/dist/dom/plugin/dom-text-flow-index.js +0 -396
- package/dist/dom/plugin/dom-text-freshness.js +0 -188
- package/dist/dom/plugin/dom-text-proofs.d.ts +0 -2
- package/dist/dom/plugin/dom-text-proofs.js +0 -350
- package/dist/dom/plugin/dom-view-caret.js +0 -28
- package/dist/dom/plugin/with-dom.d.ts +0 -53
- package/dist/dom/plugin/with-dom.js +0 -101
- package/dist/dom/utils/constants.d.ts +0 -5
- package/dist/dom/utils/constants.js +0 -5
- package/dist/dom/utils/diff-text.d.ts +0 -51
- package/dist/dom/utils/diff-text.js +0 -264
- package/dist/dom/utils/dom.d.ts +0 -104
- package/dist/dom/utils/dom.js +0 -257
- package/dist/dom/utils/drag-session.d.ts +0 -2
- package/dist/dom/utils/drag-session.js +0 -115
- package/dist/dom/utils/drop-indicator.d.ts +0 -18
- package/dist/dom/utils/drop-indicator.js +0 -36
- package/dist/dom/utils/environment.d.ts +0 -12
- package/dist/dom/utils/environment.js +0 -118
- package/dist/dom/utils/hotkey-match.d.ts +0 -36
- package/dist/dom/utils/hotkey-match.js +0 -208
- package/dist/dom/utils/hotkeys.d.ts +0 -32
- package/dist/dom/utils/hotkeys.js +0 -121
- package/dist/dom/utils/key.d.ts +0 -14
- package/dist/dom/utils/key.js +0 -18
- package/dist/dom/utils/plite-dom-markers.d.ts +0 -26
- package/dist/dom/utils/plite-dom-markers.js +0 -25
- package/dist/dom/utils/selection-writes.d.ts +0 -18
- package/dist/dom/utils/selection-writes.js +0 -63
- package/dist/dom/utils/weak-maps.d.ts +0 -2
- package/dist/dom/utils/weak-maps.js +0 -51
- package/dist/editor/above.js +0 -30
- package/dist/editor/add-mark.js +0 -79
- package/dist/editor/adjacent-character-point.js +0 -120
- package/dist/editor/after.js +0 -37
- package/dist/editor/before.js +0 -124
- package/dist/editor/block-void-break.js +0 -20
- package/dist/editor/correct-document.js +0 -225
- package/dist/editor/delete-backward.js +0 -64
- package/dist/editor/delete-forward.js +0 -11
- package/dist/editor/delete-fragment.js +0 -40
- package/dist/editor/edges.js +0 -5
- package/dist/editor/element-read-only.js +0 -35
- package/dist/editor/end.d.ts +0 -7
- package/dist/editor/end.js +0 -5
- package/dist/editor/exit-break.js +0 -51
- package/dist/editor/first.js +0 -8
- package/dist/editor/get-void.js +0 -9
- package/dist/editor/has-blocks.js +0 -6
- package/dist/editor/has-inlines.js +0 -6
- package/dist/editor/has-path.js +0 -5
- package/dist/editor/has-texts.js +0 -5
- package/dist/editor/insert-break.js +0 -77
- package/dist/editor/insert-default-child.js +0 -55
- package/dist/editor/insert-soft-break.js +0 -14
- package/dist/editor/insert-text.js +0 -83
- package/dist/editor/is-block.js +0 -5
- package/dist/editor/is-edge.js +0 -5
- package/dist/editor/is-editor.js +0 -13
- package/dist/editor/is-empty.js +0 -6
- package/dist/editor/is-end.js +0 -9
- package/dist/editor/is-start.js +0 -9
- package/dist/editor/last.js +0 -20
- package/dist/editor/leaf.js +0 -9
- package/dist/editor/levels.js +0 -21
- package/dist/editor/next.js +0 -46
- package/dist/editor/node.js +0 -9
- package/dist/editor/nodes.js +0 -106
- package/dist/editor/parent.js +0 -14
- package/dist/editor/path.js +0 -26
- package/dist/editor/point.js +0 -52
- package/dist/editor/positions.js +0 -322
- package/dist/editor/previous.js +0 -48
- package/dist/editor/project-range.js +0 -6
- package/dist/editor/range.js +0 -12
- package/dist/editor/remove-mark.js +0 -65
- package/dist/editor/should-merge-nodes-remove-prev-node.js +0 -11
- package/dist/editor/string.js +0 -35
- package/dist/editor/toggle-mark.js +0 -71
- package/dist/editor/unhang-range.js +0 -71
- package/dist/editor-runtime-view.d.ts +0 -33
- package/dist/editor-runtime-view.js +0 -788
- package/dist/history/history-carets.js +0 -127
- package/dist/history/history-character-map.js +0 -425
- package/dist/history/history-codec.js +0 -176
- package/dist/history/history-merge-policy.js +0 -164
- package/dist/history/history-plugin.d.ts +0 -71
- package/dist/history/history-plugin.js +0 -814
- package/dist/history/history-replay.js +0 -799
- package/dist/history/history-selection.js +0 -75
- package/dist/history/history-state.js +0 -1287
- package/dist/history/history.d.ts +0 -112
- package/dist/history/history.js +0 -29
- package/dist/hyperscript/creators.d.ts +0 -51
- package/dist/hyperscript/hyperscript.d.ts +0 -36
- package/dist/hyperscript/hyperscript.js +0 -66
- package/dist/hyperscript/tokens.d.ts +0 -31
- package/dist/hyperscript/tokens.js +0 -63
- package/dist/interfaces/decoration.d.ts +0 -35
- package/dist/interfaces/editor.d.ts +0 -2783
- package/dist/interfaces/editor.js +0 -348
- package/dist/interfaces/element.d.ts +0 -66
- package/dist/interfaces/element.js +0 -34
- package/dist/interfaces/index.d.ts +0 -13
- package/dist/interfaces/json.d.ts +0 -7
- package/dist/interfaces/location.d.ts +0 -50
- package/dist/interfaces/location.js +0 -26
- package/dist/interfaces/node.d.ts +0 -306
- package/dist/interfaces/node.js +0 -339
- package/dist/interfaces/path.d.ts +0 -118
- package/dist/interfaces/path.js +0 -116
- package/dist/interfaces/point.d.ts +0 -45
- package/dist/interfaces/point.js +0 -32
- package/dist/interfaces/range.d.ts +0 -80
- package/dist/interfaces/range.js +0 -85
- package/dist/interfaces/schema-validation.d.ts +0 -33
- package/dist/interfaces/schema.d.ts +0 -870
- package/dist/interfaces/selection.d.ts +0 -61
- package/dist/interfaces/selection.js +0 -106
- package/dist/interfaces/text.d.ts +0 -68
- package/dist/interfaces/text.js +0 -52
- package/dist/interfaces/transforms/node.d.ts +0 -222
- package/dist/interfaces/transforms/selection.d.ts +0 -48
- package/dist/interfaces/transforms/text.d.ts +0 -58
- package/dist/internal/browser-protocol.d.ts +0 -5
- package/dist/internal/document-range.d.ts +0 -9
- package/dist/internal/document-range.js +0 -31
- package/dist/internal/editor-options.d.ts +0 -37
- package/dist/internal/editor-options.js +0 -36
- package/dist/internal/fail-invariant.d.ts +0 -4
- package/dist/internal/fail-invariant.js +0 -6
- package/dist/internal/get-defined.js +0 -7
- package/dist/internal/law-check.js +0 -7
- package/dist/internal/range-text-marks.js +0 -31
- package/dist/internal/root-location.d.ts +0 -23
- package/dist/internal/root-location.js +0 -86
- package/dist/internal/text-run.d.ts +0 -13
- package/dist/internal/text-run.js +0 -44
- package/dist/internal/view/annotation-store-metrics.d.ts +0 -11
- package/dist/internal/view/view-source.d.ts +0 -20
- package/dist/pagination/page-composition.internal.js +0 -313
- package/dist/pagination/page-geometry.internal.js +0 -99
- package/dist/pagination/page-layout-engine-invalidation.internal.js +0 -20
- package/dist/pagination/page-mount-plan.js +0 -84
- package/dist/pagination/paged-view-lines.js +0 -163
- package/dist/range-projection.d.ts +0 -7
- package/dist/range-projection.js +0 -50
- package/dist/react/components/dom-coverage-boundary.d.ts +0 -14
- package/dist/react/components/dom-coverage-boundary.js +0 -143
- package/dist/react/components/editable-descendant-binding.js +0 -70
- package/dist/react/components/editable-dom-commit-fence.js +0 -107
- package/dist/react/components/editable-element-placement.d.ts +0 -2
- package/dist/react/components/editable-element-placement.js +0 -117
- package/dist/react/components/editable-external-text.js +0 -47
- package/dist/react/components/editable-node-equality.js +0 -25
- package/dist/react/components/editable-rendered-element.d.ts +0 -3
- package/dist/react/components/editable-rendered-element.js +0 -61
- package/dist/react/components/editable-text-blocks.d.ts +0 -192
- package/dist/react/components/editable-text-blocks.js +0 -896
- package/dist/react/components/editable-text-containers.d.ts +0 -3
- package/dist/react/components/editable-text-containers.js +0 -28
- package/dist/react/components/editable-text-flow.js +0 -1039
- package/dist/react/components/editable-text-pieces.d.ts +0 -7
- package/dist/react/components/editable-text-pieces.js +0 -193
- package/dist/react/components/editable-text.d.ts +0 -80
- package/dist/react/components/editable-text.js +0 -322
- package/dist/react/components/editable.d.ts +0 -35
- package/dist/react/components/editable.js +0 -406
- package/dist/react/components/editor-announcement-live-region.js +0 -113
- package/dist/react/components/plite-element.d.ts +0 -18
- package/dist/react/components/plite-element.js +0 -54
- package/dist/react/components/plite-leaf.d.ts +0 -18
- package/dist/react/components/plite-leaf.js +0 -21
- package/dist/react/components/plite-placeholder.d.ts +0 -19
- package/dist/react/components/plite-placeholder.js +0 -39
- package/dist/react/components/plite-spacer.js +0 -14
- package/dist/react/components/plite-text.d.ts +0 -23
- package/dist/react/components/plite-text.js +0 -32
- package/dist/react/components/plite-void-shell.js +0 -49
- package/dist/react/components/plite.d.ts +0 -45
- package/dist/react/components/plite.js +0 -297
- package/dist/react/components/text-string.js +0 -18
- package/dist/react/components/windowed-editable.internal.js +0 -51
- package/dist/react/components/zero-width-string.js +0 -26
- package/dist/react/context.js +0 -11
- package/dist/react/decoration-context.d.ts +0 -2
- package/dist/react/decoration-context.js +0 -22
- package/dist/react/decoration-source.d.ts +0 -11
- package/dist/react/decoration-source.js +0 -1030
- package/dist/react/dom-text-sync.d.ts +0 -24
- package/dist/react/dom-text-sync.js +0 -48
- package/dist/react/editable/android-composition.d.ts +0 -3
- package/dist/react/editable/android-composition.js +0 -496
- package/dist/react/editable/browser-handle.js +0 -515
- package/dist/react/editable/caret-engine.js +0 -681
- package/dist/react/editable/clipboard-input-strategy.js +0 -632
- package/dist/react/editable/composition-lease.d.ts +0 -3
- package/dist/react/editable/composition-lease.js +0 -350
- package/dist/react/editable/composition-state.js +0 -716
- package/dist/react/editable/content-root-boundaries.js +0 -79
- package/dist/react/editable/content-root-coordinate-navigation.js +0 -28
- package/dist/react/editable/content-root-navigation-actions.js +0 -190
- package/dist/react/editable/content-root-navigation.js +0 -819
- package/dist/react/editable/content-root-owner-target.js +0 -36
- package/dist/react/editable/content-root-owners.js +0 -191
- package/dist/react/editable/content-root-vertical-geometry.js +0 -60
- package/dist/react/editable/decoration-repair-bridge.js +0 -29
- package/dist/react/editable/dom-coverage-selection.js +0 -158
- package/dist/react/editable/dom-coverage-vertical-selection.js +0 -446
- package/dist/react/editable/dom-input-event.js +0 -14
- package/dist/react/editable/dom-repair-queue.d.ts +0 -7
- package/dist/react/editable/dom-repair-queue.js +0 -543
- package/dist/react/editable/dom-repair-text.js +0 -47
- package/dist/react/editable/editable-command-types.d.ts +0 -1
- package/dist/react/editable/editable-dom-runtime.d.ts +0 -66
- package/dist/react/editable/editable-dom-runtime.js +0 -1022
- package/dist/react/editable/editing-epoch-adapter.js +0 -46
- package/dist/react/editable/editing-kernel.d.ts +0 -7
- package/dist/react/editable/editing-kernel.js +0 -593
- package/dist/react/editable/external-text-binding.js +0 -43
- package/dist/react/editable/external-text-runtime.d.ts +0 -5
- package/dist/react/editable/external-text-runtime.js +0 -851
- package/dist/react/editable/history-focus.js +0 -71
- package/dist/react/editable/history-keyboard.d.ts +0 -4
- package/dist/react/editable/history-keyboard.js +0 -9
- package/dist/react/editable/input-controller.d.ts +0 -7
- package/dist/react/editable/input-controller.js +0 -175
- package/dist/react/editable/input-history.js +0 -21
- package/dist/react/editable/input-router.js +0 -742
- package/dist/react/editable/input-state.d.ts +0 -18
- package/dist/react/editable/input-state.js +0 -330
- package/dist/react/editable/input-target.js +0 -30
- package/dist/react/editable/install-browser-handle.d.ts +0 -12
- package/dist/react/editable/install-browser-handle.js +0 -18
- package/dist/react/editable/interaction-owner.js +0 -88
- package/dist/react/editable/keyboard-input-strategy.js +0 -730
- package/dist/react/editable/line-boundary.js +0 -37
- package/dist/react/editable/model-input-strategy.d.ts +0 -9
- package/dist/react/editable/model-input-strategy.js +0 -242
- package/dist/react/editable/model-selection-dom-preference.js +0 -11
- package/dist/react/editable/mutation-block-editing.js +0 -48
- package/dist/react/editable/mutation-controller.d.ts +0 -32
- package/dist/react/editable/mutation-controller.js +0 -632
- package/dist/react/editable/mutation-full-block-editing.d.ts +0 -2
- package/dist/react/editable/mutation-full-block-editing.js +0 -44
- package/dist/react/editable/mutation-history.d.ts +0 -3
- package/dist/react/editable/mutation-history.js +0 -146
- package/dist/react/editable/native-input-strategy.js +0 -86
- package/dist/react/editable/native-text-input-delta.js +0 -40
- package/dist/react/editable/placed-drag.js +0 -177
- package/dist/react/editable/plite-string-coordinate-placement.js +0 -46
- package/dist/react/editable/press-fence.d.ts +0 -2
- package/dist/react/editable/press-fence.js +0 -70
- package/dist/react/editable/projected-clipboard.js +0 -123
- package/dist/react/editable/projected-native-affordance.js +0 -30
- package/dist/react/editable/projected-selection-target.js +0 -13
- package/dist/react/editable/render-contract-monitor.d.ts +0 -3
- package/dist/react/editable/render-contract-monitor.js +0 -152
- package/dist/react/editable/root-interaction-controller.js +0 -1400
- package/dist/react/editable/root-interaction-dom-selection-replay.js +0 -40
- package/dist/react/editable/root-interaction-resolver.js +0 -116
- package/dist/react/editable/root-selector-sources.js +0 -90
- package/dist/react/editable/runtime-android-engine.js +0 -40
- package/dist/react/editable/runtime-before-input-events.js +0 -671
- package/dist/react/editable/runtime-browser-handle-events.js +0 -40
- package/dist/react/editable/runtime-clipboard-events.js +0 -169
- package/dist/react/editable/runtime-composition-events.js +0 -163
- package/dist/react/editable/runtime-drag-events.js +0 -136
- package/dist/react/editable/runtime-editor-api.d.ts +0 -20
- package/dist/react/editable/runtime-editor-api.js +0 -21
- package/dist/react/editable/runtime-event-engine.js +0 -213
- package/dist/react/editable/runtime-focus-mouse-events.js +0 -264
- package/dist/react/editable/runtime-input-events.js +0 -166
- package/dist/react/editable/runtime-kernel-trace.js +0 -185
- package/dist/react/editable/runtime-keyboard-events.js +0 -333
- package/dist/react/editable/runtime-live-state.js +0 -44
- package/dist/react/editable/runtime-mutation-state.js +0 -11
- package/dist/react/editable/runtime-repair-engine.js +0 -118
- package/dist/react/editable/runtime-root-engine.js +0 -244
- package/dist/react/editable/runtime-root-lifecycle.js +0 -118
- package/dist/react/editable/runtime-root-selection-export.js +0 -38
- package/dist/react/editable/runtime-root-selection-import.js +0 -54
- package/dist/react/editable/runtime-root-state.js +0 -62
- package/dist/react/editable/runtime-selection-engine.js +0 -260
- package/dist/react/editable/runtime-selection-state.js +0 -12
- package/dist/react/editable/runtime-target-bridge.js +0 -29
- package/dist/react/editable/schema-runtime-invalidation.js +0 -26
- package/dist/react/editable/selection-change-listener.js +0 -99
- package/dist/react/editable/selection-claim.d.ts +0 -3
- package/dist/react/editable/selection-claim.js +0 -398
- package/dist/react/editable/selection-controller.d.ts +0 -8
- package/dist/react/editable/selection-controller.js +0 -693
- package/dist/react/editable/selection-dom-range.js +0 -84
- package/dist/react/editable/selection-projected-dom.js +0 -156
- package/dist/react/editable/selection-reconciler.js +0 -630
- package/dist/react/editable/selection-runtime.js +0 -89
- package/dist/react/editable/selection-side-effect-policy.js +0 -20
- package/dist/react/editable/selection-triple-click.js +0 -48
- package/dist/react/editable/selection-void-target.js +0 -172
- package/dist/react/editable/set-root-endpoints.js +0 -75
- package/dist/react/editable/soft-line-end-delete.js +0 -106
- package/dist/react/editable/text-direction.js +0 -82
- package/dist/react/editable/typed-text.d.ts +0 -17
- package/dist/react/editable/typed-text.js +0 -89
- package/dist/react/editable/unread-press.d.ts +0 -2
- package/dist/react/editable/unread-press.js +0 -86
- package/dist/react/editable/view-caret-restore.js +0 -128
- package/dist/react/editable/view-lines.d.ts +0 -7
- package/dist/react/editable/view-lines.js +0 -166
- package/dist/react/external-text.d.ts +0 -131
- package/dist/react/history-step-views.d.ts +0 -4
- package/dist/react/history-step-views.js +0 -119
- package/dist/react/hooks/android-input-manager/android-input-manager.d.ts +0 -7
- package/dist/react/hooks/android-input-manager/android-input-manager.js +0 -716
- package/dist/react/hooks/android-input-manager/use-android-input-manager.js +0 -53
- package/dist/react/hooks/focus-plite-editable.js +0 -116
- package/dist/react/hooks/use-claim-editable-dom-commit.d.ts +0 -12
- package/dist/react/hooks/use-claim-editable-dom-commit.js +0 -31
- package/dist/react/hooks/use-drop-indicator.d.ts +0 -9
- package/dist/react/hooks/use-drop-indicator.js +0 -14
- package/dist/react/hooks/use-editable-clip.d.ts +0 -18
- package/dist/react/hooks/use-editable-clip.js +0 -31
- package/dist/react/hooks/use-editable-layout-pass.js +0 -53
- package/dist/react/hooks/use-editor-composing.d.ts +0 -7
- package/dist/react/hooks/use-editor-composing.js +0 -12
- package/dist/react/hooks/use-editor-context.d.ts +0 -10
- package/dist/react/hooks/use-editor-context.js +0 -18
- package/dist/react/hooks/use-editor-dom-scope.d.ts +0 -27
- package/dist/react/hooks/use-editor-dom-scope.js +0 -23
- package/dist/react/hooks/use-editor-focused.d.ts +0 -7
- package/dist/react/hooks/use-editor-focused.js +0 -12
- package/dist/react/hooks/use-editor-read-only.d.ts +0 -25
- package/dist/react/hooks/use-editor-read-only.js +0 -19
- package/dist/react/hooks/use-editor-runtime-state.d.ts +0 -18
- package/dist/react/hooks/use-editor-runtime-state.js +0 -38
- package/dist/react/hooks/use-editor-selection.d.ts +0 -10
- package/dist/react/hooks/use-editor-selection.js +0 -13
- package/dist/react/hooks/use-editor-selector.d.ts +0 -38
- package/dist/react/hooks/use-editor-selector.js +0 -265
- package/dist/react/hooks/use-editor-view-state.d.ts +0 -16
- package/dist/react/hooks/use-editor-view-state.js +0 -20
- package/dist/react/hooks/use-editor.d.ts +0 -26
- package/dist/react/hooks/use-editor.js +0 -27
- package/dist/react/hooks/use-element-path.d.ts +0 -7
- package/dist/react/hooks/use-element-path.js +0 -36
- package/dist/react/hooks/use-element-selected.d.ts +0 -26
- package/dist/react/hooks/use-element-selected.js +0 -91
- package/dist/react/hooks/use-element.d.ts +0 -13
- package/dist/react/hooks/use-element.js +0 -17
- package/dist/react/hooks/use-generic-selector.js +0 -91
- package/dist/react/hooks/use-hydrated.js +0 -12
- package/dist/react/hooks/use-isomorphic-layout-effect.js +0 -9
- package/dist/react/hooks/use-node-selector.d.ts +0 -40
- package/dist/react/hooks/use-node-selector.js +0 -102
- package/dist/react/hooks/use-plite-annotation-store.d.ts +0 -21
- package/dist/react/hooks/use-plite-annotation-store.js +0 -61
- package/dist/react/hooks/use-plite-annotations.d.ts +0 -9
- package/dist/react/hooks/use-plite-annotations.js +0 -16
- package/dist/react/hooks/use-plite-child-root.d.ts +0 -14
- package/dist/react/hooks/use-plite-child-root.js +0 -38
- package/dist/react/hooks/use-plite-content-root.d.ts +0 -21
- package/dist/react/hooks/use-plite-content-root.js +0 -26
- package/dist/react/hooks/use-plite-history.d.ts +0 -43
- package/dist/react/hooks/use-plite-history.js +0 -137
- package/dist/react/hooks/use-plite-node-ref.js +0 -513
- package/dist/react/hooks/use-plite-root-chrome.d.ts +0 -34
- package/dist/react/hooks/use-plite-root-chrome.js +0 -98
- package/dist/react/hooks/use-plite-runtime.d.ts +0 -86
- package/dist/react/hooks/use-plite-runtime.js +0 -433
- package/dist/react/hooks/use-runtime-focus-state.js +0 -37
- package/dist/react/hooks/use-selection-geometry.d.ts +0 -12
- package/dist/react/hooks/use-selection-geometry.js +0 -39
- package/dist/react/hooks/use-selection-view.d.ts +0 -14
- package/dist/react/hooks/use-selection-view.js +0 -14
- package/dist/react/hooks/use-state-field.d.ts +0 -26
- package/dist/react/hooks/use-state-field.js +0 -38
- package/dist/react/inactive-selection.js +0 -175
- package/dist/react/plugin/react-editor.d.ts +0 -20
- package/dist/react/plugin/react-editor.js +0 -6
- package/dist/react/plugin/with-react.d.ts +0 -108
- package/dist/react/plugin/with-react.js +0 -58
- package/dist/react/render-profiler.js +0 -20
- package/dist/react/root-key.js +0 -12
- package/dist/react/shell-runtime.js +0 -29
- package/dist/react/update-policy.d.ts +0 -10
- package/dist/react/update-policy.js +0 -15
- package/dist/react/utils/environment.js +0 -5
- package/dist/react/view-boundary-graph-core.d.ts +0 -1
- package/dist/react/view-boundary-graph-core.js +0 -208
- package/dist/react/view-boundary-graph.js +0 -105
- package/dist/react/view-selection-decoration.js +0 -97
- package/dist/react/view-selection.js +0 -184
- package/dist/react/viewport-boundary.js +0 -45
- package/dist/react/viewport-commands.d.ts +0 -1
- package/dist/react/viewport-commands.js +0 -17
- package/dist/react/viewport-plan.d.ts +0 -2
- package/dist/react/viewport-plan.js +0 -77
- package/dist/react/virtualized/use-virtualized-root-plan.js +0 -148
- package/dist/testing/createDataTransfer.d.ts +0 -4
- package/dist/testing/createDataTransfer.js +0 -13
- package/dist/testing/jsx.d.ts +0 -181
- package/dist/testing/jsx.js +0 -82
- package/dist/transforms-node/insert-nodes.js +0 -143
- package/dist/transforms-node/lift-nodes.js +0 -117
- package/dist/transforms-node/merge-nodes.js +0 -180
- package/dist/transforms-node/move-nodes.js +0 -58
- package/dist/transforms-node/remove-nodes.js +0 -86
- package/dist/transforms-node/replace-children.js +0 -117
- package/dist/transforms-node/set-nodes.js +0 -188
- package/dist/transforms-node/split-nodes.js +0 -258
- package/dist/transforms-node/unset-nodes.js +0 -10
- package/dist/transforms-node/unwrap-nodes.js +0 -182
- package/dist/transforms-node/wrap-nodes.js +0 -250
- package/dist/transforms-selection/collapse.js +0 -20
- package/dist/transforms-selection/deselect.js +0 -8
- package/dist/transforms-selection/move.js +0 -35
- package/dist/transforms-selection/select.js +0 -59
- package/dist/transforms-selection/set-point.js +0 -32
- package/dist/transforms-selection/set-selection.js +0 -52
- package/dist/transforms-text/delete-text-collapsed-path-targets.js +0 -102
- package/dist/transforms-text/delete-text-grid.js +0 -402
- package/dist/transforms-text/delete-text-inline-points.js +0 -82
- package/dist/transforms-text/delete-text-plan.js +0 -55
- package/dist/transforms-text/delete-text-removal.js +0 -153
- package/dist/transforms-text/delete-text-structural-cleanup.js +0 -130
- package/dist/transforms-text/delete-text-whole-blocks.js +0 -70
- package/dist/transforms-text/delete-text.js +0 -804
- package/dist/transforms-text/full-document-range.js +0 -12
- package/dist/transforms-text/insert-text.js +0 -314
- package/dist/types/types.d.ts +0 -13
- package/dist/utils/format-debug-value.d.ts +0 -8
- package/dist/utils/format-debug-value.js +0 -31
- package/dist/utils/get-default-insert-location.js +0 -19
- package/dist/utils/is-object.d.ts +0 -4
- package/dist/utils/is-object.js +0 -4
- package/dist/utils/match-path.js +0 -8
- package/dist/utils/node-keys.d.ts +0 -15
- package/dist/utils/node-keys.js +0 -179
- package/dist/utils/node-match.js +0 -9
- package/dist/utils/string.js +0 -283
- package/dist/yjs/core/addresses.js +0 -98
- package/dist/yjs/core/ancestor-properties.js +0 -56
- package/dist/yjs/core/attributes.js +0 -21
- package/dist/yjs/core/awareness-adapter.d.ts +0 -5
- package/dist/yjs/core/awareness-adapter.js +0 -399
- package/dist/yjs/core/awareness-relative-selection.js +0 -22
- package/dist/yjs/core/awareness.js +0 -25
- package/dist/yjs/core/binding.d.ts +0 -3
- package/dist/yjs/core/binding.js +0 -128
- package/dist/yjs/core/boundaries.js +0 -453
- package/dist/yjs/core/canonical-split.js +0 -130
- package/dist/yjs/core/change-bridge.js +0 -124
- package/dist/yjs/core/change-regions.js +0 -119
- package/dist/yjs/core/controller-registry.js +0 -70
- package/dist/yjs/core/controller.d.ts +0 -6
- package/dist/yjs/core/controller.js +0 -1282
- package/dist/yjs/core/document.js +0 -1499
- package/dist/yjs/core/editor-adapter.d.ts +0 -18
- package/dist/yjs/core/editor-adapter.js +0 -145
- package/dist/yjs/core/editor-only-roots.js +0 -53
- package/dist/yjs/core/editor-types.d.ts +0 -1
- package/dist/yjs/core/enclosures.js +0 -410
- package/dist/yjs/core/event-change-bridge.js +0 -3642
- package/dist/yjs/core/index.d.ts +0 -4
- package/dist/yjs/core/joined-lines.js +0 -81
- package/dist/yjs/core/joins.js +0 -587
- package/dist/yjs/core/json-equality.js +0 -31
- package/dist/yjs/core/keys.js +0 -29
- package/dist/yjs/core/letter-scripts.js +0 -449
- package/dist/yjs/core/new-letters.js +0 -300
- package/dist/yjs/core/path.js +0 -25
- package/dist/yjs/core/plugin.js +0 -206
- package/dist/yjs/core/record.js +0 -4
- package/dist/yjs/core/replacement.js +0 -165
- package/dist/yjs/core/retraction.js +0 -132
- package/dist/yjs/core/root-owners.js +0 -110
- package/dist/yjs/core/root-projection-index.js +0 -428
- package/dist/yjs/core/schema-metadata.js +0 -88
- package/dist/yjs/core/selection.js +0 -34
- package/dist/yjs/core/set-valued-attributes.js +0 -57
- package/dist/yjs/core/shared-effect-log.d.ts +0 -4
- package/dist/yjs/core/shared-effect-log.js +0 -674
- package/dist/yjs/core/text-runs.js +0 -1596
- package/dist/yjs/core/types.d.ts +0 -76
- package/dist/yjs/react/useYjs.d.ts +0 -25
- package/dist/yjs/react/useYjs.js +0 -85
|
@@ -0,0 +1,1246 @@
|
|
|
1
|
+
import { $u as EditorUpdatePolicy, Bc as EditorCommandInput, Cc as CompatibleEditorCommand, Cn as TransferPlugin, Dc as Editor$2, Fd as PluginDependencyReferenceFor, In as TransferOutcome, Kc as EditorCommitContext, Lc as EditorCommandDescriptor, Mg as Path, Mn as TransferInput, Nd as PluginDependencyContractReference, Qs as Element$1, Sn as TransferApi, Tc as CreateEditorOptions$1, Th as Node$1, Uc as EditorCommit, Ud as PluginPortal, Yd as PluginReference, Zu as EditorUpdateContext, _d as NamedRootKey, _g as Range, bc as AnyEditor, bf as Value, bl as EditorLifecycleErrorSink, ch as DecorationAttributes, dd as EditorViewOptions, gf as StateFieldValueInput, gg as BaseRange, hu as EditorStateView, if as PluginsOf, kn as TransferCheck, mc as Text, n as PluginsFromOptions, nu as EditorStateField, of as RootKey, pd as HistoryOutcome, rd as EditorUpdateTransaction, t as EditorValueFromOptions, tu as EditorSnapshot, uh as DecorationSource, vd as NodeKey, xd as Plugin, xf as ValueOf, yd as NodeTarget, zt as CheckedEditorOptions } from "./index-DpltOCot.js";
|
|
2
|
+
import { a as AnnotationSnapshot, f as ViewSourceErrorSink, l as ResolvedAnnotation, o as AnnotationStore, t as Annotation } from "./index-DPWyk3lG.js";
|
|
3
|
+
import { B as DOMApi, I as DOMEditorOptions, It as DOMCoverageReason, L as DOMPlugin, Mt as DOMCoverageMaterializeReason, O as DataTransferDiagnostic, R as DOMPluginTypes, Rt as DOMCoverageSelectionPolicy, Tt as DOMCoverageBoundary, V as DOMClipboardApi, W as DOMEditor, jt as DOMCoverageMaterializeRangeRole, kt as DOMCoverageCopyPolicy, vt as DropIndicator } from "./index-BpQx2UG4.js";
|
|
4
|
+
import { r as ViewportRect, t as RangeGeometry } from "./range-geometry-BLAHRE11.js";
|
|
5
|
+
import React$1, { CSSProperties, DependencyList, HTMLAttributes, KeyboardEvent as KeyboardEvent$1, MouseEventHandler, ReactNode, Ref, RefObject, TextareaHTMLAttributes } from "react";
|
|
6
|
+
import "lodash";
|
|
7
|
+
//#region src/react/editable/runtime-editor-api.d.ts
|
|
8
|
+
type Editor$1<V extends Value = any> = AnyEditor<V>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/react/editable/input-state.d.ts
|
|
11
|
+
type InputIntent = 'clipboard' | 'composition' | 'delete' | 'history' | 'insert-break' | 'internal-control' | 'model-selection-move' | 'native-selection-move' | 'viewport-selection' | 'text-insert';
|
|
12
|
+
type SelectionSource = 'app-owned' | 'composition-owned' | 'dom-current' | 'internal-control' | 'model-owned' | 'viewport-backed' | 'unknown';
|
|
13
|
+
type EditableSelectionSourceTransition = {
|
|
14
|
+
preferModelSelection: boolean;
|
|
15
|
+
reason: 'internal-control' | 'model-command' | 'native-selection-move' | 'decoration-refresh' | 'repair-induced' | 'unknown-selection';
|
|
16
|
+
selectionSource: SelectionSource;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/react/editable/typed-text.d.ts
|
|
20
|
+
/** Text a mounted Editable committed with typing intent. */
|
|
21
|
+
type TypedText = Readonly<{
|
|
22
|
+
/** The Editable root element whose input produced the text. */
|
|
23
|
+
editable: HTMLElement;
|
|
24
|
+
/** The inserted text in the model, ending at the caret. */
|
|
25
|
+
range: Range;
|
|
26
|
+
text: string;
|
|
27
|
+
}>;
|
|
28
|
+
type TypedTextListener = (typed: TypedText) => void;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/react/plugin/with-react.d.ts
|
|
31
|
+
type AnyDOMPlugin = DOMPlugin | DOMPlugin<false> | DOMPlugin<boolean>;
|
|
32
|
+
/** Options for installing React over one exact DOM plugin descriptor. */
|
|
33
|
+
interface ReactPluginOptions<TDOMPlugin extends AnyDOMPlugin = AnyDOMPlugin> {
|
|
34
|
+
/** DOM plugin owned by this React bridge. */
|
|
35
|
+
dom: TDOMPlugin;
|
|
36
|
+
}
|
|
37
|
+
/** React capability exposed through `editor.api.react`. */
|
|
38
|
+
type ReactApi = {
|
|
39
|
+
isComposing: () => boolean;
|
|
40
|
+
isFocused: () => boolean;
|
|
41
|
+
isReadOnly: () => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Commit pending native input to the model, including an active Android
|
|
44
|
+
* keyboard draft. Returns false while a non-Android composition is active or
|
|
45
|
+
* when the mounted Editable unmounts during the flush.
|
|
46
|
+
*/
|
|
47
|
+
settleInput: () => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Call `listener` with the text each mounted Editable of this editor types:
|
|
50
|
+
* an `insertText` input or composition commit whose one change is an
|
|
51
|
+
* insertion ending at a collapsed caret. Paste, drop, yank, replacement and
|
|
52
|
+
* data-transfer input, history replay, remote edits and typing over a
|
|
53
|
+
* selection report nothing, and so does a commit whose document an earlier
|
|
54
|
+
* commit listener changes before the report. Android keyboards that paste through
|
|
55
|
+
* `insertText` report the pasted text. Returns the unsubscribe function.
|
|
56
|
+
*/
|
|
57
|
+
subscribeTypedText: (listener: TypedTextListener) => () => void;
|
|
58
|
+
};
|
|
59
|
+
declare const createReactPlugin: <const TDOMPlugin extends AnyDOMPlugin>(domPlugin: TDOMPlugin) => Plugin<Readonly<{
|
|
60
|
+
readonly api: ReactApi;
|
|
61
|
+
readonly dependencies: readonly [PluginDependencyReferenceFor<TDOMPlugin>, PluginDependencyContractReference<Readonly<{
|
|
62
|
+
direct: Readonly<Pick<Readonly<{
|
|
63
|
+
readonly read: Readonly<{
|
|
64
|
+
check: (input: TransferInput) => TransferCheck;
|
|
65
|
+
nodes: (options?: Readonly<{
|
|
66
|
+
node?: NodeTarget<Element$1>;
|
|
67
|
+
}>) => readonly NodeKey[];
|
|
68
|
+
}>;
|
|
69
|
+
readonly api: Readonly<{
|
|
70
|
+
copy: (input: TransferInput) => TransferOutcome;
|
|
71
|
+
move: (input: TransferInput) => TransferOutcome;
|
|
72
|
+
}>;
|
|
73
|
+
readonly name: "transfer";
|
|
74
|
+
}>, "api" | "name" | "read">> & Readonly<Record<never, never>>;
|
|
75
|
+
installed: Readonly<Pick<Readonly<{
|
|
76
|
+
readonly read: Readonly<{
|
|
77
|
+
check: (input: TransferInput) => TransferCheck;
|
|
78
|
+
nodes: (options?: Readonly<{
|
|
79
|
+
node?: NodeTarget<Element$1>;
|
|
80
|
+
}>) => readonly NodeKey[];
|
|
81
|
+
}>;
|
|
82
|
+
readonly api: Readonly<{
|
|
83
|
+
copy: (input: TransferInput) => TransferOutcome;
|
|
84
|
+
move: (input: TransferInput) => TransferOutcome;
|
|
85
|
+
}>;
|
|
86
|
+
readonly name: "transfer";
|
|
87
|
+
}>, "api" | "name" | "read">> & Readonly<Record<never, never>>;
|
|
88
|
+
}>>];
|
|
89
|
+
readonly on: true;
|
|
90
|
+
}> & Readonly<{
|
|
91
|
+
name: "react";
|
|
92
|
+
}>>;
|
|
93
|
+
/** React plugin backed by one exact DOM dependency. */
|
|
94
|
+
type ReactPlugin<TDOMPlugin extends AnyDOMPlugin = DOMPlugin> = ReturnType<typeof createReactPlugin<TDOMPlugin>>;
|
|
95
|
+
/**
|
|
96
|
+
* Installs the DOM bridge and exposes React focus, read-only, and composition
|
|
97
|
+
* APIs through the editor plugin system.
|
|
98
|
+
*/
|
|
99
|
+
declare const react: <const TDOMPlugin extends AnyDOMPlugin>({ dom: domPlugin }: ReactPluginOptions<TDOMPlugin>) => ReactPlugin<TDOMPlugin>;
|
|
100
|
+
type ReactDefaultPlugins<TPlugins extends readonly unknown[]> = readonly [...TPlugins, DOMPlugin, TransferPlugin, ReactPlugin];
|
|
101
|
+
type EditorBase<V extends Value, TPlugins extends readonly unknown[]> = AnyEditor<V, ReactDefaultPlugins<TPlugins>>;
|
|
102
|
+
/** AnyEditor type with the React and DOM plugins installed. */
|
|
103
|
+
type Editor<V extends Value = Value, TPlugins extends readonly unknown[] = readonly []> = Omit<EditorBase<V, TPlugins>, 'api' | 'update'> & {
|
|
104
|
+
readonly api: EditorBase<V, TPlugins>['api'] & DOMPluginTypes['api'] & {
|
|
105
|
+
react: ReactApi;
|
|
106
|
+
transfer: TransferApi;
|
|
107
|
+
};
|
|
108
|
+
update: EditorBase<V, TPlugins>['update'] & DOMPluginTypes['update'];
|
|
109
|
+
};
|
|
110
|
+
/** React-only editor context value used by lower-level provider internals. */
|
|
111
|
+
type EditorContextValue<V extends Value = Value> = Omit<Editor<V>, 'plugin' | 'update'> & {
|
|
112
|
+
plugin: Editor<V>['plugin'] & (<const TPlugin extends PluginReference>(plugin: TPlugin) => PluginPortal<TPlugin, V>);
|
|
113
|
+
update: Editor<V>['update'] & ((policy: EditorUpdatePolicy, fn: (tx: EditorUpdateTransaction<V, any>, context: EditorUpdateContext<Editor<V>>) => void) => void);
|
|
114
|
+
};
|
|
115
|
+
/** Options for `createEditor`. */
|
|
116
|
+
type CreateEditorOptions<V extends Value = Value, TPlugins extends readonly unknown[] = readonly []> = Omit<CreateEditorOptions$1<V, TPlugins>, 'lifecycleErrorSink'> & Pick<DOMEditorOptions, 'clipboardFormatKey'> & {
|
|
117
|
+
lifecycleErrorSink?: EditorLifecycleErrorSink<Editor<V, TPlugins>>;
|
|
118
|
+
};
|
|
119
|
+
declare function createEditor<const TOptions extends CreateEditorOptions<any, readonly unknown[]> & {
|
|
120
|
+
plugins: readonly unknown[];
|
|
121
|
+
}>(options: CheckedEditorOptions<TOptions, CreateEditorOptions>): Editor<EditorValueFromOptions<TOptions>, PluginsFromOptions<TOptions>>;
|
|
122
|
+
declare function createEditor<V extends Value = Value, const TPlugins extends readonly unknown[] = readonly []>(options?: CreateEditorOptions<V, TPlugins>): Editor<V, TPlugins>;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/react/plugin/react-editor.d.ts
|
|
125
|
+
/**
|
|
126
|
+
* A React and DOM-specific version of the `Editor` interface.
|
|
127
|
+
*/
|
|
128
|
+
interface ReactRuntimeEditor<V extends Value = Value, TPlugins extends readonly unknown[] = any> extends DOMEditor<V, TPlugins> {
|
|
129
|
+
api: DOMEditor<V, TPlugins>['api'] & {
|
|
130
|
+
dom: DOMApi & {
|
|
131
|
+
clipboard: DOMClipboardApi;
|
|
132
|
+
};
|
|
133
|
+
react: ReactApi;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/react/decoration-source.d.ts
|
|
138
|
+
type DecorationSlice = Readonly<{
|
|
139
|
+
attributes: DecorationAttributes;
|
|
140
|
+
end: number;
|
|
141
|
+
key: string;
|
|
142
|
+
start: number;
|
|
143
|
+
}>;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/react/editable/mutation-controller.d.ts
|
|
146
|
+
type EditableRepairRequest = {
|
|
147
|
+
focus?: boolean;
|
|
148
|
+
forceRender?: boolean;
|
|
149
|
+
kind: 'force-render';
|
|
150
|
+
selectionSourceTransition?: EditableSelectionSourceTransition;
|
|
151
|
+
} | {
|
|
152
|
+
focus?: boolean;
|
|
153
|
+
forceRender?: boolean;
|
|
154
|
+
kind: 'sync-selection';
|
|
155
|
+
selectionSourceTransition?: EditableSelectionSourceTransition;
|
|
156
|
+
syncDOMSelection?: boolean;
|
|
157
|
+
} | {
|
|
158
|
+
focus?: boolean;
|
|
159
|
+
forceRender?: boolean;
|
|
160
|
+
kind: 'repair-caret' | 'repair-caret-after-text-insert';
|
|
161
|
+
selectionSourceTransition?: EditableSelectionSourceTransition;
|
|
162
|
+
} | {
|
|
163
|
+
kind: 'none' | 'skip-dom-sync';
|
|
164
|
+
};
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/react/external-text.d.ts
|
|
167
|
+
/** An exact replacement in the observed text's UTF-16 before coordinates. */
|
|
168
|
+
type ExternalTextChange = Readonly<{
|
|
169
|
+
from: number;
|
|
170
|
+
insert: string;
|
|
171
|
+
to: number;
|
|
172
|
+
}>;
|
|
173
|
+
/** Directed UTF-16 offsets within one canonical Text. */
|
|
174
|
+
type ExternalTextSelection = Readonly<{
|
|
175
|
+
anchor: number;
|
|
176
|
+
focus: number;
|
|
177
|
+
}>;
|
|
178
|
+
/** Only the focused view may install a native selection. */
|
|
179
|
+
type ExternalTextSelectionState = ExternalTextSelection & Readonly<{
|
|
180
|
+
mode: 'model' | 'native';
|
|
181
|
+
}>;
|
|
182
|
+
/** A keyed editor decoration clipped to this Text's offsets. */
|
|
183
|
+
type ExternalTextDecoration = DecorationSlice;
|
|
184
|
+
/** Canonical state delivered to one mounted external text view. */
|
|
185
|
+
type ExternalTextState<TConfig = undefined> = Readonly<{
|
|
186
|
+
config: TConfig;
|
|
187
|
+
decorations: readonly ExternalTextDecoration[];
|
|
188
|
+
readOnly: boolean;
|
|
189
|
+
selection: ExternalTextSelectionState | null;
|
|
190
|
+
/** The canonical string reference; retain it without diffing whole strings. */
|
|
191
|
+
text: string;
|
|
192
|
+
/** Echo this observed version in actions; unrelated commits need no update. */
|
|
193
|
+
version: number;
|
|
194
|
+
}>;
|
|
195
|
+
/** Rejected actions never change the canonical document and may reset the view before returning. */
|
|
196
|
+
type ExternalTextDispatchResult = Readonly<{
|
|
197
|
+
status: 'applied' | 'read-only' | 'stale';
|
|
198
|
+
}>;
|
|
199
|
+
/** The only mutation bridge from an external view to its owning editor runtime.
|
|
200
|
+
* Actions may synchronously deliver view updates before they return. Invoke them
|
|
201
|
+
* from input and command handlers, never from adapter lifecycle callbacks.
|
|
202
|
+
*/
|
|
203
|
+
type ExternalTextActions = Readonly<{
|
|
204
|
+
composition: (phase: 'end' | 'start') => void;
|
|
205
|
+
deleteOut: (input: {
|
|
206
|
+
baseVersion: number;
|
|
207
|
+
direction: 'backward' | 'forward';
|
|
208
|
+
}) => ExternalTextDispatchResult;
|
|
209
|
+
dispatch: (input: {
|
|
210
|
+
baseVersion: number;
|
|
211
|
+
changes: readonly ExternalTextChange[];
|
|
212
|
+
intent: 'composition' | 'cut' | 'drop' | 'input' | 'paste';
|
|
213
|
+
selection: ExternalTextSelection;
|
|
214
|
+
}) => ExternalTextDispatchResult;
|
|
215
|
+
/** Delegate to installed editor history; adapters must disable local history. */
|
|
216
|
+
history: (direction: 'redo' | 'undo') => boolean;
|
|
217
|
+
navigateOut: (input: {
|
|
218
|
+
baseVersion: number;
|
|
219
|
+
direction: 'backward' | 'forward';
|
|
220
|
+
extend?: boolean;
|
|
221
|
+
/** The caret's goal client x for an ArrowUp or ArrowDown exit; omit it for other keys. */
|
|
222
|
+
x?: number;
|
|
223
|
+
}) => ExternalTextDispatchResult;
|
|
224
|
+
select: (input: {
|
|
225
|
+
baseVersion: number;
|
|
226
|
+
selection: ExternalTextSelection;
|
|
227
|
+
}) => ExternalTextDispatchResult;
|
|
228
|
+
/**
|
|
229
|
+
* Offer a keydown the view declined to the Editable's `onKeyDown`. Pass the
|
|
230
|
+
* DOM event from its own listener, after every local handler passed on it.
|
|
231
|
+
* The editor drops the key when something prevents its default or stops
|
|
232
|
+
* its propagation before the editor root, and refuses keys a text input
|
|
233
|
+
* uses natively, such as composing and modifier keys, typing, Enter without
|
|
234
|
+
* Ctrl or Meta, Tab, navigation keys, deletion, select-all, clipboard, undo
|
|
235
|
+
* and redo keys, and on Apple hosts Control with a letter, the quote key or
|
|
236
|
+
* Enter. It also refuses every key while the editor or the element is
|
|
237
|
+
* read-only, during an authored preview, or while any part of the selection
|
|
238
|
+
* is outside this view's Text. When the view held focus as the key arrived,
|
|
239
|
+
* focus follows the selection once React commits the handler's change. It
|
|
240
|
+
* stays put when the handler unmounted the Editable, when the handler moved
|
|
241
|
+
* focus out of the view or blurred it before returning while the view stayed
|
|
242
|
+
* mounted, or when focus sits outside the view, other than on the page body,
|
|
243
|
+
* once React has committed. When the view did not hold focus, focus stays
|
|
244
|
+
* where it was.
|
|
245
|
+
*/
|
|
246
|
+
yieldKey: (event: KeyboardEvent) => void;
|
|
247
|
+
}>;
|
|
248
|
+
/** Adapter-owned DOM and local resources for one mounted host. */
|
|
249
|
+
type ExternalTextView<TConfig = undefined> = Readonly<{
|
|
250
|
+
destroy: () => void;
|
|
251
|
+
/** Install the delivered `state.selection`, then focus the local input. */
|
|
252
|
+
focus: () => void;
|
|
253
|
+
/**
|
|
254
|
+
* The offset nearest client `x` on the view's first (`'start'`) or last
|
|
255
|
+
* (`'end'`) visual line, in the delivered `state.text`; `null` when the view
|
|
256
|
+
* cannot tell. The owning editor asks before a vertical arrow enters the
|
|
257
|
+
* view and writes the selection itself. Read layout only: never dispatch an
|
|
258
|
+
* action, change the view's text or selection, focus, scroll, or run work
|
|
259
|
+
* the view deferred, such as a pending layout pass. Actions called during
|
|
260
|
+
* the query are refused. Omitted, the caret enters at the first or last
|
|
261
|
+
* offset.
|
|
262
|
+
*/
|
|
263
|
+
offsetAt?: (input: {
|
|
264
|
+
edge: 'end' | 'start';
|
|
265
|
+
x: number;
|
|
266
|
+
}) => number | null;
|
|
267
|
+
/** Apply patches and canonical state before returning without dispatching an action. */
|
|
268
|
+
update: (input: {
|
|
269
|
+
/** `null` resets from state.text; a list applies exact patches; [] acknowledges. */
|
|
270
|
+
changes: readonly ExternalTextChange[] | null;
|
|
271
|
+
state: ExternalTextState<TConfig>;
|
|
272
|
+
}) => void;
|
|
273
|
+
}>;
|
|
274
|
+
/** Render one exact-one-Text block without a second model or history owner.
|
|
275
|
+
* Lifecycle callbacks are synchronous notifications and must not mutate the
|
|
276
|
+
* owning editor or reenter the mounted view.
|
|
277
|
+
*/
|
|
278
|
+
type ExternalTextAdapter<TConfig = undefined> = Readonly<{
|
|
279
|
+
mount: (context: {
|
|
280
|
+
actions: ExternalTextActions;
|
|
281
|
+
host: HTMLElement;
|
|
282
|
+
state: ExternalTextState<TConfig>;
|
|
283
|
+
}) => ExternalTextView<TConfig>;
|
|
284
|
+
}>;
|
|
285
|
+
/** Mount options inferred from the adapter; changing config does not remount it. */
|
|
286
|
+
type ExternalTextOptions<TConfig = undefined> = Readonly<{
|
|
287
|
+
adapter: ExternalTextAdapter<TConfig>;
|
|
288
|
+
ariaLabel: string;
|
|
289
|
+
}> & (undefined extends TConfig ? Readonly<{
|
|
290
|
+
config?: TConfig;
|
|
291
|
+
}> : Readonly<{
|
|
292
|
+
config: TConfig;
|
|
293
|
+
}>);
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/react/editable/editable-dom-runtime.d.ts
|
|
296
|
+
type EditorHistoryFocusPolicy$1 = 'none' | 'preserve' | 'restore-root';
|
|
297
|
+
type NodeSelectionFocus = RefObject<HTMLElement | null>;
|
|
298
|
+
type EditableHistoryReplayResult = HistoryOutcome | Readonly<{
|
|
299
|
+
reason: 'composing' | 'not-installed' | 'unmounted';
|
|
300
|
+
status: 'unavailable';
|
|
301
|
+
}> | Readonly<{
|
|
302
|
+
/** No shown `Editable` of the presentation can edit `root`. */
|
|
303
|
+
reason: 'hidden' | 'read-only';
|
|
304
|
+
/** The root the replay would change, `undefined` for the primary document. */
|
|
305
|
+
root: RootKey | undefined;
|
|
306
|
+
status: 'unavailable';
|
|
307
|
+
}>;
|
|
308
|
+
type EditableHistoryReplayEvent = Readonly<{
|
|
309
|
+
direction: 'redo' | 'undo';
|
|
310
|
+
result: EditableHistoryReplayResult;
|
|
311
|
+
}>;
|
|
312
|
+
/** Hears the final range of a mouse selection made in an Editable's own text. */
|
|
313
|
+
type EditablePointerSelectionEndHandler = (selection: Range, context: EditableHandlerContext) => void;
|
|
314
|
+
/** Outcome of one paste that an editable's built-in insertion handled. */
|
|
315
|
+
type EditablePasteResult = Readonly<{
|
|
316
|
+
/**
|
|
317
|
+
* Reports from the format that inserted or claimed the payload, plus loss
|
|
318
|
+
* from payloads that could not be used. `impact: 'lossy'` means pasted
|
|
319
|
+
* content was left out.
|
|
320
|
+
*/
|
|
321
|
+
diagnostics: readonly DataTransferDiagnostic[];
|
|
322
|
+
/** Whether the paste committed content. */
|
|
323
|
+
inserted: boolean;
|
|
324
|
+
}>;
|
|
325
|
+
/** What one drop the Editable settled did. */
|
|
326
|
+
type EditableDropResult = Readonly<{
|
|
327
|
+
kind: 'data';
|
|
328
|
+
/** Format reports for external data inserted on the paste path. */
|
|
329
|
+
diagnostics: readonly DataTransferDiagnostic[];
|
|
330
|
+
inserted: boolean;
|
|
331
|
+
}> | Readonly<{
|
|
332
|
+
kind: 'transfer';
|
|
333
|
+
outcome: TransferOutcome;
|
|
334
|
+
}>;
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/react/components/editable.d.ts
|
|
337
|
+
type EditableHandlerResult = boolean | EditableRepairRequest | void;
|
|
338
|
+
/**
|
|
339
|
+
* What an editable passes each DOM handler after its event. `editor` is the
|
|
340
|
+
* view whose editable runs the handler, such as a content root's.
|
|
341
|
+
*/
|
|
342
|
+
type EditableHandlerContext = {
|
|
343
|
+
editor: ReactRuntimeEditor;
|
|
344
|
+
};
|
|
345
|
+
type EditableInputEventContext = EditableHandlerContext & {
|
|
346
|
+
data: unknown;
|
|
347
|
+
event?: InputEvent | React$1.KeyboardEvent<HTMLDivElement>;
|
|
348
|
+
inputType?: string;
|
|
349
|
+
intent: InputIntent | null;
|
|
350
|
+
native: boolean;
|
|
351
|
+
selection: Range | null;
|
|
352
|
+
};
|
|
353
|
+
type EditableDOMBeforeInputContext = EditableInputEventContext & {
|
|
354
|
+
event: InputEvent;
|
|
355
|
+
inputType: string;
|
|
356
|
+
};
|
|
357
|
+
type EditableDOMBeforeInputHandler = (event: InputEvent, context: EditableDOMBeforeInputContext) => EditableHandlerResult;
|
|
358
|
+
type EditableKeyDownHandler = (event: React$1.KeyboardEvent<HTMLDivElement>, context: EditableHandlerContext) => EditableHandlerResult;
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/react/editable/install-browser-handle.d.ts
|
|
361
|
+
/**
|
|
362
|
+
* Expose the browser test handle that `@platejs/test` reads on every
|
|
363
|
+
* `Editable` root mounted afterwards, and keep the kernel trace it reads.
|
|
364
|
+
*
|
|
365
|
+
* Call once at module scope in a test or development entry, before the first
|
|
366
|
+
* editor mounts. Production entries never call it, so their bundles drop the
|
|
367
|
+
* handle. Calling it again changes nothing.
|
|
368
|
+
*/
|
|
369
|
+
declare const installBrowserHandle: () => void;
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/react/dom-text-sync.d.ts
|
|
372
|
+
type DOMTextSyncOptOutReason = 'empty-text' | 'decoration' | 'custom-leaf' | 'custom-text';
|
|
373
|
+
/** Marks of the text a renderer capability resolver is asked about. */
|
|
374
|
+
type DOMTextSyncRendererCapabilityContext = Readonly<{
|
|
375
|
+
marks: Omit<Text, 'text'>;
|
|
376
|
+
}>;
|
|
377
|
+
/**
|
|
378
|
+
* Mark a custom `renderLeaf` or `renderText` as safe for native DOM text sync
|
|
379
|
+
* for the marks `resolve` accepts, so typing updates text in place without
|
|
380
|
+
* re-rendering the renderer. Call it once per renderer object; a second call
|
|
381
|
+
* with a different `resolve` throws.
|
|
382
|
+
*/
|
|
383
|
+
declare const setDOMTextSyncRendererCapability: <TRenderer extends object>(renderer: TRenderer, resolve: (context: DOMTextSyncRendererCapabilityContext) => boolean) => TRenderer;
|
|
384
|
+
/**
|
|
385
|
+
* Mark a custom `renderLeaf` or `renderText` as safe to skip during retained
|
|
386
|
+
* text flow for the marks `resolve` accepts. Call it once per renderer
|
|
387
|
+
* object; a second call with a different `resolve` throws.
|
|
388
|
+
*/
|
|
389
|
+
declare const setRetainedTextFlowRendererCapability: <TRenderer extends object>(renderer: TRenderer, resolve: (context: DOMTextSyncRendererCapabilityContext) => boolean) => TRenderer;
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/react/components/plite-placeholder.d.ts
|
|
392
|
+
type VoidIntrinsicTag = 'area' | 'base' | 'br' | 'col' | 'embed' | 'hr' | 'img' | 'input' | 'link' | 'meta' | 'param' | 'source' | 'track' | 'wbr';
|
|
393
|
+
type PlaceholderIntrinsicTag = Exclude<keyof HTMLElementTagNameMap, VoidIntrinsicTag>;
|
|
394
|
+
/**
|
|
395
|
+
* Render non-editable placeholder content inside an editable surface.
|
|
396
|
+
*
|
|
397
|
+
* The placeholder is aria-hidden, pointer-inert, and styled to overlay the
|
|
398
|
+
* empty editable block without becoming editor content.
|
|
399
|
+
*/
|
|
400
|
+
declare const EditorPlaceholder: ({ as, children, dir, ref, style }: {
|
|
401
|
+
as?: PlaceholderIntrinsicTag;
|
|
402
|
+
children: ReactNode;
|
|
403
|
+
dir?: 'rtl';
|
|
404
|
+
ref?: Ref<HTMLElement>;
|
|
405
|
+
style?: CSSProperties;
|
|
406
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region src/react/components/editable-text.d.ts
|
|
409
|
+
type RenderLeafProps = {
|
|
410
|
+
attributes: {
|
|
411
|
+
'data-editor-leaf': true;
|
|
412
|
+
'data-editor-leaf-end'?: number;
|
|
413
|
+
'data-editor-leaf-start'?: number;
|
|
414
|
+
};
|
|
415
|
+
children: ReactNode;
|
|
416
|
+
leaf: Omit<Text, 'text'>;
|
|
417
|
+
leafPosition?: {
|
|
418
|
+
end: number;
|
|
419
|
+
isFirst?: true;
|
|
420
|
+
isLast?: true;
|
|
421
|
+
start: number;
|
|
422
|
+
};
|
|
423
|
+
path?: Path;
|
|
424
|
+
text: Omit<Text, 'text'>;
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Props of a `renderText` call. Outside a paged view each text gets one call
|
|
428
|
+
* with its host attributes. In a paged view each piece of a text gets its own
|
|
429
|
+
* call with `piece`, and the editor renders the text host around them.
|
|
430
|
+
*/
|
|
431
|
+
type RenderTextProps = RenderTextHostProps | RenderTextPieceProps;
|
|
432
|
+
/** One `renderText` call for a whole text, which owns the text's identity. */
|
|
433
|
+
type RenderTextHostProps = {
|
|
434
|
+
attributes: {
|
|
435
|
+
'data-editor-dom-sync'?: true;
|
|
436
|
+
'data-editor-node': 'text';
|
|
437
|
+
'data-editor-dom-sync-reason'?: DOMTextSyncOptOutReason;
|
|
438
|
+
'data-editor-path'?: string;
|
|
439
|
+
'data-editor-node-key'?: string;
|
|
440
|
+
ref?: Ref<HTMLSpanElement>;
|
|
441
|
+
};
|
|
442
|
+
children: ReactNode;
|
|
443
|
+
piece?: undefined;
|
|
444
|
+
text: Text;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* One `renderText` call for one piece of a paged text: a measured run of the
|
|
448
|
+
* text on a drawn page, the lines of a page not drawn yet, or a whole text
|
|
449
|
+
* that no layout measures. One line can hold several runs of a text. Its
|
|
450
|
+
* children hold only that piece's leaves, and its attributes carry no text
|
|
451
|
+
* identity. `piece.index` is the piece's position among the text's pieces.
|
|
452
|
+
*/
|
|
453
|
+
type RenderTextPieceProps = {
|
|
454
|
+
attributes: Readonly<{
|
|
455
|
+
'data-editor-node'?: never;
|
|
456
|
+
'data-editor-node-key'?: never;
|
|
457
|
+
'data-editor-path'?: never;
|
|
458
|
+
'data-editor-text-piece': true;
|
|
459
|
+
ref?: never;
|
|
460
|
+
}>;
|
|
461
|
+
children: ReactNode;
|
|
462
|
+
piece: Readonly<{
|
|
463
|
+
index: number;
|
|
464
|
+
}>;
|
|
465
|
+
text: Text;
|
|
466
|
+
};
|
|
467
|
+
type RenderPlaceholderProps = {
|
|
468
|
+
attributes: {
|
|
469
|
+
'aria-hidden': true;
|
|
470
|
+
'data-editor-placeholder': true;
|
|
471
|
+
contentEditable: false;
|
|
472
|
+
dir?: 'rtl';
|
|
473
|
+
ref: React$1.RefCallback<HTMLElement>;
|
|
474
|
+
style: CSSProperties;
|
|
475
|
+
};
|
|
476
|
+
children: ReactNode;
|
|
477
|
+
};
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/react/components/dom-coverage-boundary.d.ts
|
|
480
|
+
type DOMCoverageBoundaryMaterializePayload = {
|
|
481
|
+
boundary: DOMCoverageBoundary;
|
|
482
|
+
range?: Range;
|
|
483
|
+
rangeRole?: DOMCoverageMaterializeRangeRole;
|
|
484
|
+
reason: DOMCoverageMaterializeReason;
|
|
485
|
+
};
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region src/react/components/editable-text-blocks.d.ts
|
|
488
|
+
type EditableDOMCoverageBoundaryScope = {
|
|
489
|
+
from: number;
|
|
490
|
+
to?: number;
|
|
491
|
+
type: 'children';
|
|
492
|
+
} | {
|
|
493
|
+
type: 'self';
|
|
494
|
+
};
|
|
495
|
+
type EditableDOMCoverageBoundaryPlaceholderContext = {
|
|
496
|
+
materialize: () => void;
|
|
497
|
+
};
|
|
498
|
+
type EditableDOMCoverageBoundaryMaterializePayload = DOMCoverageBoundaryMaterializePayload;
|
|
499
|
+
type EditableDOMCoverageBoundaryProps = {
|
|
500
|
+
boundaryId?: string;
|
|
501
|
+
children?: ReactNode;
|
|
502
|
+
copyPolicy?: DOMCoverageCopyPolicy;
|
|
503
|
+
mounted?: boolean;
|
|
504
|
+
onMaterialize?: (payload: DOMCoverageBoundaryMaterializePayload) => void;
|
|
505
|
+
reason?: DOMCoverageReason;
|
|
506
|
+
renderPlaceholder?: (context: EditableDOMCoverageBoundaryPlaceholderContext) => ReactNode;
|
|
507
|
+
scope: EditableDOMCoverageBoundaryScope;
|
|
508
|
+
selectionPolicy?: DOMCoverageSelectionPolicy;
|
|
509
|
+
};
|
|
510
|
+
type EditableContentRootViewport = {
|
|
511
|
+
/**
|
|
512
|
+
* The root's top-level blocks in view, such as the shapes a camera shows.
|
|
513
|
+
* The slot also mounts the blocks the selection's ends are in, and hides
|
|
514
|
+
* each run of the others behind a boundary whose copy reads the model.
|
|
515
|
+
*/
|
|
516
|
+
mountedKeys: ReadonlySet<NodeKey>;
|
|
517
|
+
/**
|
|
518
|
+
* Brings `path` into view, such as when the selection moves into a block
|
|
519
|
+
* outside `mountedKeys`. `editor.api.dom.scrollIntoView` calls it with
|
|
520
|
+
* `align` `'auto'` for a mounted path, point or range in this root, and
|
|
521
|
+
* `'auto'` leaves a block already in view where it is. It adds the block at
|
|
522
|
+
* `path[0]` to `mountedKeys` before or on the next render, and returns false
|
|
523
|
+
* when it cannot.
|
|
524
|
+
*/
|
|
525
|
+
reveal: (path: Path, align?: 'auto' | 'center' | 'end' | 'start') => boolean;
|
|
526
|
+
};
|
|
527
|
+
type EditableContentRootSlotOptions = {
|
|
528
|
+
ariaLabel?: string;
|
|
529
|
+
className?: string;
|
|
530
|
+
disableDefaultStyles?: boolean;
|
|
531
|
+
id?: string;
|
|
532
|
+
/**
|
|
533
|
+
* The element that takes focus in place of this root's editable when the
|
|
534
|
+
* editor moves focus here, as after an undo or on a call to
|
|
535
|
+
* `editor.api.dom.focus()`, while there is no selection or a node selection
|
|
536
|
+
* holds only top-level blocks of this root. It does not take focus while the
|
|
537
|
+
* editor shows a caret or a text selection, even a range drawn on the page
|
|
538
|
+
* that reaches into this root, and a click that selects an object in this
|
|
539
|
+
* root focuses the editable. When the render that follows a focus call
|
|
540
|
+
* replaces the element, focus falls to the page. Unless the element is a
|
|
541
|
+
* control, such as a button, the editor reads no keys from it, so it must
|
|
542
|
+
* handle the keys it needs, such as undo and redo.
|
|
543
|
+
*/
|
|
544
|
+
nodeSelectionFocus?: NodeSelectionFocus;
|
|
545
|
+
placeholder?: ReactNode;
|
|
546
|
+
readOnly?: boolean;
|
|
547
|
+
spellCheck?: TextareaHTMLAttributes<HTMLDivElement>['spellCheck'];
|
|
548
|
+
style?: CSSProperties;
|
|
549
|
+
tabIndex?: number;
|
|
550
|
+
/** Mount only some of the root's top-level blocks, such as a board's shapes in view. */
|
|
551
|
+
viewport?: EditableContentRootViewport;
|
|
552
|
+
};
|
|
553
|
+
type EditableElementSlots = {
|
|
554
|
+
children: (range?: {
|
|
555
|
+
from?: number;
|
|
556
|
+
to?: number;
|
|
557
|
+
}) => ReactNode;
|
|
558
|
+
/** Delegate one exact-one-Text block to an adapter while the editor owns its value. */
|
|
559
|
+
externalText: <TConfig = undefined>(options: ExternalTextOptions<TConfig>) => ReactNode;
|
|
560
|
+
/**
|
|
561
|
+
* Renders model-present content whose editable DOM may be intentionally
|
|
562
|
+
* absent, such as closed accordion bodies or inactive tab panels.
|
|
563
|
+
*/
|
|
564
|
+
contentBoundary: (props: EditableDOMCoverageBoundaryProps) => ReactNode;
|
|
565
|
+
contentRoot: (slot: string, options?: EditableContentRootSlotOptions) => ReactNode;
|
|
566
|
+
};
|
|
567
|
+
type RenderElementProps<TElement extends Element$1 = Element$1> = TElement extends Element$1 ? {
|
|
568
|
+
attributes: {
|
|
569
|
+
'data-editor-inline'?: true;
|
|
570
|
+
'data-editor-node': 'element';
|
|
571
|
+
'data-editor-path': string;
|
|
572
|
+
'data-editor-node-key': string;
|
|
573
|
+
'data-editor-void'?: true;
|
|
574
|
+
/** The direction of a text block's first letter, absent when none decides. */
|
|
575
|
+
dir?: 'ltr' | 'rtl';
|
|
576
|
+
/**
|
|
577
|
+
* Binds and places the element. It changes when the node or its page
|
|
578
|
+
* placement changes, so a ref merge must change with it and pass a
|
|
579
|
+
* detach on as a call with `null`.
|
|
580
|
+
*/
|
|
581
|
+
ref: React$1.RefCallback<HTMLElement>;
|
|
582
|
+
};
|
|
583
|
+
children: ReactNode;
|
|
584
|
+
element: TElement;
|
|
585
|
+
isInline: boolean;
|
|
586
|
+
slots: EditableElementSlots;
|
|
587
|
+
} : never;
|
|
588
|
+
type RenderElementRenderer<TElement extends Element$1 = Element$1> = (props: RenderElementProps<TElement>) => ReactNode;
|
|
589
|
+
type RenderVoidProps<TElement extends Element$1 = Element$1> = {
|
|
590
|
+
element: TElement;
|
|
591
|
+
};
|
|
592
|
+
type RenderVoidRenderer<TElement extends Element$1 = Element$1> = (props: RenderVoidProps<TElement>) => ReactNode;
|
|
593
|
+
type EditableDOMHandlers<TAttributes> = { [K in keyof TAttributes]: K extends `on${string}` ? NonNullable<TAttributes[K]> extends ((event: infer E) => void) ? (event: E, context: EditableHandlerContext) => void : TAttributes[K] : TAttributes[K]; };
|
|
594
|
+
/**
|
|
595
|
+
* Each DOM handler gets an `EditableHandlerContext` after its event, whose
|
|
596
|
+
* `editor` is the view whose editable runs it. An editable skips an event
|
|
597
|
+
* inside a content root's editable, which runs the same handlers on the
|
|
598
|
+
* content root's view.
|
|
599
|
+
*/
|
|
600
|
+
type EditableProps<TElement extends Element$1 = Element$1, TRoot extends RootKey = RootKey> = {
|
|
601
|
+
autoFocus?: boolean;
|
|
602
|
+
className?: string;
|
|
603
|
+
disableDefaultStyles?: boolean;
|
|
604
|
+
id?: string;
|
|
605
|
+
ignoreBlankEditableRootClicks?: boolean;
|
|
606
|
+
onDOMBeforeInput?: EditableDOMBeforeInputHandler;
|
|
607
|
+
onHistoryReplay?: (event: EditableHistoryReplayEvent) => void;
|
|
608
|
+
onKeyDown?: EditableKeyDownHandler;
|
|
609
|
+
/**
|
|
610
|
+
* Called once for each paste this editable handles through its built-in
|
|
611
|
+
* formats: after the paste commits (`inserted: true`), or when no format
|
|
612
|
+
* can insert it or a format claims it with an empty slice
|
|
613
|
+
* (`inserted: false`). A diagnostic with `impact: 'lossy'` means pasted
|
|
614
|
+
* content was left out.
|
|
615
|
+
*
|
|
616
|
+
* Not called when `onPaste` or a plugin command handles the paste without
|
|
617
|
+
* the built-in formats, or when this editable unmounts before the paste
|
|
618
|
+
* settles. An `onPaste` handler that inserts through
|
|
619
|
+
* `editor.api.dom.clipboard.insertData` during the paste gets that
|
|
620
|
+
* insertion's result.
|
|
621
|
+
*/
|
|
622
|
+
onPasteResult?: (result: EditablePasteResult) => void;
|
|
623
|
+
/**
|
|
624
|
+
* Called once after a primary mouse press that began on this editable's own
|
|
625
|
+
* text has its final text range: after the mouseup's import and every later
|
|
626
|
+
* write of that press, such as a drag released outside the editable or a
|
|
627
|
+
* click inside selected text that collapses it. Not called for a press on a
|
|
628
|
+
* control, an external text host or a nested editor, for touch or pen, when
|
|
629
|
+
* the press ends in a node selection, or when a key other than a modifier,
|
|
630
|
+
* a composition, a native drag, a blur, another press or an unmount comes
|
|
631
|
+
* first.
|
|
632
|
+
*/
|
|
633
|
+
onPointerSelectionEnd?: EditablePointerSelectionEndHandler;
|
|
634
|
+
/** Reports a drop this Editable lands: the transfer outcome, or the data it inserted. */
|
|
635
|
+
onDropResult?: (result: EditableDropResult) => void;
|
|
636
|
+
placeholder?: ReactNode;
|
|
637
|
+
readOnly?: boolean;
|
|
638
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
639
|
+
renderElement?: RenderElementRenderer<TElement>;
|
|
640
|
+
renderLeaf?: (props: RenderLeafProps) => ReactNode;
|
|
641
|
+
renderPlaceholder?: (props: RenderPlaceholderProps) => ReactNode;
|
|
642
|
+
renderText?: (props: RenderTextProps) => ReactNode;
|
|
643
|
+
renderVoid?: RenderVoidRenderer<TElement>;
|
|
644
|
+
root?: NamedRootKey<TRoot>;
|
|
645
|
+
scrollSelectionIntoView?: (editor: Editor$1, domRange: globalThis.Range) => void;
|
|
646
|
+
spellCheck?: TextareaHTMLAttributes<HTMLDivElement>['spellCheck'];
|
|
647
|
+
style?: CSSProperties;
|
|
648
|
+
} & EditableDOMHandlers<Omit<TextareaHTMLAttributes<HTMLDivElement>, 'autoFocus' | 'children' | 'className' | 'id' | 'onKeyDown' | 'placeholder' | 'readOnly' | 'spellCheck' | 'style'>>;
|
|
649
|
+
/**
|
|
650
|
+
* Render the editable content area for one Plite root.
|
|
651
|
+
*
|
|
652
|
+
* `Editable` renders the complete root DOM and owns renderers, events,
|
|
653
|
+
* selection sync, and optional root scoping. Pass `root` to mount the editor
|
|
654
|
+
* surface for a specific root.
|
|
655
|
+
* When focus moves to an element or composed ancestor with
|
|
656
|
+
* `data-editor-keep-selection-visible`, that exact Editable paints its live
|
|
657
|
+
* canonical selection through `data-editor-inactive-selection` or
|
|
658
|
+
* `data-editor-inactive-selection-caret` until focus returns or moves elsewhere.
|
|
659
|
+
* A primary press on such an element counts as focus reaching it, for browsers
|
|
660
|
+
* that do not focus a clicked button.
|
|
661
|
+
*/
|
|
662
|
+
declare const Editable: <TElement extends Element$1, const TRoot extends RootKey = RootKey>(props: EditableProps<TElement, TRoot>) => import("react/jsx-runtime").JSX.Element;
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/react/components/plite.d.ts
|
|
665
|
+
/** Canonical commit payload observed by a Plite React provider. */
|
|
666
|
+
type CommitContext<V extends Value = Value, TPlugins extends readonly unknown[] = readonly unknown[]> = EditorCommitContext<Editor<V, TPlugins>>;
|
|
667
|
+
/** Value-change payload derived independently from a canonical commit. */
|
|
668
|
+
type ValueChangeContext<V extends Value = Value, TPlugins extends readonly unknown[] = readonly unknown[]> = CommitContext<V, TPlugins> & {
|
|
669
|
+
value: V;
|
|
670
|
+
};
|
|
671
|
+
/** Selection-change payload derived independently from a canonical commit. */
|
|
672
|
+
type SelectionChangeContext<V extends Value = Value, TPlugins extends readonly unknown[] = readonly unknown[]> = CommitContext<V, TPlugins> & {
|
|
673
|
+
selection: EditorSnapshot<V>['selection'];
|
|
674
|
+
};
|
|
675
|
+
/** Props for the Plite React provider around editable roots and callbacks. */
|
|
676
|
+
type EditorRootProps<E extends Editor<any, any> = Editor<any, any>, TRoot extends RootKey = RootKey> = EditorViewOptions<TRoot> & (NoInfer<E> extends {
|
|
677
|
+
read: {
|
|
678
|
+
authored: unknown;
|
|
679
|
+
};
|
|
680
|
+
} ? unknown : {
|
|
681
|
+
authored?: never;
|
|
682
|
+
}) & {
|
|
683
|
+
/** Document and initial view policy for this mounted lifetime. */
|
|
684
|
+
editor: E;
|
|
685
|
+
children: React$1.ReactNode;
|
|
686
|
+
decorations?: ReadonlyArray<DecorationSource<NoInfer<E>>> | null;
|
|
687
|
+
onCommit?: (context: EditorCommitContext<NoInfer<E>>) => void;
|
|
688
|
+
onSelectionChange?: (context: EditorCommitContext<NoInfer<E>> & {
|
|
689
|
+
selection: EditorCommitContext<NoInfer<E>>['snapshot']['selection'];
|
|
690
|
+
}) => void;
|
|
691
|
+
onValueChange?: (context: EditorCommitContext<NoInfer<E>> & {
|
|
692
|
+
value: ValueOf<E>;
|
|
693
|
+
}) => void;
|
|
694
|
+
};
|
|
695
|
+
/**
|
|
696
|
+
* Provide one mounted editor runtime to React descendants. Passing an editor
|
|
697
|
+
* with another runtime remounts everything below. Named root views may change
|
|
698
|
+
* within the same runtime.
|
|
699
|
+
*/
|
|
700
|
+
declare const EditorRoot: <E extends Editor<any, any>, const TRoot extends RootKey = RootKey>(props: EditorRootProps<E, TRoot>) => import("react/jsx-runtime").JSX.Element;
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region src/react/components/plite-element.d.ts
|
|
703
|
+
type IntrinsicTag = keyof HTMLElementTagNameMap;
|
|
704
|
+
/**
|
|
705
|
+
* Render a Plite element DOM shell bound to the current element runtime.
|
|
706
|
+
*
|
|
707
|
+
* Use this primitive when building custom element shells that still need Plite
|
|
708
|
+
* DOM attributes, path/runtime metadata, and node-ref binding.
|
|
709
|
+
*/
|
|
710
|
+
declare const EditorElement: ({ as, children, className, id, isInline, isVoid, ref, style, ...domProps }: Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
711
|
+
as?: IntrinsicTag;
|
|
712
|
+
children?: ReactNode;
|
|
713
|
+
isInline?: boolean;
|
|
714
|
+
isVoid?: boolean;
|
|
715
|
+
ref?: Ref<HTMLElement>;
|
|
716
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region src/react/components/plite-leaf.d.ts
|
|
719
|
+
/**
|
|
720
|
+
* Render a Plite leaf shell for decorated text content.
|
|
721
|
+
*
|
|
722
|
+
* The shell carries Plite leaf attributes and render profiling metadata while
|
|
723
|
+
* leaving actual text children to the caller.
|
|
724
|
+
*/
|
|
725
|
+
declare const EditorLeaf: ({ attributes, children }: {
|
|
726
|
+
attributes?: {
|
|
727
|
+
'data-editor-leaf': true;
|
|
728
|
+
'data-editor-leaf-end'?: number;
|
|
729
|
+
'data-editor-leaf-start'?: number;
|
|
730
|
+
};
|
|
731
|
+
children: ReactNode;
|
|
732
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/react/components/plite-text.d.ts
|
|
735
|
+
/**
|
|
736
|
+
* Render a Plite text DOM shell bound to a text runtime.
|
|
737
|
+
*
|
|
738
|
+
* The shell carries path/runtime metadata and native DOM-sync attributes used
|
|
739
|
+
* by selection and mutation handling. Inside a `renderText` call for one piece
|
|
740
|
+
* of a paged text it renders a plain span, because the editor already renders
|
|
741
|
+
* that text's shell around its pieces.
|
|
742
|
+
*/
|
|
743
|
+
declare const EditorText: ({ domSync, domSyncReason, children, path, ref, nodeKey }: {
|
|
744
|
+
children: ReactNode;
|
|
745
|
+
domSync?: boolean;
|
|
746
|
+
domSyncReason?: string | null;
|
|
747
|
+
path?: Path;
|
|
748
|
+
ref?: Ref<HTMLSpanElement>;
|
|
749
|
+
nodeKey?: NodeKey | null;
|
|
750
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
751
|
+
//#endregion
|
|
752
|
+
//#region src/react/hooks/use-editor-context.d.ts
|
|
753
|
+
/**
|
|
754
|
+
* Get the current editor object from the React context.
|
|
755
|
+
*/
|
|
756
|
+
declare const useEditorContext: () => EditorContextValue<any>;
|
|
757
|
+
/** Get the current editor object when a provider is mounted. */
|
|
758
|
+
declare const useOptionalEditorContext: () => EditorContextValue<any> | null;
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region src/react/hooks/use-editor-composing.d.ts
|
|
761
|
+
/**
|
|
762
|
+
* Get the current `composing` state of the editor.
|
|
763
|
+
*/
|
|
764
|
+
declare const useEditorComposing: () => boolean;
|
|
765
|
+
//#endregion
|
|
766
|
+
//#region src/react/hooks/use-editor-dom-scope.d.ts
|
|
767
|
+
type DOMScopeEditor = {
|
|
768
|
+
api: {
|
|
769
|
+
dom: Pick<DOMApi, 'editable' | 'root' | 'scroll'>;
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
/** Return the mounted editable element for a Plite root. */
|
|
773
|
+
declare const useEditorEditableElement: <const TRoot extends RootKey = RootKey>(editor: DOMScopeEditor, root?: NamedRootKey<TRoot>) => HTMLElement | null;
|
|
774
|
+
/** Return the mounted editor root element. */
|
|
775
|
+
declare const useEditorRootElement: (editor: DOMScopeEditor) => HTMLElement | null;
|
|
776
|
+
/** Return the editor scroll container element. */
|
|
777
|
+
declare const useEditorScrollElement: (editor: DOMScopeEditor) => HTMLElement | null;
|
|
778
|
+
/**
|
|
779
|
+
* Register the element that scrolls the editor, such as a page's scrolling
|
|
780
|
+
* `main`. Every editor of the document returns it from
|
|
781
|
+
* `editor.api.dom.scroll()`, and virtualized editables follow its scroll. A
|
|
782
|
+
* `fallback` registration applies only while no other element is registered.
|
|
783
|
+
*/
|
|
784
|
+
declare const useEditorScrollElementRef: (editor: DOMScopeEditor, { fallback }?: {
|
|
785
|
+
fallback?: boolean;
|
|
786
|
+
}) => (element: HTMLElement | null) => void;
|
|
787
|
+
//#endregion
|
|
788
|
+
//#region src/react/hooks/use-editor-focused.d.ts
|
|
789
|
+
/**
|
|
790
|
+
* Get the current `focused` state of the editor.
|
|
791
|
+
*/
|
|
792
|
+
declare const useEditorFocused: () => boolean;
|
|
793
|
+
//#endregion
|
|
794
|
+
//#region src/react/hooks/use-editor-read-only.d.ts
|
|
795
|
+
/**
|
|
796
|
+
* Props for `EditorReadOnlyProvider`.
|
|
797
|
+
*/
|
|
798
|
+
type EditorReadOnlyProviderProps = {
|
|
799
|
+
children: ReactNode;
|
|
800
|
+
readOnly?: boolean;
|
|
801
|
+
};
|
|
802
|
+
/**
|
|
803
|
+
* Share editor read-only state with shell components that render outside a
|
|
804
|
+
* concrete `<Plite>` root.
|
|
805
|
+
*/
|
|
806
|
+
declare const EditorReadOnlyProvider: ({ children, readOnly }: EditorReadOnlyProviderProps) => import("react").FunctionComponentElement<import("react").ProviderProps<boolean | undefined>>;
|
|
807
|
+
/**
|
|
808
|
+
* Return the nearest editor read-only state, or `undefined` when no provider is
|
|
809
|
+
* active yet.
|
|
810
|
+
*/
|
|
811
|
+
declare const useOptionalEditorReadOnly: () => boolean | undefined;
|
|
812
|
+
/**
|
|
813
|
+
* Get the current `readOnly` state of the editor.
|
|
814
|
+
*/
|
|
815
|
+
declare const useEditorReadOnly: () => boolean;
|
|
816
|
+
//#endregion
|
|
817
|
+
//#region src/react/hooks/use-editor-runtime-state.d.ts
|
|
818
|
+
/** Options for explicit editor runtime-state selectors. */
|
|
819
|
+
interface EditorRuntimeStateSelectorOptions<T, TEditor extends Editor$2<any, any> = Editor$2<any, any>> {
|
|
820
|
+
equalityFn?: (a: T, b: T) => boolean;
|
|
821
|
+
shouldUpdate?: (change?: EditorCommit<ValueOf<TEditor>>) => boolean;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Subscribe to a derived state value from an explicit editor instance.
|
|
825
|
+
*
|
|
826
|
+
* Use this for chrome that owns or receives an editor but is outside a
|
|
827
|
+
* `<EditorRoot>` provider. Commit-driven selectors invalidate synchronously. Inside
|
|
828
|
+
* provider descendants, prefer `useEditorState`.
|
|
829
|
+
*/
|
|
830
|
+
declare function useEditorRuntimeState<T, TEditor extends Editor$2<any, any> = Editor$2<any, any>>(editor: TEditor, selector: (state: EditorStateView<ValueOf<TEditor>, PluginsOf<TEditor>>) => T, { equalityFn, shouldUpdate }?: EditorRuntimeStateSelectorOptions<T, TEditor>): T;
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region src/react/hooks/use-editor-selection.d.ts
|
|
833
|
+
/**
|
|
834
|
+
* Get the current editor selection.
|
|
835
|
+
* Only triggers a rerender when the selection actually changes
|
|
836
|
+
*/
|
|
837
|
+
declare const useEditorSelection: () => BaseRange | null;
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region src/react/hooks/use-editor-selector.d.ts
|
|
840
|
+
type ContextEditor = EditorContextValue<any>;
|
|
841
|
+
/** Commit-subscription options for selectors that read from the editor. */
|
|
842
|
+
interface EditorSelectorOptions<T = unknown> {
|
|
843
|
+
deferred?: boolean;
|
|
844
|
+
equalityFn?: (a: T, b: T) => boolean;
|
|
845
|
+
includeRootOrderChanges?: boolean;
|
|
846
|
+
profileId?: string;
|
|
847
|
+
runtimeEventSource?: 'node' | 'path' | 'render' | 'selection';
|
|
848
|
+
nodeKey?: NodeKey | null;
|
|
849
|
+
nodeKeys?: readonly NodeKey[] | null;
|
|
850
|
+
shouldUpdate?: (change?: EditorCommit) => boolean;
|
|
851
|
+
}
|
|
852
|
+
/** Options for selectors that read from the immutable editor state view. */
|
|
853
|
+
interface EditorStateSelectorOptions<T> {
|
|
854
|
+
deferred?: boolean;
|
|
855
|
+
equalityFn?: (a: T, b: T) => boolean;
|
|
856
|
+
shouldUpdate?: (change?: EditorCommit) => boolean;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Subscribe to editor commits and derive a render value from the editor.
|
|
860
|
+
*
|
|
861
|
+
* Scope updates with roots/node keys or `shouldUpdate`, and use
|
|
862
|
+
* `useEditorState` when the selector only needs the immutable state view.
|
|
863
|
+
*/
|
|
864
|
+
declare function useEditorSelector<T>(selector: (editor: ContextEditor) => T, { deferred, equalityFn, includeRootOrderChanges, profileId, runtimeEventSource, nodeKey, nodeKeys, shouldUpdate }?: EditorSelectorOptions<T>): T;
|
|
865
|
+
/**
|
|
866
|
+
* Reads from the immutable editor state view and re-renders only when the
|
|
867
|
+
* selected value changes.
|
|
868
|
+
*
|
|
869
|
+
* Inline selectors always observe the latest render values.
|
|
870
|
+
*/
|
|
871
|
+
declare function useEditorState<T>(selector: (state: EditorStateView<ValueOf<ContextEditor>, PluginsOf<ContextEditor>>) => T, { deferred, equalityFn, shouldUpdate }?: EditorStateSelectorOptions<T>): T;
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/react/hooks/use-editor-view-state.d.ts
|
|
874
|
+
/** Options for explicit editor view-state selectors. */
|
|
875
|
+
interface EditorViewStateSelectorOptions<T> {
|
|
876
|
+
equalityFn?: (a: T, b: T) => boolean;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Subscribe to a derived view-state value from an explicit editor instance.
|
|
880
|
+
*
|
|
881
|
+
* View state covers editable facts such as read-only, focus, and composition.
|
|
882
|
+
*/
|
|
883
|
+
declare function useEditorViewState<T, TEditor extends AnyEditor = AnyEditor>(editor: TEditor, selector: (view: EditorStateView<ValueOf<TEditor>>['view']) => T, { equalityFn }?: EditorViewStateSelectorOptions<T>): T;
|
|
884
|
+
//#endregion
|
|
885
|
+
//#region src/react/hooks/use-element.d.ts
|
|
886
|
+
/**
|
|
887
|
+
* Get the current element.
|
|
888
|
+
*/
|
|
889
|
+
declare const useElement: <TElement extends Element$1 = Element$1>() => TElement;
|
|
890
|
+
/**
|
|
891
|
+
* Get the current element, or return null if not inside `renderElement`.
|
|
892
|
+
*/
|
|
893
|
+
declare const useOptionalElement: <TElement extends Element$1 = Element$1>() => TElement | null;
|
|
894
|
+
//#endregion
|
|
895
|
+
//#region src/react/hooks/use-element-path.d.ts
|
|
896
|
+
/** Subscribe to the live path for the current rendered element. */
|
|
897
|
+
declare const useElementPath: () => Path | null;
|
|
898
|
+
//#endregion
|
|
899
|
+
//#region src/react/hooks/use-element-selected.d.ts
|
|
900
|
+
/**
|
|
901
|
+
* Selection match mode for `useElementSelected`:
|
|
902
|
+
*
|
|
903
|
+
* - `intersects`: any selection reaches the element.
|
|
904
|
+
* - `collapsed`: a collapsed selection reaches the element.
|
|
905
|
+
* - `text`: a text selection reaches the element; any node selection is false.
|
|
906
|
+
* - `node`: a node selection holds the element.
|
|
907
|
+
* - `object`: an object node selection holds the element itself.
|
|
908
|
+
*/
|
|
909
|
+
type UseElementSelectedMode = 'collapsed' | 'intersects' | 'node' | 'object' | 'text';
|
|
910
|
+
/** Options for selecting the context element or an explicit element path. */
|
|
911
|
+
type UseElementSelectedOptions = {
|
|
912
|
+
at?: NodeKey | Path | null;
|
|
913
|
+
mode?: UseElementSelectedMode;
|
|
914
|
+
};
|
|
915
|
+
/**
|
|
916
|
+
* Subscribe to whether an element path matches the current view's selection,
|
|
917
|
+
* including retained content in a mounted markup view.
|
|
918
|
+
*/
|
|
919
|
+
declare const useElementSelected: ({ at, mode }?: UseElementSelectedOptions) => boolean;
|
|
920
|
+
//#endregion
|
|
921
|
+
//#region src/react/hooks/use-node-selector.d.ts
|
|
922
|
+
/** Runtime/node payload passed to node selectors. */
|
|
923
|
+
type EditorNodeSelectorContext = {
|
|
924
|
+
editor: ReactRuntimeEditor;
|
|
925
|
+
node: Node$1 | null;
|
|
926
|
+
path: Path | null;
|
|
927
|
+
nodeKey: NodeKey | null;
|
|
928
|
+
};
|
|
929
|
+
/** Node selector payload narrowed with the text node when available. */
|
|
930
|
+
type EditorTextSelectorContext = EditorNodeSelectorContext & {
|
|
931
|
+
text: Text | null;
|
|
932
|
+
};
|
|
933
|
+
/** Update-scoping options for selectors tied to a rendered node key. */
|
|
934
|
+
type EditorRuntimeSelectorOptions = {
|
|
935
|
+
deferred?: boolean;
|
|
936
|
+
includeRootOrderChanges?: boolean;
|
|
937
|
+
nodeKey?: NodeKey | null;
|
|
938
|
+
};
|
|
939
|
+
/**
|
|
940
|
+
* Subscribe to the Plite node rendered by the current runtime.
|
|
941
|
+
*
|
|
942
|
+
* Use this from element, leaf, or custom shell renderers that need node, path,
|
|
943
|
+
* runtime, or root metadata without forcing unrelated runtimes to re-render.
|
|
944
|
+
*/
|
|
945
|
+
declare function useNodeSelector<T>(selector: (context: EditorNodeSelectorContext) => T, equalityFn?: (a: T, b: T) => boolean, options?: EditorRuntimeSelectorOptions): T;
|
|
946
|
+
/**
|
|
947
|
+
* Subscribe to the text node rendered by the current runtime.
|
|
948
|
+
*
|
|
949
|
+
* The selector receives `text` when the runtime owns a Plite text node, or
|
|
950
|
+
* `null` for element runtimes.
|
|
951
|
+
*/
|
|
952
|
+
declare function useTextSelector<T>(selector: (context: EditorTextSelectorContext) => T, equalityFn?: (a: T, b: T) => boolean, options?: EditorRuntimeSelectorOptions): T;
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region src/react/hooks/use-plite-annotation-store.d.ts
|
|
955
|
+
/** Options for a React-owned annotation store. */
|
|
956
|
+
type UseAnnotationStoreOptions = {
|
|
957
|
+
id?: string;
|
|
958
|
+
onError?: ViewSourceErrorSink;
|
|
959
|
+
/** Explicit invalidation token for a mutable external annotation source. */
|
|
960
|
+
revision?: unknown;
|
|
961
|
+
};
|
|
962
|
+
/**
|
|
963
|
+
* Create an annotation store from a React-owned annotation value.
|
|
964
|
+
*
|
|
965
|
+
* New array identities refresh automatically. Pass `revision` only when an
|
|
966
|
+
* external mutable source changes without producing a new array.
|
|
967
|
+
*/
|
|
968
|
+
declare function useAnnotationStore<TData = unknown, V extends Value = Value, TPlugins extends readonly unknown[] = readonly []>(editor: Editor$2<V, TPlugins>, annotations: ReadonlyArray<Annotation<TData>>, options?: UseAnnotationStoreOptions): AnnotationStore<TData>;
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/react/hooks/use-plite-annotations.d.ts
|
|
971
|
+
/** Read one resolved annotation by id from an explicit store. */
|
|
972
|
+
declare function useAnnotation<TData = unknown>(store: AnnotationStore<TData>, id: string): ResolvedAnnotation<TData> | null;
|
|
973
|
+
/** Read the current annotation snapshot from an explicit store. */
|
|
974
|
+
declare function useAnnotations<TData = unknown>(store: AnnotationStore<TData>): AnnotationSnapshot<TData>;
|
|
975
|
+
//#endregion
|
|
976
|
+
//#region src/react/hooks/use-plite-child-root.d.ts
|
|
977
|
+
/**
|
|
978
|
+
* Resolve a stable same-runtime root key owned by an element.
|
|
979
|
+
*
|
|
980
|
+
* Prefer storing `childRoots[slot]` on the element when the child root is part
|
|
981
|
+
* of persisted document data. The node-key fallback is useful for ephemeral
|
|
982
|
+
* island roots, but it is intentionally not a persistence contract.
|
|
983
|
+
*/
|
|
984
|
+
declare function useChildRoot(element?: Element$1 | null, slot?: string): NamedRootKey;
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/react/hooks/use-plite-root-chrome.d.ts
|
|
987
|
+
/** Options for mouse interaction on root-level chrome outside editable text. */
|
|
988
|
+
type UseRootChromeOptions = {
|
|
989
|
+
disabled?: boolean;
|
|
990
|
+
selection?: 'end' | 'restore';
|
|
991
|
+
};
|
|
992
|
+
/** Props and root metadata for root-level mouse interaction chrome. */
|
|
993
|
+
type RootChromeController = {
|
|
994
|
+
props: {
|
|
995
|
+
'data-editor-root-chrome'?: NamedRootKey;
|
|
996
|
+
onMouseDownCapture: MouseEventHandler<HTMLElement>;
|
|
997
|
+
onMouseMoveCapture: MouseEventHandler<HTMLElement>;
|
|
998
|
+
onMouseUpCapture: MouseEventHandler<HTMLElement>;
|
|
999
|
+
};
|
|
1000
|
+
root: NamedRootKey | undefined;
|
|
1001
|
+
};
|
|
1002
|
+
/**
|
|
1003
|
+
* Create props for root-level mouse interaction outside editable content.
|
|
1004
|
+
*
|
|
1005
|
+
* Each mounted `Editable` of the root is a copy of it. A press acts on the copy
|
|
1006
|
+
* that the chrome surrounds, even while another copy of that root was used
|
|
1007
|
+
* last. A press on a control or widget inside the chrome, such as a button,
|
|
1008
|
+
* acts on no copy. When one chrome holds several copies, a press outside them
|
|
1009
|
+
* acts on the copy used last, or else the first. Chrome of the primary
|
|
1010
|
+
* document inside another chrome of it acts as part of the outer one. A press
|
|
1011
|
+
* that an `Editable` of another root around the chrome handles first never
|
|
1012
|
+
* reaches the chrome.
|
|
1013
|
+
*/
|
|
1014
|
+
declare function useRootChrome<const TRoot extends RootKey = RootKey>(root?: NamedRootKey<TRoot>, { disabled, selection }?: UseRootChromeOptions): RootChromeController;
|
|
1015
|
+
//#endregion
|
|
1016
|
+
//#region src/react/hooks/use-plite-content-root.d.ts
|
|
1017
|
+
/** Options for resolving a schema-owned child content root. */
|
|
1018
|
+
type UseContentRootOptions = UseRootChromeOptions & {
|
|
1019
|
+
/** Select one schema `contentRoots` slot. Optional for single-slot elements. */
|
|
1020
|
+
slot?: string;
|
|
1021
|
+
};
|
|
1022
|
+
/** Resolved child root and chrome controller for nested editable content. */
|
|
1023
|
+
type ContentRootController = {
|
|
1024
|
+
chrome: RootChromeController;
|
|
1025
|
+
root: NamedRootKey;
|
|
1026
|
+
};
|
|
1027
|
+
/**
|
|
1028
|
+
* Resolve a schema-owned child content root and its root chrome controller.
|
|
1029
|
+
*/
|
|
1030
|
+
declare function useContentRoot(element?: Element$1 | null, options?: UseContentRootOptions): ContentRootController;
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region src/react/hooks/use-editor.d.ts
|
|
1033
|
+
/** Options used to create a component-owned React editor. */
|
|
1034
|
+
type UseEditorOptions<V extends Value = Value, TPlugins extends readonly unknown[] = readonly []> = CreateEditorOptions<V, TPlugins>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Creates one React editor instance for the component lifetime.
|
|
1037
|
+
*
|
|
1038
|
+
* Use this inside a component or custom hook that owns the editor lifetime.
|
|
1039
|
+
* `initialValue` seeds the editor once; replace document content later through
|
|
1040
|
+
* editor commands instead of changing props. Plugins take resources outside
|
|
1041
|
+
* the editor, such as a Yjs document, when React commits the component, and
|
|
1042
|
+
* give them back when it unmounts or `deps` change. Use `createEditor` when an
|
|
1043
|
+
* editor must be created outside React ownership.
|
|
1044
|
+
*/
|
|
1045
|
+
declare function useEditor<const TOptions extends UseEditorOptions<any, readonly unknown[]> & {
|
|
1046
|
+
plugins: readonly unknown[];
|
|
1047
|
+
}>(options: CheckedEditorOptions<TOptions, UseEditorOptions>, deps?: DependencyList): Editor<EditorValueFromOptions<TOptions>, PluginsFromOptions<TOptions>>;
|
|
1048
|
+
declare function useEditor<V extends Value = Value, const TPlugins extends readonly unknown[] = readonly []>(options?: UseEditorOptions<V, TPlugins>, deps?: DependencyList): Editor<V, TPlugins>;
|
|
1049
|
+
//#endregion
|
|
1050
|
+
//#region src/react/hooks/use-drop-indicator.d.ts
|
|
1051
|
+
/**
|
|
1052
|
+
* This view's block drop indicator while a block drag hovers an admitted
|
|
1053
|
+
* edge: the target key, edge, axis and the viewport line to paint.
|
|
1054
|
+
*/
|
|
1055
|
+
declare const useDropIndicator: () => DropIndicator | null;
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/react/hooks/use-editable-clip.d.ts
|
|
1058
|
+
/** Identifies the exact mounted Editable whose visible part cuts the boxes. */
|
|
1059
|
+
type UseEditableClipOptions = Readonly<{
|
|
1060
|
+
editableRef: RefObject<HTMLElement | null>;
|
|
1061
|
+
}>;
|
|
1062
|
+
type EditableClip = (rects: Iterable<DOMRectReadOnly>) => readonly ViewportRect[];
|
|
1063
|
+
/**
|
|
1064
|
+
* Cuts viewport boxes to `RangeGeometry.clipRect` of one Editable, with the
|
|
1065
|
+
* edge rule of `RangeGeometry.visible`. Returns [] when no part shows or no
|
|
1066
|
+
* Editable is mounted. It reads layout, so call it where you measure. The
|
|
1067
|
+
* returned function is stable.
|
|
1068
|
+
*/
|
|
1069
|
+
declare function useEditableClip({ editableRef }: UseEditableClipOptions): EditableClip;
|
|
1070
|
+
//#endregion
|
|
1071
|
+
//#region src/react/hooks/use-claim-editable-dom-commit.d.ts
|
|
1072
|
+
/**
|
|
1073
|
+
* Claim DOM mutations produced by a nested React commit.
|
|
1074
|
+
*
|
|
1075
|
+
* Plate render boundaries use this when an external store can update
|
|
1076
|
+
* a descendant without publishing an editor commit.
|
|
1077
|
+
*
|
|
1078
|
+
*/
|
|
1079
|
+
declare const useClaimEditableDOMCommit: () => void;
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region src/react/editable/history-keyboard.d.ts
|
|
1082
|
+
type HistoryDirection = 'redo' | 'undo';
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/react/hooks/use-plite-history.d.ts
|
|
1085
|
+
/** Focus behavior after mounted undo or redo applies a history batch. */
|
|
1086
|
+
type EditorHistoryFocusPolicy = EditorHistoryFocusPolicy$1;
|
|
1087
|
+
/** Options for history commands and shortcut handling. */
|
|
1088
|
+
type UseEditorHistoryOptions<TRoot extends RootKey = RootKey> = {
|
|
1089
|
+
focusPolicy?: EditorHistoryFocusPolicy;
|
|
1090
|
+
} & ({
|
|
1091
|
+
/** Bind commands and focus to this existing view, including outside an editor root. */
|
|
1092
|
+
editor: Editor<any, any>;
|
|
1093
|
+
root?: never;
|
|
1094
|
+
} | {
|
|
1095
|
+
editor?: undefined;
|
|
1096
|
+
root?: NamedRootKey<TRoot>;
|
|
1097
|
+
});
|
|
1098
|
+
/** Undo/redo availability and command handlers for the document's history. */
|
|
1099
|
+
type EditorHistoryController = {
|
|
1100
|
+
canRedo: boolean;
|
|
1101
|
+
canUndo: boolean;
|
|
1102
|
+
onKeyDown: (event: KeyboardEvent$1) => void;
|
|
1103
|
+
pending: HistoryDirection | null;
|
|
1104
|
+
redo: () => void;
|
|
1105
|
+
undo: () => void;
|
|
1106
|
+
};
|
|
1107
|
+
/**
|
|
1108
|
+
* Create undo/redo commands and keyboard handling.
|
|
1109
|
+
*
|
|
1110
|
+
* Without `editor` or `root`, they run through the shown writable view used
|
|
1111
|
+
* last, and are on only while a shown writable `Editable` reaches every root
|
|
1112
|
+
* the next undo or redo changes. With `editor` or `root`, they replay the next
|
|
1113
|
+
* batch whatever roots it changes. With `root`, they are off while no view of
|
|
1114
|
+
* it is shown. With `editor`, they can stay on while no `Editable` runs that
|
|
1115
|
+
* editor, and a click then does nothing. They are off while their view is
|
|
1116
|
+
* read-only or composes text.
|
|
1117
|
+
*/
|
|
1118
|
+
declare function useEditorHistory<const TRoot extends RootKey = RootKey>({ editor: providedEditor, focusPolicy, root: fixedRoot }?: UseEditorHistoryOptions<TRoot>): EditorHistoryController;
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/react/hooks/use-plite-runtime.d.ts
|
|
1121
|
+
/** Selector options for `useRuntimeState` and `useRootState`. */
|
|
1122
|
+
type RuntimeStateSelectorOptions<T> = {
|
|
1123
|
+
deferred?: boolean;
|
|
1124
|
+
equalityFn?: (a: T, b: T) => boolean;
|
|
1125
|
+
shouldUpdate?: (change?: EditorCommit) => boolean;
|
|
1126
|
+
};
|
|
1127
|
+
type ReactEditorState = EditorStateView<ValueOf<Editor>, PluginsOf<Editor>>;
|
|
1128
|
+
/**
|
|
1129
|
+
* Subscribe to a selected value from the root runtime editor state.
|
|
1130
|
+
*
|
|
1131
|
+
* Use this for toolbar, sidebar, and shell UI that reads the whole editor
|
|
1132
|
+
* runtime. Use `useRootState` for root-scoped UI in multi-root editors.
|
|
1133
|
+
* Inline selectors observe current render values. Use `shouldUpdate` when a
|
|
1134
|
+
* commit can be skipped before the selector runs. The selector state holds the
|
|
1135
|
+
* core editor groups; read a plugin's state through `editor.plugin(Plugin)`.
|
|
1136
|
+
*/
|
|
1137
|
+
declare function useRuntimeState<T>(selector: (state: ReactEditorState) => T, { deferred, equalityFn, shouldUpdate }?: RuntimeStateSelectorOptions<T>): T;
|
|
1138
|
+
/**
|
|
1139
|
+
* Subscribe to a selected value from one root.
|
|
1140
|
+
*
|
|
1141
|
+
* Root-scoped selectors skip commits that cannot affect the requested root.
|
|
1142
|
+
* Use this for chrome tied to a known root, such as headers, sidebars, and
|
|
1143
|
+
* nested content roots. Use `useRuntimeState` only when the selected value
|
|
1144
|
+
* genuinely spans roots. The selector state holds the core editor groups; read
|
|
1145
|
+
* a plugin's state through `editor.plugin(Plugin)`.
|
|
1146
|
+
*/
|
|
1147
|
+
declare function useRootState<T, const TRoot extends RootKey = RootKey>(root: NamedRootKey<TRoot> | undefined, selector: (state: ReactEditorState) => T, { deferred, equalityFn, shouldUpdate }?: RuntimeStateSelectorOptions<T>): T;
|
|
1148
|
+
/** Options for creating a root-specific command editor. */
|
|
1149
|
+
type UseRootEditorOptions = {
|
|
1150
|
+
readOnly?: boolean;
|
|
1151
|
+
};
|
|
1152
|
+
/**
|
|
1153
|
+
* Create a command-capable editor for one root.
|
|
1154
|
+
*
|
|
1155
|
+
* The returned object is stable for the requested root and read-only option.
|
|
1156
|
+
* A renderer inside an `Editable` gets another object than UI outside it, so
|
|
1157
|
+
* a lock set through one does not reach the other.
|
|
1158
|
+
* It obeys the read-only state and the authored view of the mounted view that
|
|
1159
|
+
* shows its root, and of the view around the hook while none shows it. Inside
|
|
1160
|
+
* a view, that mounted view is the one this view mounts for the root, such as
|
|
1161
|
+
* its own board when two editing areas show the same board. While its
|
|
1162
|
+
* `EditorRoot` is writable, shows no editing area and the caret is in its
|
|
1163
|
+
* root, it follows the editing area that holds the caret, for that area's DOM
|
|
1164
|
+
* and the read-only state of that area's `EditorRoot`. It keeps its own
|
|
1165
|
+
* `EditorRoot`'s authored view there, and a write that places the caret, even
|
|
1166
|
+
* where the caret already is, moves the caret into its own `EditorRoot`, which
|
|
1167
|
+
* ends the follow. Use it for root-specific toolbar/sidebar commands. Pass
|
|
1168
|
+
* `readOnly: true` when UI only needs read APIs. Exact plugin capability comes
|
|
1169
|
+
* from `editor.plugin(Plugin)`.
|
|
1170
|
+
*/
|
|
1171
|
+
declare function useRootEditor<const TRoot extends RootKey = RootKey>(root?: NamedRootKey<TRoot>, options?: UseRootEditorOptions): Editor;
|
|
1172
|
+
/**
|
|
1173
|
+
* Return a command-capable editor for the root that holds the caret, such as
|
|
1174
|
+
* a board note, or for the primary root while nothing is selected.
|
|
1175
|
+
*
|
|
1176
|
+
* Use it for UI outside every `Editable`, such as a toolbar, that acts where
|
|
1177
|
+
* the caret is. The editor works as the one `useRootEditor` returns for that
|
|
1178
|
+
* root, and the hook renders again only when the caret moves to another root.
|
|
1179
|
+
*/
|
|
1180
|
+
declare function useCaretEditor(): Editor;
|
|
1181
|
+
/** Focus behavior before or after root command callbacks. */
|
|
1182
|
+
type CommandFocusPolicy = 'none' | 'preserve' | 'restore-root';
|
|
1183
|
+
/** Options for `useCommand`. */
|
|
1184
|
+
type UseCommandOptions<TRoot extends RootKey = RootKey> = {
|
|
1185
|
+
focus?: CommandFocusPolicy;
|
|
1186
|
+
root?: NamedRootKey<TRoot>;
|
|
1187
|
+
};
|
|
1188
|
+
type CommandArgs<TCommand extends EditorCommandDescriptor> = [EditorCommandInput<TCommand>] extends [void] ? [] | [input: EditorCommandInput<TCommand>] : [input: EditorCommandInput<TCommand>];
|
|
1189
|
+
/** Typed dispatcher returned for one semantic command descriptor. */
|
|
1190
|
+
type CommandDispatcher<TCommand extends EditorCommandDescriptor> = (...input: CommandArgs<TCommand>) => boolean | undefined;
|
|
1191
|
+
/**
|
|
1192
|
+
* Bind one semantic command to the mounted editor for a root.
|
|
1193
|
+
*
|
|
1194
|
+
* Command input belongs to the returned dispatcher, so event-time data never
|
|
1195
|
+
* becomes hook configuration. Pass `root` for a known root and use
|
|
1196
|
+
* `focus: 'restore-root'` when the command should first restore editor focus.
|
|
1197
|
+
* Without `root`, the command runs in the root of the `Editable` around the
|
|
1198
|
+
* hook, or else in the caret's root when the dispatcher runs.
|
|
1199
|
+
* The command runs on the mounted view that shows the root, and on the editor
|
|
1200
|
+
* `useRootEditor` gives for the root while none shows it, so a lock on either
|
|
1201
|
+
* refuses its writes. The dispatcher throws inside `editor.read` and
|
|
1202
|
+
* `editor.update`, before it moves focus. Inside an update, run the command
|
|
1203
|
+
* with `tx.command` in an update of the root's `useRootEditor` editor, so it
|
|
1204
|
+
* keeps that view's suggesting mode.
|
|
1205
|
+
*/
|
|
1206
|
+
declare function useCommand<TCommand extends EditorCommandDescriptor, const TRoot extends RootKey = RootKey>(command: TCommand & CompatibleEditorCommand<Editor, TCommand>, options?: UseCommandOptions<TRoot>): CommandDispatcher<TCommand>;
|
|
1207
|
+
//#endregion
|
|
1208
|
+
//#region src/react/hooks/use-selection-geometry.d.ts
|
|
1209
|
+
/** Identifies the exact mounted Editable used to resolve selection geometry. */
|
|
1210
|
+
type UseSelectionGeometryOptions = Readonly<{
|
|
1211
|
+
editableRef: RefObject<HTMLElement | null>;
|
|
1212
|
+
}>;
|
|
1213
|
+
/** Read geometry for the current selection in one exact Editable. */
|
|
1214
|
+
declare function useSelectionGeometry({ editableRef }: UseSelectionGeometryOptions): RangeGeometry | null;
|
|
1215
|
+
//#endregion
|
|
1216
|
+
//#region src/react/hooks/use-state-field.d.ts
|
|
1217
|
+
/** Selector options for subscribing to one editor state field. */
|
|
1218
|
+
type UseStateFieldValueOptions<TValue> = Pick<EditorStateSelectorOptions<TValue>, 'deferred' | 'equalityFn'>;
|
|
1219
|
+
/** Setter returned by `useSetStateField` for one editor state field. */
|
|
1220
|
+
type StateFieldSetter<TValue> = (value: StateFieldValueInput<TValue>, policy?: EditorUpdatePolicy) => void;
|
|
1221
|
+
/**
|
|
1222
|
+
* Subscribe to one `defineStateField` value.
|
|
1223
|
+
*
|
|
1224
|
+
* The hook only re-renders when the field key appears in the committed dirty
|
|
1225
|
+
* state keys. Use it for document meta controls such as title, page settings,
|
|
1226
|
+
* or feature state that should not subscribe to every editor change.
|
|
1227
|
+
*/
|
|
1228
|
+
declare function useStateFieldValue<TValue>(field: EditorStateField<TValue>, options?: UseStateFieldValueOptions<TValue>): TValue;
|
|
1229
|
+
/**
|
|
1230
|
+
* Create a setter for one `defineStateField` value.
|
|
1231
|
+
*
|
|
1232
|
+
* The setter writes through `editor.update` and preserves DOM selection by
|
|
1233
|
+
* default so external controls can update state without stealing focus. Pass
|
|
1234
|
+
* an update policy when history or tags need additional control.
|
|
1235
|
+
*/
|
|
1236
|
+
declare function useSetStateField<TValue>(field: EditorStateField<TValue>): StateFieldSetter<TValue>;
|
|
1237
|
+
//#endregion
|
|
1238
|
+
//#region src/react/update-policy.d.ts
|
|
1239
|
+
/** Selection-effect policies owned by the editor React runtime. */
|
|
1240
|
+
declare const ReactUpdatePolicy: Readonly<{
|
|
1241
|
+
preserveSelection: Readonly<{
|
|
1242
|
+
tags: readonly ["skip-dom-selection", "skip-selection-focus", "skip-scroll-into-view"];
|
|
1243
|
+
}>;
|
|
1244
|
+
}>;
|
|
1245
|
+
//#endregion
|
|
1246
|
+
export { EditorStateSelectorOptions as $, EditablePasteResult as $t, useContentRoot as A, EditableElementSlots as At, EditorRuntimeSelectorOptions as B, DOMTextSyncRendererCapabilityContext as Bt, UseEditableClipOptions as C, SelectionChangeContext as Ct, useEditor as D, EditableDOMCoverageBoundaryPlaceholderContext as Dt, UseEditorOptions as E, EditableDOMCoverageBoundaryMaterializePayload as Et, useAnnotation as F, RenderPlaceholderProps as Ft, UseElementSelectedOptions as G, EditableDOMBeforeInputHandler as Gt, useNodeSelector as H, setRetainedTextFlowRendererCapability as Ht, useAnnotations as I, RenderTextHostProps as It, useElement as J, EditableInputEventContext as Jt, useElementSelected as K, EditableHandlerContext as Kt, UseAnnotationStoreOptions as L, RenderTextPieceProps as Lt, UseRootChromeOptions as M, RenderElementProps as Mt, useRootChrome as N, RenderVoidProps as Nt, ContentRootController as O, EditableDOMCoverageBoundaryProps as Ot, useChildRoot as P, RenderLeafProps as Pt, EditorSelectorOptions as Q, EditableHistoryReplayResult as Qt, useAnnotationStore as R, RenderTextProps as Rt, useClaimEditableDOMCommit as S, EditorRootProps as St, useDropIndicator as T, Editable as Tt, useTextSelector as U, installBrowserHandle as Ut, EditorTextSelectorContext as V, setDOMTextSyncRendererCapability as Vt, UseElementSelectedMode as W, EditableDOMBeforeInputContext as Wt, EditorViewStateSelectorOptions as X, EditableDropResult as Xt, useOptionalElement as Y, EditableKeyDownHandler as Yt, useEditorViewState as Z, EditableHistoryReplayEvent as Zt, useRuntimeState as _, react as _n, EditorText as _t, useStateFieldValue as a, ExternalTextDispatchResult as an, EditorReadOnlyProvider as at, UseEditorHistoryOptions as b, CommitContext as bt, CommandDispatcher as c, ExternalTextSelectionState as cn, useOptionalEditorReadOnly as ct, UseCommandOptions as d, CreateEditorOptions as dn, useEditorRootElement as dt, EditablePointerSelectionEndHandler as en, useEditorSelector as et, UseRootEditorOptions as f, Editor as fn, useEditorScrollElement as ft, useRootState as g, createEditor as gn, useOptionalEditorContext as gt, useRootEditor as h, ReactPluginOptions as hn, useEditorContext as ht, useSetStateField as i, ExternalTextDecoration as in, useEditorRuntimeState as it, RootChromeController as j, EditableProps as jt, UseContentRootOptions as k, EditableDOMCoverageBoundaryScope as kt, CommandFocusPolicy as l, ExternalTextState as ln, useEditorFocused as lt, useCommand as m, ReactPlugin as mn, useEditorComposing as mt, StateFieldSetter as n, ExternalTextAdapter as nn, useEditorSelection as nt, UseSelectionGeometryOptions as o, ExternalTextOptions as on, EditorReadOnlyProviderProps as ot, useCaretEditor as p, ReactApi as pn, useEditorScrollElementRef as pt, useElementPath as q, EditableHandlerResult as qt, UseStateFieldValueOptions as r, ExternalTextChange as rn, EditorRuntimeStateSelectorOptions as rt, useSelectionGeometry as s, ExternalTextSelection as sn, useEditorReadOnly as st, ReactUpdatePolicy as t, ExternalTextActions as tn, useEditorState as tt, RuntimeStateSelectorOptions as u, ExternalTextView as un, useEditorEditableElement as ut, EditorHistoryController as v, TypedText as vn, EditorLeaf as vt, useEditableClip as w, ValueChangeContext as wt, useEditorHistory as x, EditorRoot as xt, EditorHistoryFocusPolicy as y, TypedTextListener as yn, EditorElement as yt, EditorNodeSelectorContext as z, EditorPlaceholder as zt };
|