diff --git a/packages/lexical-react/package.json b/packages/lexical-react/package.json index 9c4bbb1e628..f39f851abc0 100644 --- a/packages/lexical-react/package.json +++ b/packages/lexical-react/package.json @@ -41,323 +41,563 @@ }, "exports": { "./LexicalAutoEmbedPlugin": { - "import": "./LexicalAutoEmbedPlugin.esm.js", + "import": { + "default": "./LexicalAutoEmbedPlugin.esm.js", + "types": "./LexicalAutoEmbedPlugin.d.ts" + }, "require": "./LexicalAutoEmbedPlugin.js" }, "./LexicalAutoEmbedPlugin.js": { - "import": "./LexicalAutoEmbedPlugin.esm.js", + "import": { + "default": "./LexicalAutoEmbedPlugin.esm.js", + "types": "./LexicalAutoEmbedPlugin.d.ts" + }, "require": "./LexicalAutoEmbedPlugin.js" }, "./LexicalAutoFocusPlugin": { - "import": "./LexicalAutoFocusPlugin.esm.js", + "import": { + "default": "./LexicalAutoFocusPlugin.esm.js", + "types": "./LexicalAutoFocusPlugin.d.ts" + }, "require": "./LexicalAutoFocusPlugin.js" }, "./LexicalAutoFocusPlugin.js": { - "import": "./LexicalAutoFocusPlugin.esm.js", + "import": { + "default": "./LexicalAutoFocusPlugin.esm.js", + "types": "./LexicalAutoFocusPlugin.d.ts" + }, "require": "./LexicalAutoFocusPlugin.js" }, "./LexicalAutoLinkPlugin": { - "import": "./LexicalAutoLinkPlugin.esm.js", + "import": { + "default": "./LexicalAutoLinkPlugin.esm.js", + "types": "./LexicalAutoLinkPlugin.d.ts" + }, "require": "./LexicalAutoLinkPlugin.js" }, "./LexicalAutoLinkPlugin.js": { - "import": "./LexicalAutoLinkPlugin.esm.js", + "import": { + "default": "./LexicalAutoLinkPlugin.esm.js", + "types": "./LexicalAutoLinkPlugin.d.ts" + }, "require": "./LexicalAutoLinkPlugin.js" }, "./LexicalBlockWithAlignableContents": { - "import": "./LexicalBlockWithAlignableContents.esm.js", + "import": { + "default": "./LexicalBlockWithAlignableContents.esm.js", + "types": "./LexicalBlockWithAlignableContents.d.ts" + }, "require": "./LexicalBlockWithAlignableContents.js" }, "./LexicalBlockWithAlignableContents.js": { - "import": "./LexicalBlockWithAlignableContents.esm.js", + "import": { + "default": "./LexicalBlockWithAlignableContents.esm.js", + "types": "./LexicalBlockWithAlignableContents.d.ts" + }, "require": "./LexicalBlockWithAlignableContents.js" }, "./LexicalCharacterLimitPlugin": { - "import": "./LexicalCharacterLimitPlugin.esm.js", + "import": { + "default": "./LexicalCharacterLimitPlugin.esm.js", + "types": "./LexicalCharacterLimitPlugin.d.ts" + }, "require": "./LexicalCharacterLimitPlugin.js" }, "./LexicalCharacterLimitPlugin.js": { - "import": "./LexicalCharacterLimitPlugin.esm.js", + "import": { + "default": "./LexicalCharacterLimitPlugin.esm.js", + "types": "./LexicalCharacterLimitPlugin.d.ts" + }, "require": "./LexicalCharacterLimitPlugin.js" }, "./LexicalCheckListPlugin": { - "import": "./LexicalCheckListPlugin.esm.js", + "import": { + "default": "./LexicalCheckListPlugin.esm.js", + "types": "./LexicalCheckListPlugin.d.ts" + }, "require": "./LexicalCheckListPlugin.js" }, "./LexicalCheckListPlugin.js": { - "import": "./LexicalCheckListPlugin.esm.js", + "import": { + "default": "./LexicalCheckListPlugin.esm.js", + "types": "./LexicalCheckListPlugin.d.ts" + }, "require": "./LexicalCheckListPlugin.js" }, "./LexicalClearEditorPlugin": { - "import": "./LexicalClearEditorPlugin.esm.js", + "import": { + "default": "./LexicalClearEditorPlugin.esm.js", + "types": "./LexicalClearEditorPlugin.d.ts" + }, "require": "./LexicalClearEditorPlugin.js" }, "./LexicalClearEditorPlugin.js": { - "import": "./LexicalClearEditorPlugin.esm.js", + "import": { + "default": "./LexicalClearEditorPlugin.esm.js", + "types": "./LexicalClearEditorPlugin.d.ts" + }, "require": "./LexicalClearEditorPlugin.js" }, "./LexicalClickableLinkPlugin": { - "import": "./LexicalClickableLinkPlugin.esm.js", + "import": { + "default": "./LexicalClickableLinkPlugin.esm.js", + "types": "./LexicalClickableLinkPlugin.d.ts" + }, "require": "./LexicalClickableLinkPlugin.js" }, "./LexicalClickableLinkPlugin.js": { - "import": "./LexicalClickableLinkPlugin.esm.js", + "import": { + "default": "./LexicalClickableLinkPlugin.esm.js", + "types": "./LexicalClickableLinkPlugin.d.ts" + }, "require": "./LexicalClickableLinkPlugin.js" }, "./LexicalCollaborationContext": { - "import": "./LexicalCollaborationContext.esm.js", + "import": { + "default": "./LexicalCollaborationContext.esm.js", + "types": "./LexicalCollaborationContext.d.ts" + }, "require": "./LexicalCollaborationContext.js" }, "./LexicalCollaborationContext.js": { - "import": "./LexicalCollaborationContext.esm.js", + "import": { + "default": "./LexicalCollaborationContext.esm.js", + "types": "./LexicalCollaborationContext.d.ts" + }, "require": "./LexicalCollaborationContext.js" }, "./LexicalCollaborationPlugin": { - "import": "./LexicalCollaborationPlugin.esm.js", + "import": { + "default": "./LexicalCollaborationPlugin.esm.js", + "types": "./LexicalCollaborationPlugin.d.ts" + }, "require": "./LexicalCollaborationPlugin.js" }, "./LexicalCollaborationPlugin.js": { - "import": "./LexicalCollaborationPlugin.esm.js", + "import": { + "default": "./LexicalCollaborationPlugin.esm.js", + "types": "./LexicalCollaborationPlugin.d.ts" + }, "require": "./LexicalCollaborationPlugin.js" }, "./LexicalComposer": { - "import": "./LexicalComposer.esm.js", + "import": { + "default": "./LexicalComposer.esm.js", + "types": "./LexicalComposer.d.ts" + }, "require": "./LexicalComposer.js" }, "./LexicalComposer.js": { - "import": "./LexicalComposer.esm.js", + "import": { + "default": "./LexicalComposer.esm.js", + "types": "./LexicalComposer.d.ts" + }, "require": "./LexicalComposer.js" }, "./LexicalComposerContext": { - "import": "./LexicalComposerContext.esm.js", + "import": { + "default": "./LexicalComposerContext.esm.js", + "types": "./LexicalComposerContext.d.ts" + }, "require": "./LexicalComposerContext.js" }, "./LexicalComposerContext.js": { - "import": "./LexicalComposerContext.esm.js", + "import": { + "default": "./LexicalComposerContext.esm.js", + "types": "./LexicalComposerContext.d.ts" + }, "require": "./LexicalComposerContext.js" }, "./LexicalContentEditable": { - "import": "./LexicalContentEditable.esm.js", + "import": { + "default": "./LexicalContentEditable.esm.js", + "types": "./LexicalContentEditable.d.ts" + }, "require": "./LexicalContentEditable.js" }, "./LexicalContentEditable.js": { - "import": "./LexicalContentEditable.esm.js", + "import": { + "default": "./LexicalContentEditable.esm.js", + "types": "./LexicalContentEditable.d.ts" + }, "require": "./LexicalContentEditable.js" }, "./LexicalContextMenuPlugin": { - "import": "./LexicalContextMenuPlugin.esm.js", + "import": { + "default": "./LexicalContextMenuPlugin.esm.js", + "types": "./LexicalContextMenuPlugin.d.ts" + }, "require": "./LexicalContextMenuPlugin.js" }, "./LexicalContextMenuPlugin.js": { - "import": "./LexicalContextMenuPlugin.esm.js", + "import": { + "default": "./LexicalContextMenuPlugin.esm.js", + "types": "./LexicalContextMenuPlugin.d.ts" + }, "require": "./LexicalContextMenuPlugin.js" }, "./LexicalDecoratorBlockNode": { - "import": "./LexicalDecoratorBlockNode.esm.js", + "import": { + "default": "./LexicalDecoratorBlockNode.esm.js", + "types": "./LexicalDecoratorBlockNode.d.ts" + }, "require": "./LexicalDecoratorBlockNode.js" }, "./LexicalDecoratorBlockNode.js": { - "import": "./LexicalDecoratorBlockNode.esm.js", + "import": { + "default": "./LexicalDecoratorBlockNode.esm.js", + "types": "./LexicalDecoratorBlockNode.d.ts" + }, "require": "./LexicalDecoratorBlockNode.js" }, "./LexicalEditorRefPlugin": { - "import": "./LexicalEditorRefPlugin.esm.js", + "import": { + "default": "./LexicalEditorRefPlugin.esm.js", + "types": "./LexicalEditorRefPlugin.d.ts" + }, "require": "./LexicalEditorRefPlugin.js" }, "./LexicalEditorRefPlugin.js": { - "import": "./LexicalEditorRefPlugin.esm.js", + "import": { + "default": "./LexicalEditorRefPlugin.esm.js", + "types": "./LexicalEditorRefPlugin.d.ts" + }, "require": "./LexicalEditorRefPlugin.js" }, "./LexicalErrorBoundary": { - "import": "./LexicalErrorBoundary.esm.js", + "import": { + "default": "./LexicalErrorBoundary.esm.js", + "types": "./LexicalErrorBoundary.d.ts" + }, "require": "./LexicalErrorBoundary.js" }, "./LexicalErrorBoundary.js": { - "import": "./LexicalErrorBoundary.esm.js", + "import": { + "default": "./LexicalErrorBoundary.esm.js", + "types": "./LexicalErrorBoundary.d.ts" + }, "require": "./LexicalErrorBoundary.js" }, "./LexicalHashtagPlugin": { - "import": "./LexicalHashtagPlugin.esm.js", + "import": { + "default": "./LexicalHashtagPlugin.esm.js", + "types": "./LexicalHashtagPlugin.d.ts" + }, "require": "./LexicalHashtagPlugin.js" }, "./LexicalHashtagPlugin.js": { - "import": "./LexicalHashtagPlugin.esm.js", + "import": { + "default": "./LexicalHashtagPlugin.esm.js", + "types": "./LexicalHashtagPlugin.d.ts" + }, "require": "./LexicalHashtagPlugin.js" }, "./LexicalHistoryPlugin": { - "import": "./LexicalHistoryPlugin.esm.js", + "import": { + "default": "./LexicalHistoryPlugin.esm.js", + "types": "./LexicalHistoryPlugin.d.ts" + }, "require": "./LexicalHistoryPlugin.js" }, "./LexicalHistoryPlugin.js": { - "import": "./LexicalHistoryPlugin.esm.js", + "import": { + "default": "./LexicalHistoryPlugin.esm.js", + "types": "./LexicalHistoryPlugin.d.ts" + }, "require": "./LexicalHistoryPlugin.js" }, "./LexicalHorizontalRuleNode": { - "import": "./LexicalHorizontalRuleNode.esm.js", + "import": { + "default": "./LexicalHorizontalRuleNode.esm.js", + "types": "./LexicalHorizontalRuleNode.d.ts" + }, "require": "./LexicalHorizontalRuleNode.js" }, "./LexicalHorizontalRuleNode.js": { - "import": "./LexicalHorizontalRuleNode.esm.js", + "import": { + "default": "./LexicalHorizontalRuleNode.esm.js", + "types": "./LexicalHorizontalRuleNode.d.ts" + }, "require": "./LexicalHorizontalRuleNode.js" }, "./LexicalHorizontalRulePlugin": { - "import": "./LexicalHorizontalRulePlugin.esm.js", + "import": { + "default": "./LexicalHorizontalRulePlugin.esm.js", + "types": "./LexicalHorizontalRulePlugin.d.ts" + }, "require": "./LexicalHorizontalRulePlugin.js" }, "./LexicalHorizontalRulePlugin.js": { - "import": "./LexicalHorizontalRulePlugin.esm.js", + "import": { + "default": "./LexicalHorizontalRulePlugin.esm.js", + "types": "./LexicalHorizontalRulePlugin.d.ts" + }, "require": "./LexicalHorizontalRulePlugin.js" }, "./LexicalLinkPlugin": { - "import": "./LexicalLinkPlugin.esm.js", + "import": { + "default": "./LexicalLinkPlugin.esm.js", + "types": "./LexicalLinkPlugin.d.ts" + }, "require": "./LexicalLinkPlugin.js" }, "./LexicalLinkPlugin.js": { - "import": "./LexicalLinkPlugin.esm.js", + "import": { + "default": "./LexicalLinkPlugin.esm.js", + "types": "./LexicalLinkPlugin.d.ts" + }, "require": "./LexicalLinkPlugin.js" }, "./LexicalListPlugin": { - "import": "./LexicalListPlugin.esm.js", + "import": { + "default": "./LexicalListPlugin.esm.js", + "types": "./LexicalListPlugin.d.ts" + }, "require": "./LexicalListPlugin.js" }, "./LexicalListPlugin.js": { - "import": "./LexicalListPlugin.esm.js", + "import": { + "default": "./LexicalListPlugin.esm.js", + "types": "./LexicalListPlugin.d.ts" + }, "require": "./LexicalListPlugin.js" }, "./LexicalMarkdownShortcutPlugin": { - "import": "./LexicalMarkdownShortcutPlugin.esm.js", + "import": { + "default": "./LexicalMarkdownShortcutPlugin.esm.js", + "types": "./LexicalMarkdownShortcutPlugin.d.ts" + }, "require": "./LexicalMarkdownShortcutPlugin.js" }, "./LexicalMarkdownShortcutPlugin.js": { - "import": "./LexicalMarkdownShortcutPlugin.esm.js", + "import": { + "default": "./LexicalMarkdownShortcutPlugin.esm.js", + "types": "./LexicalMarkdownShortcutPlugin.d.ts" + }, "require": "./LexicalMarkdownShortcutPlugin.js" }, "./LexicalNestedComposer": { - "import": "./LexicalNestedComposer.esm.js", + "import": { + "default": "./LexicalNestedComposer.esm.js", + "types": "./LexicalNestedComposer.d.ts" + }, "require": "./LexicalNestedComposer.js" }, "./LexicalNestedComposer.js": { - "import": "./LexicalNestedComposer.esm.js", + "import": { + "default": "./LexicalNestedComposer.esm.js", + "types": "./LexicalNestedComposer.d.ts" + }, "require": "./LexicalNestedComposer.js" }, "./LexicalNodeEventPlugin": { - "import": "./LexicalNodeEventPlugin.esm.js", + "import": { + "default": "./LexicalNodeEventPlugin.esm.js", + "types": "./LexicalNodeEventPlugin.d.ts" + }, "require": "./LexicalNodeEventPlugin.js" }, "./LexicalNodeEventPlugin.js": { - "import": "./LexicalNodeEventPlugin.esm.js", + "import": { + "default": "./LexicalNodeEventPlugin.esm.js", + "types": "./LexicalNodeEventPlugin.d.ts" + }, "require": "./LexicalNodeEventPlugin.js" }, "./LexicalNodeMenuPlugin": { - "import": "./LexicalNodeMenuPlugin.esm.js", + "import": { + "default": "./LexicalNodeMenuPlugin.esm.js", + "types": "./LexicalNodeMenuPlugin.d.ts" + }, "require": "./LexicalNodeMenuPlugin.js" }, "./LexicalNodeMenuPlugin.js": { - "import": "./LexicalNodeMenuPlugin.esm.js", + "import": { + "default": "./LexicalNodeMenuPlugin.esm.js", + "types": "./LexicalNodeMenuPlugin.d.ts" + }, "require": "./LexicalNodeMenuPlugin.js" }, "./LexicalOnChangePlugin": { - "import": "./LexicalOnChangePlugin.esm.js", + "import": { + "default": "./LexicalOnChangePlugin.esm.js", + "types": "./LexicalOnChangePlugin.d.ts" + }, "require": "./LexicalOnChangePlugin.js" }, "./LexicalOnChangePlugin.js": { - "import": "./LexicalOnChangePlugin.esm.js", + "import": { + "default": "./LexicalOnChangePlugin.esm.js", + "types": "./LexicalOnChangePlugin.d.ts" + }, "require": "./LexicalOnChangePlugin.js" }, "./LexicalPlainTextPlugin": { - "import": "./LexicalPlainTextPlugin.esm.js", + "import": { + "default": "./LexicalPlainTextPlugin.esm.js", + "types": "./LexicalPlainTextPlugin.d.ts" + }, "require": "./LexicalPlainTextPlugin.js" }, "./LexicalPlainTextPlugin.js": { - "import": "./LexicalPlainTextPlugin.esm.js", + "import": { + "default": "./LexicalPlainTextPlugin.esm.js", + "types": "./LexicalPlainTextPlugin.d.ts" + }, "require": "./LexicalPlainTextPlugin.js" }, "./LexicalRichTextPlugin": { - "import": "./LexicalRichTextPlugin.esm.js", + "import": { + "default": "./LexicalRichTextPlugin.esm.js", + "types": "./LexicalRichTextPlugin.d.ts" + }, "require": "./LexicalRichTextPlugin.js" }, "./LexicalRichTextPlugin.js": { - "import": "./LexicalRichTextPlugin.esm.js", + "import": { + "default": "./LexicalRichTextPlugin.esm.js", + "types": "./LexicalRichTextPlugin.d.ts" + }, "require": "./LexicalRichTextPlugin.js" }, "./LexicalTabIndentationPlugin": { - "import": "./LexicalTabIndentationPlugin.esm.js", + "import": { + "default": "./LexicalTabIndentationPlugin.esm.js", + "types": "./LexicalTabIndentationPlugin.d.ts" + }, "require": "./LexicalTabIndentationPlugin.js" }, "./LexicalTabIndentationPlugin.js": { - "import": "./LexicalTabIndentationPlugin.esm.js", + "import": { + "default": "./LexicalTabIndentationPlugin.esm.js", + "types": "./LexicalTabIndentationPlugin.d.ts" + }, "require": "./LexicalTabIndentationPlugin.js" }, "./LexicalTableOfContents": { - "import": "./LexicalTableOfContents.esm.js", + "import": { + "default": "./LexicalTableOfContents.esm.js", + "types": "./LexicalTableOfContents.d.ts" + }, "require": "./LexicalTableOfContents.js" }, "./LexicalTableOfContents.js": { - "import": "./LexicalTableOfContents.esm.js", + "import": { + "default": "./LexicalTableOfContents.esm.js", + "types": "./LexicalTableOfContents.d.ts" + }, "require": "./LexicalTableOfContents.js" }, "./LexicalTablePlugin": { - "import": "./LexicalTablePlugin.esm.js", + "import": { + "default": "./LexicalTablePlugin.esm.js", + "types": "./LexicalTablePlugin.d.ts" + }, "require": "./LexicalTablePlugin.js" }, "./LexicalTablePlugin.js": { - "import": "./LexicalTablePlugin.esm.js", + "import": { + "default": "./LexicalTablePlugin.esm.js", + "types": "./LexicalTablePlugin.d.ts" + }, "require": "./LexicalTablePlugin.js" }, "./LexicalTreeView": { - "import": "./LexicalTreeView.esm.js", + "import": { + "default": "./LexicalTreeView.esm.js", + "types": "./LexicalTreeView.d.ts" + }, "require": "./LexicalTreeView.js" }, "./LexicalTreeView.js": { - "import": "./LexicalTreeView.esm.js", + "import": { + "default": "./LexicalTreeView.esm.js", + "types": "./LexicalTreeView.d.ts" + }, "require": "./LexicalTreeView.js" }, "./LexicalTypeaheadMenuPlugin": { - "import": "./LexicalTypeaheadMenuPlugin.esm.js", + "import": { + "default": "./LexicalTypeaheadMenuPlugin.esm.js", + "types": "./LexicalTypeaheadMenuPlugin.d.ts" + }, "require": "./LexicalTypeaheadMenuPlugin.js" }, "./LexicalTypeaheadMenuPlugin.js": { - "import": "./LexicalTypeaheadMenuPlugin.esm.js", + "import": { + "default": "./LexicalTypeaheadMenuPlugin.esm.js", + "types": "./LexicalTypeaheadMenuPlugin.d.ts" + }, "require": "./LexicalTypeaheadMenuPlugin.js" }, "./useLexicalEditable": { - "import": "./useLexicalEditable.esm.js", + "import": { + "default": "./useLexicalEditable.esm.js", + "types": "./useLexicalEditable.d.ts" + }, "require": "./useLexicalEditable.js" }, "./useLexicalEditable.js": { - "import": "./useLexicalEditable.esm.js", + "import": { + "default": "./useLexicalEditable.esm.js", + "types": "./useLexicalEditable.d.ts" + }, "require": "./useLexicalEditable.js" }, "./useLexicalIsTextContentEmpty": { - "import": "./useLexicalIsTextContentEmpty.esm.js", + "import": { + "default": "./useLexicalIsTextContentEmpty.esm.js", + "types": "./useLexicalIsTextContentEmpty.d.ts" + }, "require": "./useLexicalIsTextContentEmpty.js" }, "./useLexicalIsTextContentEmpty.js": { - "import": "./useLexicalIsTextContentEmpty.esm.js", + "import": { + "default": "./useLexicalIsTextContentEmpty.esm.js", + "types": "./useLexicalIsTextContentEmpty.d.ts" + }, "require": "./useLexicalIsTextContentEmpty.js" }, "./useLexicalNodeSelection": { - "import": "./useLexicalNodeSelection.esm.js", + "import": { + "default": "./useLexicalNodeSelection.esm.js", + "types": "./useLexicalNodeSelection.d.ts" + }, "require": "./useLexicalNodeSelection.js" }, "./useLexicalNodeSelection.js": { - "import": "./useLexicalNodeSelection.esm.js", + "import": { + "default": "./useLexicalNodeSelection.esm.js", + "types": "./useLexicalNodeSelection.d.ts" + }, "require": "./useLexicalNodeSelection.js" }, "./useLexicalSubscription": { - "import": "./useLexicalSubscription.esm.js", + "import": { + "default": "./useLexicalSubscription.esm.js", + "types": "./useLexicalSubscription.d.ts" + }, "require": "./useLexicalSubscription.js" }, "./useLexicalSubscription.js": { - "import": "./useLexicalSubscription.esm.js", + "import": { + "default": "./useLexicalSubscription.esm.js", + "types": "./useLexicalSubscription.d.ts" + }, "require": "./useLexicalSubscription.js" }, "./useLexicalTextEntity": { - "import": "./useLexicalTextEntity.esm.js", + "import": { + "default": "./useLexicalTextEntity.esm.js", + "types": "./useLexicalTextEntity.d.ts" + }, "require": "./useLexicalTextEntity.js" }, "./useLexicalTextEntity.js": { - "import": "./useLexicalTextEntity.esm.js", + "import": { + "default": "./useLexicalTextEntity.esm.js", + "types": "./useLexicalTextEntity.d.ts" + }, "require": "./useLexicalTextEntity.js" } } diff --git a/scripts/updateVersion.js b/scripts/updateVersion.js index f1c0db44cac..eafcb149a09 100644 --- a/scripts/updateVersion.js +++ b/scripts/updateVersion.js @@ -67,13 +67,19 @@ function updateModule(packageJSON, pkg) { if (/^[^.]+\.js$/.test(file)) { // support for import "@lexical/react/LexicalComposer" exports[`./${file.replace(/\.js$/, '')}`] = { - import: `./${withEsmExtension(file)}`, + import: { + default: `./${withEsmExtension(file)}`, + types: `./${file.replace(/\.js$/, '.d.ts')}`, + }, require: `./${file}`, }; // support for import "@lexical/react/LexicalComposer.js" // @mdxeditor/editor uses this at least as of 2.13.1 exports[`./${file}`] = { - import: `./${withEsmExtension(file)}`, + import: { + default: `./${withEsmExtension(file)}`, + types: `./${file.replace(/\.js$/, '.d.ts')}`, + }, require: `./${file}`, }; }