@lexical/html 0.44.1-nightly.20260518.0 → 0.45.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/{DOMRenderExtension.d.ts → dist/DOMRenderExtension.d.ts} +12 -1
- package/dist/DOMRenderRuntime.d.ts +51 -0
- package/dist/LexicalHtml.dev.js +3192 -0
- package/dist/LexicalHtml.dev.mjs +3146 -0
- package/{LexicalHtml.js.flow → dist/LexicalHtml.js.flow} +16 -16
- package/dist/LexicalHtml.mjs +56 -0
- package/dist/LexicalHtml.node.mjs +54 -0
- package/dist/LexicalHtml.prod.js +9 -0
- package/dist/LexicalHtml.prod.mjs +9 -0
- package/dist/RenderContext.d.ts +68 -0
- package/{compileDOMRenderConfigOverrides.d.ts → dist/compileDOMRenderConfigOverrides.d.ts} +1 -1
- package/{constants.d.ts → dist/constants.d.ts} +2 -0
- package/dist/domOverride.d.ts +23 -0
- package/dist/import/CoreImportExtension.d.ts +11 -0
- package/dist/import/DOMImportExtension.d.ts +82 -0
- package/dist/import/HorizontalRuleImportExtension.d.ts +27 -0
- package/dist/import/ImportContext.d.ts +208 -0
- package/dist/import/compileImportRules.d.ts +50 -0
- package/dist/import/coreImportRules.d.ts +25 -0
- package/dist/import/defineImportRule.d.ts +32 -0
- package/dist/import/defineOverlayRules.d.ts +66 -0
- package/dist/import/index.d.ts +38 -0
- package/dist/import/inlineStylesFromStyleSheets.d.ts +28 -0
- package/dist/import/parseCss.d.ts +18 -0
- package/dist/import/runImport.d.ts +19 -0
- package/dist/import/schemas.d.ts +91 -0
- package/dist/import/sel.d.ts +74 -0
- package/dist/import/types.d.ts +394 -0
- package/dist/index.d.ts +44 -0
- package/{types.d.ts → dist/types.d.ts} +96 -8
- package/package.json +33 -18
- package/src/ContextRecord.ts +243 -0
- package/src/DOMRenderExtension.ts +96 -0
- package/src/DOMRenderRuntime.ts +265 -0
- package/src/RenderContext.ts +168 -0
- package/src/compileDOMRenderConfigOverrides.ts +416 -0
- package/src/constants.ts +18 -0
- package/src/domOverride.ts +46 -0
- package/src/import/CoreImportExtension.ts +26 -0
- package/src/import/DOMImportExtension.ts +221 -0
- package/src/import/HorizontalRuleImportExtension.ts +53 -0
- package/src/import/ImportContext.ts +339 -0
- package/src/import/compileImportRules.ts +178 -0
- package/src/import/coreImportRules.ts +485 -0
- package/src/import/defineImportRule.ts +40 -0
- package/src/import/defineOverlayRules.ts +105 -0
- package/src/import/index.ts +96 -0
- package/src/import/inlineStylesFromStyleSheets.ts +104 -0
- package/src/import/parseCss.ts +219 -0
- package/src/import/runImport.ts +245 -0
- package/src/import/schemas.ts +236 -0
- package/src/import/sel.ts +314 -0
- package/src/import/types.ts +471 -0
- package/src/index.ts +555 -0
- package/src/types.ts +470 -0
- package/LexicalHtml.dev.js +0 -914
- package/LexicalHtml.dev.mjs +0 -900
- package/LexicalHtml.mjs +0 -24
- package/LexicalHtml.node.mjs +0 -22
- package/LexicalHtml.prod.js +0 -9
- package/LexicalHtml.prod.mjs +0 -9
- package/RenderContext.d.ts +0 -32
- package/domOverride.d.ts +0 -18
- package/index.d.ts +0 -32
- /package/{ContextRecord.d.ts → dist/ContextRecord.d.ts} +0 -0
- /package/{LexicalHtml.js → dist/LexicalHtml.js} +0 -0
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import type { DOMRenderConfig, DOMRenderExtensionOutput } from './types';
|
|
9
|
+
import type { InitialEditorConfig } from 'lexical';
|
|
10
|
+
/** @internal The result returned from {@link DOMRenderExtension}'s `init`. */
|
|
11
|
+
interface DOMRenderInitResult {
|
|
12
|
+
/**
|
|
13
|
+
* The `nodes` and base `dom` captured from the editor config before `dom`
|
|
14
|
+
* is overwritten with the compiled config — the only fields the runtime
|
|
15
|
+
* needs to recompile.
|
|
16
|
+
*/
|
|
17
|
+
initialEditorConfig: Pick<InitialEditorConfig, 'nodes' | 'dom'>;
|
|
18
|
+
}
|
|
9
19
|
/**
|
|
10
20
|
* @experimental
|
|
11
21
|
*
|
|
@@ -13,4 +23,5 @@ import type { DOMRenderConfig, DOMRenderExtensionOutput } from './types';
|
|
|
13
23
|
* editor. This is highly experimental and subject to change from one version
|
|
14
24
|
* to the next.
|
|
15
25
|
**/
|
|
16
|
-
export declare const DOMRenderExtension: import("lexical").LexicalExtension<DOMRenderConfig, "@lexical/html/DOM", DOMRenderExtensionOutput,
|
|
26
|
+
export declare const DOMRenderExtension: import("lexical").LexicalExtension<DOMRenderConfig, "@lexical/html/DOM", DOMRenderExtensionOutput, DOMRenderInitResult>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { AnyDOMRenderMatch, AnyRenderStateConfigPairOrUpdater, ContextRecord, DOMRenderRuntime, RenderStateConfig } from './types';
|
|
9
|
+
import type { EditorDOMRenderConfig, InitialEditorConfig, LexicalEditor } from 'lexical';
|
|
10
|
+
import { DOMRenderContextSymbol } from './constants';
|
|
11
|
+
type RenderContextRecord = ContextRecord<typeof DOMRenderContextSymbol>;
|
|
12
|
+
/**
|
|
13
|
+
* The mutable, writable editor-level context record. Reads of a render state
|
|
14
|
+
* during reconciliation (and as the base layer of a session) fall through to
|
|
15
|
+
* this record, and it is the layer the `disabledForEditor` predicates read.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function createEditorContextRecord(contextDefaults: readonly AnyRenderStateConfigPairOrUpdater[]): RenderContextRecord;
|
|
20
|
+
/**
|
|
21
|
+
* Filter the configured overrides down to those that are resident in the
|
|
22
|
+
* editor's render config, removing any whose `disabledForEditor` predicate
|
|
23
|
+
* returns `true` for the given editor context.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare function filterEditorInstalled(overrides: readonly AnyDOMRenderMatch[], record: RenderContextRecord): AnyDOMRenderMatch[];
|
|
28
|
+
/**
|
|
29
|
+
* Per-editor runtime backing {@link DOMRenderExtension}'s conditional
|
|
30
|
+
* overrides and imperative editor context. See {@link DOMRenderRuntime}.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare class DOMRenderRuntimeImpl implements DOMRenderRuntime {
|
|
35
|
+
readonly editor: LexicalEditor;
|
|
36
|
+
/**
|
|
37
|
+
* The `nodes` and base `dom` captured at `init` (before `dom` was
|
|
38
|
+
* overwritten with the compiled config) — the clean base for every recompile.
|
|
39
|
+
*/
|
|
40
|
+
readonly initialEditorConfig: Pick<InitialEditorConfig, 'nodes' | 'dom'>;
|
|
41
|
+
readonly overrides: readonly AnyDOMRenderMatch[];
|
|
42
|
+
readonly editorContext: RenderContextRecord;
|
|
43
|
+
readonly hasSessionGates: boolean;
|
|
44
|
+
installed: readonly AnyDOMRenderMatch[];
|
|
45
|
+
/** Memoized session configs keyed by the set of session-disabled overrides. */
|
|
46
|
+
private readonly sessionCache;
|
|
47
|
+
constructor(editor: LexicalEditor, initialEditorConfig: Pick<InitialEditorConfig, 'nodes' | 'dom'>, overrides: readonly AnyDOMRenderMatch[], editorContext: RenderContextRecord);
|
|
48
|
+
setContextValue<V>(cfg: RenderStateConfig<V>, value: V): void;
|
|
49
|
+
getSessionConfig(): EditorDOMRenderConfig;
|
|
50
|
+
}
|
|
51
|
+
export {};
|