@lyfie/luthor-headless 2.7.1 → 2.7.3

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 CHANGED
@@ -37,9 +37,7 @@ 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.
40
+ Code-block language options are constrained to the languages available in the active runtime tokenizer.
43
41
 
44
42
  ## Quick Usage
45
43
 
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>;
@@ -2663,4 +2656,4 @@ declare class EnterKeyBehaviorExtension extends BaseExtension<"enterKeyBehavior"
2663
2656
  }
2664
2657
  declare const enterKeyBehaviorExtension: EnterKeyBehaviorExtension;
2665
2658
 
2666
- export { type Alignment, type BaseCommands, BaseExtension, type BaseExtensionConfig, BaseProvider, BlockFormatExtension, BoldExtension, type BridgeMode, CodeExtension, type CodeExtensionConfig, CodeFormatExtension, type CodeGrammarPreloadMode, 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, getDefaultPopularPrismLanguages, historyExtension, horizontalRuleExtension, htmlToJSON, iframeEmbedExtension, imageExtension, isDefaultBridgeValue, isHTMLRepresentable, isLuthorTheme, isMarkdownRepresentable, italicExtension, jsonToHTML, jsonToMarkdown, lineHeightExtension, linkExtension, listExtension, loadPopularPrismLanguages, loadPrismLanguages, markdownToJSON, mergeThemes, prepareDocumentForBridge, rehydrateDocumentFromEnvelopes, resolveLinkNodeKeyFromAnchor, richTextExtension, slashCommandExtension, strikethroughExtension, subscriptExtension, superscriptExtension, tabIndentExtension, tableExtension, textColorExtension, textHighlightExtension, underlineExtension, useBaseEditor, youTubeEmbedExtension };
2659
+ 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 };