plitejs 54.0.0-beta.5 → 54.0.0-beta.7
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/README.md +4 -4
- package/dist/authored/index.d.ts +25 -8
- package/dist/authored/index.js +4316 -735
- package/dist/{authored-veto-Cu-5JdVj.js → authored-veto-CferDljr.js} +1 -1
- package/dist/clipboard-format-key-CLFcThXH.js +14 -0
- package/dist/{comparison-plan-BJxnVPcS.js → comparison-plan-7iIABSWG.js} +108 -2
- package/dist/{comparison-types-Bvvxzxq2.d.ts → comparison-types-CsmDG5r2.d.ts} +1 -1
- package/dist/{create-editor-XvI_4sYc.js → create-editor-acDgsovY.js} +25 -49
- package/dist/diff/index.d.ts +2 -2
- package/dist/diff/index.js +111 -20
- package/dist/dom/index.d.ts +3 -2
- package/dist/dom/index.js +3 -2
- package/dist/{dom-BjspML2h.js → dom-B5bAma7X.js} +859 -210
- package/dist/history/index.d.ts +1 -1
- package/dist/history/index.js +5302 -4295
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/hyperscript/index.js +1 -1
- package/dist/{hyperscript-BFypA5qW.js → hyperscript-BXUV6sdO.js} +2 -2
- package/dist/{index-BwmXxqbi.d.ts → index-CTTjpWgb.d.ts} +1 -1
- package/dist/{index-DaXz-4c7.d.ts → index-D8DQ1YFB.d.ts} +22 -22
- package/dist/{index-CYac3_ID.d.ts → index-DJvrmSRP.d.ts} +82 -199
- package/dist/{index-BUJsM0oV.d.ts → index-LhVJuuEf.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +5 -5
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/react.d.ts +14 -11
- package/dist/pagination/react.js +150 -103
- package/dist/{pagination-ChDBJtdC.js → pagination-CwjmxPoX.js} +1 -1
- package/dist/{plugin-BvM4s-Lr.js → plugin-BZCGtqMI.js} +8691 -2054
- package/dist/{range-geometry-wFuJaBlA.d.ts → range-geometry-CZari453.d.ts} +1 -1
- package/dist/{range-geometry-B5CITwMp.js → range-geometry-CqWrwkjH.js} +2 -2
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +7 -7
- package/dist/react/virtualized.d.ts +5 -5
- package/dist/react/virtualized.js +12 -7
- package/dist/{react-cmFeNP6P.js → react-DO9IETEQ.js} +128 -126
- package/dist/{retraction-lXQwo2Ia.js → retraction-RHEKiF3h.js} +1 -1
- package/dist/{src-BA6F9yxN.js → src-fLbHzUjC.js} +277 -72
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/{index-QuqD4Dyj.d.ts → tx-only-1FM45FSj.d.ts} +9060 -8608
- package/dist/{editor-owner-CRgIQ625.js → update-policy-C32RjjGt.js} +53 -2
- package/dist/{use-editor-dom-scope-B4gF9t_Y.js → use-editor-dom-scope-CUBnNAZV.js} +6133 -4076
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/dist/yjs/react/index.d.ts +3 -3
- package/dist/yjs/react/index.js +3 -3
- package/dist/{yjs-CWdWDrpv.js → yjs-BMguSAX_.js} +311 -127
- package/package.json +1 -7
- package/dist/annotation-store-metrics-Ccjkef45.js +0 -12
- package/dist/annotations/index.d.ts +0 -2
- package/dist/annotations/index.js +0 -2
- package/dist/index-CRmyGzS8.d.ts +0 -71
- package/dist/mapped-view-store-XUJ-fnHE.js +0 -120
- package/dist/native-grouping-input-8kO12VK9.js +0 -8
- package/dist/store-Bllfuqp4.js +0 -717
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as HyperscriptEditorFixture, c as createText, i as createHyperscript, n as HyperscriptCreators, o as createEditor, r as HyperscriptShorthands, s as createEditorFixture, t as jsx } from "../index-
|
|
1
|
+
import { a as HyperscriptEditorFixture, c as createText, i as createHyperscript, n as HyperscriptCreators, o as createEditor, r as HyperscriptShorthands, s as createEditorFixture, t as jsx } from "../index-CTTjpWgb.js";
|
|
2
2
|
export { type HyperscriptCreators, type HyperscriptEditorFixture, type HyperscriptShorthands, createEditor, createEditorFixture, createHyperscript, createText, jsx };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx } from "../hyperscript-
|
|
1
|
+
import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx } from "../hyperscript-BXUV6sdO.js";
|
|
2
2
|
export { createEditor, createEditorFixture, createHyperscript, createText, jsx };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as createEditor$1 } from "./create-editor-
|
|
1
|
+
import { Cd as TextApi, V as NodeApi, Yt as replace, um as RangeApi, vd as SelectionApi, yd as ElementApi } from "./plugin-BZCGtqMI.js";
|
|
2
|
+
import { a as createEditor$1 } from "./create-editor-acDgsovY.js";
|
|
3
3
|
//#region src/hyperscript/tokens.ts
|
|
4
4
|
/**
|
|
5
5
|
* A weak map to hold anchor tokens.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P_ as Text, S_ as Path, ap as Selection, bg as Descendant, g as Editor, lp as TextSelection, ng as Element } from "./tx-only-1FM45FSj.js";
|
|
2
2
|
//#region src/hyperscript/tokens.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* All tokens inherit from a single constructor for `instanceof` checking.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dg as Node$1, P_ as Text$1, S as EditorCommand, S_ as Path, Sh as SchemaProperty, _r as Plugin, bg as Descendant, g as Editor, l as AnyEditor, ng as Element$1, pr as NodeKey, ri as RootKey, rp as NodeSelection, s_ as Range$1, sc as ContentSlice, sp as SelectionAssociation, v_ as Point, vi as Value, z as EditorCoreStateView } from "./tx-only-1FM45FSj.js";
|
|
2
2
|
import { StandardBehaviorOptions } from "scroll-into-view-if-needed";
|
|
3
3
|
//#region src/dom/utils/dom.d.ts
|
|
4
4
|
/**
|
|
@@ -272,6 +272,7 @@ type DOMDropTargetInput = Readonly<{
|
|
|
272
272
|
dataTransfer?: DataTransfer | null;
|
|
273
273
|
target?: EventTarget | null;
|
|
274
274
|
}>;
|
|
275
|
+
/** Options for resolving a drop target or running a drop at a pointer position. */
|
|
275
276
|
type DOMDropTargetOptions = Readonly<{
|
|
276
277
|
/** Copy instead of move; defaults to the input's modifier. */
|
|
277
278
|
copy?: boolean;
|
|
@@ -299,6 +300,7 @@ type DropIndicator = Readonly<{
|
|
|
299
300
|
}>;
|
|
300
301
|
//#endregion
|
|
301
302
|
//#region src/dom/plugin/dom-geometry.d.ts
|
|
303
|
+
/** Plain bounding rectangle with viewport coordinates and dimensions. */
|
|
302
304
|
type DOMGeometryRect = {
|
|
303
305
|
bottom: number;
|
|
304
306
|
height: number;
|
|
@@ -384,8 +386,6 @@ type ClipboardSliceWrite<V extends Value = Value> = Readonly<{
|
|
|
384
386
|
formats?: Readonly<Record<string, string>>;
|
|
385
387
|
slice: ContentSlice<V>;
|
|
386
388
|
}>;
|
|
387
|
-
/** Read the configured MIME suffix used for exact Plite clipboard payloads. */
|
|
388
|
-
declare const getDOMClipboardFormatKey: (editor: Editor<any, any>) => string;
|
|
389
389
|
/** HTML payload for a serialized Plite fragment. */
|
|
390
390
|
type DOMFragmentDataHtml = ((context: {
|
|
391
391
|
clipboardFormatKey: string;
|
|
@@ -979,6 +979,24 @@ declare const isGeckoDOMHost: (source: unknown) => boolean;
|
|
|
979
979
|
/** True when the current environment exposes the browser DOM APIs Plite needs. */
|
|
980
980
|
declare const CAN_USE_DOM: boolean;
|
|
981
981
|
//#endregion
|
|
982
|
+
//#region src/dom/utils/selection-writes.d.ts
|
|
983
|
+
/** A selection's anchor and focus as DOM points, in selection direction. */
|
|
984
|
+
type DOMSelectionPoints = Readonly<{
|
|
985
|
+
anchor: DOMPoint;
|
|
986
|
+
focus: DOMPoint;
|
|
987
|
+
}>;
|
|
988
|
+
/**
|
|
989
|
+
* Write `points` as `tree`'s selection, keeping their direction, or clear its
|
|
990
|
+
* ranges for null, and record what the tree then shows, or the points written
|
|
991
|
+
* where the tree reads its selection as its host. A selection that already
|
|
992
|
+
* shows them is left alone, and so is the record, unless WebKit got them from
|
|
993
|
+
* a write while their anchor had no layout box, neither the user nor a write
|
|
994
|
+
* of other points has come since, and the anchor has one now.
|
|
995
|
+
*/
|
|
996
|
+
declare const writeDOMSelection: (tree: Document | ShadowRoot, points: DOMSelectionPoints | null) => void;
|
|
997
|
+
/** A copy of `selection`'s range at `index`, safe to keep or change. */
|
|
998
|
+
declare const readDOMSelectionRange: (selection: Selection, index?: number) => Range;
|
|
999
|
+
//#endregion
|
|
982
1000
|
//#region src/dom/plugin/dom-root-runtime.d.ts
|
|
983
1001
|
/** Resolve the mounted DOM root that currently represents an editor. */
|
|
984
1002
|
declare const getEditorDOMRoot: (editor: object) => HTMLElement | null;
|
|
@@ -1052,24 +1070,6 @@ declare const Hotkeys: {
|
|
|
1052
1070
|
isUndo: (event: KeyboardEvent) => boolean;
|
|
1053
1071
|
};
|
|
1054
1072
|
//#endregion
|
|
1055
|
-
//#region src/dom/utils/selection-writes.d.ts
|
|
1056
|
-
/** A selection's anchor and focus as DOM points, in selection direction. */
|
|
1057
|
-
type DOMSelectionPoints = Readonly<{
|
|
1058
|
-
anchor: DOMPoint;
|
|
1059
|
-
focus: DOMPoint;
|
|
1060
|
-
}>;
|
|
1061
|
-
/**
|
|
1062
|
-
* Write `points` as `tree`'s selection, keeping their direction, or clear its
|
|
1063
|
-
* ranges for null, and record what the tree then shows, or the points written
|
|
1064
|
-
* where the tree reads its selection as its host. A selection that already
|
|
1065
|
-
* shows them is left alone, and so is the record, unless WebKit got them from
|
|
1066
|
-
* a write while their anchor had no layout box, neither the user nor a write
|
|
1067
|
-
* of other points has come since, and the anchor has one now.
|
|
1068
|
-
*/
|
|
1069
|
-
declare const writeDOMSelection: (tree: Document | ShadowRoot, points: DOMSelectionPoints | null) => void;
|
|
1070
|
-
/** A copy of `selection`'s range at `index`, safe to keep or change. */
|
|
1071
|
-
declare const readDOMSelectionRange: (selection: Selection, index?: number) => Range;
|
|
1072
|
-
//#endregion
|
|
1073
1073
|
//#region src/dom/utils/plite-dom-markers.d.ts
|
|
1074
1074
|
/** Return true when the element is a Plite void element boundary. */
|
|
1075
1075
|
declare const isVoid: (element: HTMLElement) => boolean;
|
|
@@ -1092,4 +1092,4 @@ declare const keyToDataAttribute: (key: string) => string;
|
|
|
1092
1092
|
/** Return DOM data attribute names that mirror primitive node properties. */
|
|
1093
1093
|
declare const getNodeDataAttributeKeys: (node: Element$1 | Text$1) => string[];
|
|
1094
1094
|
//#endregion
|
|
1095
|
-
export { ClipboardSliceWrite as $,
|
|
1095
|
+
export { ClipboardSliceWrite as $, isBefore as $t, DataTransferFormat as A, DOMCoverageMaterializeRangeRole as At, DOMApi as B, DOMNode as Bt, writeDOMSelection as C, DOMCoverage as Ct, DataTransferDecodeContext as D, DOMCoverageBoundaryState as Dt, usesAppleDOMHotkeys as E, DOMCoverageBoundaryEdge as Et, writeDataTransferFragment as F, DOMCoverageReason as Ft, DOMEditorClipboardCapability as G, DOMText as Gt, DOMClipboardInsertDataHandler as H, DOMRange as Ht, DOMEditorOptions as I, DOMCoverageRuntimeRange as It, DOMVisualPointOptions as J, getActiveElement as Jt, DOMResolutionError as K, closestShadowAware as Kt, DOMPlugin as L, DOMCoverageSelectionPolicy as Lt, DataTransferSchemaClaim as M, DOMCoverageMaterializeResult as Mt, DataTransferSnapshot as N, DOMCoveragePathRange as Nt, DataTransferDiagnostic as O, DOMCoverageCopyPolicy as Ot, dataTransferFormats as P, DOMCoveragePointResult as Pt, ClipboardSliceRead as Q, isAfter as Qt, DOMPluginTypes as R, DOMCoverageSession as Rt, readDOMSelectionRange as S, DOMDropTargetOptions as St, isGeckoDOMHost as T, DOMCoverageBoundaryAnchor as Tt, DOMDragApi as U, DOMSelection as Ut, DOMClipboardApi as V, DOMPoint as Vt, DOMEditor as W, DOMStaticRange as Wt, ScrollIntoViewTarget as X, getSelection as Xt, ScrollIntoViewOptions as Y, getDefaultView as Yt, isTrackedMutation as Z, hasShadowRoot as Zt, createCompiledHotkeyMatcher as _, DropIndicator as _t, isLeaf as a, normalizeDOMPoint as an, writeDOMRangeData as at, getEditorDOMRoot as b, DOMDropTarget as bt, isText as c, TextDiff as ct, Hotkeys as d, normalizePoint as dt, isDOMElement as en, DOMFragmentDataHtml as et, HotkeyMatchOptions as f, normalizeRange as ft, ariaKeyShortcuts as g, DOMGeometryRect as gt, KeyboardEventLike as h, verifyDiffState as ht, isElement as i, isPlainTextOnlyPaste as in, writeDOMFragmentData as it, DataTransferFormatPhase as j, DOMCoverageMaterializeReason as jt, DataTransferEncodeContext as k, DOMCoverageMaterializeHandler as kt, isVoid as l, applyStringDiff as lt, HotkeySpec as m, targetRange as mt, getNodeDataAttributeKeys as n, isDOMSelection as nn, cleanDOMClipboardContents as nt, isNode as o, Key as ot, HotkeyPlatform as p, normalizeStringDiff as pt, DOMVisualPoint as q, containsShadowAware as qt, isEditor as r, isDOMText as rn, domCommands as rt, isString as s, StringDiff as st, getElements as t, isDOMNode as tn, DOMFragmentDataPayload as tt, keyToDataAttribute as u, mergeStringDiffs as ut, isHotkey as v, DOMDragStart as vt, CAN_USE_DOM as w, DOMCoverageBoundary as wt, DOMSelectionPoints as x, DOMDropTargetInput as xt, TRIPLE_CLICK as y, DOMDropEdge as yt, dom as z, DOMElement as zt };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import React$1, { CSSProperties, DependencyList, HTMLAttributes, KeyboardEvent as KeyboardEvent$1, MouseEventHandler, ReactNode, Ref, RefObject, TextareaHTMLAttributes } from "react";
|
|
1
|
+
import { Dg as Node$1, E as EditorCommandDescriptor, F as EditorCommitContext, Fc as TransferOutcome, G as EditorDocumentValue, Gn as EditorUpdatePolicy, Gr as PluginReference, Ja as PluginsFromOptions, Jd as EditorSelectorDependencies, Jt as EditorStateField, Oc as TransferCheck, Os as CheckedEditorOptions, P_ as Text, S_ as Path, Sc as TransferPlugin, Un as EditorUpdateContext, Yn as EditorUpdateTransaction, _r as Plugin, dp as DecorationAttributes, f as CompatibleEditorCommand, fr as NamedRootKey, ft as EditorLifecycleErrorSink, jc as TransferInput, jr as PluginDependencyReferenceFor, k as EditorCommandInput, kr as PluginDependencyContractReference, l as AnyEditor, m as CreateEditorOptions$1, mr as NodeTarget, ng as Element$1, ni as ReadValue, o_ as BaseRange, or as HistoryOutcome, pi as StateFieldValueInput, pp as DecorationSource, pr as NodeKey, qa as EditorValueFromOptions, ri as RootKey, rr as EditorViewOptions, s_ as Range, vi as Value, xc as TransferApi, yi as ValueOf, zr as PluginPortal } from "./tx-only-1FM45FSj.js";
|
|
2
|
+
import { At as DOMCoverageMaterializeRangeRole, B as DOMApi, Ft as DOMCoverageReason, I as DOMEditorOptions, L as DOMPlugin, Lt as DOMCoverageSelectionPolicy, O as DataTransferDiagnostic, Ot as DOMCoverageCopyPolicy, R as DOMPluginTypes, V as DOMClipboardApi, W as DOMEditor, _t as DropIndicator, jt as DOMCoverageMaterializeReason, wt as DOMCoverageBoundary } from "./index-D8DQ1YFB.js";
|
|
3
|
+
import { r as ViewportRect, t as RangeGeometry } from "./range-geometry-CZari453.js";
|
|
4
|
+
import React$1, { CSSProperties, DependencyList, KeyboardEvent as KeyboardEvent$1, MouseEventHandler, ReactNode, Ref, RefObject, TextareaHTMLAttributes } from "react";
|
|
6
5
|
import "lodash";
|
|
7
6
|
//#region src/react/editable/runtime-editor-api.d.ts
|
|
8
7
|
type Editor$1<V extends Value = any> = AnyEditor<V>;
|
|
@@ -25,6 +24,7 @@ type TypedText = Readonly<{
|
|
|
25
24
|
range: Range;
|
|
26
25
|
text: string;
|
|
27
26
|
}>;
|
|
27
|
+
/** Listener called when a mounted Editable commits typed text. */
|
|
28
28
|
type TypedTextListener = (typed: TypedText) => void;
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/react/plugin/with-react.d.ts
|
|
@@ -604,7 +604,7 @@ type EditableDOMHandlers<TAttributes> = { [K in keyof TAttributes]: K extends `o
|
|
|
604
604
|
* inside a content root's editable, which runs the same handlers on the
|
|
605
605
|
* content root's view.
|
|
606
606
|
*/
|
|
607
|
-
type
|
|
607
|
+
type EditorContentProps<TElement extends Element$1 = Element$1, TRoot extends RootKey = RootKey> = {
|
|
608
608
|
autoFocus?: boolean;
|
|
609
609
|
className?: string;
|
|
610
610
|
disableDefaultStyles?: boolean;
|
|
@@ -656,31 +656,31 @@ type EditableProps<TElement extends Element$1 = Element$1, TRoot extends RootKey
|
|
|
656
656
|
/**
|
|
657
657
|
* Render the editable content area for one Plite root.
|
|
658
658
|
*
|
|
659
|
-
* `
|
|
659
|
+
* `EditorContent` renders the complete root DOM and owns renderers, events,
|
|
660
660
|
* selection sync, and optional root scoping. Pass `root` to mount the editor
|
|
661
661
|
* surface for a specific root.
|
|
662
662
|
* When focus moves to an element or composed ancestor with
|
|
663
|
-
* `data-editor-keep-selection-visible`, that exact
|
|
664
|
-
* canonical selection through `data-editor-inactive-selection` or
|
|
663
|
+
* `data-editor-keep-selection-visible`, that exact `EditorContent` paints its
|
|
664
|
+
* live canonical selection through `data-editor-inactive-selection` or
|
|
665
665
|
* `data-editor-inactive-selection-caret` until focus returns or moves elsewhere.
|
|
666
666
|
* A primary press on such an element counts as focus reaching it, for browsers
|
|
667
667
|
* that do not focus a clicked button.
|
|
668
668
|
*/
|
|
669
|
-
declare const
|
|
669
|
+
declare const EditorContent: <TElement extends Element$1, const TRoot extends RootKey = RootKey>(props: EditorContentProps<TElement, TRoot>) => import("react/jsx-runtime").JSX.Element;
|
|
670
670
|
//#endregion
|
|
671
671
|
//#region src/react/components/plite.d.ts
|
|
672
672
|
/** Canonical commit payload observed by a Plite React provider. */
|
|
673
|
-
type CommitContext<
|
|
673
|
+
type CommitContext<E extends Editor<any, any> = Editor<any, any>> = EditorCommitContext<E>;
|
|
674
674
|
/** Value-change payload derived independently from a canonical commit. */
|
|
675
|
-
type ValueChangeContext<
|
|
676
|
-
value:
|
|
675
|
+
type ValueChangeContext<E extends Editor<any, any> = Editor<any, any>> = CommitContext<E> & {
|
|
676
|
+
value: EditorDocumentValue<ReadValue<ValueOf<E>>>;
|
|
677
677
|
};
|
|
678
678
|
/** Selection-change payload derived independently from a canonical commit. */
|
|
679
|
-
type SelectionChangeContext<
|
|
680
|
-
selection:
|
|
679
|
+
type SelectionChangeContext<E extends Editor<any, any> = Editor<any, any>> = CommitContext<E> & {
|
|
680
|
+
selection: EditorCommitContext<E>['snapshot']['selection'];
|
|
681
681
|
};
|
|
682
682
|
/** Props for the Plite React provider around editable roots and callbacks. */
|
|
683
|
-
type EditorRootProps<E extends Editor<any, any> = Editor<any, any>, TRoot extends RootKey = RootKey> = EditorViewOptions<TRoot> & (NoInfer<E> extends {
|
|
683
|
+
type EditorRootProps<E extends Editor<any, any> = Editor<any, any>, TRoot extends RootKey = RootKey> = Pick<EditorViewOptions<TRoot>, 'authored' | 'readOnly' | 'root'> & (NoInfer<E> extends {
|
|
684
684
|
read: {
|
|
685
685
|
authored: unknown;
|
|
686
686
|
};
|
|
@@ -691,13 +691,9 @@ type EditorRootProps<E extends Editor<any, any> = Editor<any, any>, TRoot extend
|
|
|
691
691
|
editor: E;
|
|
692
692
|
children: React$1.ReactNode;
|
|
693
693
|
decorations?: ReadonlyArray<DecorationSource<NoInfer<E>>> | null;
|
|
694
|
-
onCommit?: (context:
|
|
695
|
-
onSelectionChange?: (context:
|
|
696
|
-
|
|
697
|
-
}) => void;
|
|
698
|
-
onValueChange?: (context: EditorCommitContext<NoInfer<E>> & {
|
|
699
|
-
value: ValueOf<E>;
|
|
700
|
-
}) => void;
|
|
694
|
+
onCommit?: (context: CommitContext<NoInfer<E>>) => void;
|
|
695
|
+
onSelectionChange?: (context: SelectionChangeContext<NoInfer<E>>) => void;
|
|
696
|
+
onValueChange?: (context: ValueChangeContext<NoInfer<E>>) => void;
|
|
701
697
|
};
|
|
702
698
|
/**
|
|
703
699
|
* Provide one mounted editor runtime to React descendants. Passing an editor
|
|
@@ -706,56 +702,6 @@ type EditorRootProps<E extends Editor<any, any> = Editor<any, any>, TRoot extend
|
|
|
706
702
|
*/
|
|
707
703
|
declare const EditorRoot: <E extends Editor<any, any>, const TRoot extends RootKey = RootKey>(props: EditorRootProps<E, TRoot>) => import("react/jsx-runtime").JSX.Element;
|
|
708
704
|
//#endregion
|
|
709
|
-
//#region src/react/components/plite-element.d.ts
|
|
710
|
-
type IntrinsicTag = keyof HTMLElementTagNameMap;
|
|
711
|
-
/**
|
|
712
|
-
* Render a Plite element DOM shell bound to the current element runtime.
|
|
713
|
-
*
|
|
714
|
-
* Use this primitive when building custom element shells that still need Plite
|
|
715
|
-
* DOM attributes, path/runtime metadata, and node-ref binding.
|
|
716
|
-
*/
|
|
717
|
-
declare const EditorElement: ({ as, children, className, id, isInline, isVoid, ref, style, ...domProps }: Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
718
|
-
as?: IntrinsicTag;
|
|
719
|
-
children?: ReactNode;
|
|
720
|
-
isInline?: boolean;
|
|
721
|
-
isVoid?: boolean;
|
|
722
|
-
ref?: Ref<HTMLElement>;
|
|
723
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
724
|
-
//#endregion
|
|
725
|
-
//#region src/react/components/plite-leaf.d.ts
|
|
726
|
-
/**
|
|
727
|
-
* Render a Plite leaf shell for decorated text content.
|
|
728
|
-
*
|
|
729
|
-
* The shell carries Plite leaf attributes and render profiling metadata while
|
|
730
|
-
* leaving actual text children to the caller.
|
|
731
|
-
*/
|
|
732
|
-
declare const EditorLeaf: ({ attributes, children }: {
|
|
733
|
-
attributes?: {
|
|
734
|
-
'data-editor-leaf': true;
|
|
735
|
-
'data-editor-leaf-end'?: number;
|
|
736
|
-
'data-editor-leaf-start'?: number;
|
|
737
|
-
};
|
|
738
|
-
children: ReactNode;
|
|
739
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
740
|
-
//#endregion
|
|
741
|
-
//#region src/react/components/plite-text.d.ts
|
|
742
|
-
/**
|
|
743
|
-
* Render a Plite text DOM shell bound to a text runtime.
|
|
744
|
-
*
|
|
745
|
-
* The shell carries path/runtime metadata and native DOM-sync attributes used
|
|
746
|
-
* by selection and mutation handling. Inside a `renderText` call for one piece
|
|
747
|
-
* of a paged text it renders a plain span, because the editor already renders
|
|
748
|
-
* that text's shell around its pieces.
|
|
749
|
-
*/
|
|
750
|
-
declare const EditorText: ({ domSync, domSyncReason, children, path, ref, nodeKey }: {
|
|
751
|
-
children: ReactNode;
|
|
752
|
-
domSync?: boolean;
|
|
753
|
-
domSyncReason?: string | null;
|
|
754
|
-
path?: Path;
|
|
755
|
-
ref?: Ref<HTMLSpanElement>;
|
|
756
|
-
nodeKey?: NodeKey | null;
|
|
757
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
758
|
-
//#endregion
|
|
759
705
|
//#region src/react/hooks/use-editor-context.d.ts
|
|
760
706
|
/**
|
|
761
707
|
* Get the current editor object from the React context.
|
|
@@ -766,7 +712,7 @@ declare const useOptionalEditorContext: () => EditorContextValue<any> | null;
|
|
|
766
712
|
//#endregion
|
|
767
713
|
//#region src/react/hooks/use-editor-composing.d.ts
|
|
768
714
|
/**
|
|
769
|
-
* Get the current `composing` state of the editor.
|
|
715
|
+
* Get the current `composing` state of the active editor.
|
|
770
716
|
*/
|
|
771
717
|
declare const useEditorComposing: () => boolean;
|
|
772
718
|
//#endregion
|
|
@@ -776,7 +722,7 @@ type DOMScopeEditor = {
|
|
|
776
722
|
dom: Pick<DOMApi, 'editable' | 'root' | 'scroll'>;
|
|
777
723
|
};
|
|
778
724
|
};
|
|
779
|
-
/** Return the mounted editable element for
|
|
725
|
+
/** Return the mounted editable element for an editor root. */
|
|
780
726
|
declare const useEditorEditableElement: <const TRoot extends RootKey = RootKey>(editor: DOMScopeEditor, root?: NamedRootKey<TRoot>) => HTMLElement | null;
|
|
781
727
|
/** Return the mounted editor root element. */
|
|
782
728
|
declare const useEditorRootElement: (editor: DOMScopeEditor) => HTMLElement | null;
|
|
@@ -794,7 +740,7 @@ declare const useEditorScrollElementRef: (editor: DOMScopeEditor, { fallback }?:
|
|
|
794
740
|
//#endregion
|
|
795
741
|
//#region src/react/hooks/use-editor-focused.d.ts
|
|
796
742
|
/**
|
|
797
|
-
* Get the current `focused` state of the editor.
|
|
743
|
+
* Get the current `focused` state of the active editor.
|
|
798
744
|
*/
|
|
799
745
|
declare const useEditorFocused: () => boolean;
|
|
800
746
|
//#endregion
|
|
@@ -812,30 +758,10 @@ type EditorReadOnlyProviderProps = {
|
|
|
812
758
|
*/
|
|
813
759
|
declare const EditorReadOnlyProvider: ({ children, readOnly }: EditorReadOnlyProviderProps) => import("react").FunctionComponentElement<import("react").ProviderProps<boolean | undefined>>;
|
|
814
760
|
/**
|
|
815
|
-
*
|
|
816
|
-
* active yet.
|
|
817
|
-
*/
|
|
818
|
-
declare const useOptionalEditorReadOnly: () => boolean | undefined;
|
|
819
|
-
/**
|
|
820
|
-
* Get the current `readOnly` state of the editor.
|
|
761
|
+
* Get the current `readOnly` state of the active editor.
|
|
821
762
|
*/
|
|
822
763
|
declare const useEditorReadOnly: () => boolean;
|
|
823
764
|
//#endregion
|
|
824
|
-
//#region src/react/hooks/use-editor-runtime-state.d.ts
|
|
825
|
-
/** Options for explicit editor runtime-state selectors. */
|
|
826
|
-
interface EditorRuntimeStateSelectorOptions<T, TEditor extends Editor$2<any, any> = Editor$2<any, any>> {
|
|
827
|
-
equalityFn?: (a: T, b: T) => boolean;
|
|
828
|
-
shouldUpdate?: (change?: EditorCommit<ValueOf<TEditor>>) => boolean;
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Subscribe to a derived state value from an explicit editor instance.
|
|
832
|
-
*
|
|
833
|
-
* Use this for chrome that owns or receives an editor but is outside a
|
|
834
|
-
* `<EditorRoot>` provider. Commit-driven selectors invalidate synchronously. Inside
|
|
835
|
-
* provider descendants, prefer `useEditorState`.
|
|
836
|
-
*/
|
|
837
|
-
declare function useEditorRuntimeState<T, TEditor extends Editor$2<any, any> = Editor$2<any, any>>(editor: TEditor, selector: (state: EditorStateView<ValueOf<TEditor>, PluginsOf<TEditor>>) => T, { equalityFn, shouldUpdate }?: EditorRuntimeStateSelectorOptions<T, TEditor>): T;
|
|
838
|
-
//#endregion
|
|
839
765
|
//#region src/react/hooks/use-editor-selection.d.ts
|
|
840
766
|
/**
|
|
841
767
|
* Get the current editor selection.
|
|
@@ -845,49 +771,39 @@ declare const useEditorSelection: () => BaseRange | null;
|
|
|
845
771
|
//#endregion
|
|
846
772
|
//#region src/react/hooks/use-editor-selector.d.ts
|
|
847
773
|
type ContextEditor = EditorContextValue<any>;
|
|
848
|
-
/** Commit-subscription options for
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
equalityFn?: (a: T, b: T) => boolean;
|
|
852
|
-
includeRootOrderChanges?: boolean;
|
|
853
|
-
profileId?: string;
|
|
854
|
-
runtimeEventSource?: 'node' | 'path' | 'render' | 'selection';
|
|
855
|
-
nodeKey?: NodeKey | null;
|
|
856
|
-
nodeKeys?: readonly NodeKey[] | null;
|
|
857
|
-
shouldUpdate?: (change?: EditorCommit) => boolean;
|
|
858
|
-
}
|
|
859
|
-
/** Options for selectors that read from the immutable editor state view. */
|
|
860
|
-
interface EditorStateSelectorOptions<T> {
|
|
861
|
-
deferred?: boolean;
|
|
774
|
+
/** Commit and view-state subscription options for `useEditorSelector`. */
|
|
775
|
+
type UseEditorSelectorOptions<T = unknown> = {
|
|
776
|
+
dependsOn?: EditorSelectorDependencies;
|
|
862
777
|
equalityFn?: (a: T, b: T) => boolean;
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Subscribe to editor commits and derive a render value from the editor.
|
|
867
|
-
*
|
|
868
|
-
* Scope updates with roots/node keys or `shouldUpdate`, and use
|
|
869
|
-
* `useEditorState` when the selector only needs the immutable state view.
|
|
870
|
-
*/
|
|
871
|
-
declare function useEditorSelector<T>(selector: (editor: ContextEditor) => T, { deferred, equalityFn, includeRootOrderChanges, profileId, runtimeEventSource, nodeKey, nodeKeys, shouldUpdate }?: EditorSelectorOptions<T>): T;
|
|
778
|
+
};
|
|
872
779
|
/**
|
|
873
|
-
*
|
|
874
|
-
*
|
|
780
|
+
* Subscribe to editor commits and view-state changes and derive a render value
|
|
781
|
+
* from the active context editor or an explicit editor instance.
|
|
875
782
|
*
|
|
876
|
-
*
|
|
783
|
+
* Scope updates with `dependsOn` using commit kinds, state fields, node keys,
|
|
784
|
+
* or view-state tokens (`'authored'`, `'composing'`, `'focused'`, `'readOnly'`,
|
|
785
|
+
* `'view'`). Omitting `dependsOn` subscribes to commits and all view-state
|
|
786
|
+
* changes (including focus and composition).
|
|
877
787
|
*/
|
|
878
|
-
declare function
|
|
788
|
+
declare function useEditorSelector<T>(selector: (editor: ContextEditor) => T, options?: UseEditorSelectorOptions<T>): T;
|
|
789
|
+
declare function useEditorSelector<T, TEditor extends AnyEditor = AnyEditor>(editor: TEditor, selector: (editor: TEditor) => T, options?: UseEditorSelectorOptions<T>): T;
|
|
879
790
|
//#endregion
|
|
880
|
-
//#region src/react/hooks/use-editor-
|
|
881
|
-
/**
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
791
|
+
//#region src/react/hooks/use-editor-root-areas.d.ts
|
|
792
|
+
/** Standalone editing areas mounted in a view's presentation. */
|
|
793
|
+
type EditorRootAreas<TEditor extends AnyEditor = AnyEditor> = Readonly<{
|
|
794
|
+
/** Whether this view is the active shown standalone editing area for its root in this presentation. */
|
|
795
|
+
isPrimaryForRoot: boolean;
|
|
796
|
+
/** Return the mounted view of a nested content root inside this editing area, if one is mounted. */
|
|
797
|
+
nestedView: (root: NamedRootKey) => TEditor | null;
|
|
798
|
+
/** Named roots that currently have their own shown standalone editing area in this presentation. */
|
|
799
|
+
standaloneRoots: readonly NamedRootKey[];
|
|
800
|
+
}>;
|
|
885
801
|
/**
|
|
886
|
-
* Subscribe to
|
|
887
|
-
*
|
|
888
|
-
*
|
|
802
|
+
* Subscribe to the standalone editing areas mounted in this view's
|
|
803
|
+
* presentation, and whether this view is the active standalone area for its
|
|
804
|
+
* root.
|
|
889
805
|
*/
|
|
890
|
-
declare function
|
|
806
|
+
declare function useEditorRootAreas<TEditor extends AnyEditor = AnyEditor>(editor: TEditor): EditorRootAreas<TEditor>;
|
|
891
807
|
//#endregion
|
|
892
808
|
//#region src/react/hooks/use-element.d.ts
|
|
893
809
|
/**
|
|
@@ -939,7 +855,6 @@ type EditorTextSelectorContext = EditorNodeSelectorContext & {
|
|
|
939
855
|
};
|
|
940
856
|
/** Update-scoping options for selectors tied to a rendered node key. */
|
|
941
857
|
type EditorRuntimeSelectorOptions = {
|
|
942
|
-
deferred?: boolean;
|
|
943
858
|
includeRootOrderChanges?: boolean;
|
|
944
859
|
nodeKey?: NodeKey | null;
|
|
945
860
|
};
|
|
@@ -958,28 +873,6 @@ declare function useNodeSelector<T>(selector: (context: EditorNodeSelectorContex
|
|
|
958
873
|
*/
|
|
959
874
|
declare function useTextSelector<T>(selector: (context: EditorTextSelectorContext) => T, equalityFn?: (a: T, b: T) => boolean, options?: EditorRuntimeSelectorOptions): T;
|
|
960
875
|
//#endregion
|
|
961
|
-
//#region src/react/hooks/use-plite-annotation-store.d.ts
|
|
962
|
-
/** Options for a React-owned annotation store. */
|
|
963
|
-
type UseAnnotationStoreOptions = {
|
|
964
|
-
id?: string;
|
|
965
|
-
onError?: ViewSourceErrorSink;
|
|
966
|
-
/** Explicit invalidation token for a mutable external annotation source. */
|
|
967
|
-
revision?: unknown;
|
|
968
|
-
};
|
|
969
|
-
/**
|
|
970
|
-
* Create an annotation store from a React-owned annotation value.
|
|
971
|
-
*
|
|
972
|
-
* New array identities refresh automatically. Pass `revision` only when an
|
|
973
|
-
* external mutable source changes without producing a new array.
|
|
974
|
-
*/
|
|
975
|
-
declare function useAnnotationStore<TData = unknown, V extends Value = Value, TPlugins extends readonly unknown[] = readonly []>(editor: Editor$2<V, TPlugins>, annotations: ReadonlyArray<Annotation<TData>>, options?: UseAnnotationStoreOptions): AnnotationStore<TData>;
|
|
976
|
-
//#endregion
|
|
977
|
-
//#region src/react/hooks/use-plite-annotations.d.ts
|
|
978
|
-
/** Read one resolved annotation by id from an explicit store. */
|
|
979
|
-
declare function useAnnotation<TData = unknown>(store: AnnotationStore<TData>, id: string): ResolvedAnnotation<TData> | null;
|
|
980
|
-
/** Read the current annotation snapshot from an explicit store. */
|
|
981
|
-
declare function useAnnotations<TData = unknown>(store: AnnotationStore<TData>): AnnotationSnapshot<TData>;
|
|
982
|
-
//#endregion
|
|
983
876
|
//#region src/react/hooks/use-plite-child-root.d.ts
|
|
984
877
|
/**
|
|
985
878
|
* Resolve a stable same-runtime root key owned by an element.
|
|
@@ -1037,8 +930,6 @@ type ContentRootController = {
|
|
|
1037
930
|
declare function useContentRoot(element?: Element$1 | null, options?: UseContentRootOptions): ContentRootController;
|
|
1038
931
|
//#endregion
|
|
1039
932
|
//#region src/react/hooks/use-editor.d.ts
|
|
1040
|
-
/** Options used to create a component-owned React editor. */
|
|
1041
|
-
type UseEditorOptions<V extends Value = Value, TPlugins extends readonly unknown[] = readonly []> = CreateEditorOptions<V, TPlugins>;
|
|
1042
933
|
/**
|
|
1043
934
|
* Creates one React editor instance for the component lifetime.
|
|
1044
935
|
*
|
|
@@ -1049,10 +940,12 @@ type UseEditorOptions<V extends Value = Value, TPlugins extends readonly unknown
|
|
|
1049
940
|
* give them back when it unmounts or `deps` change. Use `createEditor` when an
|
|
1050
941
|
* editor must be created outside React ownership.
|
|
1051
942
|
*/
|
|
1052
|
-
declare function
|
|
943
|
+
declare function useCreateEditor(options?: undefined, deps?: DependencyList): Editor;
|
|
944
|
+
declare function useCreateEditor<const TOptions extends CreateEditorOptions<any, readonly unknown[]> & {
|
|
1053
945
|
plugins: readonly unknown[];
|
|
1054
|
-
}>(options: CheckedEditorOptions<TOptions,
|
|
1055
|
-
declare function
|
|
946
|
+
}>(options: CheckedEditorOptions<TOptions, CreateEditorOptions>, deps?: DependencyList): Editor<EditorValueFromOptions<TOptions>, PluginsFromOptions<TOptions>>;
|
|
947
|
+
declare function useCreateEditor<V extends Value = Value, const TPlugins extends readonly unknown[] = readonly []>(options: CreateEditorOptions<V, TPlugins>, deps?: DependencyList): Editor<V, TPlugins>;
|
|
948
|
+
declare function useCreateEditor(options: CreateEditorOptions<Value, readonly unknown[]> | undefined, deps?: DependencyList): Editor;
|
|
1056
949
|
//#endregion
|
|
1057
950
|
//#region src/react/hooks/use-drop-indicator.d.ts
|
|
1058
951
|
/**
|
|
@@ -1125,33 +1018,11 @@ type EditorHistoryController = {
|
|
|
1125
1018
|
declare function useEditorHistory<const TRoot extends RootKey = RootKey>({ editor: providedEditor, focusPolicy, root: fixedRoot }?: UseEditorHistoryOptions<TRoot>): EditorHistoryController;
|
|
1126
1019
|
//#endregion
|
|
1127
1020
|
//#region src/react/hooks/use-plite-runtime.d.ts
|
|
1128
|
-
/** Selector options for `useRuntimeState` and `useRootState`. */
|
|
1129
|
-
type RuntimeStateSelectorOptions<T> = {
|
|
1130
|
-
deferred?: boolean;
|
|
1131
|
-
equalityFn?: (a: T, b: T) => boolean;
|
|
1132
|
-
shouldUpdate?: (change?: EditorCommit) => boolean;
|
|
1133
|
-
};
|
|
1134
|
-
type ReactEditorState = EditorStateView<ValueOf<Editor>, PluginsOf<Editor>>;
|
|
1135
|
-
/**
|
|
1136
|
-
* Subscribe to a selected value from the root runtime editor state.
|
|
1137
|
-
*
|
|
1138
|
-
* Use this for toolbar, sidebar, and shell UI that reads the whole editor
|
|
1139
|
-
* runtime. Use `useRootState` for root-scoped UI in multi-root editors.
|
|
1140
|
-
* Inline selectors observe current render values. Use `shouldUpdate` when a
|
|
1141
|
-
* commit can be skipped before the selector runs. The selector state holds the
|
|
1142
|
-
* core editor groups; read a plugin's state through `editor.plugin(Plugin)`.
|
|
1143
|
-
*/
|
|
1144
|
-
declare function useRuntimeState<T>(selector: (state: ReactEditorState) => T, { deferred, equalityFn, shouldUpdate }?: RuntimeStateSelectorOptions<T>): T;
|
|
1145
1021
|
/**
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
* Root-scoped selectors skip commits that cannot affect the requested root.
|
|
1149
|
-
* Use this for chrome tied to a known root, such as headers, sidebars, and
|
|
1150
|
-
* nested content roots. Use `useRuntimeState` only when the selected value
|
|
1151
|
-
* genuinely spans roots. The selector state holds the core editor groups; read
|
|
1152
|
-
* a plugin's state through `editor.plugin(Plugin)`.
|
|
1022
|
+
* Return the owning model editor from the nearest `<EditorRoot>` or
|
|
1023
|
+
* `<EditorRuntimeProvider>`.
|
|
1153
1024
|
*/
|
|
1154
|
-
declare function
|
|
1025
|
+
declare function useModelEditor(): Editor;
|
|
1155
1026
|
/** Options for creating a root-specific command editor. */
|
|
1156
1027
|
type UseRootEditorOptions = {
|
|
1157
1028
|
readOnly?: boolean;
|
|
@@ -1160,7 +1031,7 @@ type UseRootEditorOptions = {
|
|
|
1160
1031
|
* Create a command-capable editor for one root.
|
|
1161
1032
|
*
|
|
1162
1033
|
* The returned object is stable for the requested root and read-only option.
|
|
1163
|
-
* A renderer inside an `
|
|
1034
|
+
* A renderer inside an `EditorContent` gets another object than UI outside it, so
|
|
1164
1035
|
* a lock set through one does not reach the other.
|
|
1165
1036
|
* It obeys the read-only state and the authored view of the mounted view that
|
|
1166
1037
|
* shows its root, and of the view around the hook while none shows it. Inside
|
|
@@ -1174,14 +1045,24 @@ type UseRootEditorOptions = {
|
|
|
1174
1045
|
*/
|
|
1175
1046
|
declare function useRootEditor<const TRoot extends RootKey = RootKey>(root?: NamedRootKey<TRoot>, options?: UseRootEditorOptions): Editor;
|
|
1176
1047
|
/**
|
|
1177
|
-
* Return
|
|
1178
|
-
*
|
|
1048
|
+
* Return the active command editor from the nearest `<EditorRoot>`, or `null`
|
|
1049
|
+
* when called outside one.
|
|
1050
|
+
*
|
|
1051
|
+
* Inside an editing area (`<EditorContent>`), returns that editing area's own
|
|
1052
|
+
* editor without subscribing to caret moves. Outside editing areas, such as in
|
|
1053
|
+
* a toolbar, returns the root editor for the root holding the caret, or the
|
|
1054
|
+
* enclosing `<EditorRoot>`'s root while nothing is selected.
|
|
1055
|
+
*/
|
|
1056
|
+
declare function useOptionalEditor(): EditorContextValue | null;
|
|
1057
|
+
/**
|
|
1058
|
+
* Return the active command editor from the nearest `<EditorRoot>`.
|
|
1179
1059
|
*
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1060
|
+
* Inside an editing area (`<EditorContent>`), returns that editing area's own
|
|
1061
|
+
* editor. Outside editing areas, such as in a toolbar, returns the root editor
|
|
1062
|
+
* for the root holding the caret, or the enclosing `<EditorRoot>`'s root while
|
|
1063
|
+
* nothing is selected. Throws outside `<EditorRoot>`.
|
|
1183
1064
|
*/
|
|
1184
|
-
declare function
|
|
1065
|
+
declare function useEditor(): EditorContextValue;
|
|
1185
1066
|
/** Focus behavior before or after root command callbacks. */
|
|
1186
1067
|
type CommandFocusPolicy = 'none' | 'preserve' | 'restore-root';
|
|
1187
1068
|
/** Options for `useCommand`. */
|
|
@@ -1198,7 +1079,7 @@ type CommandDispatcher<TCommand extends EditorCommandDescriptor> = (...input: Co
|
|
|
1198
1079
|
* Command input belongs to the returned dispatcher, so event-time data never
|
|
1199
1080
|
* becomes hook configuration. Pass `root` for a known root and use
|
|
1200
1081
|
* `focus: 'restore-root'` when the command should first restore editor focus.
|
|
1201
|
-
* Without `root`, the command runs in the root of the `
|
|
1082
|
+
* Without `root`, the command runs in the root of the `EditorContent` around the
|
|
1202
1083
|
* hook, or else in the caret's root when the dispatcher runs.
|
|
1203
1084
|
* The command runs on the mounted view that shows the root, and on the editor
|
|
1204
1085
|
* `useRootEditor` gives for the root while none shows it, so a lock on either
|
|
@@ -1219,15 +1100,17 @@ declare function useSelectionGeometry({ editableRef }: UseSelectionGeometryOptio
|
|
|
1219
1100
|
//#endregion
|
|
1220
1101
|
//#region src/react/hooks/use-state-field.d.ts
|
|
1221
1102
|
/** Selector options for subscribing to one editor state field. */
|
|
1222
|
-
type UseStateFieldValueOptions<TValue> = Pick<
|
|
1103
|
+
type UseStateFieldValueOptions<TValue = unknown> = Pick<UseEditorSelectorOptions<TValue>, 'equalityFn'>;
|
|
1223
1104
|
/** Setter returned by `useSetStateField` for one editor state field. */
|
|
1224
1105
|
type StateFieldSetter<TValue> = (value: StateFieldValueInput<TValue>, policy?: EditorUpdatePolicy) => void;
|
|
1225
1106
|
/**
|
|
1226
1107
|
* Subscribe to one `defineStateField` value.
|
|
1227
1108
|
*
|
|
1228
|
-
* The hook
|
|
1229
|
-
* state keys
|
|
1230
|
-
*
|
|
1109
|
+
* The hook re-evaluates when the field key or `'$configuration'` appears in
|
|
1110
|
+
* the committed dirty state keys (for example on plugin uninstall or
|
|
1111
|
+
* reinstall), and re-renders only when the value changes. Use it for document
|
|
1112
|
+
* meta controls such as title, page settings, or feature state that should not
|
|
1113
|
+
* subscribe to every editor change.
|
|
1231
1114
|
*/
|
|
1232
1115
|
declare function useStateFieldValue<TValue>(field: EditorStateField<TValue>, options?: UseStateFieldValueOptions<TValue>): TValue;
|
|
1233
1116
|
/**
|
|
@@ -1247,4 +1130,4 @@ declare const ReactUpdatePolicy: Readonly<{
|
|
|
1247
1130
|
}>;
|
|
1248
1131
|
}>;
|
|
1249
1132
|
//#endregion
|
|
1250
|
-
export {
|
|
1133
|
+
export { useEditorEditableElement as $, ReactApi as $t, UseRootChromeOptions as A, EditableDOMBeforeInputContext as At, useElementSelected as B, EditablePointerSelectionEndHandler as Bt, useEditableClip as C, RenderTextPieceProps as Ct, UseContentRootOptions as D, setDOMTextSyncRendererCapability as Dt, ContentRootController as E, DOMTextSyncRendererCapabilityContext as Et, EditorTextSelectorContext as F, EditableKeyDownHandler as Ft, useEditorRootAreas as G, ExternalTextDispatchResult as Gt, useElement as H, ExternalTextAdapter as Ht, useNodeSelector as I, EditableDropResult as It, useEditorSelection as J, ExternalTextSelectionState as Jt, UseEditorSelectorOptions as K, ExternalTextOptions as Kt, useTextSelector as L, EditableHistoryReplayEvent as Lt, useChildRoot as M, EditableHandlerContext as Mt, EditorNodeSelectorContext as N, EditableHandlerResult as Nt, useContentRoot as O, setRetainedTextFlowRendererCapability as Ot, EditorRuntimeSelectorOptions as P, EditableInputEventContext as Pt, useEditorFocused as Q, Editor as Qt, UseElementSelectedMode as R, EditableHistoryReplayResult as Rt, UseEditableClipOptions as S, RenderTextHostProps as St, useCreateEditor as T, EditorPlaceholder as Tt, useOptionalElement as U, ExternalTextChange as Ut, useElementPath as V, ExternalTextActions as Vt, EditorRootAreas as W, ExternalTextDecoration as Wt, EditorReadOnlyProviderProps as X, ExternalTextView as Xt, EditorReadOnlyProvider as Y, ExternalTextState as Yt, useEditorReadOnly as Z, CreateEditorOptions as Zt, EditorHistoryController as _, EditorContentProps as _t, useStateFieldValue as a, TypedTextListener as an, useOptionalEditorContext as at, useEditorHistory as b, RenderLeafProps as bt, CommandDispatcher as c, EditorRootProps as ct, UseRootEditorOptions as d, EditableDOMCoverageBoundaryMaterializePayload as dt, ReactPlugin as en, useEditorRootElement as et, useCommand as f, EditableDOMCoverageBoundaryPlaceholderContext as ft, useRootEditor as g, EditorContent as gt, useOptionalEditor as h, EditableElementSlots as ht, useSetStateField as i, TypedText as in, useEditorContext as it, useRootChrome as j, EditableDOMBeforeInputHandler as jt, RootChromeController as k, installBrowserHandle as kt, CommandFocusPolicy as l, SelectionChangeContext as lt, useModelEditor as m, EditableDOMCoverageBoundaryScope as mt, StateFieldSetter as n, createEditor as nn, useEditorScrollElementRef as nt, UseSelectionGeometryOptions as o, CommitContext as ot, useEditor as p, EditableDOMCoverageBoundaryProps as pt, useEditorSelector as q, ExternalTextSelection as qt, UseStateFieldValueOptions as r, react as rn, useEditorComposing as rt, useSelectionGeometry as s, EditorRoot as st, ReactUpdatePolicy as t, ReactPluginOptions as tn, useEditorScrollElement as tt, UseCommandOptions as u, ValueChangeContext as ut, EditorHistoryFocusPolicy as v, RenderElementProps as vt, useDropIndicator as w, RenderTextProps as wt, useClaimEditableDOMCommit as x, RenderPlaceholderProps as xt, UseEditorHistoryOptions as y, RenderVoidProps as yt, UseElementSelectedOptions as z, EditablePasteResult as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mr as PluginFactoryTypeLambda, Nr as PluginFactoryTypeProvider, _r as Plugin, s_ as Range } from "./tx-only-1FM45FSj.js";
|
|
2
2
|
import * as Y from "yjs";
|
|
3
3
|
//#region src/yjs/core/editor-adapter.d.ts
|
|
4
4
|
/**
|