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,1093 @@
|
|
|
1
|
+
import { Dc as Editor, Mg as Path, Nc as EditorCommand, Og as Point, Qs as Element$1, Th as Node$1, Xc as EditorCoreStateView, _g as Range$1, bc as AnyEditor, bf as Value, cn as ContentSlice, eh as NodeSelection, ih as SelectionAssociation, mc as Text$1, of as RootKey, vd as NodeKey, vh as Descendant, vs as SchemaProperty, xd as Plugin } from "./index-DpltOCot.js";
|
|
2
|
+
import { StandardBehaviorOptions } from "scroll-into-view-if-needed";
|
|
3
|
+
//#region src/dom/utils/dom.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Types.
|
|
6
|
+
*/
|
|
7
|
+
type DOMNode = globalThis.Node;
|
|
8
|
+
type DOMElement = globalThis.Element;
|
|
9
|
+
type DOMText = globalThis.Text;
|
|
10
|
+
type DOMRange = globalThis.Range;
|
|
11
|
+
type DOMSelection = globalThis.Selection;
|
|
12
|
+
type DOMStaticRange = globalThis.StaticRange;
|
|
13
|
+
declare const DOMNode: {
|
|
14
|
+
new (): Node;
|
|
15
|
+
prototype: Node;
|
|
16
|
+
readonly ELEMENT_NODE: 1;
|
|
17
|
+
readonly ATTRIBUTE_NODE: 2;
|
|
18
|
+
readonly TEXT_NODE: 3;
|
|
19
|
+
readonly CDATA_SECTION_NODE: 4;
|
|
20
|
+
readonly ENTITY_REFERENCE_NODE: 5;
|
|
21
|
+
readonly ENTITY_NODE: 6;
|
|
22
|
+
readonly PROCESSING_INSTRUCTION_NODE: 7;
|
|
23
|
+
readonly COMMENT_NODE: 8;
|
|
24
|
+
readonly DOCUMENT_NODE: 9;
|
|
25
|
+
readonly DOCUMENT_TYPE_NODE: 10;
|
|
26
|
+
readonly DOCUMENT_FRAGMENT_NODE: 11;
|
|
27
|
+
readonly NOTATION_NODE: 12;
|
|
28
|
+
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
|
|
29
|
+
readonly DOCUMENT_POSITION_PRECEDING: 2;
|
|
30
|
+
readonly DOCUMENT_POSITION_FOLLOWING: 4;
|
|
31
|
+
readonly DOCUMENT_POSITION_CONTAINS: 8;
|
|
32
|
+
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
33
|
+
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
34
|
+
};
|
|
35
|
+
declare const DOMText: {
|
|
36
|
+
new (data?: string): Text;
|
|
37
|
+
prototype: Text;
|
|
38
|
+
};
|
|
39
|
+
declare global {
|
|
40
|
+
interface Window {
|
|
41
|
+
Selection: (typeof Selection)['constructor'];
|
|
42
|
+
DataTransfer: (typeof DataTransfer)['constructor'];
|
|
43
|
+
Node: (typeof Node)['constructor'];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
type DOMPoint = [Node, number];
|
|
47
|
+
/**
|
|
48
|
+
* Returns the host window of a DOM node
|
|
49
|
+
*/
|
|
50
|
+
declare const getDefaultView: (value: unknown) => Window | null;
|
|
51
|
+
/**
|
|
52
|
+
* Check if a DOM node is an element node.
|
|
53
|
+
*/
|
|
54
|
+
declare const isDOMElement: (value: unknown) => value is DOMElement;
|
|
55
|
+
/**
|
|
56
|
+
* Check if a value is a DOM node.
|
|
57
|
+
*/
|
|
58
|
+
declare const isDOMNode: (value: unknown) => value is DOMNode;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a value is a DOM selection.
|
|
61
|
+
*/
|
|
62
|
+
declare const isDOMSelection: (value: unknown) => value is DOMSelection;
|
|
63
|
+
/**
|
|
64
|
+
* Check if a DOM node is an element node.
|
|
65
|
+
*/
|
|
66
|
+
declare const isDOMText: (value: unknown) => value is DOMText;
|
|
67
|
+
/**
|
|
68
|
+
* Checks whether a paste event is a plaintext-only event.
|
|
69
|
+
*/
|
|
70
|
+
declare const isPlainTextOnlyPaste: (event: ClipboardEvent) => boolean | null;
|
|
71
|
+
/**
|
|
72
|
+
* Normalize a DOM point so that it always refers to a text node.
|
|
73
|
+
*/
|
|
74
|
+
declare const normalizeDOMPoint: (domPoint: DOMPoint) => DOMPoint;
|
|
75
|
+
/**
|
|
76
|
+
* Determines whether the active element is nested within a shadowRoot
|
|
77
|
+
*/
|
|
78
|
+
declare const hasShadowRoot: (node: Node | null) => boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Get the dom selection from Shadow Root if possible, otherwise from the document
|
|
81
|
+
*/
|
|
82
|
+
declare const getSelection: (root: Document | ShadowRoot) => Selection | null;
|
|
83
|
+
/**
|
|
84
|
+
* Retrieves the deepest active element in the DOM, considering nested shadow DOMs.
|
|
85
|
+
*/
|
|
86
|
+
declare const getActiveElement: () => Element | null;
|
|
87
|
+
/**
|
|
88
|
+
* @returns `true` if `otherNode` is before `node` in the document; otherwise, `false`.
|
|
89
|
+
*/
|
|
90
|
+
declare const isBefore: (node: DOMNode, otherNode: DOMNode) => boolean;
|
|
91
|
+
/**
|
|
92
|
+
* @returns `true` if `otherNode` is after `node` in the document; otherwise, `false`.
|
|
93
|
+
*/
|
|
94
|
+
declare const isAfter: (node: DOMNode, otherNode: DOMNode) => boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Shadow DOM-aware version of Element.closest()
|
|
97
|
+
* Traverses up the DOM tree, crossing shadow DOM boundaries
|
|
98
|
+
*/
|
|
99
|
+
declare const closestShadowAware: (element: DOMElement | null | undefined, selector: string) => DOMElement | null;
|
|
100
|
+
/**
|
|
101
|
+
* Shadow DOM-aware version of Node.contains()
|
|
102
|
+
* Checks if a node contains another node, crossing shadow DOM boundaries
|
|
103
|
+
*/
|
|
104
|
+
declare const containsShadowAware: (parent: DOMNode | null | undefined, child: DOMNode | null | undefined) => boolean;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/dom/plugin/dom-coverage.d.ts
|
|
107
|
+
/** Mounted state for a model range represented by a DOM coverage boundary. */
|
|
108
|
+
type DOMCoverageBoundaryState = 'mounted' | 'intentionally-hidden' | 'pending-mount' | 'virtualized' | 'atom-boundary';
|
|
109
|
+
/** Why a model range is missing from, summarized in, or detached from the DOM. */
|
|
110
|
+
type DOMCoverageReason = 'external-text' | 'app-collapse' | 'app-hidden' | 'viewport-virtualization' | 'runtime-atom';
|
|
111
|
+
/** Selection behavior when navigation reaches covered content. */
|
|
112
|
+
type DOMCoverageSelectionPolicy = 'materialize' | 'skip' | 'model';
|
|
113
|
+
/** Clipboard behavior when a copied range crosses covered content. */
|
|
114
|
+
type DOMCoverageCopyPolicy = 'model' | 'exclude';
|
|
115
|
+
/** Inclusive path range covered by a boundary. */
|
|
116
|
+
interface DOMCoveragePathRange {
|
|
117
|
+
anchor: Path;
|
|
118
|
+
focus: Path;
|
|
119
|
+
}
|
|
120
|
+
/** Runtime-id range that can be rebased into current paths. */
|
|
121
|
+
interface DOMCoverageRuntimeRange {
|
|
122
|
+
anchor: NodeKey;
|
|
123
|
+
focus: NodeKey;
|
|
124
|
+
}
|
|
125
|
+
/** DOM anchor used for native point/range conversion at a boundary edge. */
|
|
126
|
+
type DOMCoverageBoundaryAnchor = {
|
|
127
|
+
type: 'owner';
|
|
128
|
+
} | {
|
|
129
|
+
nodeKey: NodeKey;
|
|
130
|
+
type: 'summary-slot';
|
|
131
|
+
} | {
|
|
132
|
+
nodeKey?: NodeKey;
|
|
133
|
+
type: 'placeholder';
|
|
134
|
+
};
|
|
135
|
+
/** Registered coverage boundary for one owner element and its hidden ranges. */
|
|
136
|
+
interface DOMCoverageBoundary {
|
|
137
|
+
boundaryId: string;
|
|
138
|
+
ownerNodeKey: NodeKey | null;
|
|
139
|
+
ownerPath: Path;
|
|
140
|
+
coveredPathRanges: readonly DOMCoveragePathRange[];
|
|
141
|
+
coveredRuntimeRanges: readonly DOMCoverageRuntimeRange[];
|
|
142
|
+
state: DOMCoverageBoundaryState;
|
|
143
|
+
reason: DOMCoverageReason;
|
|
144
|
+
anchor: DOMCoverageBoundaryAnchor;
|
|
145
|
+
selectionPolicy: DOMCoverageSelectionPolicy;
|
|
146
|
+
copyPolicy: DOMCoverageCopyPolicy;
|
|
147
|
+
version: number;
|
|
148
|
+
}
|
|
149
|
+
/** Boundary edge used when a DOM point maps back to Plite. */
|
|
150
|
+
type DOMCoverageBoundaryEdge = 'anchor' | 'focus' | 'owner';
|
|
151
|
+
/** DOM-to-Plite point conversion result for native boundary DOM. */
|
|
152
|
+
type DOMCoveragePointResult = {
|
|
153
|
+
point: Point;
|
|
154
|
+
type: 'point';
|
|
155
|
+
} | {
|
|
156
|
+
boundary: DOMCoverageBoundary;
|
|
157
|
+
domPoint: DOMPoint;
|
|
158
|
+
edge: DOMCoverageBoundaryEdge;
|
|
159
|
+
type: 'boundary-point';
|
|
160
|
+
};
|
|
161
|
+
/** Why covered content should be mounted or revealed. */
|
|
162
|
+
type DOMCoverageMaterializeReason = 'selection' | 'copy' | 'paste' | 'focus' | 'programmatic' | 'background' | 'drag';
|
|
163
|
+
/** Which part of a covered range triggered materialization. */
|
|
164
|
+
type DOMCoverageMaterializeRangeRole = 'anchor' | 'focus' | 'interior';
|
|
165
|
+
/** Result from asking the app to materialize a boundary. */
|
|
166
|
+
type DOMCoverageMaterializeResult = {
|
|
167
|
+
boundaryId: string;
|
|
168
|
+
reason: DOMCoverageMaterializeReason;
|
|
169
|
+
status: 'handled';
|
|
170
|
+
} | {
|
|
171
|
+
boundaryId: string;
|
|
172
|
+
reason: DOMCoverageMaterializeReason;
|
|
173
|
+
status: 'missing-boundary';
|
|
174
|
+
} | {
|
|
175
|
+
boundaryId: string;
|
|
176
|
+
reason: DOMCoverageMaterializeReason;
|
|
177
|
+
status: 'unhandled';
|
|
178
|
+
};
|
|
179
|
+
/** Context passed to a materialization handler. */
|
|
180
|
+
type DOMCoverageMaterializeOptions = {
|
|
181
|
+
range?: Range$1;
|
|
182
|
+
rangeRole?: DOMCoverageMaterializeRangeRole;
|
|
183
|
+
};
|
|
184
|
+
/** App hook that can reveal or mount covered content on demand. */
|
|
185
|
+
type DOMCoverageMaterializeHandler = (boundary: DOMCoverageBoundary, reason: DOMCoverageMaterializeReason, options: DOMCoverageMaterializeOptions) => boolean | void;
|
|
186
|
+
/**
|
|
187
|
+
* Tracks model ranges that are intentionally missing or summarized in the DOM.
|
|
188
|
+
*
|
|
189
|
+
* Staged, virtualized, app-hidden, and atom-like content register boundaries so
|
|
190
|
+
* selection, copy, find, and Plite-to-DOM conversion can follow explicit
|
|
191
|
+
* policies instead of assuming every node is mounted.
|
|
192
|
+
*/
|
|
193
|
+
declare const DOMCoverage: {
|
|
194
|
+
boundaryEdgeAttribute: string;
|
|
195
|
+
boundaryElementAttribute: string;
|
|
196
|
+
/** Create independent coverage for one mounted view of an editor. */
|
|
197
|
+
create(editor: AnyEditor): {
|
|
198
|
+
/** Release this view's boundary registrations and materialization handlers. */
|
|
199
|
+
destroy(): void;
|
|
200
|
+
/** Remove all materialization handlers for this view. */
|
|
201
|
+
clearMaterializeHandler(): void;
|
|
202
|
+
hasCollapsedBoundaries(): boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Whether a collapsed boundary covers `point`. It leaves the registry as it
|
|
205
|
+
* is.
|
|
206
|
+
*/
|
|
207
|
+
hidesPoint(point: Point): boolean;
|
|
208
|
+
/** Return all currently valid boundaries after rebasing them to the editor. */
|
|
209
|
+
getBoundaries(): readonly DOMCoverageBoundary[];
|
|
210
|
+
/** Whether a `model` boundary is registered, without a coverage query. */
|
|
211
|
+
hasModelBoundaries(): boolean;
|
|
212
|
+
/** Return boundaries whose covered ranges intersect a Plite range. */
|
|
213
|
+
getBoundariesForRange(range: Range$1): readonly DOMCoverageBoundary[];
|
|
214
|
+
/** Resolve a boundary by id, rebasing or removing it if the owner moved. */
|
|
215
|
+
getBoundary(boundaryId: string): DOMCoverageBoundary | null;
|
|
216
|
+
/** Return the nearest boundary that owns a Plite point. */
|
|
217
|
+
getBoundaryForPoint(point: Point): DOMCoverageBoundary | null;
|
|
218
|
+
/** Find the next selectable point outside a boundary with the same policy. */
|
|
219
|
+
getPointOutsideBoundary(boundary: DOMCoverageBoundary, point: Point, options?: {
|
|
220
|
+
reverse?: boolean;
|
|
221
|
+
}): Point | null;
|
|
222
|
+
/** Ask app code to mount or reveal a boundary for selection, copy, focus or a resting drag. */
|
|
223
|
+
materializeBoundary(boundaryId: string, reason: DOMCoverageMaterializeReason, options?: DOMCoverageMaterializeOptions): DOMCoverageMaterializeResult;
|
|
224
|
+
/** Register or replace one boundary and return an unregister function. */
|
|
225
|
+
registerBoundary(boundary: DOMCoverageBoundary): () => void;
|
|
226
|
+
/** Replace all materialization handlers with one handler. */
|
|
227
|
+
setMaterializeHandler(handler: DOMCoverageMaterializeHandler): void;
|
|
228
|
+
/** Register one materialization handler and return an unregister function. */
|
|
229
|
+
registerMaterializeHandler(handler: DOMCoverageMaterializeHandler): () => void;
|
|
230
|
+
/** Resolve native boundary DOM back to the Plite point it represents. */
|
|
231
|
+
resolvePointFromBoundary(domPoint: DOMPoint): DOMCoveragePointResult | null;
|
|
232
|
+
/** Remove one registered boundary and its lookup index entries. */
|
|
233
|
+
unregisterBoundary(boundaryId: string): void;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
/** Boundary and materialization state owned by one mounted editor view. */
|
|
237
|
+
type DOMCoverageSession = ReturnType<typeof DOMCoverage.create>;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/dom/plugin/dom-drag.d.ts
|
|
240
|
+
/** What `drag.start` hands the caller for its drag image. */
|
|
241
|
+
type DOMDragStart = Readonly<{
|
|
242
|
+
/** Pointer offset from the first preview's top-left corner. */
|
|
243
|
+
origin: Readonly<{
|
|
244
|
+
x: number;
|
|
245
|
+
y: number;
|
|
246
|
+
}>;
|
|
247
|
+
/** Inert clones of the dragged blocks, in document order. */
|
|
248
|
+
previews: readonly HTMLElement[];
|
|
249
|
+
}>;
|
|
250
|
+
/** A drop beside a block on an axis. */
|
|
251
|
+
type DOMDropEdge = Readonly<{
|
|
252
|
+
axis: 'x' | 'y';
|
|
253
|
+
edge: 'after' | 'before';
|
|
254
|
+
key: NodeKey;
|
|
255
|
+
}>;
|
|
256
|
+
/**
|
|
257
|
+
* Where a drop lands: beside a block on an axis, at a block's inline start or
|
|
258
|
+
* end side, or at a text point.
|
|
259
|
+
*/
|
|
260
|
+
type DOMDropTarget = DOMDropEdge | Readonly<{
|
|
261
|
+
key: NodeKey;
|
|
262
|
+
side: 'end' | 'start';
|
|
263
|
+
}> | Readonly<{
|
|
264
|
+
point: Point;
|
|
265
|
+
}>;
|
|
266
|
+
/** A pointer position, from a drag event or a custom driver. */
|
|
267
|
+
type DOMDropTargetInput = Readonly<{
|
|
268
|
+
altKey?: boolean;
|
|
269
|
+
clientX: number;
|
|
270
|
+
clientY: number;
|
|
271
|
+
ctrlKey?: boolean;
|
|
272
|
+
dataTransfer?: DataTransfer | null;
|
|
273
|
+
target?: EventTarget | null;
|
|
274
|
+
}>;
|
|
275
|
+
type DOMDropTargetOptions = Readonly<{
|
|
276
|
+
/** Copy instead of move; defaults to the input's modifier. */
|
|
277
|
+
copy?: boolean;
|
|
278
|
+
/** The block dropped files become; resolves a files drop. */
|
|
279
|
+
files?: Element$1;
|
|
280
|
+
/** Source view of `nodes` or `range`; defaults to the drag session's. */
|
|
281
|
+
from?: AnyEditor;
|
|
282
|
+
nodes?: readonly NodeKey[];
|
|
283
|
+
range?: Range$1;
|
|
284
|
+
}>;
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/dom/utils/drop-indicator.d.ts
|
|
287
|
+
/** Where a block drop would land in one view, with the line to paint. */
|
|
288
|
+
type DropIndicator = Readonly<{
|
|
289
|
+
axis: 'x' | 'y';
|
|
290
|
+
edge: 'after' | 'before';
|
|
291
|
+
key: NodeKey;
|
|
292
|
+
/** Viewport rectangle of the edge: zero height on `y`, zero width on `x`. */
|
|
293
|
+
line: Readonly<{
|
|
294
|
+
height: number;
|
|
295
|
+
width: number;
|
|
296
|
+
x: number;
|
|
297
|
+
y: number;
|
|
298
|
+
}>;
|
|
299
|
+
}>;
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/dom/plugin/dom-geometry.d.ts
|
|
302
|
+
type DOMGeometryRect = {
|
|
303
|
+
bottom: number;
|
|
304
|
+
height: number;
|
|
305
|
+
left: number;
|
|
306
|
+
right: number;
|
|
307
|
+
top: number;
|
|
308
|
+
width: number;
|
|
309
|
+
};
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/dom/utils/diff-text.d.ts
|
|
312
|
+
type StringDiff = {
|
|
313
|
+
start: number;
|
|
314
|
+
end: number;
|
|
315
|
+
text: string;
|
|
316
|
+
};
|
|
317
|
+
type TextDiff = {
|
|
318
|
+
id: number;
|
|
319
|
+
path: Path;
|
|
320
|
+
diff: StringDiff;
|
|
321
|
+
/** The input type the diff carries into the model; a merged diff takes the latest non-typing type that added text. */
|
|
322
|
+
inputType?: string;
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Check whether a text diff was applied in a way we can perform the pending action on /
|
|
326
|
+
* recover the pending selection.
|
|
327
|
+
*/
|
|
328
|
+
declare function verifyDiffState(editor: AnyEditor, textDiff: TextDiff): boolean;
|
|
329
|
+
/** Apply one or more string diffs to a text value in order. */
|
|
330
|
+
declare function applyStringDiff(text: string, ...diffs: StringDiff[]): string;
|
|
331
|
+
/**
|
|
332
|
+
* Remove redundant changes from the diff so that it spans the minimal possible range
|
|
333
|
+
*/
|
|
334
|
+
declare function normalizeStringDiff(targetText: string, diff: StringDiff): StringDiff | null;
|
|
335
|
+
/**
|
|
336
|
+
* Return a string diff that is equivalent to applying b after a spanning the range of
|
|
337
|
+
* both changes
|
|
338
|
+
*/
|
|
339
|
+
declare function mergeStringDiffs(targetText: string, a: StringDiff, b: StringDiff): StringDiff | null;
|
|
340
|
+
/**
|
|
341
|
+
* Get the Plite range the text diff spans.
|
|
342
|
+
*/
|
|
343
|
+
declare function targetRange(textDiff: TextDiff): Range$1;
|
|
344
|
+
/**
|
|
345
|
+
* Normalize a 'pending point' a.k.a a point based on the dom state before applying
|
|
346
|
+
* the pending diffs. Since the pending diffs might have been inserted with different
|
|
347
|
+
* marks we have to 'walk' the offset from the starting position to ensure we still
|
|
348
|
+
* have a valid point inside the document
|
|
349
|
+
*/
|
|
350
|
+
declare function normalizePoint(editor: AnyEditor, point: Point): Point | null;
|
|
351
|
+
/**
|
|
352
|
+
* Normalize a 'pending selection' to ensure it's valid in the current document model.
|
|
353
|
+
*/
|
|
354
|
+
declare function normalizeRange(editor: AnyEditor, range: Range$1): Range$1 | null;
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/dom/utils/key.d.ts
|
|
357
|
+
/**
|
|
358
|
+
* An auto-incrementing identifier for keys.
|
|
359
|
+
*/
|
|
360
|
+
/**
|
|
361
|
+
* A class that keeps track of a key string. We use a full class here because we
|
|
362
|
+
* want to be able to use them as keys in `WeakMap` objects.
|
|
363
|
+
*/
|
|
364
|
+
declare class Key {
|
|
365
|
+
id: string;
|
|
366
|
+
constructor();
|
|
367
|
+
}
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/dom/plugin/dom-clipboard-runtime.d.ts
|
|
370
|
+
/** Semantic commands that own DOM clipboard ingress. */
|
|
371
|
+
declare const domCommands: Readonly<{
|
|
372
|
+
insertData: EditorCommand<DataTransfer, Editor>;
|
|
373
|
+
}>;
|
|
374
|
+
type ClipboardSliceRead<V extends Value = Value> = Readonly<{
|
|
375
|
+
kind: 'absent';
|
|
376
|
+
}> | Readonly<{
|
|
377
|
+
kind: 'invalid';
|
|
378
|
+
source: 'html' | 'mime';
|
|
379
|
+
}> | Readonly<{
|
|
380
|
+
kind: 'slice';
|
|
381
|
+
slice: ContentSlice<V>;
|
|
382
|
+
}>;
|
|
383
|
+
type ClipboardSliceWrite<V extends Value = Value> = Readonly<{
|
|
384
|
+
formats?: Readonly<Record<string, string>>;
|
|
385
|
+
slice: ContentSlice<V>;
|
|
386
|
+
}>;
|
|
387
|
+
/** Read the configured MIME suffix used for exact Plite clipboard payloads. */
|
|
388
|
+
declare const getDOMClipboardFormatKey: (editor: Editor<any, any>) => string;
|
|
389
|
+
/** HTML payload for a serialized Plite fragment. */
|
|
390
|
+
type DOMFragmentDataHtml = ((context: {
|
|
391
|
+
clipboardFormatKey: string;
|
|
392
|
+
encoded: string;
|
|
393
|
+
text: string;
|
|
394
|
+
}) => string) | string;
|
|
395
|
+
/** Payload written to browser clipboard data for a Plite fragment. */
|
|
396
|
+
type DOMFragmentDataPayload<V extends Value = Value> = {
|
|
397
|
+
clipboardFormatKey?: string;
|
|
398
|
+
html: DOMFragmentDataHtml;
|
|
399
|
+
slice: ContentSlice<V>;
|
|
400
|
+
text?: string;
|
|
401
|
+
window?: Pick<Window, 'btoa'>;
|
|
402
|
+
};
|
|
403
|
+
/** Write Plite fragment MIME, HTML, and plain-text clipboard payloads. */
|
|
404
|
+
declare const writeDOMFragmentData: <V extends Value>(data: Pick<DataTransfer, 'setData'>, { clipboardFormatKey, html, slice, text, window }: DOMFragmentDataPayload<V>) => string;
|
|
405
|
+
/**
|
|
406
|
+
* Remove what the page paints for its view from a DOM copy of editor content
|
|
407
|
+
* before it becomes `text/html`: editor markers, decoration and app state
|
|
408
|
+
* attributes, classes, ids, form controls, `aria-hidden` elements such as icons
|
|
409
|
+
* and carets, and the style a decoration paints on the text. A button keeps
|
|
410
|
+
* its label, and links, images, table spans and other inline styles stay.
|
|
411
|
+
*/
|
|
412
|
+
declare const cleanDOMClipboardContents: (root: ParentNode) => void;
|
|
413
|
+
/** Write clipboard payloads for one model range without changing selection. */
|
|
414
|
+
declare const writeDOMRangeData: <V extends Value>(editor: DOMEditor<V>, data: Pick<DataTransfer, 'getData' | 'setData'>, range: NodeSelection | Range$1, options?: Readonly<{
|
|
415
|
+
coverage?: DOMCoverageSession;
|
|
416
|
+
slice?: ContentSlice<V>;
|
|
417
|
+
}>) => Pick<DataTransfer, "getData" | "setData"> | undefined;
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/dom/plugin/dom-editor.d.ts
|
|
420
|
+
/** Core editor accepted by the DOM bridge before its API is installed. */
|
|
421
|
+
type DOMEditor<V extends Value = Value, TPlugins extends readonly unknown[] = any> = AnyEditor<V, TPlugins>;
|
|
422
|
+
interface DOMApi {
|
|
423
|
+
/**
|
|
424
|
+
* Blur the editor, and take focus from the root's `nodeSelectionFocus`
|
|
425
|
+
* element while it holds it.
|
|
426
|
+
*/
|
|
427
|
+
blur: () => void;
|
|
428
|
+
drag: DOMDragApi;
|
|
429
|
+
/**
|
|
430
|
+
* Resolve where a drop under a pointer lands: the innermost block edge or
|
|
431
|
+
* side the transfer dry pass admits, or a text point for a text drag. A
|
|
432
|
+
* files drop resolves only to an edge. With no `target`, a text drag
|
|
433
|
+
* resolves nothing, and a block or files drop hit-tests the pointer, read as
|
|
434
|
+
* client coordinates of the window of the view this editor picks, where its
|
|
435
|
+
* last rendered Editable sits, and resolves in the editor's view found
|
|
436
|
+
* there, else in the picked view. The editor an Editable renders with always
|
|
437
|
+
* resolves in its own view. For a `useRootEditor` editor, the hit test finds
|
|
438
|
+
* only its `EditorRoot`'s views of its root. The hit test enters shadow
|
|
439
|
+
* roots but not iframes. A read-only editor resolves nothing unless an
|
|
440
|
+
* Editable renders with it.
|
|
441
|
+
*/
|
|
442
|
+
resolveDropTarget: (input: DOMDropTargetInput, options?: DOMDropTargetOptions) => DOMDropTarget | null;
|
|
443
|
+
deselect: () => void;
|
|
444
|
+
/**
|
|
445
|
+
* The Editable of the view this editor's calls run in, or of a view at
|
|
446
|
+
* `root` when given. Null when no view is picked, or when a view's own
|
|
447
|
+
* editor is given another root.
|
|
448
|
+
*/
|
|
449
|
+
editable: (root?: RootKey) => HTMLElement | null;
|
|
450
|
+
assertDocumentOrShadowRoot: () => Document | ShadowRoot;
|
|
451
|
+
/**
|
|
452
|
+
* The DOM document or shadow root holding the Editable of the view this
|
|
453
|
+
* editor's calls run in. A view's own editor runs in its own view. A
|
|
454
|
+
* `useRootEditor` editor runs in a view of its root from its `EditorRoot`.
|
|
455
|
+
* While that `EditorRoot` shows no editing area and the caret is in the
|
|
456
|
+
* editor's root, it runs in the view that holds the caret. The editor
|
|
457
|
+
* `createEditor` returns runs in a view of the selection's root,
|
|
458
|
+
* else of main. When the caret was placed in that root from an
|
|
459
|
+
* `EditorRoot`, only that `EditorRoot`'s views of the root count, even
|
|
460
|
+
* after this editor moves the caret within it. Of the views that count, it
|
|
461
|
+
* takes the only one, else the one that holds focus, through iframes and
|
|
462
|
+
* shadow roots. Null when no view is picked, or when that view has several
|
|
463
|
+
* Editables and none holds focus.
|
|
464
|
+
*/
|
|
465
|
+
resolveDocumentOrShadowRoot: () => Document | ShadowRoot | null;
|
|
466
|
+
assertEventRange: (event: any) => Range$1;
|
|
467
|
+
findKey: (node: Descendant) => Key;
|
|
468
|
+
assertPath: (node: Node$1) => Path;
|
|
469
|
+
/**
|
|
470
|
+
* Focus the editor's view. The root's `nodeSelectionFocus` element takes
|
|
471
|
+
* focus while there is no selection or a node selection holds only the
|
|
472
|
+
* root's top-level blocks, and a range shown across roots stays shown.
|
|
473
|
+
*/
|
|
474
|
+
focus: (options?: {
|
|
475
|
+
retries?: number;
|
|
476
|
+
}) => void;
|
|
477
|
+
getWindow: () => Window;
|
|
478
|
+
hasDOMNode: (target: DOMNode, options?: {
|
|
479
|
+
editable?: boolean;
|
|
480
|
+
}) => boolean;
|
|
481
|
+
hasEditableTarget: (target: EventTarget | null) => target is DOMNode;
|
|
482
|
+
hasRange: (range: Range$1) => boolean;
|
|
483
|
+
hasSelectableTarget: (target: EventTarget | null) => boolean;
|
|
484
|
+
hasTarget: (target: EventTarget | null) => target is DOMNode;
|
|
485
|
+
isComposing: () => boolean;
|
|
486
|
+
isFocused: () => boolean;
|
|
487
|
+
isReadOnly: () => boolean;
|
|
488
|
+
isTargetInsideNonReadonlyVoid: (target: EventTarget | null) => boolean;
|
|
489
|
+
resolveDOMNode: (nodeOrKey: Node$1 | NodeKey) => HTMLElement | null;
|
|
490
|
+
resolveDOMPoint: (point: Point) => DOMPoint | null;
|
|
491
|
+
resolveDOMRange: (range: Range$1) => DOMRange | null;
|
|
492
|
+
resolveEventRange: (event: any) => Range$1 | null;
|
|
493
|
+
resolvePath: (node: Node$1) => Path | null;
|
|
494
|
+
resolveRangeRect: (range: Range$1) => DOMRect | null;
|
|
495
|
+
/** Resolve one mounted caret step in rendered visual order. */
|
|
496
|
+
resolveVisualPoint: (point: Point, options: DOMVisualPointOptions) => DOMVisualPoint | null;
|
|
497
|
+
/** The root element of the view this editor's calls run in. */
|
|
498
|
+
root: () => HTMLElement | null;
|
|
499
|
+
/**
|
|
500
|
+
* The DOM text from `from` to this editor root's caret, including IME
|
|
501
|
+
* preedit the model has not received, without non-editable, retained or
|
|
502
|
+
* nested-editor DOM. Returns null when the root or `from` is not mounted,
|
|
503
|
+
* when `from.root` is not this view's root, or when the caret is outside
|
|
504
|
+
* this editor or before `from`.
|
|
505
|
+
*/
|
|
506
|
+
textToCaret: (from: Point) => string | null;
|
|
507
|
+
scroll: () => HTMLElement | null;
|
|
508
|
+
/** Scroll a mounted target; return cleanup that cancels pending scrolling. */
|
|
509
|
+
scrollIntoView: (target: ScrollIntoViewTarget, options?: ScrollIntoViewOptions) => () => void;
|
|
510
|
+
/**
|
|
511
|
+
* The part of `element` the user can see, in client coordinates: inside the
|
|
512
|
+
* viewport and every box that clips it. Null when none of it is visible.
|
|
513
|
+
*/
|
|
514
|
+
visibleRect: (element: Element) => DOMGeometryRect | null;
|
|
515
|
+
resolveNode: (domNode: DOMNode) => Node$1 | null;
|
|
516
|
+
resolvePoint: (domPoint: DOMPoint, options: {
|
|
517
|
+
exactMatch: boolean;
|
|
518
|
+
searchDirection?: 'backward' | 'forward';
|
|
519
|
+
}) => Point | null;
|
|
520
|
+
resolveRange: (domRange: DOMRange | DOMSelection | DOMStaticRange, options: {
|
|
521
|
+
exactMatch: boolean;
|
|
522
|
+
}) => Range$1 | null;
|
|
523
|
+
assertDOMNode: (node: Node$1) => HTMLElement;
|
|
524
|
+
assertDOMPoint: (point: Point) => DOMPoint;
|
|
525
|
+
assertDOMRange: (range: Range$1) => DOMRange;
|
|
526
|
+
assertNode: (domNode: DOMNode) => Node$1;
|
|
527
|
+
assertPoint: (domPoint: DOMPoint, options: {
|
|
528
|
+
exactMatch: boolean;
|
|
529
|
+
searchDirection?: 'backward' | 'forward';
|
|
530
|
+
}) => Point;
|
|
531
|
+
assertRange: (domRange: DOMRange | DOMSelection | DOMStaticRange, options: {
|
|
532
|
+
exactMatch: boolean;
|
|
533
|
+
}) => Range$1;
|
|
534
|
+
}
|
|
535
|
+
/** Native block drag, used by drag handles and custom drivers. */
|
|
536
|
+
interface DOMDragApi {
|
|
537
|
+
/**
|
|
538
|
+
* Scroll one step for a drag whose pointer is at `point`, in client
|
|
539
|
+
* coordinates of the window of the view this editor picks, where its last
|
|
540
|
+
* rendered Editable sits. It hit-tests the point for the editor's view
|
|
541
|
+
* there, else takes the picked view, and scrolls the innermost element from
|
|
542
|
+
* that view's root up whose visible edge holds the point and that can still
|
|
543
|
+
* scroll that way, else the window. The editor an Editable renders with
|
|
544
|
+
* always scrolls from its own view. For a `useRootEditor` editor, the hit
|
|
545
|
+
* test finds only its `EditorRoot`'s views of its root. The hit test enters
|
|
546
|
+
* shadow roots but not iframes. Returns the pixels scrolled, 0 when nothing
|
|
547
|
+
* moved or no view is picked. Call it once per animation frame while the
|
|
548
|
+
* drag lasts.
|
|
549
|
+
*/
|
|
550
|
+
autoScroll: (point: Readonly<{
|
|
551
|
+
x: number;
|
|
552
|
+
y: number;
|
|
553
|
+
}>) => number;
|
|
554
|
+
/** Publish this view's drop indicator for a target, or clear it. */
|
|
555
|
+
indicate: (target: DOMDropTarget | null) => void;
|
|
556
|
+
/**
|
|
557
|
+
* Start a block drag: block-select what a transfer of `node` carries, open
|
|
558
|
+
* the drag session and return inert previews for the drag image. A read-only
|
|
559
|
+
* view starts a copy-only drag.
|
|
560
|
+
*/
|
|
561
|
+
start: (event: Pick<DragEvent, 'clientX' | 'clientY' | 'dataTransfer'>, options: {
|
|
562
|
+
node: Element$1;
|
|
563
|
+
}) => DOMDragStart | null;
|
|
564
|
+
}
|
|
565
|
+
/** Clipboard methods installed by the editor DOM bridge. */
|
|
566
|
+
interface DOMEditorClipboardCapability<V extends Value = Value> {
|
|
567
|
+
/**
|
|
568
|
+
* Insert data from a `DataTransfer` into the editor.
|
|
569
|
+
*/
|
|
570
|
+
insertData: (data: DataTransfer) => boolean | undefined;
|
|
571
|
+
/**
|
|
572
|
+
* Insert fragment data from a `DataTransfer` into the editor.
|
|
573
|
+
*/
|
|
574
|
+
insertFragmentData: (data: DataTransfer) => boolean | undefined;
|
|
575
|
+
/**
|
|
576
|
+
* Insert text data from a `DataTransfer` into the editor.
|
|
577
|
+
*/
|
|
578
|
+
insertTextData: (data: DataTransfer) => boolean | undefined;
|
|
579
|
+
/** Read an exact editor slice and distinguish absence from invalid data. */
|
|
580
|
+
readSlice: (data: Pick<DataTransfer, 'getData' | 'types'>) => ClipboardSliceRead<V>;
|
|
581
|
+
/**
|
|
582
|
+
* Write the current selection to a `DataTransfer`.
|
|
583
|
+
*/
|
|
584
|
+
writeSelection: (data: Pick<DataTransfer, 'getData' | 'setData'>) => void;
|
|
585
|
+
/** Write one exact editor slice plus optional DataTransfer formats. */
|
|
586
|
+
writeSlice: (data: Pick<DataTransfer, 'getData' | 'setData'>, payload: ClipboardSliceWrite<V>) => void;
|
|
587
|
+
}
|
|
588
|
+
interface DOMClipboardApi<V extends Value = Value> extends DOMEditorClipboardCapability<V> {}
|
|
589
|
+
type ScrollIntoViewOptions = StandardBehaviorOptions | boolean;
|
|
590
|
+
type ScrollIntoViewTarget = DOMRange | Path | Point | Range$1;
|
|
591
|
+
type DOMVisualPoint = Readonly<{
|
|
592
|
+
affinity: SelectionAssociation;
|
|
593
|
+
point: Point;
|
|
594
|
+
}>;
|
|
595
|
+
type DOMVisualPointOptions = Readonly<{
|
|
596
|
+
affinity?: SelectionAssociation;
|
|
597
|
+
direction: 'left' | 'right';
|
|
598
|
+
unit: 'character' | 'word';
|
|
599
|
+
}>;
|
|
600
|
+
/** Error thrown when the editor cannot resolve a DOM node, point, or range. */
|
|
601
|
+
declare class DOMResolutionError extends Error {
|
|
602
|
+
readonly details: unknown;
|
|
603
|
+
constructor(message: string, { details }?: {
|
|
604
|
+
details?: unknown;
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
type DOMClipboardInsertDataHandler<V extends Value = Value, TPlugins extends readonly unknown[] = readonly []> = (editor: DOMEditor<V, TPlugins>, data: DataTransfer) => boolean;
|
|
608
|
+
interface DOMEditorClipboardInterface {
|
|
609
|
+
/**
|
|
610
|
+
* Insert data from a `DataTransfer` into the editor.
|
|
611
|
+
*/
|
|
612
|
+
insertData: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, data: DataTransfer) => boolean | undefined;
|
|
613
|
+
/**
|
|
614
|
+
* Insert fragment data from a `DataTransfer` into the editor.
|
|
615
|
+
*/
|
|
616
|
+
insertFragmentData: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, data: DataTransfer) => boolean | undefined;
|
|
617
|
+
/**
|
|
618
|
+
* Insert text data from a `DataTransfer` into the editor.
|
|
619
|
+
*/
|
|
620
|
+
insertTextData: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, data: DataTransfer) => boolean | undefined;
|
|
621
|
+
/**
|
|
622
|
+
* Write the currently selected fragment to a `DataTransfer`.
|
|
623
|
+
*/
|
|
624
|
+
writeSelection: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, data: Pick<DataTransfer, 'getData' | 'setData'>) => void;
|
|
625
|
+
}
|
|
626
|
+
interface DOMEditorInterface {
|
|
627
|
+
/**
|
|
628
|
+
* Android text-repair internal: return pending text diffs.
|
|
629
|
+
*/
|
|
630
|
+
androidPendingDiffs: <V extends Value, TPlugins extends readonly unknown[]>(editor: AnyEditor<V, TPlugins>) => TextDiff[] | undefined;
|
|
631
|
+
/**
|
|
632
|
+
* Android text-repair internal: flush pending diffs and end composition.
|
|
633
|
+
*/
|
|
634
|
+
androidScheduleFlush: <V extends Value, TPlugins extends readonly unknown[]>(editor: AnyEditor<V, TPlugins>) => void;
|
|
635
|
+
/**
|
|
636
|
+
* Blur the editor.
|
|
637
|
+
*/
|
|
638
|
+
blur: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => void;
|
|
639
|
+
/**
|
|
640
|
+
* Deselect the editor.
|
|
641
|
+
*/
|
|
642
|
+
deselect: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => void;
|
|
643
|
+
/**
|
|
644
|
+
* Resolve the Editable of the view an editor's calls run in, or of a view at
|
|
645
|
+
* `root` when given. Null when no view is picked.
|
|
646
|
+
*/
|
|
647
|
+
editable: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, root?: RootKey) => HTMLElement | null;
|
|
648
|
+
/**
|
|
649
|
+
* Return the DocumentOrShadowRoot holding the editor's editable, or throw
|
|
650
|
+
* where `resolveDocumentOrShadowRoot` returns null.
|
|
651
|
+
*/
|
|
652
|
+
assertDocumentOrShadowRoot: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => Document | ShadowRoot;
|
|
653
|
+
/**
|
|
654
|
+
* Resolve the DOM document or shadow root holding the Editable of the view
|
|
655
|
+
* an editor's calls run in. See `editor.api.dom.resolveDocumentOrShadowRoot`
|
|
656
|
+
* for which view that is and when the result is null.
|
|
657
|
+
*/
|
|
658
|
+
resolveDocumentOrShadowRoot: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => Document | ShadowRoot | null;
|
|
659
|
+
/**
|
|
660
|
+
* Get the target range from a DOM `event`.
|
|
661
|
+
*/
|
|
662
|
+
assertEventRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, event: any) => Range$1;
|
|
663
|
+
/**
|
|
664
|
+
* Find a key for an editor node.
|
|
665
|
+
*/
|
|
666
|
+
findKey: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, node: Descendant) => Key;
|
|
667
|
+
/**
|
|
668
|
+
* Find the path of an editor node.
|
|
669
|
+
*/
|
|
670
|
+
assertPath: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, node: Node$1) => Path;
|
|
671
|
+
/**
|
|
672
|
+
* Focus the view an editor's calls run in. Does nothing when no view is
|
|
673
|
+
* picked.
|
|
674
|
+
*/
|
|
675
|
+
focus: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, options?: {
|
|
676
|
+
retries?: number;
|
|
677
|
+
}) => void;
|
|
678
|
+
/**
|
|
679
|
+
* Return the host window of the current editor.
|
|
680
|
+
*/
|
|
681
|
+
getWindow: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => Window;
|
|
682
|
+
/**
|
|
683
|
+
* Check if a DOM node is within the editor.
|
|
684
|
+
*/
|
|
685
|
+
hasDOMNode: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, target: DOMNode, options?: {
|
|
686
|
+
editable?: boolean;
|
|
687
|
+
}) => boolean;
|
|
688
|
+
/**
|
|
689
|
+
* Check if the target is editable and in the editor.
|
|
690
|
+
*/
|
|
691
|
+
hasEditableTarget: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, target: EventTarget | null) => target is DOMNode;
|
|
692
|
+
/**
|
|
693
|
+
* Check if every point in an editor range maps to mounted DOM.
|
|
694
|
+
*/
|
|
695
|
+
hasRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, range: Range$1) => boolean;
|
|
696
|
+
/**
|
|
697
|
+
* Check if the target can be selected.
|
|
698
|
+
*/
|
|
699
|
+
hasSelectableTarget: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, target: EventTarget | null) => boolean;
|
|
700
|
+
/**
|
|
701
|
+
* Check if the target is in the editor.
|
|
702
|
+
*/
|
|
703
|
+
hasTarget: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, target: EventTarget | null) => target is DOMNode;
|
|
704
|
+
clipboard: DOMEditorClipboardInterface;
|
|
705
|
+
/**
|
|
706
|
+
* Check if the user is currently composing inside the editor.
|
|
707
|
+
*/
|
|
708
|
+
isComposing: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => boolean;
|
|
709
|
+
/**
|
|
710
|
+
* Check if the editor is focused.
|
|
711
|
+
*/
|
|
712
|
+
isFocused: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => boolean;
|
|
713
|
+
/**
|
|
714
|
+
* Check if the editor is in read-only mode.
|
|
715
|
+
*/
|
|
716
|
+
isReadOnly: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => boolean;
|
|
717
|
+
/**
|
|
718
|
+
* Check if the target is inside a void in a writable editor.
|
|
719
|
+
*/
|
|
720
|
+
isTargetInsideNonReadonlyVoid: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, target: EventTarget | null) => boolean;
|
|
721
|
+
/**
|
|
722
|
+
* Resolve the native DOM element for an editor node or live node key.
|
|
723
|
+
*
|
|
724
|
+
* Returns `null` when the node is not currently mounted or the node maps are
|
|
725
|
+
* stale.
|
|
726
|
+
*/
|
|
727
|
+
resolveDOMNode: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, nodeOrKey: Node$1 | NodeKey) => HTMLElement | null;
|
|
728
|
+
/**
|
|
729
|
+
* Resolve a native DOM point from an editor point.
|
|
730
|
+
*
|
|
731
|
+
* Returns `null` when the point cannot be projected into mounted DOM.
|
|
732
|
+
*/
|
|
733
|
+
resolveDOMPoint: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, point: Point) => DOMPoint | null;
|
|
734
|
+
/**
|
|
735
|
+
* Resolve a native DOM range from an editor range.
|
|
736
|
+
*
|
|
737
|
+
* Returns `null` when either endpoint cannot be projected into mounted DOM.
|
|
738
|
+
*/
|
|
739
|
+
resolveDOMRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, range: Range$1) => DOMRange | null;
|
|
740
|
+
/**
|
|
741
|
+
* Resolve the target range from a DOM event.
|
|
742
|
+
*
|
|
743
|
+
* Returns `null` when the browser cannot provide a usable caret range or the
|
|
744
|
+
* target is outside this editor.
|
|
745
|
+
*/
|
|
746
|
+
resolveEventRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, event: any) => Range$1 | null;
|
|
747
|
+
/**
|
|
748
|
+
* Resolve an editor node path.
|
|
749
|
+
*
|
|
750
|
+
* Returns `null` for detached nodes or stale path metadata.
|
|
751
|
+
*/
|
|
752
|
+
resolvePath: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, node: Node$1) => Path | null;
|
|
753
|
+
/**
|
|
754
|
+
* Resolve an editor range to its DOM bounding rectangle.
|
|
755
|
+
*/
|
|
756
|
+
resolveRangeRect: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, range: Range$1) => DOMRect | null;
|
|
757
|
+
/**
|
|
758
|
+
* Resolve the root element of the view an editor's calls run in.
|
|
759
|
+
*/
|
|
760
|
+
root: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => HTMLElement | null;
|
|
761
|
+
/**
|
|
762
|
+
* Resolve the scroll element used for editor viewport work.
|
|
763
|
+
*/
|
|
764
|
+
scroll: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>) => HTMLElement | null;
|
|
765
|
+
/** Scroll an editor path, point, range, or DOM range; return pending-work cleanup. */
|
|
766
|
+
scrollIntoView: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, target: ScrollIntoViewTarget, options?: ScrollIntoViewOptions) => () => void;
|
|
767
|
+
/**
|
|
768
|
+
* Resolve an editor node from a native DOM node.
|
|
769
|
+
*
|
|
770
|
+
* Returns `null` when the DOM node is foreign to this editor or no mounted
|
|
771
|
+
* editor node can be recovered.
|
|
772
|
+
*/
|
|
773
|
+
resolveNode: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, domNode: DOMNode) => Node$1 | null;
|
|
774
|
+
/**
|
|
775
|
+
* Resolve an editor point from a DOM selection point.
|
|
776
|
+
*/
|
|
777
|
+
resolvePoint: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, domPoint: DOMPoint, options: {
|
|
778
|
+
exactMatch: boolean;
|
|
779
|
+
/**
|
|
780
|
+
* The direction to search for editor leaf nodes if `domPoint` is
|
|
781
|
+
* non-editable and non-void.
|
|
782
|
+
*/
|
|
783
|
+
searchDirection?: 'forward' | 'backward';
|
|
784
|
+
}) => Point | null;
|
|
785
|
+
/**
|
|
786
|
+
* Resolve an editor range from a DOM range or selection.
|
|
787
|
+
*/
|
|
788
|
+
resolveRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, domRange: DOMRange | DOMStaticRange | DOMSelection, options: {
|
|
789
|
+
exactMatch: boolean;
|
|
790
|
+
}) => Range$1 | null;
|
|
791
|
+
/**
|
|
792
|
+
* Find the native DOM element from an editor node.
|
|
793
|
+
*/
|
|
794
|
+
assertDOMNode: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, node: Node$1) => HTMLElement;
|
|
795
|
+
/**
|
|
796
|
+
* Find a native DOM selection point from an editor point.
|
|
797
|
+
*/
|
|
798
|
+
assertDOMPoint: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, point: Point) => DOMPoint;
|
|
799
|
+
/**
|
|
800
|
+
* Find a native DOM range from an editor `range`.
|
|
801
|
+
*
|
|
802
|
+
* Notice: the returned range will always be ordinal regardless of the direction of the editor `range` due to DOM API limit.
|
|
803
|
+
*
|
|
804
|
+
* there is no way to create a reverse DOM Range using Range.setStart/setEnd
|
|
805
|
+
* according to https://dom.spec.whatwg.org/#concept-range-bp-set.
|
|
806
|
+
*/
|
|
807
|
+
assertDOMRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, range: Range$1) => DOMRange;
|
|
808
|
+
/**
|
|
809
|
+
* Find an editor node from a native DOM `element`.
|
|
810
|
+
*/
|
|
811
|
+
assertNode: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, domNode: DOMNode) => Node$1;
|
|
812
|
+
/**
|
|
813
|
+
* Find an editor point from a DOM selection's `domNode` and `domOffset`.
|
|
814
|
+
*/
|
|
815
|
+
assertPoint: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, domPoint: DOMPoint, options: {
|
|
816
|
+
exactMatch: boolean;
|
|
817
|
+
/**
|
|
818
|
+
* The direction to search for editor leaf nodes if `domPoint` is
|
|
819
|
+
* non-editable and non-void.
|
|
820
|
+
*/
|
|
821
|
+
searchDirection?: 'forward' | 'backward';
|
|
822
|
+
}) => Point;
|
|
823
|
+
/**
|
|
824
|
+
* Find an editor range from a DOM range or selection.
|
|
825
|
+
*/
|
|
826
|
+
assertRange: <V extends Value, TPlugins extends readonly unknown[]>(editor: DOMEditor<V, TPlugins>, domRange: DOMRange | DOMStaticRange | DOMSelection, options: {
|
|
827
|
+
exactMatch: boolean;
|
|
828
|
+
}) => Range$1;
|
|
829
|
+
}
|
|
830
|
+
/** DOM translation, selection, focus, and clipboard operations for an editor. */
|
|
831
|
+
declare const DOMEditor: DOMEditorInterface;
|
|
832
|
+
/** Check whether a mutation originates from an editable editor element. */
|
|
833
|
+
declare const isTrackedMutation: (editor: DOMEditor, mutation: MutationRecord, batch: MutationRecord[]) => boolean;
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region src/dom/plugin/with-dom.d.ts
|
|
836
|
+
interface DOMEditorOptions {
|
|
837
|
+
/**
|
|
838
|
+
* Expose DOM clipboard insertion through
|
|
839
|
+
* `editor.api.dom.clipboard.insertData`.
|
|
840
|
+
*
|
|
841
|
+
* Set to `false` when a host package owns clipboard parsing and fallback
|
|
842
|
+
* insertion.
|
|
843
|
+
*/
|
|
844
|
+
clipboard?: false;
|
|
845
|
+
/**
|
|
846
|
+
* Bare `DataTransfer` subtype for Plite's internal fragment payload.
|
|
847
|
+
*
|
|
848
|
+
* Plite writes and reads `application/${clipboardFormatKey}`.
|
|
849
|
+
*/
|
|
850
|
+
clipboardFormatKey?: string;
|
|
851
|
+
}
|
|
852
|
+
type DOMPluginTypes<TClipboard extends boolean = true> = {
|
|
853
|
+
api: {
|
|
854
|
+
dom: DOMApi & ([TClipboard] extends [true] ? {
|
|
855
|
+
clipboard: DOMClipboardApi;
|
|
856
|
+
} : {
|
|
857
|
+
clipboard?: never;
|
|
858
|
+
});
|
|
859
|
+
};
|
|
860
|
+
} & ([TClipboard] extends [true] ? {
|
|
861
|
+
update: {
|
|
862
|
+
dom: Pick<DOMClipboardApi, 'insertData'>;
|
|
863
|
+
};
|
|
864
|
+
} : Record<never, never>);
|
|
865
|
+
type DOMPluginDefinition<TClipboard extends boolean> = {
|
|
866
|
+
activate: true;
|
|
867
|
+
api: DOMPluginTypes<TClipboard>['api']['dom'];
|
|
868
|
+
name: 'dom';
|
|
869
|
+
on: true;
|
|
870
|
+
} & ([TClipboard] extends [true] ? {
|
|
871
|
+
update: Pick<DOMClipboardApi, 'insertData'>;
|
|
872
|
+
} : Record<never, never>);
|
|
873
|
+
/** Editor plugin installed by `dom()`. */
|
|
874
|
+
type DOMPlugin<TClipboard extends boolean = true> = Plugin<DOMPluginDefinition<TClipboard>>;
|
|
875
|
+
/** Install DOM clipboard, selection, focus, and node-resolution behavior. */
|
|
876
|
+
declare function dom(options: DOMEditorOptions & {
|
|
877
|
+
clipboard: false;
|
|
878
|
+
}): DOMPlugin<false>;
|
|
879
|
+
declare function dom(options?: Omit<DOMEditorOptions, 'clipboard'> & {
|
|
880
|
+
clipboard?: never;
|
|
881
|
+
}): DOMPlugin;
|
|
882
|
+
declare function dom(options: DOMEditorOptions): DOMPlugin<boolean>;
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region src/dom/plugin/data-transfer-format.d.ts
|
|
885
|
+
type DataTransferFormatPhase = 'accept' | 'decode' | 'encode';
|
|
886
|
+
/** Read-only host data exposed to pure format callbacks. */
|
|
887
|
+
type DataTransferSnapshot = Readonly<{
|
|
888
|
+
/** Files captured when clipboard ingress began. */
|
|
889
|
+
files: Readonly<{
|
|
890
|
+
readonly [index: number]: File;
|
|
891
|
+
readonly length: number;
|
|
892
|
+
item: (index: number) => File | null;
|
|
893
|
+
}>;
|
|
894
|
+
/** Read a captured mimeType. Missing mimeTypes return an empty string. */
|
|
895
|
+
getData: (mimeType: string) => string;
|
|
896
|
+
/** Formats advertised by the incoming host payload. */
|
|
897
|
+
types: readonly string[];
|
|
898
|
+
}>;
|
|
899
|
+
/** One conversion diagnostic a format reports while decoding a payload. */
|
|
900
|
+
type DataTransferDiagnostic = Readonly<{
|
|
901
|
+
/** `lossy` when pasted content is left out or loses meaning. */
|
|
902
|
+
impact: 'lossless' | 'lossy';
|
|
903
|
+
/** Human-readable explanation of what changed. */
|
|
904
|
+
message: string;
|
|
905
|
+
}>;
|
|
906
|
+
type DataTransferDecodeContext<V extends Value = Value> = Readonly<{
|
|
907
|
+
/** Payload for this format's registered mimeType. */
|
|
908
|
+
data: string;
|
|
909
|
+
/** MIME type currently being decoded. */
|
|
910
|
+
mimeType: string;
|
|
911
|
+
/**
|
|
912
|
+
* Report a conversion diagnostic while `accept` or `decode` runs. A mounted
|
|
913
|
+
* paste delivers the inserted payload's reports, plus loss from earlier
|
|
914
|
+
* payloads that it cannot account for, through `Editable.onPasteResult`.
|
|
915
|
+
*/
|
|
916
|
+
report: (diagnostic: DataTransferDiagnostic) => void;
|
|
917
|
+
/** Immutable snapshot of every incoming host MIME type and file. */
|
|
918
|
+
snapshot: DataTransferSnapshot;
|
|
919
|
+
/** Read-only editor snapshot captured for this callback. */
|
|
920
|
+
state: EditorCoreStateView<V>;
|
|
921
|
+
}>;
|
|
922
|
+
type DataTransferEncodeContext<V extends Value = Value> = Readonly<{
|
|
923
|
+
/** MIME type currently being encoded. */
|
|
924
|
+
mimeType: string;
|
|
925
|
+
/** Immutable model slice selected for export. */
|
|
926
|
+
slice: ContentSlice<V>;
|
|
927
|
+
/** Read-only editor snapshot captured for this callback. */
|
|
928
|
+
state: EditorCoreStateView<V>;
|
|
929
|
+
}>;
|
|
930
|
+
/** Stable schema ownership claimed by one format direction and MIME type. */
|
|
931
|
+
type DataTransferSchemaClaim = Readonly<{
|
|
932
|
+
kind: 'element';
|
|
933
|
+
type: string;
|
|
934
|
+
}> | SchemaProperty | Readonly<{
|
|
935
|
+
kind: 'schema';
|
|
936
|
+
}>;
|
|
937
|
+
type DataTransferFormat<V extends Value = Value> = Readonly<{
|
|
938
|
+
/** Stable registration identity used for lifecycle errors and conflicts. */
|
|
939
|
+
key: string;
|
|
940
|
+
/** MIME type read from and written to the host data container. */
|
|
941
|
+
mimeType: string;
|
|
942
|
+
/**
|
|
943
|
+
* Parse an intact slice, or return null to delegate to the next format. An
|
|
944
|
+
* empty slice claims the payload, so no later format reads it and nothing is
|
|
945
|
+
* inserted. A claimed paste keeps the selection. Contextual schema fitting
|
|
946
|
+
* occurs at insertion. Report what the slice leaves out through
|
|
947
|
+
* `context.report`.
|
|
948
|
+
*/
|
|
949
|
+
decode?: (context: DataTransferDecodeContext<V>) => ContentSlice<V> | null;
|
|
950
|
+
/** Return false to skip this payload before decoding. */
|
|
951
|
+
accept?: (context: DataTransferDecodeContext<V>) => boolean;
|
|
952
|
+
/** Schema resources owned by this format and checked atomically. */
|
|
953
|
+
claims?: readonly DataTransferSchemaClaim[];
|
|
954
|
+
/** Encode the supplied slice, or return null to delegate this mimeType. */
|
|
955
|
+
encode?: (context: DataTransferEncodeContext<V>) => string | null;
|
|
956
|
+
}>;
|
|
957
|
+
type DataTransferFormatsPluginDefinition<TName extends string> = {
|
|
958
|
+
contributions: true;
|
|
959
|
+
name: TName;
|
|
960
|
+
validate: true;
|
|
961
|
+
};
|
|
962
|
+
/** Install one or more DataTransfer formats as a named editor plugin. */
|
|
963
|
+
declare const dataTransferFormats: <const TName extends string, V extends Value = Value>(name: TName, formats: ReadonlyArray<DataTransferFormat<V>>) => Plugin<DataTransferFormatsPluginDefinition<TName>>;
|
|
964
|
+
/** Serialize a model fragment through configuration-ordered formats. */
|
|
965
|
+
declare const writeDataTransferFragment: <V extends Value>(editor: Editor<V, any>, data: Pick<DataTransfer, 'setData'>, slice: ContentSlice<V>, options?: Readonly<{
|
|
966
|
+
excludeMimeTypes?: readonly string[];
|
|
967
|
+
}>) => readonly string[];
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/dom/utils/environment.d.ts
|
|
970
|
+
/**
|
|
971
|
+
* Returns whether an event, node, window, or document belongs to an Apple
|
|
972
|
+
* platform, where `mod` is Command.
|
|
973
|
+
*/
|
|
974
|
+
declare const usesAppleDOMHotkeys: (event: unknown) => boolean;
|
|
975
|
+
/** Returns whether an event, node, window, or document belongs to Gecko. */
|
|
976
|
+
declare const isGeckoDOMHost: (source: unknown) => boolean;
|
|
977
|
+
/** True when the current environment exposes the browser DOM APIs Plite needs. */
|
|
978
|
+
declare const CAN_USE_DOM: boolean;
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region src/dom/plugin/dom-root-runtime.d.ts
|
|
981
|
+
/** Resolve the mounted DOM root that currently represents an editor. */
|
|
982
|
+
declare const getEditorDOMRoot: (editor: object) => HTMLElement | null;
|
|
983
|
+
//#endregion
|
|
984
|
+
//#region src/dom/utils/constants.d.ts
|
|
985
|
+
/** Browser click count used to detect triple-click selection gestures. */
|
|
986
|
+
declare const TRIPLE_CLICK = 3;
|
|
987
|
+
//#endregion
|
|
988
|
+
//#region src/dom/utils/hotkey-match.d.ts
|
|
989
|
+
type HotkeyPlatform = 'apple' | 'other' | 'windows';
|
|
990
|
+
type HotkeyMatchOptions = {
|
|
991
|
+
ignoreModifiers?: boolean;
|
|
992
|
+
platform?: HotkeyPlatform;
|
|
993
|
+
};
|
|
994
|
+
type HotkeySpec = readonly string[] | string;
|
|
995
|
+
type KeyboardEventLike = {
|
|
996
|
+
altKey?: boolean;
|
|
997
|
+
code?: string;
|
|
998
|
+
ctrlKey?: boolean;
|
|
999
|
+
getModifierState?: (key: 'AltGraph') => boolean;
|
|
1000
|
+
key: string;
|
|
1001
|
+
metaKey?: boolean;
|
|
1002
|
+
shiftKey?: boolean;
|
|
1003
|
+
};
|
|
1004
|
+
type HotkeyMatcher = (event: KeyboardEventLike) => boolean;
|
|
1005
|
+
/**
|
|
1006
|
+
* Names the combos of a hotkey the way the `aria-keyshortcuts` attribute does,
|
|
1007
|
+
* such as `Control+Shift+X`, joined by spaces. Each name is a combo the hotkey
|
|
1008
|
+
* matcher matches on a US layout for `platform`. A combo whose key is a literal
|
|
1009
|
+
* digit or punctuation character, or a letter or Space with Option on Apple,
|
|
1010
|
+
* gets no name. To name a letter, digit or punctuation key, write its code,
|
|
1011
|
+
* such as `digit1` or `keyi`.
|
|
1012
|
+
* Returns `undefined` when no combo has a name, and throws the matcher's
|
|
1013
|
+
* `TypeError` for a hotkey it rejects.
|
|
1014
|
+
*/
|
|
1015
|
+
declare const ariaKeyShortcuts: (hotkey: HotkeySpec, options: {
|
|
1016
|
+
platform: HotkeyPlatform;
|
|
1017
|
+
}) => string | undefined;
|
|
1018
|
+
/** Compiles one or more hotkey specs into a reusable event predicate. */
|
|
1019
|
+
declare const createCompiledHotkeyMatcher: (hotkey: HotkeySpec, options?: HotkeyMatchOptions) => HotkeyMatcher;
|
|
1020
|
+
declare function isHotkey(hotkey: HotkeySpec, event: KeyboardEventLike): boolean;
|
|
1021
|
+
declare function isHotkey(hotkey: HotkeySpec, options: HotkeyMatchOptions, event: KeyboardEventLike): boolean;
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/dom/utils/hotkeys.d.ts
|
|
1024
|
+
/** Platform-aware hotkey predicates used by Plite DOM editing behavior. */
|
|
1025
|
+
declare const Hotkeys: {
|
|
1026
|
+
isCompose: (event: KeyboardEvent) => boolean;
|
|
1027
|
+
isMoveBackward: (event: KeyboardEvent) => boolean;
|
|
1028
|
+
isMoveForward: (event: KeyboardEvent) => boolean;
|
|
1029
|
+
isDeleteBackward: (event: KeyboardEvent) => boolean;
|
|
1030
|
+
isDeleteForward: (event: KeyboardEvent) => boolean;
|
|
1031
|
+
isDeleteLineBackward: (event: KeyboardEvent) => boolean;
|
|
1032
|
+
isDeleteLineForward: (event: KeyboardEvent) => boolean;
|
|
1033
|
+
isDeleteWordBackward: (event: KeyboardEvent) => boolean;
|
|
1034
|
+
isDeleteWordForward: (event: KeyboardEvent) => boolean;
|
|
1035
|
+
isExtendBackward: (event: KeyboardEvent) => boolean;
|
|
1036
|
+
isExtendForward: (event: KeyboardEvent) => boolean;
|
|
1037
|
+
isExtendLineBackward: (event: KeyboardEvent) => boolean;
|
|
1038
|
+
isExtendLineForward: (event: KeyboardEvent) => boolean;
|
|
1039
|
+
isExtendWordBackward: (event: KeyboardEvent) => boolean;
|
|
1040
|
+
isExtendWordForward: (event: KeyboardEvent) => boolean;
|
|
1041
|
+
isMoveLineBackward: (event: KeyboardEvent) => boolean;
|
|
1042
|
+
isMoveLineForward: (event: KeyboardEvent) => boolean;
|
|
1043
|
+
isMoveWordBackward: (event: KeyboardEvent) => boolean;
|
|
1044
|
+
isMoveWordForward: (event: KeyboardEvent) => boolean;
|
|
1045
|
+
isOpenLine: (event: KeyboardEvent) => boolean;
|
|
1046
|
+
isRedo: (event: KeyboardEvent) => boolean;
|
|
1047
|
+
isSoftBreak: (event: KeyboardEvent) => boolean;
|
|
1048
|
+
isSplitBlock: (event: KeyboardEvent) => boolean;
|
|
1049
|
+
isTransposeCharacter: (event: KeyboardEvent) => boolean;
|
|
1050
|
+
isUndo: (event: KeyboardEvent) => boolean;
|
|
1051
|
+
};
|
|
1052
|
+
//#endregion
|
|
1053
|
+
//#region src/dom/utils/selection-writes.d.ts
|
|
1054
|
+
/** A selection's anchor and focus as DOM points, in selection direction. */
|
|
1055
|
+
type DOMSelectionPoints = Readonly<{
|
|
1056
|
+
anchor: DOMPoint;
|
|
1057
|
+
focus: DOMPoint;
|
|
1058
|
+
}>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Write `points` as `tree`'s selection, keeping their direction, or clear its
|
|
1061
|
+
* ranges for null, and record what the tree then shows, or the points written
|
|
1062
|
+
* where the tree reads its selection as its host. A selection that already
|
|
1063
|
+
* shows them is left alone, and so is the record, unless WebKit got them from
|
|
1064
|
+
* a write while their anchor had no layout box, neither the user nor a write
|
|
1065
|
+
* of other points has come since, and the anchor has one now.
|
|
1066
|
+
*/
|
|
1067
|
+
declare const writeDOMSelection: (tree: Document | ShadowRoot, points: DOMSelectionPoints | null) => void;
|
|
1068
|
+
/** A copy of `selection`'s range at `index`, safe to keep or change. */
|
|
1069
|
+
declare const readDOMSelectionRange: (selection: Selection, index?: number) => Range;
|
|
1070
|
+
//#endregion
|
|
1071
|
+
//#region src/dom/utils/plite-dom-markers.d.ts
|
|
1072
|
+
/** Return true when the element is a Plite void element boundary. */
|
|
1073
|
+
declare const isVoid: (element: HTMLElement) => boolean;
|
|
1074
|
+
/** Return true when the element is a Plite element node boundary. */
|
|
1075
|
+
declare const isElement: (element: HTMLElement) => boolean;
|
|
1076
|
+
/** Return true when the element is a Plite text node boundary. */
|
|
1077
|
+
declare const isText: (element: HTMLElement) => boolean;
|
|
1078
|
+
/** Return true when the element is a Plite rendered string boundary. */
|
|
1079
|
+
declare const isString: (element: HTMLElement) => boolean;
|
|
1080
|
+
/** Return true when the element is a Plite leaf boundary. */
|
|
1081
|
+
declare const isLeaf: (element: HTMLElement) => boolean;
|
|
1082
|
+
/** Return true when the element is a Plite editable root. */
|
|
1083
|
+
declare const isEditor: (element: HTMLElement) => boolean;
|
|
1084
|
+
/** Return true when the element is any Plite-owned DOM node boundary. */
|
|
1085
|
+
declare const isNode: (element: HTMLElement) => boolean;
|
|
1086
|
+
/** Return Plite element boundaries below the provided element. */
|
|
1087
|
+
declare const getElements: (element: HTMLElement) => HTMLElement[];
|
|
1088
|
+
/** Convert a model property key to its Plite DOM data attribute name. */
|
|
1089
|
+
declare const keyToDataAttribute: (key: string) => string;
|
|
1090
|
+
/** Return DOM data attribute names that mirror primitive node properties. */
|
|
1091
|
+
declare const getNodeDataAttributeKeys: (node: Element$1 | Text$1) => string[];
|
|
1092
|
+
//#endregion
|
|
1093
|
+
export { ClipboardSliceWrite as $, isAfter as $t, DataTransferFormat as A, DOMCoverageMaterializeHandler as At, DOMApi as B, DOMElement as Bt, getEditorDOMRoot as C, DOMDropTargetOptions as Ct, DataTransferDecodeContext as D, DOMCoverageBoundaryEdge as Dt, usesAppleDOMHotkeys as E, DOMCoverageBoundaryAnchor as Et, writeDataTransferFragment as F, DOMCoveragePointResult as Ft, DOMEditorClipboardCapability as G, DOMStaticRange as Gt, DOMClipboardInsertDataHandler as H, DOMPoint as Ht, DOMEditorOptions as I, DOMCoverageReason as It, DOMVisualPointOptions as J, containsShadowAware as Jt, DOMResolutionError as K, DOMText as Kt, DOMPlugin as L, DOMCoverageRuntimeRange as Lt, DataTransferSchemaClaim as M, DOMCoverageMaterializeReason as Mt, DataTransferSnapshot as N, DOMCoverageMaterializeResult as Nt, DataTransferDiagnostic as O, DOMCoverageBoundaryState as Ot, dataTransferFormats as P, DOMCoveragePathRange as Pt, ClipboardSliceRead as Q, hasShadowRoot as Qt, DOMPluginTypes as R, DOMCoverageSelectionPolicy as Rt, TRIPLE_CLICK as S, DOMDropTargetInput as St, isGeckoDOMHost as T, DOMCoverageBoundary as Tt, DOMDragApi as U, DOMRange as Ut, DOMClipboardApi as V, DOMNode as Vt, DOMEditor as W, DOMSelection as Wt, ScrollIntoViewTarget as X, getDefaultView as Xt, ScrollIntoViewOptions as Y, getActiveElement as Yt, isTrackedMutation as Z, getSelection as Zt, HotkeySpec as _, DOMGeometryRect as _t, isLeaf as a, isPlainTextOnlyPaste as an, writeDOMFragmentData as at, createCompiledHotkeyMatcher as b, DOMDropEdge as bt, isText as c, StringDiff as ct, DOMSelectionPoints as d, mergeStringDiffs as dt, isBefore as en, DOMFragmentDataHtml as et, readDOMSelectionRange as f, normalizePoint as ft, HotkeyPlatform as g, verifyDiffState as gt, HotkeyMatchOptions as h, targetRange as ht, isElement as i, isDOMText as in, getDOMClipboardFormatKey as it, DataTransferFormatPhase as j, DOMCoverageMaterializeRangeRole as jt, DataTransferEncodeContext as k, DOMCoverageCopyPolicy as kt, isVoid as l, TextDiff as lt, Hotkeys as m, normalizeStringDiff as mt, getNodeDataAttributeKeys as n, isDOMNode as nn, cleanDOMClipboardContents as nt, isNode as o, normalizeDOMPoint as on, writeDOMRangeData as ot, writeDOMSelection as p, normalizeRange as pt, DOMVisualPoint as q, closestShadowAware as qt, isEditor as r, isDOMSelection as rn, domCommands as rt, isString as s, Key as st, getElements as t, isDOMElement as tn, DOMFragmentDataPayload as tt, keyToDataAttribute as u, applyStringDiff as ut, KeyboardEventLike as v, DropIndicator as vt, CAN_USE_DOM as w, DOMCoverage as wt, isHotkey as x, DOMDropTarget as xt, ariaKeyShortcuts as y, DOMDragStart as yt, dom as z, DOMCoverageSession as zt };
|