@markput/react 0.12.0 → 0.14.0
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/index.d.ts +287 -229
- package/index.d.ts.map +1 -1
- package/index.js +2540 -2202
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -10763,22 +10763,144 @@ declare function annotate(markup: Markup, params: {
|
|
|
10763
10763
|
*/
|
|
10764
10764
|
declare function denote(value: string, callback: (mark: MarkToken) => string, markups: Markup[]): string;
|
|
10765
10765
|
//#endregion
|
|
10766
|
-
//#region ../../core/src/
|
|
10767
|
-
|
|
10766
|
+
//#region ../../core/src/shared/editorContracts.d.ts
|
|
10767
|
+
type TokenPath = readonly number[];
|
|
10768
|
+
type TokenAddress = {
|
|
10769
|
+
readonly path: TokenPath;
|
|
10770
|
+
readonly parseGeneration: number;
|
|
10771
|
+
};
|
|
10772
|
+
type Result<T, Reason extends string> = {
|
|
10773
|
+
ok: true;
|
|
10774
|
+
value: T;
|
|
10775
|
+
} | {
|
|
10776
|
+
ok: false;
|
|
10777
|
+
reason: Reason;
|
|
10778
|
+
};
|
|
10779
|
+
type DomRef = (element: HTMLElement | null) => void;
|
|
10780
|
+
type RawRange = {
|
|
10781
|
+
readonly start: number;
|
|
10782
|
+
readonly end: number;
|
|
10783
|
+
};
|
|
10784
|
+
type RawSelection = {
|
|
10785
|
+
readonly range: RawRange;
|
|
10786
|
+
readonly direction?: 'forward' | 'backward';
|
|
10787
|
+
};
|
|
10788
|
+
type NodeLocationResult = Result<{
|
|
10789
|
+
readonly address: TokenAddress;
|
|
10790
|
+
readonly tokenElement: HTMLElement;
|
|
10791
|
+
readonly textElement?: HTMLElement;
|
|
10792
|
+
readonly rowElement?: HTMLElement;
|
|
10793
|
+
}, 'notIndexed' | 'outsideEditor' | 'control'>;
|
|
10794
|
+
type RawSelectionResult = Result<RawSelection, 'notIndexed' | 'outsideEditor' | 'control' | 'mixedBoundary' | 'invalidBoundary'>;
|
|
10795
|
+
type BoundaryPositionResult = Result<number, 'notIndexed' | 'outsideEditor' | 'control' | 'invalidBoundary' | 'composing'>;
|
|
10796
|
+
type EditResult = {
|
|
10797
|
+
ok: true;
|
|
10798
|
+
value: string;
|
|
10799
|
+
accepted: 'immediate' | 'pendingControlledEcho';
|
|
10800
|
+
} | {
|
|
10801
|
+
ok: false;
|
|
10802
|
+
reason: 'readOnly' | 'invalidRange' | 'stale';
|
|
10803
|
+
};
|
|
10804
|
+
type CaretRecovery = {
|
|
10805
|
+
readonly kind: 'caret';
|
|
10806
|
+
readonly rawPosition: number;
|
|
10807
|
+
readonly affinity?: 'before' | 'after';
|
|
10808
|
+
} | {
|
|
10809
|
+
readonly kind: 'selection';
|
|
10810
|
+
readonly selection: RawSelection;
|
|
10811
|
+
};
|
|
10812
|
+
type OptionalMarkFieldPatch = {
|
|
10813
|
+
readonly kind: 'set';
|
|
10814
|
+
readonly value: string;
|
|
10815
|
+
} | {
|
|
10816
|
+
readonly kind: 'clear';
|
|
10817
|
+
};
|
|
10818
|
+
type MarkPatch = {
|
|
10819
|
+
readonly value?: string;
|
|
10820
|
+
readonly meta?: OptionalMarkFieldPatch;
|
|
10821
|
+
readonly slot?: OptionalMarkFieldPatch;
|
|
10822
|
+
};
|
|
10823
|
+
type MarkSnapshot = {
|
|
10824
|
+
readonly value: string;
|
|
10825
|
+
readonly meta: string | undefined;
|
|
10826
|
+
readonly slot: string | undefined;
|
|
10827
|
+
readonly readOnly: boolean;
|
|
10828
|
+
};
|
|
10829
|
+
type MarkInfo = {
|
|
10830
|
+
readonly address: TokenAddress;
|
|
10831
|
+
readonly depth: number;
|
|
10832
|
+
readonly hasNestedMarks: boolean;
|
|
10833
|
+
readonly key: string;
|
|
10834
|
+
};
|
|
10835
|
+
type TokenShapeSnapshot = {
|
|
10836
|
+
readonly kind: 'text';
|
|
10837
|
+
} | {
|
|
10838
|
+
readonly kind: 'mark';
|
|
10839
|
+
readonly descriptor: MarkupDescriptor;
|
|
10840
|
+
readonly descriptorIndex: number;
|
|
10841
|
+
};
|
|
10842
|
+
type DomIndex = {
|
|
10843
|
+
readonly generation: number;
|
|
10844
|
+
};
|
|
10845
|
+
type CaretLocation = {
|
|
10846
|
+
readonly address: TokenAddress;
|
|
10847
|
+
readonly role: 'row' | 'token' | 'text' | 'markDescendant';
|
|
10848
|
+
};
|
|
10849
|
+
type DomDiagnostic = {
|
|
10850
|
+
readonly kind: 'missingRole' | 'stalePath' | 'outsideEditor' | 'controlBoundary' | 'mixedBoundary' | 'invalidBoundary' | 'renderReentry' | 'recoveryFailed' | 'missingContainer' | 'ambiguousStructure';
|
|
10851
|
+
readonly path?: TokenPath;
|
|
10852
|
+
readonly reason: string;
|
|
10853
|
+
};
|
|
10854
|
+
type EditSource = 'input' | 'paste' | 'cut' | 'overlay' | 'mark' | 'block' | 'drag';
|
|
10855
|
+
//#endregion
|
|
10856
|
+
//#region ../../core/src/features/caret/CaretFeature.d.ts
|
|
10857
|
+
declare class CaretFeature implements Feature {
|
|
10768
10858
|
#private;
|
|
10769
|
-
private readonly
|
|
10770
|
-
|
|
10859
|
+
private readonly _store;
|
|
10860
|
+
readonly recovery: Signal<CaretRecovery | undefined>;
|
|
10861
|
+
readonly location: Signal<CaretLocation | undefined>;
|
|
10862
|
+
readonly selecting: Signal<"drag" | "all" | undefined>;
|
|
10863
|
+
constructor(_store: Store);
|
|
10771
10864
|
enable(): void;
|
|
10772
10865
|
disable(): void;
|
|
10866
|
+
placeAt(rawPosition: number, affinity?: 'before' | 'after'): Result<void, 'notIndexed' | 'invalidBoundary'>;
|
|
10867
|
+
focus(address: TokenAddress, boundary?: 'start' | 'end'): Result<void, 'notIndexed' | 'stale'>;
|
|
10773
10868
|
}
|
|
10774
10869
|
//#endregion
|
|
10775
|
-
//#region ../../core/src/
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10870
|
+
//#region ../../core/src/shared/signals/signal.d.ts
|
|
10871
|
+
interface Signal<T> {
|
|
10872
|
+
(): T;
|
|
10873
|
+
(value: T | undefined): void;
|
|
10874
|
+
}
|
|
10875
|
+
type SignalValues<T> = { [K in keyof T]: T[K] extends Signal<infer V> | Computed<infer V> ? V : T[K] };
|
|
10876
|
+
interface Computed<T> {
|
|
10877
|
+
(): T;
|
|
10878
|
+
}
|
|
10879
|
+
interface Event<T = void> {
|
|
10880
|
+
(payload: T): void;
|
|
10881
|
+
read(): T | undefined;
|
|
10882
|
+
}
|
|
10883
|
+
//#endregion
|
|
10884
|
+
//#region ../../core/src/features/props/PropsFeature.d.ts
|
|
10885
|
+
declare class PropsFeature {
|
|
10886
|
+
private readonly _store;
|
|
10887
|
+
readonly value: Signal<string | undefined>;
|
|
10888
|
+
readonly defaultValue: Signal<string | undefined>;
|
|
10889
|
+
readonly onChange: Signal<((value: string) => void) | undefined>;
|
|
10890
|
+
readonly options: Signal<CoreOption[]>;
|
|
10891
|
+
readonly readOnly: Signal<boolean>;
|
|
10892
|
+
readonly layout: Signal<"inline" | "block">;
|
|
10893
|
+
readonly draggable: Signal<boolean | DraggableConfig>;
|
|
10894
|
+
readonly showOverlayOn: Signal<OverlayTrigger>;
|
|
10895
|
+
readonly Span: Signal<_$react.ElementType | undefined>;
|
|
10896
|
+
readonly Mark: Signal<_$react.ElementType | undefined>;
|
|
10897
|
+
readonly Overlay: Signal<_$react.ElementType | undefined>;
|
|
10898
|
+
readonly className: Signal<string | undefined>;
|
|
10899
|
+
readonly style: Signal<CSSProperties$1 | undefined>;
|
|
10900
|
+
readonly slots: Signal<CoreSlots | undefined>;
|
|
10901
|
+
readonly slotProps: Signal<CoreSlotProps | undefined>;
|
|
10902
|
+
constructor(_store: Store);
|
|
10903
|
+
set(values: Partial<SignalValues<typeof this>>): void;
|
|
10782
10904
|
}
|
|
10783
10905
|
//#endregion
|
|
10784
10906
|
//#region ../../core/src/store/BlockStore.d.ts
|
|
@@ -10813,8 +10935,8 @@ declare class BlockRegistry {
|
|
|
10813
10935
|
get(token: object): BlockStore;
|
|
10814
10936
|
}
|
|
10815
10937
|
//#endregion
|
|
10816
|
-
//#region ../../core/src/features/clipboard/
|
|
10817
|
-
declare class
|
|
10938
|
+
//#region ../../core/src/features/clipboard/ClipboardFeature.d.ts
|
|
10939
|
+
declare class ClipboardFeature {
|
|
10818
10940
|
#private;
|
|
10819
10941
|
private readonly store;
|
|
10820
10942
|
constructor(store: Store);
|
|
@@ -10822,231 +10944,207 @@ declare class CopyFeature {
|
|
|
10822
10944
|
disable(): void;
|
|
10823
10945
|
}
|
|
10824
10946
|
//#endregion
|
|
10825
|
-
//#region ../../core/src/features/
|
|
10826
|
-
declare class
|
|
10947
|
+
//#region ../../core/src/features/dom/DomFeature.d.ts
|
|
10948
|
+
declare class DomFeature {
|
|
10827
10949
|
#private;
|
|
10828
|
-
private readonly
|
|
10829
|
-
|
|
10950
|
+
private readonly _store;
|
|
10951
|
+
readonly index: Computed<DomIndex | undefined>;
|
|
10952
|
+
readonly container: Signal<HTMLElement | null>;
|
|
10953
|
+
readonly diagnostics: Event<DomDiagnostic>;
|
|
10954
|
+
constructor(_store: Store);
|
|
10830
10955
|
enable(): void;
|
|
10831
10956
|
disable(): void;
|
|
10957
|
+
compositionStarted(): void;
|
|
10958
|
+
compositionEnded(): void;
|
|
10959
|
+
controlFor(ownerPath?: TokenPath): DomRef;
|
|
10960
|
+
childrenFor(ownerPath: TokenPath): DomRef;
|
|
10961
|
+
reconcile(): void;
|
|
10962
|
+
locateNode(node: Node): NodeLocationResult;
|
|
10963
|
+
placeCaretAtRawPosition(rawPosition: number, affinity?: 'before' | 'after'): Result<void, 'notIndexed' | 'invalidBoundary'>;
|
|
10964
|
+
focusAddress(address: TokenAddress, boundary?: 'start' | 'end'): Result<void, 'notIndexed' | 'stale'>;
|
|
10965
|
+
rawPositionFromBoundary(node: Node, offset: number, affinity?: 'before' | 'after'): BoundaryPositionResult;
|
|
10966
|
+
readRawSelection(): RawSelectionResult;
|
|
10832
10967
|
}
|
|
10833
10968
|
//#endregion
|
|
10834
|
-
//#region ../../core/src/features/
|
|
10835
|
-
declare class
|
|
10969
|
+
//#region ../../core/src/features/drag/DragFeature.d.ts
|
|
10970
|
+
declare class DragFeature {
|
|
10836
10971
|
#private;
|
|
10837
10972
|
private readonly store;
|
|
10973
|
+
readonly action: Event<DragAction>;
|
|
10838
10974
|
constructor(store: Store);
|
|
10839
10975
|
enable(): void;
|
|
10840
10976
|
disable(): void;
|
|
10841
|
-
sync(): void;
|
|
10842
10977
|
}
|
|
10843
10978
|
//#endregion
|
|
10844
|
-
//#region ../../core/src/features/
|
|
10845
|
-
declare class
|
|
10979
|
+
//#region ../../core/src/features/keyboard/KeyboardFeature.d.ts
|
|
10980
|
+
declare class KeyboardFeature implements Feature {
|
|
10846
10981
|
#private;
|
|
10847
|
-
private readonly
|
|
10848
|
-
constructor(
|
|
10982
|
+
private readonly _store;
|
|
10983
|
+
constructor(_store: Store);
|
|
10849
10984
|
enable(): void;
|
|
10850
10985
|
disable(): void;
|
|
10851
10986
|
}
|
|
10852
10987
|
//#endregion
|
|
10853
|
-
//#region ../../core/src/features/
|
|
10854
|
-
declare class
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10988
|
+
//#region ../../core/src/features/lifecycle/LifecycleFeature.d.ts
|
|
10989
|
+
declare class LifecycleFeature implements Feature {
|
|
10990
|
+
readonly mounted: Event<void>;
|
|
10991
|
+
readonly unmounted: Event<void>;
|
|
10992
|
+
readonly rendered: Event<void>;
|
|
10858
10993
|
enable(): void;
|
|
10859
10994
|
disable(): void;
|
|
10860
10995
|
}
|
|
10861
10996
|
//#endregion
|
|
10862
|
-
//#region ../../core/src/
|
|
10863
|
-
declare class
|
|
10997
|
+
//#region ../../core/src/features/mark/MarkController.d.ts
|
|
10998
|
+
declare class MarkController {
|
|
10999
|
+
#private;
|
|
10864
11000
|
private readonly store;
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
11001
|
+
private readonly address;
|
|
11002
|
+
private readonly snapshot;
|
|
11003
|
+
constructor(store: Store, address: TokenAddress, snapshot: MarkSnapshot, shape: TokenShapeSnapshot);
|
|
11004
|
+
static fromToken(store: Store, token: MarkToken): MarkController;
|
|
11005
|
+
get value(): string;
|
|
11006
|
+
get meta(): string | undefined;
|
|
11007
|
+
get slot(): string | undefined;
|
|
11008
|
+
get readOnly(): boolean;
|
|
11009
|
+
remove(): EditResult;
|
|
11010
|
+
update(patch: MarkPatch): EditResult;
|
|
10869
11011
|
}
|
|
10870
11012
|
//#endregion
|
|
10871
|
-
//#region ../../core/src/
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
get(object: object): number | undefined;
|
|
11013
|
+
//#region ../../core/src/features/slots/types.d.ts
|
|
11014
|
+
interface MarkSlot {
|
|
11015
|
+
(): (token: Token) => readonly [Slot, Record<string, unknown>];
|
|
10875
11016
|
}
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
declare class NodeProxy {
|
|
10879
|
-
#private;
|
|
10880
|
-
get target(): HTMLElement | undefined;
|
|
10881
|
-
set target(value: Node | HTMLElement | EventTarget | undefined | null);
|
|
10882
|
-
get next(): NodeProxy;
|
|
10883
|
-
get prev(): NodeProxy;
|
|
10884
|
-
get isSpan(): boolean;
|
|
10885
|
-
get isMark(): boolean;
|
|
10886
|
-
get isEditable(): boolean;
|
|
10887
|
-
get isCaretAtBeginning(): boolean;
|
|
10888
|
-
get isCaretAtEnd(): boolean;
|
|
10889
|
-
get index(): number;
|
|
10890
|
-
get caret(): number;
|
|
10891
|
-
set caret(value: number);
|
|
10892
|
-
get length(): number;
|
|
10893
|
-
get content(): string;
|
|
10894
|
-
set content(value: string | undefined);
|
|
10895
|
-
get head(): HTMLElement | null;
|
|
10896
|
-
get tail(): HTMLElement | null;
|
|
10897
|
-
get isFocused(): boolean;
|
|
10898
|
-
constructor(target: Node | EventTarget | null | undefined, store: Store);
|
|
10899
|
-
setCaretToEnd(): void;
|
|
10900
|
-
focus(): void;
|
|
10901
|
-
clear(): void;
|
|
11017
|
+
interface OverlaySlot {
|
|
11018
|
+
(): (option?: CoreOption, defaultComponent?: Slot) => readonly [Slot, Record<string, unknown>];
|
|
10902
11019
|
}
|
|
10903
11020
|
//#endregion
|
|
10904
|
-
//#region ../../core/src/
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
11021
|
+
//#region ../../core/src/features/slots/SlotsFeature.d.ts
|
|
11022
|
+
declare class SlotsFeature implements Feature {
|
|
11023
|
+
private readonly _store;
|
|
11024
|
+
readonly isBlock: Computed<boolean>;
|
|
11025
|
+
readonly isDraggable: Computed<boolean>;
|
|
11026
|
+
readonly containerComponent: Computed<Slot>;
|
|
11027
|
+
readonly containerProps: Computed<{
|
|
11028
|
+
className: string | undefined;
|
|
11029
|
+
style?: CSSProperties$1;
|
|
11030
|
+
[key: string]: unknown;
|
|
11031
|
+
}>;
|
|
11032
|
+
readonly blockComponent: Computed<Slot>;
|
|
11033
|
+
readonly blockProps: Computed<Record<string, unknown> | undefined>;
|
|
11034
|
+
readonly spanComponent: Computed<Slot>;
|
|
11035
|
+
readonly spanProps: Computed<Record<string, unknown> | undefined>;
|
|
11036
|
+
constructor(_store: Store);
|
|
11037
|
+
enable(): void;
|
|
11038
|
+
disable(): void;
|
|
10916
11039
|
}
|
|
10917
11040
|
//#endregion
|
|
10918
|
-
//#region ../../core/src/features/
|
|
10919
|
-
declare class
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
11041
|
+
//#region ../../core/src/features/mark/MarkFeature.d.ts
|
|
11042
|
+
declare class MarkFeature implements Feature {
|
|
11043
|
+
private readonly _store;
|
|
11044
|
+
readonly enabled: Computed<boolean>;
|
|
11045
|
+
readonly slot: MarkSlot;
|
|
11046
|
+
constructor(_store: Store);
|
|
10923
11047
|
enable(): void;
|
|
10924
11048
|
disable(): void;
|
|
10925
11049
|
}
|
|
10926
11050
|
//#endregion
|
|
10927
11051
|
//#region ../../core/src/features/overlay/OverlayFeature.d.ts
|
|
10928
|
-
declare class OverlayFeature {
|
|
11052
|
+
declare class OverlayFeature implements Feature {
|
|
10929
11053
|
#private;
|
|
10930
|
-
private readonly
|
|
10931
|
-
|
|
11054
|
+
private readonly _store;
|
|
11055
|
+
readonly match: Signal<OverlayMatch | undefined>;
|
|
11056
|
+
readonly element: Signal<HTMLElement | null>;
|
|
11057
|
+
readonly slot: OverlaySlot;
|
|
11058
|
+
readonly select: Event<{
|
|
11059
|
+
mark: Token;
|
|
11060
|
+
match: OverlayMatch;
|
|
11061
|
+
}>;
|
|
11062
|
+
readonly close: Event<void>;
|
|
11063
|
+
constructor(_store: Store);
|
|
10932
11064
|
enable(): void;
|
|
10933
11065
|
disable(): void;
|
|
10934
11066
|
}
|
|
10935
11067
|
//#endregion
|
|
11068
|
+
//#region ../../core/src/features/parsing/tokenIndex.d.ts
|
|
11069
|
+
type TokenIndex = {
|
|
11070
|
+
readonly generation: number;
|
|
11071
|
+
pathFor(token: Token): TokenPath | undefined;
|
|
11072
|
+
addressFor(path: TokenPath): TokenAddress | undefined;
|
|
11073
|
+
resolve(path: TokenPath): Token | undefined;
|
|
11074
|
+
resolveAddress(address: TokenAddress, expected?: TokenShapeSnapshot): Result<Token, 'stale'>;
|
|
11075
|
+
key(path: TokenPath): string;
|
|
11076
|
+
equals(a: TokenPath, b: TokenPath): boolean;
|
|
11077
|
+
};
|
|
11078
|
+
//#endregion
|
|
10936
11079
|
//#region ../../core/src/features/parsing/ParseFeature.d.ts
|
|
10937
|
-
declare class
|
|
11080
|
+
declare class ParsingFeature implements Feature {
|
|
10938
11081
|
#private;
|
|
10939
|
-
private readonly
|
|
10940
|
-
|
|
11082
|
+
private readonly _store;
|
|
11083
|
+
readonly tokens: Signal<Token[]>;
|
|
11084
|
+
readonly index: Computed<TokenIndex>;
|
|
11085
|
+
readonly parser: Computed<Parser | undefined>;
|
|
11086
|
+
readonly reparse: Event<void>;
|
|
11087
|
+
constructor(_store: Store);
|
|
11088
|
+
parseValue(value: string): Token[];
|
|
11089
|
+
acceptTokens(tokens: Token[]): void;
|
|
10941
11090
|
enable(): void;
|
|
10942
11091
|
disable(): void;
|
|
10943
|
-
sync(): void;
|
|
11092
|
+
sync(value?: string): void;
|
|
10944
11093
|
}
|
|
10945
11094
|
//#endregion
|
|
10946
|
-
//#region ../../core/src/features/
|
|
10947
|
-
declare class
|
|
11095
|
+
//#region ../../core/src/features/value/ValueFeature.d.ts
|
|
11096
|
+
declare class ValueFeature implements Feature {
|
|
10948
11097
|
#private;
|
|
10949
|
-
private readonly
|
|
10950
|
-
|
|
11098
|
+
private readonly _store;
|
|
11099
|
+
readonly current: Signal<string>;
|
|
11100
|
+
readonly isControlledMode: Computed<boolean>;
|
|
11101
|
+
readonly change: Event<void>;
|
|
11102
|
+
constructor(_store: Store);
|
|
10951
11103
|
enable(): void;
|
|
10952
11104
|
disable(): void;
|
|
11105
|
+
replaceRange(range: RawRange, replacement: string, options?: {
|
|
11106
|
+
recover?: CaretRecovery;
|
|
11107
|
+
source?: EditSource;
|
|
11108
|
+
}): EditResult;
|
|
11109
|
+
replaceAll(next: string, options?: {
|
|
11110
|
+
recover?: CaretRecovery;
|
|
11111
|
+
source?: EditSource;
|
|
11112
|
+
}): EditResult;
|
|
10953
11113
|
}
|
|
10954
11114
|
//#endregion
|
|
10955
|
-
//#region ../../core/src/
|
|
10956
|
-
|
|
10957
|
-
|
|
11115
|
+
//#region ../../core/src/shared/classes/MarkputHandler.d.ts
|
|
11116
|
+
declare class MarkputHandler {
|
|
11117
|
+
private readonly store;
|
|
11118
|
+
constructor(store: Store);
|
|
11119
|
+
get container(): HTMLElement | null;
|
|
11120
|
+
get overlay(): HTMLElement | null;
|
|
11121
|
+
focus(): void;
|
|
10958
11122
|
}
|
|
10959
|
-
|
|
10960
|
-
|
|
11123
|
+
//#endregion
|
|
11124
|
+
//#region ../../core/src/shared/classes/KeyGenerator.d.ts
|
|
11125
|
+
declare class KeyGenerator {
|
|
11126
|
+
#private;
|
|
11127
|
+
get(object: object): number | undefined;
|
|
10961
11128
|
}
|
|
10962
11129
|
//#endregion
|
|
10963
11130
|
//#region ../../core/src/store/Store.d.ts
|
|
10964
11131
|
declare class Store {
|
|
10965
11132
|
readonly key: KeyGenerator;
|
|
10966
11133
|
readonly blocks: BlockRegistry;
|
|
10967
|
-
readonly
|
|
10968
|
-
focus: NodeProxy;
|
|
10969
|
-
input: NodeProxy;
|
|
10970
|
-
};
|
|
10971
|
-
readonly props: {
|
|
10972
|
-
value: Signal<string | undefined>;
|
|
10973
|
-
defaultValue: Signal<string | undefined>;
|
|
10974
|
-
onChange: Signal<((value: string) => void) | undefined>;
|
|
10975
|
-
options: Signal<CoreOption[]>;
|
|
10976
|
-
readOnly: Signal<boolean>;
|
|
10977
|
-
layout: Signal<"inline" | "block">;
|
|
10978
|
-
draggable: Signal<boolean | DraggableConfig>;
|
|
10979
|
-
showOverlayOn: Signal<OverlayTrigger>;
|
|
10980
|
-
Span: Signal<_$react.ElementType | undefined>;
|
|
10981
|
-
Mark: Signal<_$react.ElementType | undefined>;
|
|
10982
|
-
Overlay: Signal<_$react.ElementType | undefined>;
|
|
10983
|
-
className: Signal<string | undefined>;
|
|
10984
|
-
style: Signal<CSSProperties$1 | undefined>;
|
|
10985
|
-
slots: Signal<CoreSlots | undefined>;
|
|
10986
|
-
slotProps: Signal<CoreSlotProps | undefined>;
|
|
10987
|
-
};
|
|
10988
|
-
readonly state: {
|
|
10989
|
-
tokens: Signal<Token[]>;
|
|
10990
|
-
previousValue: Signal<string | undefined>;
|
|
10991
|
-
innerValue: Signal<string | undefined>;
|
|
10992
|
-
recovery: Signal<Recovery | undefined>;
|
|
10993
|
-
container: Signal<HTMLDivElement | null>;
|
|
10994
|
-
overlay: Signal<HTMLElement | null>;
|
|
10995
|
-
selecting: Signal<"drag" | "all" | undefined>;
|
|
10996
|
-
overlayMatch: Signal<OverlayMatch | undefined>;
|
|
10997
|
-
};
|
|
10998
|
-
readonly computed: {
|
|
10999
|
-
hasMark: Computed<boolean>;
|
|
11000
|
-
isBlock: Computed<boolean>;
|
|
11001
|
-
isDraggable: Computed<boolean>;
|
|
11002
|
-
parser: Computed<Parser | undefined>;
|
|
11003
|
-
currentValue: Computed<string>;
|
|
11004
|
-
containerComponent: Computed<Slot>;
|
|
11005
|
-
containerProps: Computed<{
|
|
11006
|
-
className: string | undefined;
|
|
11007
|
-
style?: CSSProperties$1;
|
|
11008
|
-
[key: string]: unknown;
|
|
11009
|
-
}>;
|
|
11010
|
-
blockComponent: Computed<Slot>;
|
|
11011
|
-
blockProps: Computed<Record<string, unknown> | undefined>;
|
|
11012
|
-
spanComponent: Computed<Slot>;
|
|
11013
|
-
spanProps: Computed<Record<string, unknown> | undefined>;
|
|
11014
|
-
overlay: OverlaySlot;
|
|
11015
|
-
mark: MarkSlot;
|
|
11016
|
-
};
|
|
11017
|
-
readonly emit: {
|
|
11018
|
-
/** Fires after user input or programmatic mark change — triggers serialization, `onChange`, and re-parse */change: Event<void>; /** Triggers a re-parse of tokens from the current content */
|
|
11019
|
-
reparse: Event<void>; /** Removes a mark token from editor content */
|
|
11020
|
-
markRemove: Event<{
|
|
11021
|
-
token: Token;
|
|
11022
|
-
}>; /** Fires when the user selects an overlay option — annotates markup into the current input span */
|
|
11023
|
-
overlaySelect: Event<{
|
|
11024
|
-
mark: Token;
|
|
11025
|
-
match: OverlayMatch;
|
|
11026
|
-
}>; /** Dismisses the overlay by clearing the current `overlayMatch` */
|
|
11027
|
-
overlayClose: Event<void>; /** Post-render DOM alignment: aligns `contentEditable` attributes and `textContent` of child elements to token state. Emitted synchronously by `FocusFeature` inside the `rendered` handler (framework layout-effect phase). Load-bearing for post-commit DOM consistency — do not delete without reproducing this timing. */
|
|
11028
|
-
sync: Event<void>; /** Dispatches drag-mode row operations (reorder, add, delete, duplicate) */
|
|
11029
|
-
drag: Event<DragAction>; /** Fires after the framework has committed new token elements to the DOM — kicks off sync and focus recovery */
|
|
11030
|
-
rendered: Event<void>; /** Lifecycle: editor component added to the DOM — enables all features */
|
|
11031
|
-
mounted: Event<void>; /** Lifecycle: editor component removed from the DOM — disables all features and cleans up subscriptions */
|
|
11032
|
-
unmounted: Event<void>;
|
|
11033
|
-
};
|
|
11134
|
+
readonly props: PropsFeature;
|
|
11034
11135
|
readonly handler: MarkputHandler;
|
|
11035
|
-
readonly
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
parse: ParseFeature;
|
|
11047
|
-
};
|
|
11136
|
+
readonly lifecycle: LifecycleFeature;
|
|
11137
|
+
readonly value: ValueFeature;
|
|
11138
|
+
readonly mark: MarkFeature;
|
|
11139
|
+
readonly overlay: OverlayFeature;
|
|
11140
|
+
readonly slots: SlotsFeature;
|
|
11141
|
+
readonly caret: CaretFeature;
|
|
11142
|
+
readonly keyboard: KeyboardFeature;
|
|
11143
|
+
readonly dom: DomFeature;
|
|
11144
|
+
readonly drag: DragFeature;
|
|
11145
|
+
readonly clipboard: ClipboardFeature;
|
|
11146
|
+
readonly parsing: ParsingFeature;
|
|
11048
11147
|
constructor();
|
|
11049
|
-
setProps(values: Partial<SignalValues<typeof this.props>>): void;
|
|
11050
11148
|
}
|
|
11051
11149
|
//#endregion
|
|
11052
11150
|
//#region ../../core/src/shared/types.d.ts
|
|
@@ -11119,21 +11217,12 @@ type OverlayMatch<TOption = CoreOption> = {
|
|
|
11119
11217
|
* Html element, in which was a overlayMatch
|
|
11120
11218
|
*/
|
|
11121
11219
|
node: Node;
|
|
11122
|
-
|
|
11123
|
-
* Start position of a overlayMatch
|
|
11124
|
-
*/
|
|
11125
|
-
index: number;
|
|
11220
|
+
range: RawRange;
|
|
11126
11221
|
/**
|
|
11127
11222
|
* OverlayMatch's option
|
|
11128
11223
|
*/
|
|
11129
11224
|
option: TOption;
|
|
11130
11225
|
};
|
|
11131
|
-
type Recovery = {
|
|
11132
|
-
anchor: NodeProxy;
|
|
11133
|
-
isNext?: boolean;
|
|
11134
|
-
caret: number;
|
|
11135
|
-
childIndex?: number;
|
|
11136
|
-
};
|
|
11137
11226
|
type OverlayTrigger = Array<'change' | 'selectionChange'> | 'change' | 'selectionChange' | 'none';
|
|
11138
11227
|
type CSSProperties$1 = Properties<string | number>;
|
|
11139
11228
|
type DataAttributes = Record<`data${Capitalize<string>}`, string | number | boolean | undefined>;
|
|
@@ -11174,47 +11263,13 @@ type DragAction = {
|
|
|
11174
11263
|
index: number;
|
|
11175
11264
|
};
|
|
11176
11265
|
interface DragActions {
|
|
11177
|
-
|
|
11266
|
+
action: {
|
|
11178
11267
|
(action: DragAction): void;
|
|
11179
11268
|
};
|
|
11180
11269
|
}
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
current: T | null;
|
|
11185
|
-
}
|
|
11186
|
-
declare class MarkHandler<T extends HTMLElement = HTMLElement> {
|
|
11187
|
-
#private;
|
|
11188
|
-
readonly ref: RefAccessor<T>;
|
|
11189
|
-
constructor(param: {
|
|
11190
|
-
ref: RefAccessor<T>;
|
|
11191
|
-
store: Store;
|
|
11192
|
-
token: MarkToken;
|
|
11193
|
-
});
|
|
11194
|
-
get readOnly(): boolean | undefined;
|
|
11195
|
-
set readOnly(value: boolean | undefined);
|
|
11196
|
-
get content(): string;
|
|
11197
|
-
set content(value: string);
|
|
11198
|
-
get value(): string | undefined;
|
|
11199
|
-
set value(v: string | undefined);
|
|
11200
|
-
get meta(): string | undefined;
|
|
11201
|
-
set meta(v: string | undefined);
|
|
11202
|
-
get slot(): string | undefined;
|
|
11203
|
-
get depth(): number;
|
|
11204
|
-
get hasChildren(): boolean;
|
|
11205
|
-
get parent(): MarkToken | undefined;
|
|
11206
|
-
get tokens(): Token[];
|
|
11207
|
-
change: (props: {
|
|
11208
|
-
content: string;
|
|
11209
|
-
value?: string;
|
|
11210
|
-
meta?: string;
|
|
11211
|
-
}) => void;
|
|
11212
|
-
remove: () => void;
|
|
11213
|
-
}
|
|
11214
|
-
//#endregion
|
|
11215
|
-
//#region ../../core/src/features/mark/types.d.ts
|
|
11216
|
-
interface MarkOptions {
|
|
11217
|
-
controlled?: boolean;
|
|
11270
|
+
interface Feature {
|
|
11271
|
+
enable(): void;
|
|
11272
|
+
disable(): void;
|
|
11218
11273
|
}
|
|
11219
11274
|
//#endregion
|
|
11220
11275
|
//#region src/types.d.ts
|
|
@@ -11348,7 +11403,10 @@ interface MarkedInputProps<TMarkProps = MarkProps, TOverlayProps extends CoreOpt
|
|
|
11348
11403
|
declare function MarkedInput<TMarkProps = MarkProps, TOverlayProps extends CoreOption['overlay'] = OverlayProps>(props: MarkedInputProps<TMarkProps, TOverlayProps>): _$react_jsx_runtime0.JSX.Element;
|
|
11349
11404
|
//#endregion
|
|
11350
11405
|
//#region src/lib/hooks/useMark.d.ts
|
|
11351
|
-
declare const useMark:
|
|
11406
|
+
declare const useMark: () => MarkController;
|
|
11407
|
+
//#endregion
|
|
11408
|
+
//#region src/lib/hooks/useMarkInfo.d.ts
|
|
11409
|
+
declare const useMarkInfo: () => MarkInfo;
|
|
11352
11410
|
//#endregion
|
|
11353
11411
|
//#region src/lib/hooks/useOverlay.d.ts
|
|
11354
11412
|
interface OverlayHandler {
|
|
@@ -11372,5 +11430,5 @@ type ObjectSelector = Record<string, Selectable<unknown> | unknown>;
|
|
|
11372
11430
|
declare function useMarkput<T>(selector: (store: Store) => Selectable<T>): T;
|
|
11373
11431
|
declare function useMarkput<R extends ObjectSelector>(selector: (store: Store) => R): SignalValues<R>;
|
|
11374
11432
|
//#endregion
|
|
11375
|
-
export {
|
|
11433
|
+
export { MarkController, type MarkProps, type MarkToken, MarkedInput, type MarkedInputProps, MarkputHandler, type Markup, type Option, type OverlayHandler, type OverlayProps, type TextToken, type Token, annotate, denote, useMark, useMarkInfo, useMarkput, useOverlay };
|
|
11376
11434
|
//# sourceMappingURL=index.d.ts.map
|