plitejs 54.0.0-beta.2 → 54.0.0-beta.4
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 +18679 -4
- package/dist/{core/authored-veto.js → authored-veto-D_9wCJcK.js} +2 -2
- package/dist/{internal/browser-protocol.js → browser-protocol-pvt4HFF7.js} +1 -1
- package/dist/comparison-plan-DY_vuGPq.js +1338 -0
- package/dist/{diff/lib/comparison-types.d.ts → comparison-types-DdwE6mYq.d.ts} +11 -6
- package/dist/create-editor-CLQEkEZ1.js +1108 -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-CH2BXXj6.js +9220 -0
- package/dist/{core/same-result.js → editor-owner-C9rVbMTs.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-CeT83ZLB.js} +134 -8
- package/dist/{annotations/store.d.ts → index-BWPcE4ac.d.ts} +27 -6
- package/dist/index-BXjLmx1n.d.ts +9827 -0
- package/dist/index-DVMNewDn.d.ts +1243 -0
- package/dist/index-Db-ktCTE.d.ts +1092 -0
- package/dist/index-Dq3Jlj8O.d.ts +119 -0
- package/dist/{yjs/core/plugin.d.ts → index-UrB4jAwl.d.ts} +88 -5
- package/dist/index.d.ts +2 -51
- 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-CbWqba_1.js} +2 -3
- package/dist/{core/native-grouping-input.js → native-grouping-input-DXNhlPHd.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-CBdYiOuR.js +1021 -0
- package/dist/plugin-SR3HTH0j.js +51505 -0
- package/dist/{react/range-geometry.js → range-geometry-CdltxcH6.js} +23 -18
- package/dist/{react/range-geometry.d.ts → range-geometry-Dwp2oyCc.d.ts} +2 -2
- 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-CN-iBh1z.js +1018 -0
- package/dist/{core/change/retraction.js → retraction-BmPJB9cE.js} +16 -4
- package/dist/src-B-zm0kz4.js +1511 -0
- package/dist/{internal/view/stable-id-mapped-source.js → store-51r4zpCR.js} +253 -3
- package/dist/testing/index.d.ts +182 -8
- package/dist/testing/index.js +95 -8
- package/dist/use-editor-dom-scope-uDJQ692F.js +28370 -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-IGE0Al3n.js +13416 -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
|
@@ -1,870 +0,0 @@
|
|
|
1
|
-
import { EditorJsonValue } from "./json.js";
|
|
2
|
-
import { BaseText } from "./text.js";
|
|
3
|
-
import { BaseElement } from "./element.js";
|
|
4
|
-
import { EditorSchemaPluginProvider, EditorSchemaSource, EditorSchemaSourceProvider, SchemaNodeTypeProvider, SchemaValueBrand } from "../core/schema-source.internal.js";
|
|
5
|
-
//#region src/interfaces/schema.d.ts
|
|
6
|
-
/** Stable semantic actions performed by coercive schema fitting. */
|
|
7
|
-
type EditorSchemaRepairCode = 'canonicalize-set-property' | 'create-root' | 'default-property' | 'drop-unplaceable-text' | 'flatten-block-content' | 'generate-property' | 'insert-empty-text' | 'insert-inline-spacer' | 'insert-required-content' | 'merge-text' | 'omit-empty-text-property' | 'remove-empty-text' | 'remove-noncanonical-child' | 'replace-element-shell' | 'resolve-exclusive-property' | 'wrap-content';
|
|
8
|
-
type PropertyValueKind = 'boolean' | 'enum' | 'json' | 'number' | 'set' | 'string';
|
|
9
|
-
type PropertyValidation<TValue> = Readonly<{
|
|
10
|
-
validate?: never;
|
|
11
|
-
validationVersion?: never;
|
|
12
|
-
}> | Readonly<{
|
|
13
|
-
/** Narrow an untrusted JSON value to the declared property type. */
|
|
14
|
-
validate: (value: unknown) => value is TValue;
|
|
15
|
-
/** Bump whenever validation behavior changes. */
|
|
16
|
-
validationVersion: number;
|
|
17
|
-
}>;
|
|
18
|
-
type PropertyValueBaseOptions<TValue> = Readonly<{
|
|
19
|
-
default?: TValue;
|
|
20
|
-
/** Materialize a missing value during local construction. */
|
|
21
|
-
generate?: () => TValue;
|
|
22
|
-
omitDefault?: boolean;
|
|
23
|
-
/** Reject canonical values that omit this property when no default exists. */
|
|
24
|
-
required?: boolean;
|
|
25
|
-
}>;
|
|
26
|
-
type PropertyValueOptions<TValue> = PropertyValueBaseOptions<TValue> & PropertyValidation<TValue>;
|
|
27
|
-
/** One immutable JSON value law shared by text and element properties. */
|
|
28
|
-
interface PropertyValueDescriptor<TValue = unknown, TKind extends PropertyValueKind = PropertyValueKind, TOptions extends PropertyValueOptions<TValue> | undefined = PropertyValueOptions<TValue> | undefined> {
|
|
29
|
-
/** Type-only carrier for exact property-option inference. */
|
|
30
|
-
readonly '~schema.options'?: TOptions;
|
|
31
|
-
/** Type-only carrier for exact property-value inference. */
|
|
32
|
-
readonly '~schema.value'?: TValue;
|
|
33
|
-
readonly default?: TValue;
|
|
34
|
-
readonly generate?: () => TValue;
|
|
35
|
-
readonly kind: TKind;
|
|
36
|
-
readonly omitDefault: [PropertyValueOptions<TValue> | undefined] extends [TOptions] ? boolean : TOptions extends {
|
|
37
|
-
omitDefault: true;
|
|
38
|
-
} ? true : false;
|
|
39
|
-
readonly required: [PropertyValueOptions<TValue> | undefined] extends [TOptions] ? boolean : TOptions extends {
|
|
40
|
-
required: true;
|
|
41
|
-
} ? true : false;
|
|
42
|
-
/** Runtime validator; excluded from structural schema identity. */
|
|
43
|
-
readonly validate?: (value: unknown) => value is TValue;
|
|
44
|
-
/** Structural identity for `validate`; required whenever it is present. */
|
|
45
|
-
readonly validationVersion?: number;
|
|
46
|
-
}
|
|
47
|
-
interface PropertyBooleanDescriptor<TOptions extends PropertyValueOptions<boolean> | undefined = undefined> extends PropertyValueDescriptor<boolean, 'boolean', TOptions> {}
|
|
48
|
-
interface PropertyEnumDescriptor<TValues extends readonly string[] = readonly string[], TOptions extends PropertyValueOptions<TValues[number]> | undefined = undefined> extends PropertyValueDescriptor<TValues[number], 'enum', TOptions> {
|
|
49
|
-
readonly values: TValues;
|
|
50
|
-
}
|
|
51
|
-
interface PropertyJsonDescriptor<TValue = EditorJsonValue, TOptions extends PropertyValueOptions<TValue> | undefined = undefined> extends PropertyValueDescriptor<TValue, 'json', TOptions> {}
|
|
52
|
-
interface PropertyNumberDescriptor<TOptions extends PropertyValueOptions<number> | undefined = undefined> extends PropertyValueDescriptor<number, 'number', TOptions> {}
|
|
53
|
-
interface PropertyStringDescriptor<TOptions extends PropertyValueOptions<string> | undefined = undefined> extends PropertyValueDescriptor<string, 'string', TOptions> {}
|
|
54
|
-
interface PropertySetDescriptor<TItemDescriptor extends PropertyValueDescriptor = PropertyValueDescriptor, TOptions extends PropertySetOptions<PropertyValueOf<TItemDescriptor>> | undefined = undefined> extends PropertyValueDescriptor<ReadonlyArray<PropertyValueOf<TItemDescriptor>>, 'set', TOptions> {
|
|
55
|
-
readonly item: TItemDescriptor;
|
|
56
|
-
}
|
|
57
|
-
type PropertyValueOf<TDescriptor> = TDescriptor extends Readonly<{
|
|
58
|
-
'~schema.value'?: infer TValue;
|
|
59
|
-
}> ? TValue : never;
|
|
60
|
-
type PropertyOptionsOf<TDescriptor> = TDescriptor extends Readonly<{
|
|
61
|
-
'~schema.options'?: infer TOptions;
|
|
62
|
-
}> ? TOptions : never;
|
|
63
|
-
type PropertySetOptions<TItem> = PropertyValueOptions<readonly TItem[]>;
|
|
64
|
-
type PropertyJsonOptions<TValue = EditorJsonValue> = PropertyValueOptions<TValue>;
|
|
65
|
-
type SchemaKeyPrefix<TPrefix extends string = string> = Readonly<{
|
|
66
|
-
kind: 'prefix';
|
|
67
|
-
prefix: TPrefix;
|
|
68
|
-
}>;
|
|
69
|
-
/** Exact keys are strings; namespaces use `schema.key.prefix(...)`. */
|
|
70
|
-
type SchemaPropertyKey = SchemaKeyPrefix | string;
|
|
71
|
-
type SchemaTypesTarget<TTypes extends readonly string[] = readonly string[]> = Readonly<{
|
|
72
|
-
kind: 'types';
|
|
73
|
-
types: TTypes;
|
|
74
|
-
}>;
|
|
75
|
-
/** Element-type-only target used by structural schema contributions. */
|
|
76
|
-
type SchemaElementTarget = Readonly<{
|
|
77
|
-
kind: 'and';
|
|
78
|
-
targets: readonly SchemaElementTarget[];
|
|
79
|
-
}> | Readonly<{
|
|
80
|
-
group: string;
|
|
81
|
-
kind: 'group';
|
|
82
|
-
}> | Readonly<{
|
|
83
|
-
kind: 'not';
|
|
84
|
-
target: SchemaElementTarget;
|
|
85
|
-
}> | Readonly<{
|
|
86
|
-
kind: 'or';
|
|
87
|
-
targets: readonly SchemaElementTarget[];
|
|
88
|
-
}> | Readonly<{
|
|
89
|
-
kind: 'type';
|
|
90
|
-
type: string;
|
|
91
|
-
}> | SchemaTypesTarget;
|
|
92
|
-
type SchemaTarget = Readonly<{
|
|
93
|
-
kind: 'and';
|
|
94
|
-
targets: readonly SchemaTarget[];
|
|
95
|
-
}> | Readonly<{
|
|
96
|
-
group: string;
|
|
97
|
-
kind: 'group';
|
|
98
|
-
}> | Readonly<{
|
|
99
|
-
kind: 'not';
|
|
100
|
-
target: SchemaTarget;
|
|
101
|
-
}> | Readonly<{
|
|
102
|
-
kind: 'or';
|
|
103
|
-
targets: readonly SchemaTarget[];
|
|
104
|
-
}> | Readonly<{
|
|
105
|
-
kind: 'parent';
|
|
106
|
-
target: SchemaTarget;
|
|
107
|
-
}> | Readonly<{
|
|
108
|
-
kind: 'root';
|
|
109
|
-
root: string | null;
|
|
110
|
-
}> | Readonly<{
|
|
111
|
-
kind: 'type';
|
|
112
|
-
type: string;
|
|
113
|
-
}> | SchemaTypesTarget;
|
|
114
|
-
type SchemaPropertySplitPolicy = 'drop' | 'preserve';
|
|
115
|
-
type SchemaPropertyCopyPolicy = 'drop' | 'preserve';
|
|
116
|
-
type SchemaPropertyTypeChangePolicy = 'drop' | 'preserve-if-allowed';
|
|
117
|
-
/**
|
|
118
|
-
* Whether where content lands decides an element property. `rebase`: a text
|
|
119
|
-
* move may change it, such as a depth. `adopt`: a text move may change it,
|
|
120
|
-
* and a block copy or move may take it from where it lands, such as a list.
|
|
121
|
-
*/
|
|
122
|
-
type SchemaPropertyLandingPolicy = 'adopt' | 'preserve' | 'rebase';
|
|
123
|
-
type SchemaPropertyRole = 'content' | 'metadata';
|
|
124
|
-
type SchemaPropertyExclusiveGroup<TId extends string = string> = Readonly<{
|
|
125
|
-
id: TId;
|
|
126
|
-
kind: 'exclusive';
|
|
127
|
-
}>;
|
|
128
|
-
type SchemaTextPropertyOptions = Readonly<{
|
|
129
|
-
copy?: SchemaPropertyCopyPolicy;
|
|
130
|
-
exclusive?: readonly SchemaPropertyExclusiveGroup[];
|
|
131
|
-
inclusive?: boolean;
|
|
132
|
-
role?: SchemaPropertyRole;
|
|
133
|
-
split?: SchemaPropertySplitPolicy;
|
|
134
|
-
target?: SchemaTarget;
|
|
135
|
-
typeChange?: SchemaPropertyTypeChangePolicy;
|
|
136
|
-
/** Only an element property can be unique. */
|
|
137
|
-
unique?: never;
|
|
138
|
-
}>;
|
|
139
|
-
/**
|
|
140
|
-
* How an element property names elements by the values of a unique element
|
|
141
|
-
* property. The property must have an exact key, target element types alone,
|
|
142
|
-
* have no default value and not be unique itself, and `key` must be the key
|
|
143
|
-
* of a unique string element property. No content slot or content default
|
|
144
|
-
* may fix either property. The compiler refuses any other declaration.
|
|
145
|
-
*/
|
|
146
|
-
type SchemaPropertyReferences<TValue> = Readonly<{
|
|
147
|
-
/** The unique element property whose values this property names. */
|
|
148
|
-
key: string;
|
|
149
|
-
/**
|
|
150
|
-
* The value with each name it holds replaced by `renamed(name)` where that
|
|
151
|
-
* is defined. `renamed` returns the new value of a holder the same copy
|
|
152
|
-
* carried, and `undefined` for any other name.
|
|
153
|
-
*/
|
|
154
|
-
map: (value: TValue, renamed: (name: string) => string | undefined) => TValue;
|
|
155
|
-
}>;
|
|
156
|
-
type SchemaElementPropertyOptions<TValue = unknown> = Readonly<{
|
|
157
|
-
copy?: SchemaPropertyCopyPolicy;
|
|
158
|
-
/** Defaults to `preserve`. */
|
|
159
|
-
landing?: SchemaPropertyLandingPolicy;
|
|
160
|
-
references?: SchemaPropertyReferences<TValue>;
|
|
161
|
-
role?: SchemaPropertyRole;
|
|
162
|
-
/** Defaults to `drop` for a generated value, and `preserve` otherwise. */
|
|
163
|
-
split?: SchemaPropertySplitPolicy;
|
|
164
|
-
target: SchemaTarget;
|
|
165
|
-
typeChange?: SchemaPropertyTypeChangePolicy;
|
|
166
|
-
/**
|
|
167
|
-
* No two elements store one value of this property. A commit or a load that
|
|
168
|
-
* stores a value another element holds gives one of them a fresh value from
|
|
169
|
-
* the generator, so a write that stores a held value lands with a new one:
|
|
170
|
-
* read the value back from the landed node. A peer's concurrent repair can
|
|
171
|
-
* change it again. Requires a generator that never repeats a value, an
|
|
172
|
-
* exact key, a value other than a set, the `metadata` role, a target that
|
|
173
|
-
* holds wherever its types stand, `landing: 'preserve'` and
|
|
174
|
-
* `typeChange: 'preserve-if-allowed'`. Where the target holds on a type that
|
|
175
|
-
* is not a void, it holds on every type that can take that type's place, so
|
|
176
|
-
* a retype keeps the value. A void may hold it alone: a retype between a
|
|
177
|
-
* type that holds it and one that does not replaces the element. Editing
|
|
178
|
-
* drops the value and undo brings it back; Suggesting records a deletion and
|
|
179
|
-
* an insertion, so a rejection keeps the element and its value. Where the
|
|
180
|
-
* two cannot stand side by side, such as in a slot at its maximum or under
|
|
181
|
-
* one exclusive content root, Suggesting refuses the retype and changes
|
|
182
|
-
* nothing. A format tag that a writer without this rule saved for such a
|
|
183
|
-
* retype holds no value, so rejecting a tag that dropped the value returns
|
|
184
|
-
* `invalid`. Only a holder of a declared type keeps its value this way; an
|
|
185
|
-
* undeclared type that `unknown: 'preserve'` keeps does not. Sets `copy` and
|
|
186
|
-
* `split` to `drop`. The key takes no other element declaration, since every
|
|
187
|
-
* holder's fresh value comes from this one's generator.
|
|
188
|
-
* Suggesting writes the value in place, with no suggestion, except that a
|
|
189
|
-
* suggested split that drops the value parks it in the split's history,
|
|
190
|
-
* where no element holds it until someone decides.
|
|
191
|
-
*/
|
|
192
|
-
unique?: true;
|
|
193
|
-
}>;
|
|
194
|
-
type SchemaTextProperty<TKey extends SchemaPropertyKey = SchemaPropertyKey, TDescriptor extends PropertyValueDescriptor = PropertyValueDescriptor, TTarget extends SchemaTarget | undefined = SchemaTarget | undefined> = Readonly<{
|
|
195
|
-
copy: SchemaPropertyCopyPolicy;
|
|
196
|
-
exclusive?: readonly SchemaPropertyExclusiveGroup[];
|
|
197
|
-
inclusive: boolean;
|
|
198
|
-
key: TKey;
|
|
199
|
-
placement: 'text';
|
|
200
|
-
role: SchemaPropertyRole;
|
|
201
|
-
split: SchemaPropertySplitPolicy;
|
|
202
|
-
target?: TTarget;
|
|
203
|
-
typeChange: SchemaPropertyTypeChangePolicy;
|
|
204
|
-
value: TDescriptor;
|
|
205
|
-
}>;
|
|
206
|
-
type AnySchemaPropertyReferences = Readonly<{
|
|
207
|
-
key: string;
|
|
208
|
-
map: (value: never, renamed: (name: string) => string | undefined) => unknown;
|
|
209
|
-
}>;
|
|
210
|
-
type SchemaPropertyReferencesOf<TDescriptor extends PropertyValueDescriptor> = PropertyValueDescriptor extends TDescriptor ? AnySchemaPropertyReferences : SchemaPropertyReferences<PropertyValueOf<TDescriptor>>;
|
|
211
|
-
type SchemaElementProperty<TKey extends SchemaPropertyKey = SchemaPropertyKey, TDescriptor extends PropertyValueDescriptor = PropertyValueDescriptor, TTarget extends SchemaTarget = SchemaTarget, TReferences extends SchemaPropertyReferencesOf<TDescriptor> = SchemaPropertyReferencesOf<TDescriptor>> = Readonly<{
|
|
212
|
-
copy: SchemaPropertyCopyPolicy;
|
|
213
|
-
key: TKey;
|
|
214
|
-
landing: SchemaPropertyLandingPolicy;
|
|
215
|
-
placement: 'element';
|
|
216
|
-
references?: TReferences;
|
|
217
|
-
role: SchemaPropertyRole;
|
|
218
|
-
split: SchemaPropertySplitPolicy;
|
|
219
|
-
target: TTarget;
|
|
220
|
-
typeChange: SchemaPropertyTypeChangePolicy;
|
|
221
|
-
unique?: true;
|
|
222
|
-
value: TDescriptor;
|
|
223
|
-
}>;
|
|
224
|
-
type SchemaProperty = SchemaElementProperty | SchemaTextProperty;
|
|
225
|
-
/** Element-property law before a keyed owner assigns persisted identity. */
|
|
226
|
-
type SchemaElementPropertyDefinition<TDescriptor extends PropertyValueDescriptor = PropertyValueDescriptor, TTarget extends SchemaTarget = SchemaTarget, TReferences extends SchemaPropertyReferencesOf<TDescriptor> = SchemaPropertyReferencesOf<TDescriptor>> = Omit<SchemaElementProperty<SchemaPropertyKey, TDescriptor, TTarget, TReferences>, 'key'>;
|
|
227
|
-
/** Text-property law before a keyed owner assigns persisted identity. */
|
|
228
|
-
type SchemaTextPropertyDefinition<TDescriptor extends PropertyValueDescriptor = PropertyValueDescriptor, TTarget extends SchemaTarget | undefined = SchemaTarget | undefined> = Omit<SchemaTextProperty<SchemaPropertyKey, TDescriptor, TTarget>, 'key'>;
|
|
229
|
-
/** Property law accepted by keyed schema-owner maps. */
|
|
230
|
-
type SchemaPropertyDefinition = SchemaElementPropertyDefinition | SchemaTextPropertyDefinition;
|
|
231
|
-
type SchemaContentRule = Readonly<{
|
|
232
|
-
kind: 'all';
|
|
233
|
-
rules: readonly SchemaContentRule[];
|
|
234
|
-
}> | Readonly<{
|
|
235
|
-
kind: 'any';
|
|
236
|
-
rules: readonly SchemaContentRule[];
|
|
237
|
-
}> | Readonly<{
|
|
238
|
-
group: string;
|
|
239
|
-
kind: 'group';
|
|
240
|
-
}> | Readonly<{
|
|
241
|
-
kind: 'not';
|
|
242
|
-
rule: SchemaContentRule;
|
|
243
|
-
}> | Readonly<{
|
|
244
|
-
kind: 'open';
|
|
245
|
-
}> | Readonly<{
|
|
246
|
-
kind: 'text';
|
|
247
|
-
}> | Readonly<{
|
|
248
|
-
kind: 'type';
|
|
249
|
-
type: string;
|
|
250
|
-
}> | Readonly<{
|
|
251
|
-
kind: 'types';
|
|
252
|
-
types: readonly string[];
|
|
253
|
-
}>;
|
|
254
|
-
/**
|
|
255
|
-
* The child content creates when it needs one: an empty text, or a `type`
|
|
256
|
-
* element with optional `properties`, such as a heading's required `level`.
|
|
257
|
-
*/
|
|
258
|
-
type SchemaContentDefault = 'text' | Readonly<{
|
|
259
|
-
properties?: Readonly<Record<string, EditorJsonValue>>;
|
|
260
|
-
type: string;
|
|
261
|
-
}>;
|
|
262
|
-
type SchemaContentOptions = Readonly<{
|
|
263
|
-
default?: SchemaContentDefault;
|
|
264
|
-
max?: number;
|
|
265
|
-
min?: number;
|
|
266
|
-
}>;
|
|
267
|
-
/** One required child at a fixed position before ordinary content. */
|
|
268
|
-
type SchemaContentPrefixSlot = Readonly<{
|
|
269
|
-
element: string | Readonly<{
|
|
270
|
-
source: string;
|
|
271
|
-
type: string;
|
|
272
|
-
}>;
|
|
273
|
-
properties?: Readonly<Record<string, EditorJsonValue>>;
|
|
274
|
-
}>;
|
|
275
|
-
type SchemaContentRuleWitness<TAllowed extends SchemaContentRule> = Readonly<{
|
|
276
|
-
/**
|
|
277
|
-
* Exact rule witness; absent from runtime values.
|
|
278
|
-
*
|
|
279
|
-
* @internal
|
|
280
|
-
*/
|
|
281
|
-
'~schema.content.rule'?: TAllowed;
|
|
282
|
-
}>;
|
|
283
|
-
type SchemaContent<TAllowed extends SchemaContentRule = SchemaContentRule, TOptions extends SchemaContentOptions | undefined = undefined> = Readonly<{
|
|
284
|
-
allowed: TAllowed;
|
|
285
|
-
prefix?: readonly SchemaContentPrefixSlot[];
|
|
286
|
-
} & ([TOptions] extends [undefined] ? SchemaContentOptions : TOptions) & ([SchemaContentRule] extends [TAllowed] ? {} : SchemaContentRuleWitness<TAllowed>)>;
|
|
287
|
-
type SchemaContentInput = SchemaContent | SchemaContentRule;
|
|
288
|
-
type SchemaContentRootOwnership = 'exclusive' | 'shared';
|
|
289
|
-
/**
|
|
290
|
-
* A content root whose top-level blocks are members of a set: a text selection
|
|
291
|
-
* stays in one member, and range removal never crosses two. Members keep their
|
|
292
|
-
* stored order.
|
|
293
|
-
*/
|
|
294
|
-
type SchemaContentRootStructure = Readonly<{
|
|
295
|
-
kind: 'set';
|
|
296
|
-
}>;
|
|
297
|
-
/** One element-owned named-root grammar and its ownership law. */
|
|
298
|
-
type SchemaContentRoot<TContent extends SchemaContent = SchemaContent, TOwnership extends SchemaContentRootOwnership = SchemaContentRootOwnership> = Readonly<{
|
|
299
|
-
content: TContent;
|
|
300
|
-
ownership: TOwnership;
|
|
301
|
-
/** Needs `ownership: 'exclusive'` and a void owner. */
|
|
302
|
-
structure?: SchemaContentRootStructure;
|
|
303
|
-
}>;
|
|
304
|
-
/** Shared roots may use their grammar directly; ownership defaults to shared. */
|
|
305
|
-
type SchemaContentRootInput = SchemaContent | SchemaContentRoot;
|
|
306
|
-
/** One set of keyed records the document keeps beside its children. */
|
|
307
|
-
type SchemaRecordSet = Readonly<{
|
|
308
|
-
/**
|
|
309
|
-
* `retain` leaves this set's puts and drops out of undo and redo, so a
|
|
310
|
-
* record another change still points at outlives the undo of the commit
|
|
311
|
-
* that wrote it.
|
|
312
|
-
*/
|
|
313
|
-
history?: 'retain';
|
|
314
|
-
}>;
|
|
315
|
-
/** One content-root slot projected onto matching element types. */
|
|
316
|
-
type SchemaContentRootContribution<TSlot extends string = string, TRoot extends SchemaContentRoot = SchemaContentRoot, TTarget extends SchemaElementTarget = SchemaElementTarget> = Readonly<TRoot & {
|
|
317
|
-
slot: TSlot;
|
|
318
|
-
target: TTarget;
|
|
319
|
-
}>;
|
|
320
|
-
type SchemaGroupOptions = Readonly<{
|
|
321
|
-
extends?: readonly string[];
|
|
322
|
-
}>;
|
|
323
|
-
type SchemaGroup<TOptions extends SchemaGroupOptions = SchemaGroupOptions> = Readonly<TOptions>;
|
|
324
|
-
type SchemaElementProperties = Readonly<Record<string, PropertyValueDescriptor>>;
|
|
325
|
-
type SchemaElementSlicePolicy = Readonly<{
|
|
326
|
-
endMatter?: boolean;
|
|
327
|
-
preserveContext?: boolean;
|
|
328
|
-
replaceWhenCovered?: boolean;
|
|
329
|
-
}>;
|
|
330
|
-
/** Declarative logical structure read by document comparison and range removal. */
|
|
331
|
-
type SchemaElementStructure = Readonly<{
|
|
332
|
-
kind: 'grid';
|
|
333
|
-
/** Cell column-span property. Only valid for the `cell` role. */
|
|
334
|
-
columnSpan?: string;
|
|
335
|
-
role: 'cell' | 'grid' | 'row';
|
|
336
|
-
/** Cell row-span property. Only valid for the `cell` role. */
|
|
337
|
-
rowSpan?: string;
|
|
338
|
-
}> | Readonly<{
|
|
339
|
-
/** Element property containing the logical nesting depth. */
|
|
340
|
-
depth: string;
|
|
341
|
-
kind: 'list';
|
|
342
|
-
/** Optional element property identifying one logical list. */
|
|
343
|
-
membership?: string;
|
|
344
|
-
}> | Readonly<{
|
|
345
|
-
kind: 'outline';
|
|
346
|
-
/** Element property containing the outline level. */
|
|
347
|
-
level: string;
|
|
348
|
-
}>;
|
|
349
|
-
type SchemaElementInput = Readonly<{
|
|
350
|
-
atom?: boolean;
|
|
351
|
-
content?: SchemaContent;
|
|
352
|
-
/** Projected named-root grammars keyed by the element's `childRoots` slot. */
|
|
353
|
-
contentRoots?: Readonly<Record<string, SchemaContentRootInput>>;
|
|
354
|
-
/** Explicit product groups. Structural groups are compiler-derived. */
|
|
355
|
-
groups?: readonly string[];
|
|
356
|
-
inline?: boolean;
|
|
357
|
-
/** Grid and grid cell roles are always isolating, and refuse `false`. */
|
|
358
|
-
isolating?: boolean;
|
|
359
|
-
markableVoid?: boolean;
|
|
360
|
-
object?: boolean;
|
|
361
|
-
/**
|
|
362
|
-
* Declares the text block a structure of its own, such as a code block:
|
|
363
|
-
* `tx.break.exit` leaves it before any container around it. Text blocks
|
|
364
|
-
* only; voids and objects always own their exit.
|
|
365
|
-
*/
|
|
366
|
-
ownsExit?: boolean;
|
|
367
|
-
properties?: SchemaElementProperties;
|
|
368
|
-
readOnly?: boolean;
|
|
369
|
-
selectable?: boolean;
|
|
370
|
-
slice?: SchemaElementSlicePolicy;
|
|
371
|
-
structure?: SchemaElementStructure;
|
|
372
|
-
void?: 'block' | 'inline' | 'markable-inline';
|
|
373
|
-
}>;
|
|
374
|
-
type SchemaElement<TInput extends SchemaElementInput = SchemaElementInput> = Readonly<TInput>;
|
|
375
|
-
type SchemaTextBlockOptions = Omit<SchemaElementInput, 'content' | 'inline' | 'void'>;
|
|
376
|
-
/** Immutable compiled content facts exposed by `state.schema.element()`. */
|
|
377
|
-
type EditorSchemaContent = Readonly<{
|
|
378
|
-
allowedElementTypes: readonly string[];
|
|
379
|
-
allowsText: boolean;
|
|
380
|
-
allowsUnknownElements: boolean;
|
|
381
|
-
default: SchemaContentDefault | null;
|
|
382
|
-
max: number | null;
|
|
383
|
-
min: number;
|
|
384
|
-
prefix?: ReadonlyArray<Readonly<{
|
|
385
|
-
properties: Readonly<Record<string, EditorJsonValue>>;
|
|
386
|
-
type: string;
|
|
387
|
-
}>>;
|
|
388
|
-
remainder?: EditorSchemaContent;
|
|
389
|
-
}>;
|
|
390
|
-
/** Immutable compiled element-owned root facts. */
|
|
391
|
-
type EditorSchemaContentRoot = Readonly<{
|
|
392
|
-
content: EditorSchemaContent;
|
|
393
|
-
ownership: SchemaContentRootOwnership;
|
|
394
|
-
structure?: SchemaContentRootStructure;
|
|
395
|
-
}>;
|
|
396
|
-
/** One compiled property identity used by a logical structure facet. */
|
|
397
|
-
type EditorSchemaStructureProperty = SchemaPropertyHandle<string, unknown, 'element'>;
|
|
398
|
-
/** Immutable logical structure facts compiled for one element type. */
|
|
399
|
-
type EditorSchemaElementStructure = Readonly<{
|
|
400
|
-
columnSpan: EditorSchemaStructureProperty | null;
|
|
401
|
-
kind: 'grid';
|
|
402
|
-
role: 'cell' | 'grid' | 'row';
|
|
403
|
-
rowSpan: EditorSchemaStructureProperty | null;
|
|
404
|
-
}> | Readonly<{
|
|
405
|
-
depth: EditorSchemaStructureProperty;
|
|
406
|
-
kind: 'list';
|
|
407
|
-
membership: EditorSchemaStructureProperty | null;
|
|
408
|
-
}> | Readonly<{
|
|
409
|
-
kind: 'outline';
|
|
410
|
-
level: EditorSchemaStructureProperty;
|
|
411
|
-
}>;
|
|
412
|
-
/** Immutable compiled element facts for one declared element type. */
|
|
413
|
-
type EditorSchemaElement = Readonly<{
|
|
414
|
-
behavior: Readonly<{
|
|
415
|
-
atom: boolean;
|
|
416
|
-
inline: boolean;
|
|
417
|
-
isolating: boolean;
|
|
418
|
-
markableVoid: boolean;
|
|
419
|
-
object: boolean;
|
|
420
|
-
/**
|
|
421
|
-
* Whether the element owns its exit, which every void and object does, as
|
|
422
|
-
* does a text block that declares `ownsExit`. `tx.break.exit` treats a
|
|
423
|
-
* selected block that owns its exit as a structure of its own.
|
|
424
|
-
*/
|
|
425
|
-
ownsExit: boolean;
|
|
426
|
-
readOnly: boolean;
|
|
427
|
-
selectable: boolean;
|
|
428
|
-
void: boolean;
|
|
429
|
-
voidKind: SchemaElement['void'] | null;
|
|
430
|
-
}>;
|
|
431
|
-
content: EditorSchemaContent | null;
|
|
432
|
-
contentRoots: Readonly<Record<string, EditorSchemaContentRoot>>;
|
|
433
|
-
groups: readonly string[];
|
|
434
|
-
propertyIds: readonly string[];
|
|
435
|
-
slice: Readonly<{
|
|
436
|
-
endMatter: boolean;
|
|
437
|
-
preserveContext: boolean;
|
|
438
|
-
replaceWhenCovered: boolean;
|
|
439
|
-
}>;
|
|
440
|
-
structure: EditorSchemaElementStructure | null;
|
|
441
|
-
type: string;
|
|
442
|
-
}>;
|
|
443
|
-
/** Context for resolving one compiled property declaration. */
|
|
444
|
-
type EditorSchemaPropertyQuery = Readonly<{
|
|
445
|
-
/** Immediate parent type first. */
|
|
446
|
-
ancestors?: readonly string[];
|
|
447
|
-
key: string;
|
|
448
|
-
placement: 'element' | 'text';
|
|
449
|
-
/** `null` or omission addresses the implicit primary root. */
|
|
450
|
-
root?: string | null;
|
|
451
|
-
/** Target element type, or text-parent type for text properties. */
|
|
452
|
-
type?: string;
|
|
453
|
-
}>;
|
|
454
|
-
/** Immutable compiled property facts returned by `state.schema.property()`. */
|
|
455
|
-
type EditorSchemaProperty = Readonly<{
|
|
456
|
-
id: string;
|
|
457
|
-
key: SchemaPropertyKey;
|
|
458
|
-
lifecycle: Readonly<{
|
|
459
|
-
copy: SchemaPropertyCopyPolicy;
|
|
460
|
-
inclusive: boolean | null;
|
|
461
|
-
/** Always `preserve` for a text property. */
|
|
462
|
-
landing: SchemaPropertyLandingPolicy;
|
|
463
|
-
split: SchemaPropertySplitPolicy;
|
|
464
|
-
typeChange: SchemaPropertyTypeChangePolicy;
|
|
465
|
-
}>;
|
|
466
|
-
merge: 'replace' | 'set';
|
|
467
|
-
placement: 'element' | 'text';
|
|
468
|
-
role: SchemaPropertyRole;
|
|
469
|
-
target: SchemaTarget | null;
|
|
470
|
-
value: PropertyValueDescriptor;
|
|
471
|
-
}>;
|
|
472
|
-
type EditorSchemaUnknownPolicy = 'preserve' | 'reject';
|
|
473
|
-
/** Exact semantic identity for a schema without application-owned lineage. */
|
|
474
|
-
type DerivedEditorSchemaIdentity = Readonly<{
|
|
475
|
-
fingerprint: string;
|
|
476
|
-
kind: 'derived';
|
|
477
|
-
}>;
|
|
478
|
-
/** Stable application-owned lineage plus its exact semantic fingerprint. */
|
|
479
|
-
type NamedEditorSchemaIdentity = Readonly<{
|
|
480
|
-
fingerprint: string;
|
|
481
|
-
id: string;
|
|
482
|
-
kind: 'named';
|
|
483
|
-
version: number;
|
|
484
|
-
}>;
|
|
485
|
-
/** Published schema identity. Runtime configuration revisions stay separate. */
|
|
486
|
-
type EditorSchemaIdentity = DerivedEditorSchemaIdentity | NamedEditorSchemaIdentity;
|
|
487
|
-
/** Semantic schema resources changed by the last configuration publication. */
|
|
488
|
-
type EditorSchemaDelta = Readonly<{
|
|
489
|
-
constructionTypes: readonly string[];
|
|
490
|
-
elementTypes: readonly string[];
|
|
491
|
-
propertyIds: readonly string[];
|
|
492
|
-
/** `null` identifies the implicit primary root. */
|
|
493
|
-
roots: ReadonlyArray<string | null>;
|
|
494
|
-
}>;
|
|
495
|
-
/** One closed-composition element relationship override. */
|
|
496
|
-
type EditorSchemaElementOverride = Readonly<{
|
|
497
|
-
/** Element type owned by `source` before application overrides. */
|
|
498
|
-
element: string;
|
|
499
|
-
kind: 'element';
|
|
500
|
-
/** Plugin that owns the element declaration. */
|
|
501
|
-
source: string;
|
|
502
|
-
/** Replace the element's child grammar. */
|
|
503
|
-
content?: SchemaContent;
|
|
504
|
-
/** Replace explicit product-group membership. */
|
|
505
|
-
groups?: readonly string[];
|
|
506
|
-
/** Replace the persisted element discriminator. */
|
|
507
|
-
type?: string;
|
|
508
|
-
}>;
|
|
509
|
-
/** One closed-composition property relationship override. */
|
|
510
|
-
type EditorSchemaPropertyOverride = Readonly<{
|
|
511
|
-
/** Compiled id of the property before application overrides. */
|
|
512
|
-
id: string;
|
|
513
|
-
kind: 'property';
|
|
514
|
-
/** Plugin that owns the property declaration. */
|
|
515
|
-
source: string;
|
|
516
|
-
/** Replace the property's target relationship. */
|
|
517
|
-
target?: SchemaTarget | null;
|
|
518
|
-
}>;
|
|
519
|
-
/** Narrow schema policy applied before deterministic compilation. */
|
|
520
|
-
type EditorSchemaOverride = EditorSchemaElementOverride | EditorSchemaPropertyOverride;
|
|
521
|
-
/** Element facets accepted by one closed-application override. */
|
|
522
|
-
type EditorSchemaElementOverrideInput = Readonly<{
|
|
523
|
-
content?: SchemaContent;
|
|
524
|
-
groups?: readonly string[];
|
|
525
|
-
type?: string;
|
|
526
|
-
}>;
|
|
527
|
-
/** Property relationship facets accepted by one closed-application override. */
|
|
528
|
-
type EditorSchemaPropertyOverrideInput = Readonly<{
|
|
529
|
-
target?: SchemaTarget | null;
|
|
530
|
-
}>;
|
|
531
|
-
/** Source-bound policy authored before the owning schema is compiled. */
|
|
532
|
-
type EditorSchemaOverrideSourceName<TSource> = TSource extends string ? TSource : TSource extends Readonly<{
|
|
533
|
-
name: infer TName extends string;
|
|
534
|
-
}> ? TName : never;
|
|
535
|
-
type EditorSchemaOverrideInput<TSource extends string | Readonly<{
|
|
536
|
-
name: string;
|
|
537
|
-
}> = string | Readonly<{
|
|
538
|
-
name: string;
|
|
539
|
-
}>, TProperties extends Readonly<Record<string, EditorSchemaPropertyOverrideInput>> = Readonly<Record<string, EditorSchemaPropertyOverrideInput>>> = Readonly<{
|
|
540
|
-
element?: EditorSchemaElementOverrideInput;
|
|
541
|
-
kind: 'schema-override';
|
|
542
|
-
properties?: TProperties;
|
|
543
|
-
source: EditorSchemaOverrideSourceName<TSource>;
|
|
544
|
-
}>;
|
|
545
|
-
/** One partial schema declaration. Complete lineage and primary-root fields are forbidden. */
|
|
546
|
-
type EditorSchemaContribution<TElements extends Readonly<Record<string, SchemaElement>> = Readonly<Record<string, SchemaElement>>, TProperties extends readonly SchemaProperty[] = readonly SchemaProperty[], TGroups extends Readonly<Record<string, SchemaGroup>> = Readonly<Record<string, SchemaGroup>>, TRoots extends Readonly<Record<string, SchemaContent>> = Readonly<Record<string, SchemaContent>>, TContentRoots extends readonly SchemaContentRootContribution[] = readonly SchemaContentRootContribution[]> = Readonly<{
|
|
547
|
-
/** Element-owned root slots projected onto matching element types. */
|
|
548
|
-
contentRoots?: TContentRoots;
|
|
549
|
-
elements?: TElements;
|
|
550
|
-
groups?: TGroups;
|
|
551
|
-
id?: never;
|
|
552
|
-
/** Closed-composition policy; ordinary feature contributions omit this. */
|
|
553
|
-
overrides?: readonly EditorSchemaOverride[];
|
|
554
|
-
properties?: TProperties;
|
|
555
|
-
/**
|
|
556
|
-
* Keyed record sets beside the document's children, such as review records.
|
|
557
|
-
* Changes, history and collaboration carry them; no read of `children` or
|
|
558
|
-
* `roots` meets them.
|
|
559
|
-
*/
|
|
560
|
-
records?: Readonly<Record<string, SchemaRecordSet>>;
|
|
561
|
-
/** The complete schema definition exclusively owns the primary root. */
|
|
562
|
-
root?: never;
|
|
563
|
-
/** Named secondary roots only. The reserved key `main` is invalid. */
|
|
564
|
-
roots?: TRoots;
|
|
565
|
-
unknown?: never;
|
|
566
|
-
version?: never;
|
|
567
|
-
}>;
|
|
568
|
-
type EditorSchemaDefinitionBase<TElements extends Readonly<Record<string, SchemaElement>>, TProperties extends readonly SchemaProperty[], TGroups extends Readonly<Record<string, SchemaGroup>>, TRoots extends Readonly<Record<string, SchemaContent>>, TContentRoots extends readonly SchemaContentRootContribution[]> = Readonly<{
|
|
569
|
-
contentRoots?: TContentRoots;
|
|
570
|
-
elements?: TElements;
|
|
571
|
-
groups?: TGroups;
|
|
572
|
-
overrides?: never;
|
|
573
|
-
properties?: TProperties;
|
|
574
|
-
/** Keyed record sets beside the document's children. */
|
|
575
|
-
records?: Readonly<Record<string, SchemaRecordSet>>;
|
|
576
|
-
/** The implicit primary document root. */
|
|
577
|
-
root: SchemaContent;
|
|
578
|
-
/** Named secondary roots only. The reserved key `main` is invalid. */
|
|
579
|
-
roots?: TRoots;
|
|
580
|
-
unknown?: EditorSchemaUnknownPolicy;
|
|
581
|
-
}>;
|
|
582
|
-
/** One complete schema whose identity is derived only from compiled semantics. */
|
|
583
|
-
type EditorSchemaDerivedDefinition<TElements extends Readonly<Record<string, SchemaElement>> = Readonly<Record<string, SchemaElement>>, TProperties extends readonly SchemaProperty[] = readonly SchemaProperty[], TGroups extends Readonly<Record<string, SchemaGroup>> = Readonly<Record<string, SchemaGroup>>, TRoots extends Readonly<Record<string, SchemaContent>> = Readonly<Record<string, SchemaContent>>, TContentRoots extends readonly SchemaContentRootContribution[] = readonly SchemaContentRootContribution[]> = EditorSchemaDefinitionBase<TElements, TProperties, TGroups, TRoots, TContentRoots> & Readonly<{
|
|
584
|
-
id?: never;
|
|
585
|
-
version?: never;
|
|
586
|
-
}>;
|
|
587
|
-
/** One complete schema with application-owned persisted lineage. */
|
|
588
|
-
type EditorSchemaNamedDefinition<TId extends string = string, TElements extends Readonly<Record<string, SchemaElement>> = Readonly<Record<string, SchemaElement>>, TProperties extends readonly SchemaProperty[] = readonly SchemaProperty[], TGroups extends Readonly<Record<string, SchemaGroup>> = Readonly<Record<string, SchemaGroup>>, TRoots extends Readonly<Record<string, SchemaContent>> = Readonly<Record<string, SchemaContent>>, TContentRoots extends readonly SchemaContentRootContribution[] = readonly SchemaContentRootContribution[]> = EditorSchemaDefinitionBase<TElements, TProperties, TGroups, TRoots, TContentRoots> & Readonly<{
|
|
589
|
-
id: TId;
|
|
590
|
-
identity?: never;
|
|
591
|
-
version: number;
|
|
592
|
-
}>;
|
|
593
|
-
type EditorSchemaDefinition<TId extends string = string, TElements extends Readonly<Record<string, SchemaElement>> = Readonly<Record<string, SchemaElement>>, TProperties extends readonly SchemaProperty[] = readonly SchemaProperty[], TGroups extends Readonly<Record<string, SchemaGroup>> = Readonly<Record<string, SchemaGroup>>, TRoots extends Readonly<Record<string, SchemaContent>> = Readonly<Record<string, SchemaContent>>, TContentRoots extends readonly SchemaContentRootContribution[] = readonly SchemaContentRootContribution[]> = EditorSchemaDerivedDefinition<TElements, TProperties, TGroups, TRoots, TContentRoots> | EditorSchemaNamedDefinition<TId, TElements, TProperties, TGroups, TRoots, TContentRoots>;
|
|
594
|
-
type EditorSchemaDeclaration = EditorSchemaContribution | EditorSchemaDefinition;
|
|
595
|
-
/** A complete schema packaged as one editor plugin contribution. */
|
|
596
|
-
type EditorSchemaPlugin<TDefinition extends EditorSchemaDefinition = EditorSchemaDefinition, TName extends string = string> = Readonly<{
|
|
597
|
-
name: TName;
|
|
598
|
-
schema: TDefinition;
|
|
599
|
-
}>;
|
|
600
|
-
type SchemaDefinitionOf<TSchema extends EditorSchemaSource> = TSchema extends EditorSchemaSourceProvider<infer TDeclarationFactory> ? ReturnType<TDeclarationFactory> : TSchema extends {
|
|
601
|
-
schema: infer TSchemaDeclaration;
|
|
602
|
-
} ? TSchemaDeclaration extends ((...args: any[]) => infer TDeclaration) ? Extract<TDeclaration, EditorSchemaDeclaration> : Extract<TSchemaDeclaration, EditorSchemaDeclaration> : never;
|
|
603
|
-
type SchemaElementTypes<TSchema extends EditorSchemaSource> = Extract<keyof NonNullable<SchemaDefinitionOf<TSchema>['elements']>, string>;
|
|
604
|
-
type SchemaElementHandle<TSchema extends object = EditorSchemaSource, TType extends string = TSchema extends EditorSchemaSource ? SchemaElementTypes<TSchema> : string> = Readonly<{
|
|
605
|
-
kind: 'schema-element';
|
|
606
|
-
schema: TSchema;
|
|
607
|
-
type: TType;
|
|
608
|
-
}>;
|
|
609
|
-
type SchemaBuiltInGroupName = 'all' | 'block' | 'element' | 'inline' | 'text' | 'textBlock';
|
|
610
|
-
type SchemaGroupNames<TSchema extends EditorSchemaSource> = SchemaBuiltInGroupName | Extract<keyof NonNullable<SchemaDefinitionOf<TSchema>['groups']>, string>;
|
|
611
|
-
type SchemaRootNames<TSchema extends EditorSchemaSource> = Extract<keyof NonNullable<SchemaDefinitionOf<TSchema>['roots']>, string>;
|
|
612
|
-
type SchemaPropertyName<TKey extends SchemaPropertyKey> = TKey extends string ? TKey : TKey extends SchemaKeyPrefix ? `${TKey['prefix']}${string}` : never;
|
|
613
|
-
type SchemaPropertyLabel<TKey extends SchemaPropertyKey> = TKey extends string ? TKey : TKey extends SchemaKeyPrefix ? `${TKey['prefix']}*` : never;
|
|
614
|
-
type SchemaOwnedPropertyRecord<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = NonNullable<SchemaDefinitionOf<TSchema>['elements']>[TType] extends SchemaElement<infer TInput> ? TInput extends {
|
|
615
|
-
properties: infer TProperties;
|
|
616
|
-
} ? TProperties extends SchemaElementProperties ? TProperties : Readonly<Record<never, never>> : Readonly<Record<never, never>> : Readonly<Record<never, never>>;
|
|
617
|
-
type SchemaElementInputForType<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = NonNullable<SchemaDefinitionOf<TSchema>['elements']>[TType] extends SchemaElement<infer TInput> ? TInput : SchemaElementInput;
|
|
618
|
-
type SchemaTargetAnd<TMatch> = false extends TMatch ? false : 'unknown' extends TMatch ? 'unknown' : true;
|
|
619
|
-
type SchemaTargetOr<TMatch> = true extends TMatch ? true : 'unknown' extends TMatch ? 'unknown' : false;
|
|
620
|
-
type SchemaTargetNot<TMatch> = [TMatch] extends [true] ? false : [TMatch] extends [false] ? true : 'unknown';
|
|
621
|
-
type SchemaTargetCollapse<TMatch> = [TMatch] extends [true] ? true : [TMatch] extends [false] ? false : 'unknown';
|
|
622
|
-
type SchemaIsUnion<TValue, TWhole = TValue> = TValue extends unknown ? [TWhole] extends [TValue] ? false : true : never;
|
|
623
|
-
type SchemaHasRuntimeUnion<TValue> = true extends SchemaIsUnion<TValue> ? true : false;
|
|
624
|
-
type SchemaVoidIsInline<TVoid> = [TVoid] extends ['inline' | 'markable-inline'] ? true : [Extract<TVoid, 'inline' | 'markable-inline'>] extends [never] ? false : 'unknown';
|
|
625
|
-
type SchemaElementIsInlineVariant<TInput> = SchemaElementInput extends TInput ? 'unknown' : TInput extends {
|
|
626
|
-
inline: infer TInline;
|
|
627
|
-
} ? [TInline] extends [true] ? true : [TInline] extends [false] ? false : 'unknown' : TInput extends {
|
|
628
|
-
void: infer TVoid;
|
|
629
|
-
} ? SchemaVoidIsInline<TVoid> : false;
|
|
630
|
-
type SchemaElementIsInline<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = SchemaTargetCollapse<SchemaElementInputForType<TSchema, TType> extends (infer TInput) ? TInput extends unknown ? SchemaElementIsInlineVariant<TInput> : never : 'unknown'>;
|
|
631
|
-
type SchemaElementDerivedGroupMatch<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TGroup extends string> = TGroup extends 'all' | 'element' ? true : TGroup extends 'inline' ? SchemaElementIsInline<TSchema, TType> : TGroup extends 'block' ? SchemaTargetNot<SchemaElementIsInline<TSchema, TType>> : false;
|
|
632
|
-
type SchemaGroupListReachesVariant<TSchema extends EditorSchemaSource, TGroups extends readonly string[], TTarget extends string, TSeen extends string> = number extends TGroups['length'] ? 'unknown' : TGroups extends readonly [infer THead extends string, ...infer TTail extends readonly string[]] ? SchemaTargetOr<SchemaGroupReaches<TSchema, THead, TTarget, TSeen> | SchemaGroupListReachesVariant<TSchema, TTail, TTarget, TSeen>> : false;
|
|
633
|
-
type SchemaGroupListReaches<TSchema extends EditorSchemaSource, TGroups extends readonly string[], TTarget extends string, TSeen extends string> = SchemaTargetCollapse<TGroups extends unknown ? SchemaGroupListReachesVariant<TSchema, TGroups, TTarget, TSeen> : never>;
|
|
634
|
-
type SchemaGroupReachesVariant<TSchema extends EditorSchemaSource, TCurrent extends string, TTarget extends string, TSeen extends string = never> = TCurrent extends TTarget ? true : TCurrent extends TSeen ? false : TCurrent extends SchemaGroupNames<TSchema> ? NonNullable<SchemaDefinitionOf<TSchema>['groups']>[TCurrent] extends (infer TDefinition) ? TDefinition extends object ? 'extends' extends keyof TDefinition ? TDefinition extends {
|
|
635
|
-
extends: infer TParents extends readonly string[];
|
|
636
|
-
} ? SchemaGroupListReaches<TSchema, TParents, TTarget, TSeen | TCurrent> : 'unknown' : false : 'unknown' : 'unknown' : false;
|
|
637
|
-
type SchemaGroupReaches<TSchema extends EditorSchemaSource, TCurrent extends string, TTarget extends string, TSeen extends string = never> = string extends TCurrent | TTarget ? 'unknown' : SchemaTargetCollapse<TCurrent extends unknown ? SchemaGroupReachesVariant<TSchema, TCurrent, TTarget, TSeen> : never>;
|
|
638
|
-
type SchemaElementDeclaredGroupMatchVariant<TSchema extends EditorSchemaSource, TInput, TGroup extends string> = SchemaElementInput extends TInput ? 'unknown' : TInput extends {
|
|
639
|
-
groups: infer TGroups extends readonly string[];
|
|
640
|
-
} ? SchemaGroupListReaches<TSchema, TGroups, TGroup, never> : false;
|
|
641
|
-
type SchemaElementDeclaredGroupMatch<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TGroup extends string> = SchemaTargetCollapse<SchemaElementInputForType<TSchema, TType> extends (infer TInput) ? TInput extends unknown ? SchemaElementDeclaredGroupMatchVariant<TSchema, TInput, TGroup> : never : 'unknown'>;
|
|
642
|
-
type SchemaElementInGroup<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TGroup extends string> = SchemaTargetOr<SchemaElementDerivedGroupMatch<TSchema, TType, TGroup> | SchemaElementDeclaredGroupMatch<TSchema, TType, TGroup>>;
|
|
643
|
-
type SchemaTypeListContainsVariant<TTypes extends readonly string[], TType extends string> = number extends TTypes['length'] ? 'unknown' : TTypes extends readonly [infer THead extends string, ...infer TTail extends readonly string[]] ? SchemaHasRuntimeUnion<THead> extends true ? 'unknown' : SchemaTargetOr<(TType extends THead ? true : false) | SchemaTypeListContainsVariant<TTail, TType>> : false;
|
|
644
|
-
type SchemaTypeListContains<TTypes extends readonly string[], TType extends string> = SchemaTargetCollapse<TTypes extends unknown ? SchemaTypeListContainsVariant<TTypes, TType> : never>;
|
|
645
|
-
type SchemaTargetListAndVariant<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TTargets extends readonly SchemaTarget[], TAncestors extends readonly string[] | undefined, TRoot extends string | null | undefined> = number extends TTargets['length'] ? 'unknown' : TTargets extends readonly [infer THead extends SchemaTarget, ...infer TTail extends readonly SchemaTarget[]] ? SchemaTargetAnd<SchemaTargetMatch<TSchema, TType, THead, TAncestors, TRoot> | SchemaTargetListAndVariant<TSchema, TType, TTail, TAncestors, TRoot>> : true;
|
|
646
|
-
type SchemaTargetListAnd<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TTargets extends readonly SchemaTarget[], TAncestors extends readonly string[] | undefined, TRoot extends string | null | undefined> = SchemaTargetCollapse<TTargets extends unknown ? SchemaTargetListAndVariant<TSchema, TType, TTargets, TAncestors, TRoot> : never>;
|
|
647
|
-
type SchemaTargetListOrVariant<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TTargets extends readonly SchemaTarget[], TAncestors extends readonly string[] | undefined, TRoot extends string | null | undefined> = number extends TTargets['length'] ? 'unknown' : TTargets extends readonly [infer THead extends SchemaTarget, ...infer TTail extends readonly SchemaTarget[]] ? SchemaTargetOr<SchemaTargetMatch<TSchema, TType, THead, TAncestors, TRoot> | SchemaTargetListOrVariant<TSchema, TType, TTail, TAncestors, TRoot>> : false;
|
|
648
|
-
type SchemaTargetListOr<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TTargets extends readonly SchemaTarget[], TAncestors extends readonly string[] | undefined, TRoot extends string | null | undefined> = SchemaTargetCollapse<TTargets extends unknown ? SchemaTargetListOrVariant<TSchema, TType, TTargets, TAncestors, TRoot> : never>;
|
|
649
|
-
type SchemaTargetMatchVariant<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TTarget extends SchemaTarget, TAncestors extends readonly string[] | undefined = undefined, TRoot extends string | null | undefined = undefined> = TTarget extends {
|
|
650
|
-
kind: 'type';
|
|
651
|
-
type: infer TTargetType extends string;
|
|
652
|
-
} ? SchemaHasRuntimeUnion<TTargetType> extends true ? 'unknown' : string extends TTargetType ? 'unknown' : TType extends TTargetType ? true : false : TTarget extends SchemaTypesTarget<infer TTypes> ? SchemaTypeListContains<TTypes, TType> : TTarget extends {
|
|
653
|
-
group: infer TGroup extends string;
|
|
654
|
-
kind: 'group';
|
|
655
|
-
} ? SchemaHasRuntimeUnion<TGroup> extends true ? 'unknown' : string extends TGroup ? 'unknown' : SchemaElementInGroup<TSchema, TType, TGroup> : TTarget extends {
|
|
656
|
-
kind: 'and';
|
|
657
|
-
targets: infer TTargets extends readonly SchemaTarget[];
|
|
658
|
-
} ? SchemaTargetListAnd<TSchema, TType, TTargets, TAncestors, TRoot> : TTarget extends {
|
|
659
|
-
kind: 'or';
|
|
660
|
-
targets: infer TTargets extends readonly SchemaTarget[];
|
|
661
|
-
} ? SchemaTargetListOr<TSchema, TType, TTargets, TAncestors, TRoot> : TTarget extends {
|
|
662
|
-
kind: 'not';
|
|
663
|
-
target: infer TChild extends SchemaTarget;
|
|
664
|
-
} ? SchemaTargetNot<SchemaTargetMatch<TSchema, TType, TChild, TAncestors, TRoot>> : TTarget extends {
|
|
665
|
-
kind: 'root';
|
|
666
|
-
root: infer TTargetRoot extends string | null;
|
|
667
|
-
} ? [TRoot] extends [undefined] ? 'unknown' : string extends Exclude<TRoot, null | undefined> ? 'unknown' : SchemaHasRuntimeUnion<TRoot> extends true ? 'unknown' : [TRoot] extends [TTargetRoot] ? [TTargetRoot] extends [TRoot] ? true : false : false : TTarget extends {
|
|
668
|
-
kind: 'parent';
|
|
669
|
-
target: infer TParentTarget extends SchemaTarget;
|
|
670
|
-
} ? [TAncestors] extends [undefined] ? 'unknown' : TAncestors extends readonly [infer TParent extends SchemaElementTypes<TSchema>, ...infer TRest extends readonly string[]] ? SchemaTargetMatch<TSchema, TParent, TParentTarget, TRest, TRoot> : number extends NonNullable<TAncestors>['length'] ? 'unknown' : false : 'unknown';
|
|
671
|
-
type SchemaTargetMatch<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TTarget extends SchemaTarget, TAncestors extends readonly string[] | undefined = undefined, TRoot extends string | null | undefined = undefined> = SchemaTarget extends TTarget ? 'unknown' : SchemaElementTarget extends TTarget ? 'unknown' : SchemaTargetCollapse<TTarget extends unknown ? SchemaTargetMatchVariant<TSchema, TType, TTarget, TAncestors, TRoot> : never>;
|
|
672
|
-
type SchemaOwnedContentRootSlots<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = SchemaElementInputForType<TSchema, TType> extends (infer TInput) ? TInput extends {
|
|
673
|
-
contentRoots: infer TRoots extends Readonly<Record<string, SchemaContentRootInput>>;
|
|
674
|
-
} ? Extract<keyof TRoots, string> : never : never;
|
|
675
|
-
type SchemaDeclaredContentRoot<TSchema extends EditorSchemaSource> = NonNullable<SchemaDefinitionOf<TSchema>['contentRoots']>[number];
|
|
676
|
-
type SchemaTargetedContentRootSlot<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TRoot = SchemaDeclaredContentRoot<TSchema>> = TRoot extends SchemaContentRootContribution<infer TSlot, SchemaContentRoot, infer TTarget> ? [SchemaTargetMatch<TSchema, TType, TTarget>] extends [true] ? TSlot : never : never;
|
|
677
|
-
/** Required `childRoots` slots inferred for one schema element type. */
|
|
678
|
-
type SchemaContentRootSlotsFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = SchemaOwnedContentRootSlots<TSchema, TType> | SchemaTargetedContentRootSlot<TSchema, TType>;
|
|
679
|
-
type SchemaElementContentRootsFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = SchemaContentRootSlotsFor<TSchema, TType> extends (infer TSlots extends string) ? [TSlots] extends [never] ? Readonly<Record<never, never>> : Readonly<{
|
|
680
|
-
childRoots: Readonly<Record<TSlots, string>>;
|
|
681
|
-
}> : never;
|
|
682
|
-
type SchemaOwnedElementPropertyEntry<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = { [TKey in Extract<keyof SchemaOwnedPropertyRecord<TSchema, TType>, string>]: {
|
|
683
|
-
definite: true;
|
|
684
|
-
key: TKey;
|
|
685
|
-
placement: 'element';
|
|
686
|
-
value: SchemaOwnedPropertyRecord<TSchema, TType>[TKey];
|
|
687
|
-
}; }[Extract<keyof SchemaOwnedPropertyRecord<TSchema, TType>, string>];
|
|
688
|
-
type SchemaDeclaredProperty<TSchema extends EditorSchemaSource> = NonNullable<SchemaDefinitionOf<TSchema>['properties']>[number];
|
|
689
|
-
type SchemaTargetedElementPropertyEntry<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TAncestors extends readonly string[] | undefined = undefined, TRoot extends string | null | undefined = undefined, TIncludePossible extends boolean = false, TProperty = SchemaDeclaredProperty<TSchema>> = TProperty extends SchemaElementProperty<infer TKey, infer TDescriptor, infer TTarget> ? SchemaTargetMatch<TSchema, TType, TTarget, TAncestors, TRoot> extends (infer TMatch) ? TIncludePossible extends true ? [TMatch] extends [false] ? never : {
|
|
690
|
-
definite: [TMatch] extends [true] ? true : false;
|
|
691
|
-
key: TKey;
|
|
692
|
-
placement: 'element';
|
|
693
|
-
value: TDescriptor;
|
|
694
|
-
} : [TMatch] extends [true] ? {
|
|
695
|
-
definite: true;
|
|
696
|
-
key: TKey;
|
|
697
|
-
placement: 'element';
|
|
698
|
-
value: TDescriptor;
|
|
699
|
-
} : never : never : never;
|
|
700
|
-
type SchemaElementPropertyEntry<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TAncestors extends readonly string[] | undefined = undefined, TRoot extends string | null | undefined = undefined, TIncludePossible extends boolean = false> = SchemaOwnedElementPropertyEntry<TSchema, TType> | SchemaTargetedElementPropertyEntry<TSchema, TType, TAncestors, TRoot, TIncludePossible>;
|
|
701
|
-
type SchemaTextPropertyEntry<TSchema extends EditorSchemaSource, TParent extends SchemaElementTypes<TSchema> | undefined = undefined, TAncestors extends readonly string[] | undefined = undefined, TRoot extends string | null | undefined = undefined, TIncludePossible extends boolean = false, TProperty = SchemaDeclaredProperty<TSchema>> = TProperty extends SchemaTextProperty<infer TKey, infer TDescriptor, infer TTarget extends SchemaTarget | undefined> ? TTarget extends SchemaTarget ? TParent extends SchemaElementTypes<TSchema> ? SchemaTargetMatch<TSchema, TParent, TTarget, TAncestors, TRoot> extends (infer TMatch) ? TIncludePossible extends true ? [TMatch] extends [false] ? never : {
|
|
702
|
-
definite: [TMatch] extends [true] ? true : false;
|
|
703
|
-
key: TKey;
|
|
704
|
-
placement: 'text';
|
|
705
|
-
value: TDescriptor;
|
|
706
|
-
} : [TMatch] extends [true] ? {
|
|
707
|
-
definite: true;
|
|
708
|
-
key: TKey;
|
|
709
|
-
placement: 'text';
|
|
710
|
-
value: TDescriptor;
|
|
711
|
-
} : never : never : TIncludePossible extends true ? {
|
|
712
|
-
definite: false;
|
|
713
|
-
key: TKey;
|
|
714
|
-
placement: 'text';
|
|
715
|
-
value: TDescriptor;
|
|
716
|
-
} : never : {
|
|
717
|
-
definite: true;
|
|
718
|
-
key: TKey;
|
|
719
|
-
placement: 'text';
|
|
720
|
-
value: TDescriptor;
|
|
721
|
-
} : never;
|
|
722
|
-
type SchemaEntryKey<TEntry> = TEntry extends {
|
|
723
|
-
key: infer TKey extends SchemaPropertyKey;
|
|
724
|
-
} ? SchemaPropertyName<TKey> : never;
|
|
725
|
-
type SchemaEntryValue<TEntry, TKey extends string> = TEntry extends {
|
|
726
|
-
key: infer TPropertyKey extends SchemaPropertyKey;
|
|
727
|
-
value: infer TDescriptor;
|
|
728
|
-
} ? TPropertyKey extends string ? TKey extends TPropertyKey ? PropertyValueOf<TDescriptor> : never : TPropertyKey extends SchemaKeyPrefix ? TKey extends `${TPropertyKey['prefix']}${string}` ? PropertyValueOf<TDescriptor> : never : never : never;
|
|
729
|
-
type SchemaEntryRequiredKey<TEntry> = TEntry extends {
|
|
730
|
-
definite: true;
|
|
731
|
-
key: infer TKey extends string;
|
|
732
|
-
value: infer TDescriptor;
|
|
733
|
-
} ? TDescriptor extends {
|
|
734
|
-
required: true;
|
|
735
|
-
} ? TKey : PropertyOptionsOf<TDescriptor> extends {
|
|
736
|
-
generate: (...args: never[]) => unknown;
|
|
737
|
-
} ? TKey : PropertyOptionsOf<TDescriptor> extends {
|
|
738
|
-
default: unknown;
|
|
739
|
-
} ? TDescriptor extends {
|
|
740
|
-
omitDefault: false;
|
|
741
|
-
} ? TKey : never : never : never;
|
|
742
|
-
type SchemaEntryConstructionRequiredKey<TEntry> = TEntry extends {
|
|
743
|
-
definite: true;
|
|
744
|
-
key: infer TKey extends string;
|
|
745
|
-
value: infer TDescriptor;
|
|
746
|
-
} ? TDescriptor extends {
|
|
747
|
-
required: true;
|
|
748
|
-
} ? TKey : never : never;
|
|
749
|
-
type SchemaPropertiesFromEntries<TEntry> = Readonly<{ [TKey in SchemaEntryRequiredKey<TEntry>]: SchemaEntryValue<TEntry, TKey>; } & { [TKey in Exclude<SchemaEntryKey<TEntry>, SchemaEntryRequiredKey<TEntry>>]?: SchemaEntryValue<TEntry, TKey>; }>;
|
|
750
|
-
type SchemaConstructionPropertiesFromEntries<TEntry> = Readonly<{ [TKey in SchemaEntryConstructionRequiredKey<TEntry>]: SchemaEntryValue<TEntry, TKey>; } & { [TKey in Exclude<SchemaEntryKey<TEntry>, SchemaEntryConstructionRequiredKey<TEntry>>]?: SchemaEntryValue<TEntry, TKey>; }>;
|
|
751
|
-
/** Element property keys accepted for one schema element type. */
|
|
752
|
-
type SchemaElementPropertyKeys<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = string extends SchemaElementTypes<TSchema> ? string : SchemaEntryKey<SchemaElementPropertyEntry<TSchema, TType, undefined, undefined, true>>;
|
|
753
|
-
/** Optional JSON property values accepted for one schema element type. */
|
|
754
|
-
type SchemaElementPropertiesFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = string extends SchemaElementTypes<TSchema> ? Readonly<Record<string, unknown>> : SchemaPropertiesFromEntries<SchemaElementPropertyEntry<TSchema, TType, undefined, undefined, true>>;
|
|
755
|
-
/** Element properties accepted before schema defaults are materialized. */
|
|
756
|
-
type SchemaElementConstructionPropertiesFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>> = string extends SchemaElementTypes<TSchema> ? Readonly<Record<string, unknown>> : SchemaConstructionPropertiesFromEntries<SchemaElementPropertyEntry<TSchema, TType, undefined, undefined, true>>;
|
|
757
|
-
type SchemaElementPropertyValue<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema>, TKey extends SchemaElementPropertyKeys<TSchema, TType>> = SchemaEntryValue<SchemaElementPropertyEntry<TSchema, TType, undefined, undefined, true>, TKey>;
|
|
758
|
-
declare const schemaPropertyHandleValue: unique symbol;
|
|
759
|
-
/** One exact authored or compiled property identity. */
|
|
760
|
-
type SchemaPropertyHandle<TKey extends SchemaPropertyKey = SchemaPropertyKey, TValue = unknown, TPlacement extends 'element' | 'text' = 'element' | 'text'> = Readonly<{
|
|
761
|
-
id: string;
|
|
762
|
-
key: TKey;
|
|
763
|
-
kind: 'schema-property';
|
|
764
|
-
placement: TPlacement;
|
|
765
|
-
/**
|
|
766
|
-
* Covariant value witness; absent from runtime values.
|
|
767
|
-
*
|
|
768
|
-
* @internal
|
|
769
|
-
*/
|
|
770
|
-
readonly [schemaPropertyHandleValue]?: TValue;
|
|
771
|
-
}>;
|
|
772
|
-
type SchemaPropertyHandleValue<THandle> = THandle extends SchemaPropertyHandle<SchemaPropertyKey, infer TValue> ? TValue : never;
|
|
773
|
-
/** Exact and prefix-pattern text property keys declared by a schema. */
|
|
774
|
-
type SchemaTextPropertyKeys<TSchema extends EditorSchemaSource> = string extends SchemaElementTypes<TSchema> ? string : SchemaEntryKey<SchemaTextPropertyEntry<TSchema, undefined, undefined, undefined, true>>;
|
|
775
|
-
/** Optional JSON property values accepted on schema text leaves. */
|
|
776
|
-
type SchemaTextProperties<TSchema extends EditorSchemaSource> = string extends SchemaElementTypes<TSchema> ? Readonly<Record<string, unknown>> : SchemaPropertiesFromEntries<SchemaTextPropertyEntry<TSchema, undefined, undefined, undefined, true>>;
|
|
777
|
-
type SchemaAllPropertyEntry<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema> = SchemaElementTypes<TSchema>> = TType extends SchemaElementTypes<TSchema> ? SchemaElementPropertyEntry<TSchema, TType> | SchemaTextPropertyEntry<TSchema, undefined, undefined, undefined, true> : never;
|
|
778
|
-
/** Stable compiled property-ID patterns. Hash suffixes remain runtime-derived. */
|
|
779
|
-
type SchemaPropertyIds<TSchema extends EditorSchemaSource> = SchemaAllPropertyEntry<TSchema> extends (infer TEntry) ? TEntry extends {
|
|
780
|
-
key: infer TKey extends SchemaPropertyKey;
|
|
781
|
-
placement: infer TPlacement extends 'element' | 'text';
|
|
782
|
-
} ? `${TPlacement}:${SchemaPropertyLabel<TKey>}@${string}` : never : never;
|
|
783
|
-
/** One text leaf inferred from a frozen schema definition. */
|
|
784
|
-
type SchemaText<TSchema extends EditorSchemaSource> = string extends SchemaElementTypes<TSchema> ? BaseText : Readonly<{
|
|
785
|
-
text: string;
|
|
786
|
-
}> & SchemaTextProperties<TSchema>;
|
|
787
|
-
type SchemaAllElementPropertyEntry<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema> = SchemaElementTypes<TSchema>> = TType extends SchemaElementTypes<TSchema> ? SchemaElementPropertyEntry<TSchema, TType> : never;
|
|
788
|
-
type PreservedSchemaElementProperties<TSchema extends EditorSchemaSource> = { readonly [TKey in SchemaEntryKey<SchemaAllElementPropertyEntry<TSchema>>]?: SchemaEntryValue<SchemaAllElementPropertyEntry<TSchema>, TKey>; };
|
|
789
|
-
type PreservedSchemaElement<TSchema extends EditorSchemaSource> = {
|
|
790
|
-
readonly [key: string]: unknown;
|
|
791
|
-
readonly children: BaseElement['children'];
|
|
792
|
-
readonly type: string;
|
|
793
|
-
} & PreservedSchemaElementProperties<TSchema>;
|
|
794
|
-
type SchemaNodeElementFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema> = SchemaElementTypes<TSchema>> = string extends SchemaElementTypes<TSchema> ? BaseElement : TType extends SchemaElementTypes<TSchema> ? Readonly<{
|
|
795
|
-
children: BaseElement['children'];
|
|
796
|
-
type: TType;
|
|
797
|
-
}> & SchemaElementPropertiesFor<TSchema, TType> & SchemaElementContentRootsFor<TSchema, TType> : never;
|
|
798
|
-
type SchemaNodeTypeProviderFor<TSchema extends EditorSchemaSource> = TSchema extends EditorSchemaSource ? SchemaNodeTypeProvider<Extract<SchemaNodeElementFor<TSchema>, BaseElement>, Extract<SchemaText<TSchema>, BaseText>> : never;
|
|
799
|
-
/**
|
|
800
|
-
* One element variant inferred from a frozen schema definition.
|
|
801
|
-
*
|
|
802
|
-
* Its discriminator and properties are exact. Its descendants stay broad;
|
|
803
|
-
* runtime schema owns parent/child grammar and recursive validation.
|
|
804
|
-
*/
|
|
805
|
-
type SchemaElementFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema> = SchemaElementTypes<TSchema>> = string extends SchemaElementTypes<TSchema> ? BaseElement : TType extends SchemaElementTypes<TSchema> ? Readonly<{
|
|
806
|
-
'~schema.node'?: SchemaNodeTypeProviderFor<TSchema>;
|
|
807
|
-
}> & SchemaNodeElementFor<TSchema, TType> : never;
|
|
808
|
-
/**
|
|
809
|
-
* One schema-owned element shape before it is placed in an installed editor.
|
|
810
|
-
* A descriptor owns its discriminator and properties; runtime schema owns its
|
|
811
|
-
* legal parent/child relationships.
|
|
812
|
-
*/
|
|
813
|
-
type SchemaElementShapeFor<TSchema extends EditorSchemaSource, TType extends SchemaElementTypes<TSchema> = SchemaElementTypes<TSchema>> = string extends SchemaElementTypes<TSchema> ? BaseElement : TType extends SchemaElementTypes<TSchema> ? Readonly<{
|
|
814
|
-
'~schema.node'?: SchemaNodeTypeProviderFor<TSchema>;
|
|
815
|
-
}> & SchemaNodeElementFor<TSchema, TType> : never;
|
|
816
|
-
/** Any descendant accepted by a closed schema definition. */
|
|
817
|
-
type SchemaDescendant<TSchema extends EditorSchemaSource> = string extends SchemaElementTypes<TSchema> ? BaseElement | BaseText : SchemaElementFor<TSchema> | SchemaText<TSchema>;
|
|
818
|
-
/**
|
|
819
|
-
* Finite installed element vocabulary inferred from one complete schema.
|
|
820
|
-
* Runtime schema validates primary and named-root grammar.
|
|
821
|
-
*/
|
|
822
|
-
type SchemaValue<TSchema extends EditorSchemaPlugin> = ReadonlyArray<string extends SchemaElementTypes<TSchema> ? BaseElement : [SchemaElementTypes<TSchema>] extends [never] ? BaseElement : SchemaElementFor<TSchema> | (SchemaDefinitionOf<TSchema>['unknown'] extends 'preserve' ? PreservedSchemaElement<TSchema> : never)> & SchemaValueBrand<SchemaNodeTypeProviderFor<TSchema>>;
|
|
823
|
-
type SchemaDeclarationOf<TInput> = TInput extends readonly unknown[] ? SchemaDeclarationOf<TInput[number]> : TInput extends EditorSchemaPluginProvider<infer TSchemaFactory> ? ReturnType<TSchemaFactory>['schema'] : TInput extends {
|
|
824
|
-
schema: infer TSchema;
|
|
825
|
-
} ? TSchema extends ((...args: any[]) => infer TResult) ? TResult extends EditorSchemaDeclaration ? TResult : never : TSchema extends EditorSchemaDeclaration ? TSchema : never : never;
|
|
826
|
-
type SchemaUnionToIntersection<TValue> = (TValue extends unknown ? (value: TValue) => void : never) extends ((value: infer TIntersection) => void) ? TIntersection : never;
|
|
827
|
-
type SchemaDeclarationElements<TDeclaration> = TDeclaration extends {
|
|
828
|
-
elements?: infer TElements;
|
|
829
|
-
} ? NonNullable<TElements> : Readonly<Record<never, never>>;
|
|
830
|
-
type SchemaDeclarationGroups<TDeclaration> = TDeclaration extends {
|
|
831
|
-
groups?: infer TGroups;
|
|
832
|
-
} ? NonNullable<TGroups> : Readonly<Record<never, never>>;
|
|
833
|
-
type SchemaDeclarationContentRoot<TDeclaration> = TDeclaration extends {
|
|
834
|
-
contentRoots?: ReadonlyArray<infer TContentRoot>;
|
|
835
|
-
} ? Extract<TContentRoot, SchemaContentRootContribution> : never;
|
|
836
|
-
type SchemaDeclarationRoots<TDeclaration> = TDeclaration extends {
|
|
837
|
-
roots?: infer TRoots;
|
|
838
|
-
} ? NonNullable<TRoots> : Readonly<Record<never, never>>;
|
|
839
|
-
type SchemaDeclarationProperty<TDeclaration> = TDeclaration extends {
|
|
840
|
-
properties?: ReadonlyArray<infer TProperty>;
|
|
841
|
-
} ? TProperty : never;
|
|
842
|
-
type SchemaCompleteDeclaration<TInput> = Extract<SchemaDeclarationOf<TInput>, EditorSchemaDefinition>;
|
|
843
|
-
type SchemaDefaultDerivedDefinition = EditorSchemaDerivedDefinition<Readonly<Record<never, never>>, readonly [], Readonly<Record<never, never>>, Readonly<Record<never, never>>>;
|
|
844
|
-
type SchemaCompleteOrDerivedDeclaration<TInput> = [SchemaCompleteDeclaration<TInput>] extends [never] ? SchemaDefaultDerivedDefinition : SchemaCompleteDeclaration<TInput>;
|
|
845
|
-
type SchemaComposedLineage<TComplete extends EditorSchemaDefinition> = TComplete extends {
|
|
846
|
-
id: infer TId extends string;
|
|
847
|
-
version: infer TVersion extends number;
|
|
848
|
-
} ? Readonly<{
|
|
849
|
-
id: TId;
|
|
850
|
-
version: TVersion;
|
|
851
|
-
}> : Readonly<Record<never, never>>;
|
|
852
|
-
type SchemaComposedUnknown<TComplete extends EditorSchemaDefinition> = TComplete extends Readonly<{
|
|
853
|
-
unknown: infer TUnknown extends EditorSchemaUnknownPolicy;
|
|
854
|
-
}> ? TUnknown : 'reject';
|
|
855
|
-
type SchemaComposedDefinition<TInput, TComplete extends EditorSchemaDefinition, TDeclarations = SchemaDeclarationOf<TInput>> = Readonly<{
|
|
856
|
-
contentRoots: ReadonlyArray<SchemaDeclarationContentRoot<TDeclarations>>;
|
|
857
|
-
elements: SchemaUnionToIntersection<SchemaDeclarationElements<TDeclarations>>;
|
|
858
|
-
groups: SchemaUnionToIntersection<SchemaDeclarationGroups<TDeclarations>>;
|
|
859
|
-
properties: ReadonlyArray<SchemaDeclarationProperty<TDeclarations>>;
|
|
860
|
-
root: TComplete['root'];
|
|
861
|
-
roots: SchemaUnionToIntersection<SchemaDeclarationRoots<TDeclarations>>;
|
|
862
|
-
unknown: SchemaComposedUnknown<TComplete>;
|
|
863
|
-
} & SchemaComposedLineage<TComplete>>;
|
|
864
|
-
type SchemaComposedPlugin<TInput> = [SchemaDeclarationOf<TInput>] extends [never] ? never : SchemaCompleteOrDerivedDeclaration<TInput> extends (infer TComplete) ? TComplete extends EditorSchemaDefinition ? SchemaComposedDefinition<TInput, TComplete> extends (infer TDefinition) ? TDefinition extends EditorSchemaDefinition ? EditorSchemaPlugin<TDefinition> : never : never : never : never;
|
|
865
|
-
/** Complete schema vocabulary composed from every installed contribution. */
|
|
866
|
-
type SchemaPluginsOf<TInput> = SchemaComposedPlugin<TInput>;
|
|
867
|
-
/** Default document value derived from the composed installed schema. */
|
|
868
|
-
type SchemaValueFromPlugins<TInput> = SchemaComposedPlugin<TInput> extends (infer TSchema) ? TSchema extends EditorSchemaPlugin ? SchemaValue<TSchema> : never : never;
|
|
869
|
-
//#endregion
|
|
870
|
-
export { DerivedEditorSchemaIdentity, EditorSchemaContent, EditorSchemaContentRoot, EditorSchemaContribution, EditorSchemaDeclaration, EditorSchemaDefinition, EditorSchemaDelta, EditorSchemaDerivedDefinition, EditorSchemaElement, EditorSchemaElementOverride, EditorSchemaElementOverrideInput, EditorSchemaElementStructure, EditorSchemaIdentity, EditorSchemaNamedDefinition, EditorSchemaOverride, EditorSchemaOverrideInput, EditorSchemaPlugin, EditorSchemaProperty, EditorSchemaPropertyOverride, EditorSchemaPropertyOverrideInput, EditorSchemaPropertyQuery, EditorSchemaRepairCode, EditorSchemaStructureProperty, EditorSchemaUnknownPolicy, NamedEditorSchemaIdentity, PropertyBooleanDescriptor, PropertyEnumDescriptor, PropertyJsonDescriptor, PropertyJsonOptions, PropertyNumberDescriptor, PropertyOptionsOf, PropertySetDescriptor, PropertySetOptions, PropertyStringDescriptor, PropertyValidation, PropertyValueDescriptor, PropertyValueKind, PropertyValueOf, PropertyValueOptions, SchemaBuiltInGroupName, SchemaContent, SchemaContentDefault, SchemaContentInput, SchemaContentOptions, SchemaContentPrefixSlot, SchemaContentRoot, SchemaContentRootContribution, SchemaContentRootInput, SchemaContentRootOwnership, SchemaContentRootSlotsFor, SchemaContentRootStructure, SchemaContentRule, SchemaDescendant, SchemaElement, SchemaElementConstructionPropertiesFor, SchemaElementFor, SchemaElementHandle, SchemaElementInput, SchemaElementProperties, SchemaElementPropertiesFor, SchemaElementProperty, SchemaElementPropertyDefinition, SchemaElementPropertyKeys, SchemaElementPropertyOptions, SchemaElementPropertyValue, SchemaElementShapeFor, SchemaElementSlicePolicy, SchemaElementStructure, SchemaElementTarget, SchemaElementTypes, SchemaGroup, SchemaGroupNames, SchemaGroupOptions, SchemaKeyPrefix, SchemaPluginsOf, SchemaProperty, SchemaPropertyCopyPolicy, SchemaPropertyDefinition, SchemaPropertyExclusiveGroup, SchemaPropertyHandle, SchemaPropertyHandleValue, SchemaPropertyIds, SchemaPropertyKey, SchemaPropertyLandingPolicy, SchemaPropertyReferences, SchemaPropertyRole, SchemaPropertySplitPolicy, SchemaPropertyTypeChangePolicy, SchemaRecordSet, SchemaRootNames, SchemaTarget, SchemaText, SchemaTextBlockOptions, SchemaTextProperties, SchemaTextProperty, SchemaTextPropertyDefinition, SchemaTextPropertyKeys, SchemaTextPropertyOptions, SchemaTypesTarget, SchemaValue, SchemaValueFromPlugins };
|