@lyfie/luthor-headless 2.7.2 → 2.7.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/README.md +1 -5
- package/dist/index.d.ts +2 -8
- package/dist/index.js +50 -50
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
## Install
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
pnpm add @lyfie/luthor-headless lexical @lexical/code @lexical/link @lexical/list @lexical/markdown @lexical/react @lexical/rich-text @lexical/selection @lexical/table @lexical/utils
|
|
31
|
+
pnpm add @lyfie/luthor-headless lexical @lexical/code @lexical/link @lexical/list @lexical/markdown @lexical/react @lexical/rich-text @lexical/selection @lexical/table @lexical/utils react react-dom
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Optional:
|
|
@@ -37,10 +37,6 @@ Optional:
|
|
|
37
37
|
pnpm add highlight.js @emoji-mart/data
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Code-block grammars for common languages
|
|
41
|
-
(`bash`, `json`, `yaml`, `go`, `php`, `ruby`, `csharp`, `kotlin`, `jsx`, `tsx`, `graphql`, `docker`, `toml`, `lua`, `perl`, `r`, `scala`, `dart`) are supported with optional Prism loading.
|
|
42
|
-
By default, `CodeExtension` uses lazy grammar loading and only fetches grammars when code blocks actually use them.
|
|
43
|
-
|
|
44
40
|
## Quick Usage
|
|
45
41
|
|
|
46
42
|
```tsx
|
package/dist/index.d.ts
CHANGED
|
@@ -1442,12 +1442,10 @@ type CodeStateQueries = {
|
|
|
1442
1442
|
/** Check whether the current selection is within a code block */
|
|
1443
1443
|
isInCodeBlock: () => Promise<boolean>;
|
|
1444
1444
|
};
|
|
1445
|
-
type CodeGrammarPreloadMode = "lazy" | "idle" | "eager";
|
|
1446
1445
|
type CodeExtensionConfig = BaseExtensionConfig & CodeHighlightProviderConfig & {
|
|
1447
1446
|
syntaxHighlighting?: "auto" | "disabled";
|
|
1448
1447
|
tokenizer?: CodeTokenizer | null;
|
|
1449
1448
|
showLineNumbers?: boolean;
|
|
1450
|
-
grammarPreloadMode?: CodeGrammarPreloadMode;
|
|
1451
1449
|
};
|
|
1452
1450
|
/**
|
|
1453
1451
|
* CodeExtension - Adds code block support for the Lexical editor
|
|
@@ -1531,7 +1529,6 @@ declare class CodeExtension extends BaseExtension<"code", CodeExtensionConfig, C
|
|
|
1531
1529
|
* @returns Current format or null
|
|
1532
1530
|
*/
|
|
1533
1531
|
private getCurrentFormatSync;
|
|
1534
|
-
private hasCodeNodeMutations;
|
|
1535
1532
|
private hasReachedCodeTabLimit;
|
|
1536
1533
|
private ensureCodeBlockLineNumbers;
|
|
1537
1534
|
private clearCodeBlockLineNumberAttributes;
|
|
@@ -1540,10 +1537,6 @@ declare class CodeExtension extends BaseExtension<"code", CodeExtensionConfig, C
|
|
|
1540
1537
|
}
|
|
1541
1538
|
declare const codeExtension: CodeExtension;
|
|
1542
1539
|
|
|
1543
|
-
declare function getDefaultPopularPrismLanguages(): string[];
|
|
1544
|
-
declare function loadPrismLanguages(languages: readonly string[]): Promise<string[]>;
|
|
1545
|
-
declare function loadPopularPrismLanguages(): Promise<string[]>;
|
|
1546
|
-
|
|
1547
1540
|
type CodeIntelligenceCommands = {
|
|
1548
1541
|
setCodeLanguage: (language: string) => void;
|
|
1549
1542
|
autoDetectCodeLanguage: () => Promise<string | null>;
|
|
@@ -1562,6 +1555,7 @@ type CodeIntelligenceConfig = CodeHighlightProviderConfig & {
|
|
|
1562
1555
|
languageOptions?: readonly string[] | CodeLanguageOptionsConfig;
|
|
1563
1556
|
};
|
|
1564
1557
|
declare class CodeIntelligenceExtension extends BaseExtension<"codeIntelligence", CodeIntelligenceConfig, CodeIntelligenceCommands, Record<string, never>, ReactNode[]> {
|
|
1558
|
+
private languageOptions;
|
|
1565
1559
|
constructor();
|
|
1566
1560
|
register(editor: LexicalEditor): () => void;
|
|
1567
1561
|
getPlugins(): ReactNode[];
|
|
@@ -2663,4 +2657,4 @@ declare class EnterKeyBehaviorExtension extends BaseExtension<"enterKeyBehavior"
|
|
|
2663
2657
|
}
|
|
2664
2658
|
declare const enterKeyBehaviorExtension: EnterKeyBehaviorExtension;
|
|
2665
2659
|
|
|
2666
|
-
export { type Alignment, type BaseCommands, BaseExtension, type BaseExtensionConfig, BaseProvider, BlockFormatExtension, BoldExtension, type BridgeMode, CodeExtension, type CodeExtensionConfig, CodeFormatExtension, type
|
|
2660
|
+
export { type Alignment, type BaseCommands, BaseExtension, type BaseExtensionConfig, BaseProvider, BlockFormatExtension, BoldExtension, type BridgeMode, CodeExtension, type CodeExtensionConfig, CodeFormatExtension, type CodeHighlightProvider, type CodeHighlightProviderConfig, type CodeIntelligenceCommands, type CodeIntelligenceConfig, CodeIntelligenceExtension, type CodeLanguageOptionsConfig, type CodeLanguageOptionsMode, type CommandPaletteCommands, CommandPaletteExtension, type CommandPaletteItem, type CommandPaletteStateQueries, type ContextMenuCommands, type ContextMenuConfig, ContextMenuExtension, type ContextMenuItem, type ContextMenuStateQueries, DraggableBlockExtension, type DraggableCommands, type DraggableConfig, type DraggableStateQueries, type EditorConfig, type EditorContextType, type EmojiCatalogAdapter, type EmojiCatalogItem, type EmojiCommands, type EmojiConfig, EmojiExtension, type EmojiStateQueries, type EmojiSuggestionState, EnterKeyBehaviorExtension, type Extension, ExtensionCategory, type ExtractCommands, type ExtractNames, type ExtractPlugins, type ExtractStateQueries, type ExtractedMetadataEnvelopes, type FloatingCommands, type FloatingConfig, type FloatingStateQueries, FloatingToolbarExtension, type FontCssLoadStrategy, type FontFamilyConfig, FontFamilyExtension, type FontFamilyOption, type FontSizeConfig, FontSizeExtension, type FontSizeOption, HTML_NATIVE_KEY_MAP, HTML_SUPPORTED_NODE_TYPES, HistoryExtension, HorizontalRuleExtension, type HtmlBridgeOptions, IframeEmbedExtension, type ImageCommands, type ImageComponentProps, ImageExtension, type ImageExtensionConfig, type ImagePayload, type ImageStateQueries, ItalicExtension, type JsonDocument, LIGHTWEIGHT_EMOJI_CATALOG, LUTHOR_EDITOR_THEME_TOKENS, type LexicalNodeRegistration, type LineHeightConfig, LineHeightExtension, type LineHeightOption, LinkExtension, ListExtension, type LuthorEditorThemeOverrides, type LuthorEditorThemeToken, type LuthorTheme, MARKDOWN_NATIVE_KEY_MAP, MARKDOWN_SUPPORTED_NODE_TYPES, MARKDOWN_TEXT_NATIVE_FORMAT_MASK, type MarkdownBridgeFlavor, type MarkdownBridgeOptions, type MetadataEnvelope, type PreparedBridgeDocument, RichText, type RichTextComponentProps, type RichTextConfig, type SerializedImageNode, type SlashCommandCommands, type SlashCommandConfig, SlashCommandExtension, type SlashCommandItem, type SlashCommandMenuState, type SlashCommandStateQueries, type SourceMetadataMode, StrikethroughExtension, SubscriptExtension, SuperscriptExtension, TabIndentExtension, type TableConfig, TableExtension, type TextColorConfig, TextColorExtension, type TextColorOption, TextFormatExtension, type TextHighlightConfig, TextHighlightExtension, type TextHighlightOption, type ToolbarItem, UnderlineExtension, YouTubeEmbedExtension, appendMetadataEnvelopes, blockFormatExtension, boldExtension, clearLexicalSelection, codeExtension, codeFormatExtension, codeIntelligenceExtension, commandPaletteExtension, contextMenuExtension, createCustomNodeExtension, createEditorSystem, createEditorThemeStyleVars, createExtension, defaultLuthorTheme, draggableBlockExtension, emojiExtension, enterKeyBehaviorExtension, extractHTMLMetadataPatch, extractMarkdownMetadataPatch, extractMetadataEnvelopes, floatingToolbarExtension, fontFamilyExtension, fontSizeExtension, historyExtension, horizontalRuleExtension, htmlToJSON, iframeEmbedExtension, imageExtension, isDefaultBridgeValue, isHTMLRepresentable, isLuthorTheme, isMarkdownRepresentable, italicExtension, jsonToHTML, jsonToMarkdown, lineHeightExtension, linkExtension, listExtension, markdownToJSON, mergeThemes, prepareDocumentForBridge, rehydrateDocumentFromEnvelopes, resolveLinkNodeKeyFromAnchor, richTextExtension, slashCommandExtension, strikethroughExtension, subscriptExtension, superscriptExtension, tabIndentExtension, tableExtension, textColorExtension, textHighlightExtension, underlineExtension, useBaseEditor, youTubeEmbedExtension };
|