@etrepum/lexical-builder-core 0.0.25-nightly.20240624.0 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/types.d.ts +19 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
export declare const PACKAGE_VERSION: string;
|
9
9
|
export { configPlan, definePlan, provideOutput, declarePeerDependency, } from './definePlan';
|
10
|
-
export { type AnyLexicalPlan, type AnyLexicalPlanArgument, type
|
10
|
+
export { type AnyLexicalPlan, type AnyLexicalPlanArgument, type LexicalEditorWithDispose, type InitialEditorConfig, type InitialEditorStateType, type LexicalPlan, type LexicalPlanArgument, type LexicalPlanConfig, type LexicalPlanInit, type LexicalPlanName, type LexicalPlanOutput, type OutputComponentPlan, type LexicalPlanDependency, type NormalizedLexicalPlanArgument, type PlanConfigBase, type RegisterState, type RegisterCleanup, type NormalizedPeerDependency, } from './types';
|
11
11
|
export { type LexicalPlanInternal, type initTypeSymbol, type configTypeSymbol, type outputTypeSymbol, } from './internal';
|
12
12
|
export { safeCast } from './safeCast';
|
13
13
|
export { shallowMergeConfig } from './shallowMergeConfig';
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,wBAAwB,GAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -10,10 +10,10 @@ function f(n, t) {
|
|
10
10
|
function c(n, t) {
|
11
11
|
return [n, t];
|
12
12
|
}
|
13
|
-
function
|
13
|
+
function a(n) {
|
14
14
|
return n;
|
15
15
|
}
|
16
|
-
function
|
16
|
+
function i(n, t) {
|
17
17
|
if (!t || n === t)
|
18
18
|
return n;
|
19
19
|
for (const u in t)
|
@@ -21,13 +21,13 @@ function a(n, t) {
|
|
21
21
|
return { ...n, ...t };
|
22
22
|
return n;
|
23
23
|
}
|
24
|
-
const o = "0.0.25
|
24
|
+
const o = "0.0.25";
|
25
25
|
export {
|
26
26
|
o as PACKAGE_VERSION,
|
27
27
|
r as configPlan,
|
28
28
|
c as declarePeerDependency,
|
29
29
|
e as definePlan,
|
30
30
|
f as provideOutput,
|
31
|
-
|
32
|
-
|
31
|
+
a as safeCast,
|
32
|
+
i as shallowMergeConfig
|
33
33
|
};
|
package/dist/types.d.ts
CHANGED
@@ -32,7 +32,7 @@ export type NormalizedLexicalPlanArgument<in out Config extends PlanConfigBase,
|
|
32
32
|
* configuration for plan dependencies
|
33
33
|
*/
|
34
34
|
export interface RegisterState<Init> {
|
35
|
-
/** An AbortSignal that is aborted when the
|
35
|
+
/** An AbortSignal that is aborted when the LexicalEditor is disposed */
|
36
36
|
signal: AbortSignal;
|
37
37
|
/**
|
38
38
|
* Get the result of a peerDependency by name, if it exists
|
@@ -81,7 +81,7 @@ export type RegisterCleanup<Output> = (() => void) & (unknown extends Output ? {
|
|
81
81
|
* A Plan may depend on other Plans, and provide functionality to other
|
82
82
|
* plans through its config.
|
83
83
|
*/
|
84
|
-
export interface LexicalPlan<in out Config extends PlanConfigBase
|
84
|
+
export interface LexicalPlan<in out Config extends PlanConfigBase, out Name extends string, in out Output extends unknown, in out Init extends unknown> extends InitialEditorConfig, LexicalPlanInternal<Config, Output, Init> {
|
85
85
|
/** The name of the Plan, must be unique */
|
86
86
|
readonly name: Name;
|
87
87
|
/** Plan names that must not be loaded with this Plan */
|
@@ -137,10 +137,11 @@ export interface LexicalPlan<in out Config extends PlanConfigBase = PlanConfigBa
|
|
137
137
|
* used, and methods for accessing the merged configuration of
|
138
138
|
* dependencies and peerDependencies
|
139
139
|
*/
|
140
|
-
init?: (editorConfig: InitialEditorConfig, config: Config, state: RegisterState<
|
140
|
+
init?: (editorConfig: InitialEditorConfig, config: Config, state: RegisterState<never>) => Init;
|
141
141
|
/**
|
142
142
|
* Add behavior to the editor (register transforms, listeners, etc.) after
|
143
|
-
* the Editor is created
|
143
|
+
* the Editor is created, but before its initial state is set.
|
144
|
+
* The register function may also mutate the config
|
144
145
|
* in-place to expose data to other plans that use it as a dependency.
|
145
146
|
*
|
146
147
|
* @param editor The editor this Plan is being registered with
|
@@ -151,6 +152,18 @@ export interface LexicalPlan<in out Config extends PlanConfigBase = PlanConfigBa
|
|
151
152
|
* @returns A clean-up function
|
152
153
|
*/
|
153
154
|
register?: (editor: LexicalEditor, config: Config, state: RegisterState<Init>) => RegisterCleanup<Output>;
|
155
|
+
/**
|
156
|
+
* Run any code that must happen after initialization of the
|
157
|
+
* editor state (which happens after all register calls).
|
158
|
+
*
|
159
|
+
* @param editor The editor this Plan is being registered with
|
160
|
+
* @param config The merged configuration specific to this Plan
|
161
|
+
* @param state An object containing an AbortSignal that can be
|
162
|
+
* used, and methods for accessing the merged configuration of
|
163
|
+
* dependencies and peerDependencies
|
164
|
+
* @returns A clean-up function
|
165
|
+
*/
|
166
|
+
afterInitialization?: (editor: LexicalEditor, config: Config, state: RegisterState<Init>) => () => void;
|
154
167
|
}
|
155
168
|
/**
|
156
169
|
* Extract the Config type from a Plan
|
@@ -175,11 +188,9 @@ export type OutputComponentPlan<ComponentType> = LexicalPlan<any, any, {
|
|
175
188
|
Component: ComponentType;
|
176
189
|
}, any>;
|
177
190
|
/**
|
178
|
-
* A handle to the editor
|
191
|
+
* A handle to the editor with an attached dispose function
|
179
192
|
*/
|
180
|
-
export interface
|
181
|
-
/** The created editor */
|
182
|
-
editor: LexicalEditor;
|
193
|
+
export interface LexicalEditorWithDispose extends LexicalEditor, Disposable {
|
183
194
|
/**
|
184
195
|
* Dispose the editor and perform all clean-up
|
185
196
|
* (also available as Symbol.dispose via Disposable)
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;GAEG;AAEH,MAAM,MAAM,cAAc,GAAG,WAAW,CA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