From 9f589ce3752031abd8c3e47b3d779798d69a0209 Mon Sep 17 00:00:00 2001 From: Ben Asher Date: Sun, 30 Apr 2023 12:27:16 -0700 Subject: [PATCH] Require .js endings --- .eslintrc.js | 16 ++- demos/preview/Shiki.vue | 2 +- demos/setup/js.ts | 2 +- demos/setup/react.ts | 2 +- demos/setup/svelte.ts | 2 +- demos/setup/vue.ts | 2 +- .../CodeBlockLanguage/React/index.jsx | 2 +- .../CollaborativeEditing/React/MenuBar.jsx | 2 +- .../CollaborativeEditing/React/index.jsx | 4 +- .../CollaborativeEditing/Vue/index.vue | 2 +- demos/src/Examples/Community/React/index.jsx | 2 +- .../Examples/Community/React/suggestion.js | 2 +- demos/src/Examples/Community/Vue/index.vue | 2 +- demos/src/Examples/Drawing/Vue/index.vue | 2 +- .../Examples/Savvy/React/ColorHighlighter.ts | 2 +- demos/src/Examples/Savvy/React/index.jsx | 4 +- .../Examples/Savvy/Vue/ColorHighlighter.ts | 2 +- demos/src/Examples/Savvy/Vue/index.vue | 4 +- .../Vue/extension/AnnotationPlugin.ts | 2 +- .../Vue/extension/AnnotationState.ts | 6 +- .../Vue/extension/collaboration-annotation.ts | 2 +- .../Vue/extension/index.ts | 4 +- .../CollaborationAnnotation/Vue/index.vue | 2 +- demos/src/Experiments/Commands/Vue/index.vue | 4 +- demos/src/Experiments/Embeds/Vue/index.vue | 2 +- .../ExtensionStorage/React/index.jsx | 2 +- .../ExtensionStorage/Vue/index.vue | 2 +- demos/src/Experiments/Figure/Vue/index.vue | 2 +- .../Experiments/GenericFigure/Vue/index.vue | 4 +- .../IsolatingClear/React/index.jsx | 2 +- .../Linter/Vue/extension/Linter.ts | 2 +- .../Experiments/Linter/Vue/extension/index.ts | 10 +- .../Linter/Vue/extension/plugins/BadWords.ts | 2 +- .../Vue/extension/plugins/HeadingLevel.ts | 2 +- .../Vue/extension/plugins/Punctuation.ts | 2 +- demos/src/Experiments/Linter/Vue/index.vue | 2 +- .../Experiments/TrailingNode/Vue/index.vue | 2 +- demos/src/Nodes/Mention/React/index.jsx | 2 +- demos/src/Nodes/Mention/Vue/index.vue | 2 +- packages/core/src/CommandManager.ts | 6 +- packages/core/src/Editor.ts | 32 +++--- packages/core/src/Extension.ts | 20 ++-- packages/core/src/ExtensionManager.ts | 30 +++--- packages/core/src/InputRule.ts | 12 +-- packages/core/src/Mark.ts | 18 ++-- packages/core/src/Node.ts | 16 +-- packages/core/src/NodeView.ts | 8 +- packages/core/src/PasteRule.ts | 12 +-- packages/core/src/commands/blur.ts | 2 +- packages/core/src/commands/clearContent.ts | 2 +- packages/core/src/commands/clearNodes.ts | 2 +- packages/core/src/commands/command.ts | 2 +- .../core/src/commands/createParagraphNear.ts | 2 +- .../core/src/commands/deleteCurrentNode.ts | 2 +- packages/core/src/commands/deleteNode.ts | 4 +- packages/core/src/commands/deleteRange.ts | 2 +- packages/core/src/commands/deleteSelection.ts | 2 +- packages/core/src/commands/enter.ts | 2 +- packages/core/src/commands/exitCode.ts | 2 +- packages/core/src/commands/extendMarkRange.ts | 6 +- packages/core/src/commands/first.ts | 2 +- packages/core/src/commands/focus.ts | 8 +- packages/core/src/commands/forEach.ts | 2 +- packages/core/src/commands/index.ts | 100 +++++++++--------- packages/core/src/commands/insertContent.ts | 2 +- packages/core/src/commands/insertContentAt.ts | 6 +- packages/core/src/commands/join.ts | 2 +- .../core/src/commands/keyboardShortcut.ts | 6 +- packages/core/src/commands/lift.ts | 6 +- packages/core/src/commands/liftEmptyBlock.ts | 2 +- packages/core/src/commands/liftListItem.ts | 4 +- packages/core/src/commands/newlineInCode.ts | 2 +- packages/core/src/commands/resetAttributes.ts | 10 +- packages/core/src/commands/scrollIntoView.ts | 2 +- packages/core/src/commands/selectAll.ts | 2 +- .../core/src/commands/selectNodeBackward.ts | 2 +- .../core/src/commands/selectNodeForward.ts | 2 +- .../core/src/commands/selectParentNode.ts | 2 +- .../core/src/commands/selectTextblockEnd.ts | 2 +- .../core/src/commands/selectTextblockStart.ts | 2 +- packages/core/src/commands/setContent.ts | 4 +- packages/core/src/commands/setMark.ts | 8 +- packages/core/src/commands/setMeta.ts | 2 +- packages/core/src/commands/setNode.ts | 4 +- .../core/src/commands/setNodeSelection.ts | 4 +- .../core/src/commands/setTextSelection.ts | 4 +- packages/core/src/commands/sinkListItem.ts | 4 +- packages/core/src/commands/splitBlock.ts | 6 +- packages/core/src/commands/splitListItem.ts | 6 +- packages/core/src/commands/toggleList.ts | 8 +- packages/core/src/commands/toggleMark.ts | 6 +- packages/core/src/commands/toggleNode.ts | 6 +- packages/core/src/commands/toggleWrap.ts | 6 +- packages/core/src/commands/undoInputRule.ts | 2 +- packages/core/src/commands/unsetAllMarks.ts | 2 +- packages/core/src/commands/unsetMark.ts | 6 +- .../core/src/commands/updateAttributes.ts | 8 +- packages/core/src/commands/wrapIn.ts | 4 +- packages/core/src/commands/wrapInList.ts | 4 +- .../src/extensions/clipboardTextSerializer.ts | 6 +- packages/core/src/extensions/commands.ts | 6 +- packages/core/src/extensions/editable.ts | 2 +- packages/core/src/extensions/focusEvents.ts | 2 +- packages/core/src/extensions/index.ts | 12 +-- packages/core/src/extensions/keymap.ts | 10 +- packages/core/src/extensions/tabindex.ts | 2 +- packages/core/src/helpers/createDocument.ts | 4 +- .../core/src/helpers/createNodeFromContent.ts | 4 +- packages/core/src/helpers/findChildren.ts | 2 +- .../core/src/helpers/findChildrenInRange.ts | 2 +- packages/core/src/helpers/findParentNode.ts | 4 +- .../src/helpers/findParentNodeClosestToPos.ts | 2 +- packages/core/src/helpers/generateHTML.ts | 6 +- packages/core/src/helpers/generateJSON.ts | 6 +- packages/core/src/helpers/generateText.ts | 8 +- packages/core/src/helpers/getAttributes.ts | 6 +- .../helpers/getAttributesFromExtensions.ts | 8 +- packages/core/src/helpers/getChangedRanges.ts | 4 +- packages/core/src/helpers/getDebugJSON.ts | 2 +- .../core/src/helpers/getExtensionField.ts | 2 +- .../core/src/helpers/getMarkAttributes.ts | 2 +- packages/core/src/helpers/getMarkRange.ts | 4 +- packages/core/src/helpers/getMarksBetween.ts | 4 +- .../core/src/helpers/getNodeAttributes.ts | 2 +- .../core/src/helpers/getRenderedAttributes.ts | 4 +- packages/core/src/helpers/getSchema.ts | 8 +- .../helpers/getSchemaByResolvedExtensions.ts | 18 ++-- .../core/src/helpers/getSplittedAttributes.ts | 2 +- packages/core/src/helpers/getText.ts | 4 +- packages/core/src/helpers/getTextBetween.ts | 2 +- .../helpers/getTextSerializersFromSchema.ts | 2 +- packages/core/src/helpers/index.ts | 94 ++++++++-------- .../injectExtensionAttributesToParseRule.ts | 4 +- packages/core/src/helpers/isActive.ts | 6 +- .../src/helpers/isExtensionRulesEnabled.ts | 2 +- packages/core/src/helpers/isList.ts | 10 +- packages/core/src/helpers/isMarkActive.ts | 6 +- packages/core/src/helpers/isNodeActive.ts | 6 +- packages/core/src/helpers/posToDOMRect.ts | 2 +- .../core/src/helpers/resolveFocusPosition.ts | 4 +- packages/core/src/helpers/splitExtensions.ts | 8 +- packages/core/src/index.ts | 30 +++--- packages/core/src/inputRules/index.ts | 10 +- packages/core/src/inputRules/markInputRule.ts | 8 +- packages/core/src/inputRules/nodeInputRule.ts | 6 +- packages/core/src/inputRules/textInputRule.ts | 2 +- .../src/inputRules/textblockTypeInputRule.ts | 6 +- .../core/src/inputRules/wrappingInputRule.ts | 8 +- packages/core/src/pasteRules/index.ts | 6 +- packages/core/src/pasteRules/markPasteRule.ts | 8 +- packages/core/src/pasteRules/nodePasteRule.ts | 6 +- packages/core/src/pasteRules/textPasteRule.ts | 2 +- packages/core/src/types.ts | 10 +- packages/core/src/utilities/callOrReturn.ts | 4 +- packages/core/src/utilities/index.ts | 40 +++---- packages/core/src/utilities/mergeDeep.ts | 2 +- packages/core/src/utilities/objectIncludes.ts | 2 +- packages/extension-blockquote/src/index.ts | 4 +- packages/extension-bold/src/index.ts | 4 +- .../extension-bubble-menu/src/bubble-menu.ts | 2 +- packages/extension-bubble-menu/src/index.ts | 6 +- .../extension-bullet-list/src/bullet-list.ts | 4 +- packages/extension-bullet-list/src/index.ts | 4 +- .../extension-character-count/src/index.ts | 4 +- .../src/code-block-lowlight.ts | 2 +- .../src/index.ts | 4 +- packages/extension-code-block/src/index.ts | 4 +- packages/extension-code/src/index.ts | 4 +- .../src/index.ts | 4 +- packages/extension-collaboration/src/index.ts | 6 +- packages/extension-color/src/index.ts | 4 +- packages/extension-document/src/index.ts | 4 +- packages/extension-dropcursor/src/index.ts | 4 +- .../src/floating-menu.ts | 2 +- packages/extension-floating-menu/src/index.ts | 6 +- packages/extension-focus/src/index.ts | 4 +- packages/extension-font-family/src/index.ts | 4 +- packages/extension-gapcursor/src/index.ts | 4 +- packages/extension-hard-break/src/index.ts | 4 +- packages/extension-heading/src/index.ts | 4 +- packages/extension-highlight/src/index.ts | 4 +- packages/extension-history/src/index.ts | 4 +- .../extension-horizontal-rule/src/index.ts | 4 +- packages/extension-image/src/index.ts | 4 +- packages/extension-italic/src/index.ts | 4 +- packages/extension-link/src/index.ts | 4 +- packages/extension-link/src/link.ts | 6 +- packages/extension-list-item/src/index.ts | 4 +- packages/extension-mention/src/index.ts | 4 +- packages/extension-ordered-list/src/index.ts | 4 +- .../src/ordered-list.ts | 4 +- packages/extension-paragraph/src/index.ts | 4 +- packages/extension-placeholder/src/index.ts | 4 +- packages/extension-strike/src/index.ts | 4 +- packages/extension-subscript/src/index.ts | 4 +- packages/extension-superscript/src/index.ts | 4 +- packages/extension-table-cell/src/index.ts | 4 +- packages/extension-table-header/src/index.ts | 4 +- packages/extension-table-row/src/index.ts | 4 +- packages/extension-table/src/index.ts | 6 +- packages/extension-table/src/table.ts | 6 +- .../src/utilities/createTable.ts | 4 +- .../deleteTableWhenAllCellsSelected.ts | 2 +- packages/extension-task-item/src/index.ts | 4 +- packages/extension-task-list/src/index.ts | 4 +- packages/extension-text-align/src/index.ts | 4 +- packages/extension-text-style/src/index.ts | 4 +- packages/extension-text/src/index.ts | 4 +- packages/extension-typography/src/index.ts | 4 +- packages/extension-underline/src/index.ts | 4 +- packages/extension-youtube/src/index.ts | 4 +- packages/extension-youtube/src/youtube.ts | 2 +- packages/html/src/generateHTML.ts | 2 +- packages/html/src/index.ts | 4 +- packages/react/src/Editor.ts | 4 +- packages/react/src/EditorContent.tsx | 4 +- packages/react/src/NodeViewContent.tsx | 2 +- packages/react/src/NodeViewWrapper.tsx | 2 +- packages/react/src/ReactNodeViewRenderer.tsx | 6 +- packages/react/src/ReactRenderer.tsx | 2 +- packages/react/src/index.ts | 18 ++-- packages/react/src/useEditor.ts | 2 +- packages/starter-kit/src/index.ts | 6 +- packages/suggestion/src/index.ts | 6 +- packages/suggestion/src/suggestion.ts | 2 +- packages/vue-2/src/EditorContent.ts | 2 +- packages/vue-2/src/VueNodeViewRenderer.ts | 4 +- packages/vue-2/src/index.ts | 16 +-- packages/vue-3/src/Editor.ts | 2 +- packages/vue-3/src/EditorContent.ts | 2 +- packages/vue-3/src/VueNodeViewRenderer.ts | 4 +- packages/vue-3/src/VueRenderer.ts | 2 +- packages/vue-3/src/index.ts | 18 ++-- packages/vue-3/src/useEditor.ts | 2 +- tests/cypress/support/e2e.js | 2 +- 235 files changed, 677 insertions(+), 663 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1c6c7e9ba6e..ebea8e45427 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,7 +43,21 @@ module.exports = { 'no-console': ['warn', { allow: ['warn', 'error'] }], semi: ['error', 'never'], 'import/order': 'off', - 'import/extensions': 'off', + 'import/extensions': ['error', 'ignorePackages'], + 'no-restricted-imports': ['error', + { + paths: [ + { + name: '..', + message: 'Import from ../index.js instead.', + }, + { + name: '.', + message: 'Import from ./index.js instead.', + }, + ], + }, + ], 'import/no-extraneous-dependencies': 'off', 'import/no-unresolved': 'off', 'import/no-dynamic-require': 'off', diff --git a/demos/preview/Shiki.vue b/demos/preview/Shiki.vue index 8d3ae586e24..d2ec375e497 100644 --- a/demos/preview/Shiki.vue +++ b/demos/preview/Shiki.vue @@ -8,7 +8,7 @@ // otherwise the `onig.wasm` file is missing in the dist folder import 'shiki/dist/onig.wasm?url' -import Worker from './shiki.worker?worker' +import Worker from './shiki.worker.js?worker' export default { props: { diff --git a/demos/setup/js.ts b/demos/setup/js.ts index 16f174be03e..0aa85cf30e9 100644 --- a/demos/setup/js.ts +++ b/demos/setup/js.ts @@ -1,7 +1,7 @@ import 'iframe-resizer/js/iframeResizer.contentWindow' import './style.scss' -import { debug } from './helper' +import { debug } from './helper.js' export default function init(name: string, source: any) { // @ts-ignore diff --git a/demos/setup/react.ts b/demos/setup/react.ts index bf45b150762..2763174a6c0 100644 --- a/demos/setup/react.ts +++ b/demos/setup/react.ts @@ -4,7 +4,7 @@ import './style.scss' import React from 'react' import { createRoot } from 'react-dom/client' -import { debug, splitName } from './helper' +import { debug, splitName } from './helper.js' export default function init(name: string, source: any) { // @ts-ignore diff --git a/demos/setup/svelte.ts b/demos/setup/svelte.ts index 2332823ee70..51284645b1c 100644 --- a/demos/setup/svelte.ts +++ b/demos/setup/svelte.ts @@ -1,7 +1,7 @@ import 'iframe-resizer/js/iframeResizer.contentWindow' import './style.scss' -import { debug, splitName } from './helper' +import { debug, splitName } from './helper.js' export default function init(name: string, source: any) { // @ts-ignore diff --git a/demos/setup/vue.ts b/demos/setup/vue.ts index eb9aeb95be0..27892b9cc01 100644 --- a/demos/setup/vue.ts +++ b/demos/setup/vue.ts @@ -3,7 +3,7 @@ import './style.scss' import { createApp } from 'vue' -import { debug, splitName } from './helper' +import { debug, splitName } from './helper.js' export default function init(name: string, source: any) { // @ts-ignore diff --git a/demos/src/Examples/CodeBlockLanguage/React/index.jsx b/demos/src/Examples/CodeBlockLanguage/React/index.jsx index 54251263077..f73505b3154 100644 --- a/demos/src/Examples/CodeBlockLanguage/React/index.jsx +++ b/demos/src/Examples/CodeBlockLanguage/React/index.jsx @@ -17,7 +17,7 @@ import html from 'highlight.js/lib/languages/xml' import { lowlight } from 'lowlight' import React from 'react' -import CodeBlockComponent from './CodeBlockComponent' +import CodeBlockComponent from './CodeBlockComponent.jsx' lowlight.registerLanguage('html', html) lowlight.registerLanguage('css', css) diff --git a/demos/src/Examples/CollaborativeEditing/React/MenuBar.jsx b/demos/src/Examples/CollaborativeEditing/React/MenuBar.jsx index 976df615204..80527c24969 100644 --- a/demos/src/Examples/CollaborativeEditing/React/MenuBar.jsx +++ b/demos/src/Examples/CollaborativeEditing/React/MenuBar.jsx @@ -2,7 +2,7 @@ import './MenuBar.scss' import React, { Fragment } from 'react' -import MenuItem from './MenuItem' +import MenuItem from './MenuItem.jsx' export default ({ editor }) => { const items = [ diff --git a/demos/src/Examples/CollaborativeEditing/React/index.jsx b/demos/src/Examples/CollaborativeEditing/React/index.jsx index aba19939cef..c382b472b51 100644 --- a/demos/src/Examples/CollaborativeEditing/React/index.jsx +++ b/demos/src/Examples/CollaborativeEditing/React/index.jsx @@ -15,8 +15,8 @@ import React, { } from 'react' import * as Y from 'yjs' -import { variables } from '../../../variables' -import MenuBar from './MenuBar' +import { variables } from '../../../variables.js' +import MenuBar from './MenuBar.jsx' const colors = ['#958DF1', '#F98181', '#FBBC88', '#FAF594', '#70CFF8', '#94FADB', '#B9F18D'] const names = [ diff --git a/demos/src/Examples/CollaborativeEditing/Vue/index.vue b/demos/src/Examples/CollaborativeEditing/Vue/index.vue index bd5fedaab14..220cfc93c5e 100644 --- a/demos/src/Examples/CollaborativeEditing/Vue/index.vue +++ b/demos/src/Examples/CollaborativeEditing/Vue/index.vue @@ -32,7 +32,7 @@ import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' import * as Y from 'yjs' -import { variables } from '../../../variables' +import { variables } from '../../../variables.js' import MenuBar from './MenuBar.vue' const getRandomElement = list => { diff --git a/demos/src/Examples/Community/React/index.jsx b/demos/src/Examples/Community/React/index.jsx index b943839beb4..8f4a3fa211f 100644 --- a/demos/src/Examples/Community/React/index.jsx +++ b/demos/src/Examples/Community/React/index.jsx @@ -8,7 +8,7 @@ import Text from '@tiptap/extension-text' import { EditorContent, useEditor } from '@tiptap/react' import React from 'react' -import suggestion from './suggestion' +import suggestion from './suggestion.js' export default () => { const limit = 280 diff --git a/demos/src/Examples/Community/React/suggestion.js b/demos/src/Examples/Community/React/suggestion.js index f41084e5b3d..0ef5ff9afe9 100644 --- a/demos/src/Examples/Community/React/suggestion.js +++ b/demos/src/Examples/Community/React/suggestion.js @@ -1,7 +1,7 @@ import { ReactRenderer } from '@tiptap/react' import tippy from 'tippy.js' -import { MentionList } from './MentionList' +import { MentionList } from './MentionList.jsx' export default { items: ({ query }) => { diff --git a/demos/src/Examples/Community/Vue/index.vue b/demos/src/Examples/Community/Vue/index.vue index f0c7f1c2179..f8fd27546ed 100644 --- a/demos/src/Examples/Community/Vue/index.vue +++ b/demos/src/Examples/Community/Vue/index.vue @@ -44,7 +44,7 @@ import Paragraph from '@tiptap/extension-paragraph' import Text from '@tiptap/extension-text' import { Editor, EditorContent } from '@tiptap/vue-3' -import suggestion from './suggestion' +import suggestion from './suggestion.js' export default { components: { diff --git a/demos/src/Examples/Drawing/Vue/index.vue b/demos/src/Examples/Drawing/Vue/index.vue index bd165fee2c8..7168d092a2e 100644 --- a/demos/src/Examples/Drawing/Vue/index.vue +++ b/demos/src/Examples/Drawing/Vue/index.vue @@ -7,7 +7,7 @@ import Document from '@tiptap/extension-document' import Text from '@tiptap/extension-text' import { Editor, EditorContent } from '@tiptap/vue-3' -import Paper from './Paper' +import Paper from './Paper.js' export default { components: { diff --git a/demos/src/Examples/Savvy/React/ColorHighlighter.ts b/demos/src/Examples/Savvy/React/ColorHighlighter.ts index 193af7f52c2..2704629181b 100644 --- a/demos/src/Examples/Savvy/React/ColorHighlighter.ts +++ b/demos/src/Examples/Savvy/React/ColorHighlighter.ts @@ -1,7 +1,7 @@ import { Extension } from '@tiptap/core' import { Plugin } from '@tiptap/pm/state' -import findColors from './findColors' +import findColors from './findColors.js' export const ColorHighlighter = Extension.create({ name: 'colorHighlighter', diff --git a/demos/src/Examples/Savvy/React/index.jsx b/demos/src/Examples/Savvy/React/index.jsx index 1af78467aa1..775b1feb8c7 100644 --- a/demos/src/Examples/Savvy/React/index.jsx +++ b/demos/src/Examples/Savvy/React/index.jsx @@ -8,8 +8,8 @@ import Typography from '@tiptap/extension-typography' import { EditorContent, useEditor } from '@tiptap/react' import React from 'react' -import { ColorHighlighter } from './ColorHighlighter' -import { SmilieReplacer } from './SmilieReplacer' +import { ColorHighlighter } from './ColorHighlighter.ts' +import { SmilieReplacer } from './SmilieReplacer.ts' export default () => { const editor = useEditor({ diff --git a/demos/src/Examples/Savvy/Vue/ColorHighlighter.ts b/demos/src/Examples/Savvy/Vue/ColorHighlighter.ts index 193af7f52c2..2704629181b 100644 --- a/demos/src/Examples/Savvy/Vue/ColorHighlighter.ts +++ b/demos/src/Examples/Savvy/Vue/ColorHighlighter.ts @@ -1,7 +1,7 @@ import { Extension } from '@tiptap/core' import { Plugin } from '@tiptap/pm/state' -import findColors from './findColors' +import findColors from './findColors.js' export const ColorHighlighter = Extension.create({ name: 'colorHighlighter', diff --git a/demos/src/Examples/Savvy/Vue/index.vue b/demos/src/Examples/Savvy/Vue/index.vue index 043498f0188..383d41aebe6 100644 --- a/demos/src/Examples/Savvy/Vue/index.vue +++ b/demos/src/Examples/Savvy/Vue/index.vue @@ -10,8 +10,8 @@ import Text from '@tiptap/extension-text' import Typography from '@tiptap/extension-typography' import { Editor, EditorContent } from '@tiptap/vue-3' -import { ColorHighlighter } from './ColorHighlighter' -import { SmilieReplacer } from './SmilieReplacer' +import { ColorHighlighter } from './ColorHighlighter.ts' +import { SmilieReplacer } from './SmilieReplacer.ts' export default { components: { diff --git a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationPlugin.ts b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationPlugin.ts index 89f0849e331..6bbf554b66f 100644 --- a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationPlugin.ts +++ b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationPlugin.ts @@ -1,7 +1,7 @@ import { Plugin, PluginKey } from '@tiptap/pm/state' import * as Y from 'yjs' -import { AnnotationState } from './AnnotationState' +import { AnnotationState } from './AnnotationState.js' export const AnnotationPluginKey = new PluginKey('annotation') diff --git a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationState.ts b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationState.ts index cef708290bd..28cac13f3a5 100644 --- a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationState.ts +++ b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/AnnotationState.ts @@ -7,13 +7,13 @@ import { } from 'y-prosemirror' import * as Y from 'yjs' -import { AnnotationItem } from './AnnotationItem' -import { AnnotationPluginKey } from './AnnotationPlugin' +import { AnnotationItem } from './AnnotationItem.js' +import { AnnotationPluginKey } from './AnnotationPlugin.js' import { AddAnnotationAction, DeleteAnnotationAction, UpdateAnnotationAction, -} from './collaboration-annotation' +} from './collaboration-annotation.js' export interface AnnotationStateOptions { HTMLAttributes: { diff --git a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/collaboration-annotation.ts b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/collaboration-annotation.ts index c85bd66d256..6de4df8c56b 100644 --- a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/collaboration-annotation.ts +++ b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/collaboration-annotation.ts @@ -1,7 +1,7 @@ import { Extension } from '@tiptap/core' import * as Y from 'yjs' -import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin' +import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin.js' export interface AddAnnotationAction { type: 'addAnnotation', diff --git a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/index.ts b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/index.ts index b64dc6ea55e..9ede9dbbb8c 100644 --- a/demos/src/Experiments/CollaborationAnnotation/Vue/extension/index.ts +++ b/demos/src/Experiments/CollaborationAnnotation/Vue/extension/index.ts @@ -1,5 +1,5 @@ -import { CollaborationAnnotation } from './collaboration-annotation' +import { CollaborationAnnotation } from './collaboration-annotation.js' -export * from './collaboration-annotation' +export * from './collaboration-annotation.js' export default CollaborationAnnotation diff --git a/demos/src/Experiments/CollaborationAnnotation/Vue/index.vue b/demos/src/Experiments/CollaborationAnnotation/Vue/index.vue index e7b01a45eff..a414a367f99 100644 --- a/demos/src/Experiments/CollaborationAnnotation/Vue/index.vue +++ b/demos/src/Experiments/CollaborationAnnotation/Vue/index.vue @@ -41,7 +41,7 @@ import Text from '@tiptap/extension-text' import { Editor, EditorContent } from '@tiptap/vue-3' import * as Y from 'yjs' -import CollaborationAnnotation from './extension' +import CollaborationAnnotation from './extension/index.ts' export default { components: { diff --git a/demos/src/Experiments/Commands/Vue/index.vue b/demos/src/Experiments/Commands/Vue/index.vue index 9f4b624a975..b1781e0866d 100644 --- a/demos/src/Experiments/Commands/Vue/index.vue +++ b/demos/src/Experiments/Commands/Vue/index.vue @@ -8,8 +8,8 @@ import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' -import Commands from './commands' -import suggestion from './suggestion' +import Commands from './commands.js' +import suggestion from './suggestion.js' export default { components: { diff --git a/demos/src/Experiments/Embeds/Vue/index.vue b/demos/src/Experiments/Embeds/Vue/index.vue index 76f553f8b67..95b64102092 100644 --- a/demos/src/Experiments/Embeds/Vue/index.vue +++ b/demos/src/Experiments/Embeds/Vue/index.vue @@ -12,7 +12,7 @@ import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' -import Iframe from './iframe' +import Iframe from './iframe.ts' export default { components: { diff --git a/demos/src/Experiments/ExtensionStorage/React/index.jsx b/demos/src/Experiments/ExtensionStorage/React/index.jsx index 694f94823aa..edb3dcf6760 100644 --- a/demos/src/Experiments/ExtensionStorage/React/index.jsx +++ b/demos/src/Experiments/ExtensionStorage/React/index.jsx @@ -6,7 +6,7 @@ import Text from '@tiptap/extension-text' import { EditorContent, useEditor } from '@tiptap/react' import React from 'react' -import { CustomExtension } from './CustomExtension' +import { CustomExtension } from './CustomExtension.ts' export default () => { const editor = useEditor({ diff --git a/demos/src/Experiments/ExtensionStorage/Vue/index.vue b/demos/src/Experiments/ExtensionStorage/Vue/index.vue index e905d1c528e..d834b0dd1e6 100644 --- a/demos/src/Experiments/ExtensionStorage/Vue/index.vue +++ b/demos/src/Experiments/ExtensionStorage/Vue/index.vue @@ -9,7 +9,7 @@ import Paragraph from '@tiptap/extension-paragraph' import Text from '@tiptap/extension-text' import { Editor, EditorContent } from '@tiptap/vue-3' -import { CustomExtension } from './CustomExtension' +import { CustomExtension } from './CustomExtension.ts' export default { components: { diff --git a/demos/src/Experiments/Figure/Vue/index.vue b/demos/src/Experiments/Figure/Vue/index.vue index 7df88ef9cfd..73412d2610e 100644 --- a/demos/src/Experiments/Figure/Vue/index.vue +++ b/demos/src/Experiments/Figure/Vue/index.vue @@ -27,7 +27,7 @@ import Image from '@tiptap/extension-image' import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' -import { Figure } from './figure' +import { Figure } from './figure.ts' export default { components: { diff --git a/demos/src/Experiments/GenericFigure/Vue/index.vue b/demos/src/Experiments/GenericFigure/Vue/index.vue index 1bef04e993b..30a6d7071ba 100644 --- a/demos/src/Experiments/GenericFigure/Vue/index.vue +++ b/demos/src/Experiments/GenericFigure/Vue/index.vue @@ -25,8 +25,8 @@ import TableRow from '@tiptap/extension-table-row' import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' -import { Figcaption } from './figcaption' -import { Figure } from './figure' +import { Figcaption } from './figcaption.ts' +import { Figure } from './figure.ts' const ImageFigure = Figure.extend({ name: 'capturedImage', diff --git a/demos/src/Experiments/IsolatingClear/React/index.jsx b/demos/src/Experiments/IsolatingClear/React/index.jsx index c386aa1f6f5..9358f84f688 100644 --- a/demos/src/Experiments/IsolatingClear/React/index.jsx +++ b/demos/src/Experiments/IsolatingClear/React/index.jsx @@ -6,7 +6,7 @@ import TextStyle from '@tiptap/extension-text-style' import { EditorContent, Node, useEditor } from '@tiptap/react' import React from 'react' -import { content } from '../content' +import { content } from '../content.ts' const WrapperBlock = Node.create({ name: 'wrapperBlock', diff --git a/demos/src/Experiments/Linter/Vue/extension/Linter.ts b/demos/src/Experiments/Linter/Vue/extension/Linter.ts index 83b0e17e156..b3c776fd1ed 100644 --- a/demos/src/Experiments/Linter/Vue/extension/Linter.ts +++ b/demos/src/Experiments/Linter/Vue/extension/Linter.ts @@ -3,7 +3,7 @@ import { Node as ProsemirrorNode } from '@tiptap/pm/model' import { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state' import { Decoration, DecorationSet } from '@tiptap/pm/view' -import LinterPlugin, { Result as Issue } from './LinterPlugin' +import LinterPlugin, { Result as Issue } from './LinterPlugin.js' interface IconDivElement extends HTMLDivElement { issue?: Issue diff --git a/demos/src/Experiments/Linter/Vue/extension/index.ts b/demos/src/Experiments/Linter/Vue/extension/index.ts index ac123720256..75014983bdf 100644 --- a/demos/src/Experiments/Linter/Vue/extension/index.ts +++ b/demos/src/Experiments/Linter/Vue/extension/index.ts @@ -1,8 +1,8 @@ -import { Linter } from './Linter' +import { Linter } from './Linter.js' -export * from './Linter' +export * from './Linter.js' export default Linter -export { BadWords } from './plugins/BadWords' -export { HeadingLevel } from './plugins/HeadingLevel' -export { Punctuation } from './plugins/Punctuation' +export { BadWords } from './plugins/BadWords.js' +export { HeadingLevel } from './plugins/HeadingLevel.js' +export { Punctuation } from './plugins/Punctuation.js' diff --git a/demos/src/Experiments/Linter/Vue/extension/plugins/BadWords.ts b/demos/src/Experiments/Linter/Vue/extension/plugins/BadWords.ts index 8f1a01e51bf..cd9b49593ec 100644 --- a/demos/src/Experiments/Linter/Vue/extension/plugins/BadWords.ts +++ b/demos/src/Experiments/Linter/Vue/extension/plugins/BadWords.ts @@ -1,4 +1,4 @@ -import LinterPlugin from '../LinterPlugin' +import LinterPlugin from '../LinterPlugin.js' export class BadWords extends LinterPlugin { diff --git a/demos/src/Experiments/Linter/Vue/extension/plugins/HeadingLevel.ts b/demos/src/Experiments/Linter/Vue/extension/plugins/HeadingLevel.ts index b6273ab4cad..34802fdc623 100644 --- a/demos/src/Experiments/Linter/Vue/extension/plugins/HeadingLevel.ts +++ b/demos/src/Experiments/Linter/Vue/extension/plugins/HeadingLevel.ts @@ -1,6 +1,6 @@ import { EditorView } from '@tiptap/pm/view' -import LinterPlugin, { Result as Issue } from '../LinterPlugin' +import LinterPlugin, { Result as Issue } from '../LinterPlugin.js' export class HeadingLevel extends LinterPlugin { fixHeader(level: number) { diff --git a/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts b/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts index 7e9d114da63..506e0abaa87 100644 --- a/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts +++ b/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts @@ -1,6 +1,6 @@ import { EditorView } from '@tiptap/pm/view' -import LinterPlugin, { Result as Issue } from '../LinterPlugin' +import LinterPlugin, { Result as Issue } from '../LinterPlugin.js' export class Punctuation extends LinterPlugin { public regex = / ([,.!?:]) ?/g diff --git a/demos/src/Experiments/Linter/Vue/index.vue b/demos/src/Experiments/Linter/Vue/index.vue index debf58cff4f..da08b78362f 100644 --- a/demos/src/Experiments/Linter/Vue/index.vue +++ b/demos/src/Experiments/Linter/Vue/index.vue @@ -11,7 +11,7 @@ import Paragraph from '@tiptap/extension-paragraph' import Text from '@tiptap/extension-text' import { Editor, EditorContent } from '@tiptap/vue-3' -import Linter, { BadWords, HeadingLevel, Punctuation } from './extension' +import Linter, { BadWords, HeadingLevel, Punctuation } from './extension/index.ts' export default { components: { diff --git a/demos/src/Experiments/TrailingNode/Vue/index.vue b/demos/src/Experiments/TrailingNode/Vue/index.vue index d8c3e13bf38..d51cc44e46e 100644 --- a/demos/src/Experiments/TrailingNode/Vue/index.vue +++ b/demos/src/Experiments/TrailingNode/Vue/index.vue @@ -8,7 +8,7 @@ import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' -import { TrailingNode } from './trailing-node' +import { TrailingNode } from './trailing-node.ts' export default { components: { diff --git a/demos/src/Nodes/Mention/React/index.jsx b/demos/src/Nodes/Mention/React/index.jsx index 5b4204d9932..42424739992 100644 --- a/demos/src/Nodes/Mention/React/index.jsx +++ b/demos/src/Nodes/Mention/React/index.jsx @@ -5,7 +5,7 @@ import { EditorContent, useEditor } from '@tiptap/react' import StarterKit from '@tiptap/starter-kit' import React from 'react' -import suggestion from './suggestion' +import suggestion from './suggestion.js' export default () => { const editor = useEditor({ diff --git a/demos/src/Nodes/Mention/Vue/index.vue b/demos/src/Nodes/Mention/Vue/index.vue index 92c248601a9..643d9cb8585 100644 --- a/demos/src/Nodes/Mention/Vue/index.vue +++ b/demos/src/Nodes/Mention/Vue/index.vue @@ -9,7 +9,7 @@ import Mention from '@tiptap/extension-mention' import StarterKit from '@tiptap/starter-kit' import { Editor, EditorContent } from '@tiptap/vue-3' -import suggestion from './suggestion' +import suggestion from './suggestion.js' export default { components: { diff --git a/packages/core/src/CommandManager.ts b/packages/core/src/CommandManager.ts index ae87c89bc15..ae90719594c 100644 --- a/packages/core/src/CommandManager.ts +++ b/packages/core/src/CommandManager.ts @@ -1,10 +1,10 @@ import { EditorState, Transaction } from '@tiptap/pm/state' -import { Editor } from './Editor' -import { createChainableState } from './helpers/createChainableState' +import { Editor } from './Editor.js' +import { createChainableState } from './helpers/createChainableState.js' import { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands, -} from './types' +} from './types.js' export class CommandManager { editor: Editor diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 7cd43caf49c..744d7446dbf 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -4,19 +4,19 @@ import { } from '@tiptap/pm/state' import { EditorView } from '@tiptap/pm/view' -import { CommandManager } from './CommandManager' -import { EventEmitter } from './EventEmitter' -import { ExtensionManager } from './ExtensionManager' -import * as extensions from './extensions' -import { createDocument } from './helpers/createDocument' -import { getAttributes } from './helpers/getAttributes' -import { getHTMLFromFragment } from './helpers/getHTMLFromFragment' -import { getText } from './helpers/getText' -import { getTextSerializersFromSchema } from './helpers/getTextSerializersFromSchema' -import { isActive } from './helpers/isActive' -import { isNodeEmpty } from './helpers/isNodeEmpty' -import { resolveFocusPosition } from './helpers/resolveFocusPosition' -import { style } from './style' +import { CommandManager } from './CommandManager.js' +import { EventEmitter } from './EventEmitter.js' +import { ExtensionManager } from './ExtensionManager.js' +import * as extensions from './extensions/index.js' +import { createDocument } from './helpers/createDocument.js' +import { getAttributes } from './helpers/getAttributes.js' +import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js' +import { getText } from './helpers/getText.js' +import { getTextSerializersFromSchema } from './helpers/getTextSerializersFromSchema.js' +import { isActive } from './helpers/isActive.js' +import { isNodeEmpty } from './helpers/isNodeEmpty.js' +import { resolveFocusPosition } from './helpers/resolveFocusPosition.js' +import { style } from './style.js' import { CanCommands, ChainedCommands, @@ -25,9 +25,9 @@ import { JSONContent, SingleCommands, TextSerializer, -} from './types' -import { createStyleTag } from './utilities/createStyleTag' -import { isFunction } from './utilities/isFunction' +} from './types.js' +import { createStyleTag } from './utilities/createStyleTag.js' +import { isFunction } from './utilities/isFunction.js' export { extensions } diff --git a/packages/core/src/Extension.ts b/packages/core/src/Extension.ts index 3a0ca702239..74d7820a48a 100644 --- a/packages/core/src/Extension.ts +++ b/packages/core/src/Extension.ts @@ -1,12 +1,12 @@ import { Plugin, Transaction } from '@tiptap/pm/state' -import { ExtensionConfig } from '.' -import { Editor } from './Editor' -import { getExtensionField } from './helpers/getExtensionField' -import { InputRule } from './InputRule' -import { Mark } from './Mark' -import { Node } from './Node' -import { PasteRule } from './PasteRule' +import { Editor } from './Editor.js' +import { getExtensionField } from './helpers/getExtensionField.js' +import { ExtensionConfig } from './index.js' +import { InputRule } from './InputRule.js' +import { Mark } from './Mark.js' +import { Node } from './Node.js' +import { PasteRule } from './PasteRule.js' import { AnyConfig, Extensions, @@ -14,9 +14,9 @@ import { KeyboardShortcutCommand, ParentConfig, RawCommands, -} from './types' -import { callOrReturn } from './utilities/callOrReturn' -import { mergeDeep } from './utilities/mergeDeep' +} from './types.js' +import { callOrReturn } from './utilities/callOrReturn.js' +import { mergeDeep } from './utilities/mergeDeep.js' declare module '@tiptap/core' { interface ExtensionConfig { diff --git a/packages/core/src/ExtensionManager.ts b/packages/core/src/ExtensionManager.ts index bb69d7d9af4..3c82d4e8df2 100644 --- a/packages/core/src/ExtensionManager.ts +++ b/packages/core/src/ExtensionManager.ts @@ -3,21 +3,21 @@ import { Node as ProsemirrorNode, Schema } from '@tiptap/pm/model' import { Plugin } from '@tiptap/pm/state' import { Decoration, EditorView } from '@tiptap/pm/view' -import { Mark, NodeConfig } from '.' -import { Editor } from './Editor' -import { getAttributesFromExtensions } from './helpers/getAttributesFromExtensions' -import { getExtensionField } from './helpers/getExtensionField' -import { getNodeType } from './helpers/getNodeType' -import { getRenderedAttributes } from './helpers/getRenderedAttributes' -import { getSchemaByResolvedExtensions } from './helpers/getSchemaByResolvedExtensions' -import { getSchemaTypeByName } from './helpers/getSchemaTypeByName' -import { isExtensionRulesEnabled } from './helpers/isExtensionRulesEnabled' -import { splitExtensions } from './helpers/splitExtensions' -import { inputRulesPlugin } from './InputRule' -import { pasteRulesPlugin } from './PasteRule' -import { AnyConfig, Extensions, RawCommands } from './types' -import { callOrReturn } from './utilities/callOrReturn' -import { findDuplicates } from './utilities/findDuplicates' +import { Editor } from './Editor.js' +import { getAttributesFromExtensions } from './helpers/getAttributesFromExtensions.js' +import { getExtensionField } from './helpers/getExtensionField.js' +import { getNodeType } from './helpers/getNodeType.js' +import { getRenderedAttributes } from './helpers/getRenderedAttributes.js' +import { getSchemaByResolvedExtensions } from './helpers/getSchemaByResolvedExtensions.js' +import { getSchemaTypeByName } from './helpers/getSchemaTypeByName.js' +import { isExtensionRulesEnabled } from './helpers/isExtensionRulesEnabled.js' +import { splitExtensions } from './helpers/splitExtensions.js' +import { Mark, NodeConfig } from './index.js' +import { inputRulesPlugin } from './InputRule.js' +import { pasteRulesPlugin } from './PasteRule.js' +import { AnyConfig, Extensions, RawCommands } from './types.js' +import { callOrReturn } from './utilities/callOrReturn.js' +import { findDuplicates } from './utilities/findDuplicates.js' export class ExtensionManager { editor: Editor diff --git a/packages/core/src/InputRule.ts b/packages/core/src/InputRule.ts index 3d04c92da8c..04958c1bbc7 100644 --- a/packages/core/src/InputRule.ts +++ b/packages/core/src/InputRule.ts @@ -1,17 +1,17 @@ import { EditorState, Plugin, TextSelection } from '@tiptap/pm/state' -import { CommandManager } from './CommandManager' -import { Editor } from './Editor' -import { createChainableState } from './helpers/createChainableState' -import { getTextContentFromNodes } from './helpers/getTextContentFromNodes' +import { CommandManager } from './CommandManager.js' +import { Editor } from './Editor.js' +import { createChainableState } from './helpers/createChainableState.js' +import { getTextContentFromNodes } from './helpers/getTextContentFromNodes.js' import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands, -} from './types' -import { isRegExp } from './utilities/isRegExp' +} from './types.js' +import { isRegExp } from './utilities/isRegExp.js' export type InputRuleMatch = { index: number diff --git a/packages/core/src/Mark.ts b/packages/core/src/Mark.ts index 14b77cf642c..aa23a478541 100644 --- a/packages/core/src/Mark.ts +++ b/packages/core/src/Mark.ts @@ -3,12 +3,12 @@ import { } from '@tiptap/pm/model' import { Plugin, Transaction } from '@tiptap/pm/state' -import { MarkConfig } from '.' -import { Editor } from './Editor' -import { getExtensionField } from './helpers/getExtensionField' -import { InputRule } from './InputRule' -import { Node } from './Node' -import { PasteRule } from './PasteRule' +import { Editor } from './Editor.js' +import { getExtensionField } from './helpers/getExtensionField.js' +import { MarkConfig } from './index.js' +import { InputRule } from './InputRule.js' +import { Node } from './Node.js' +import { PasteRule } from './PasteRule.js' import { AnyConfig, Attributes, @@ -17,9 +17,9 @@ import { KeyboardShortcutCommand, ParentConfig, RawCommands, -} from './types' -import { callOrReturn } from './utilities/callOrReturn' -import { mergeDeep } from './utilities/mergeDeep' +} from './types.js' +import { callOrReturn } from './utilities/callOrReturn.js' +import { mergeDeep } from './utilities/mergeDeep.js' declare module '@tiptap/core' { export interface MarkConfig { diff --git a/packages/core/src/Node.ts b/packages/core/src/Node.ts index 2c9acae08ca..660c1bbd10a 100644 --- a/packages/core/src/Node.ts +++ b/packages/core/src/Node.ts @@ -3,11 +3,11 @@ import { } from '@tiptap/pm/model' import { Plugin, Transaction } from '@tiptap/pm/state' -import { NodeConfig } from '.' -import { Editor } from './Editor' -import { getExtensionField } from './helpers/getExtensionField' -import { InputRule } from './InputRule' -import { PasteRule } from './PasteRule' +import { Editor } from './Editor.js' +import { getExtensionField } from './helpers/getExtensionField.js' +import { NodeConfig } from './index.js' +import { InputRule } from './InputRule.js' +import { PasteRule } from './PasteRule.js' import { AnyConfig, Attributes, @@ -17,9 +17,9 @@ import { NodeViewRenderer, ParentConfig, RawCommands, -} from './types' -import { callOrReturn } from './utilities/callOrReturn' -import { mergeDeep } from './utilities/mergeDeep' +} from './types.js' +import { callOrReturn } from './utilities/callOrReturn.js' +import { mergeDeep } from './utilities/mergeDeep.js' declare module '@tiptap/core' { interface NodeConfig { diff --git a/packages/core/src/NodeView.ts b/packages/core/src/NodeView.ts index 62b241fac12..204867f3006 100644 --- a/packages/core/src/NodeView.ts +++ b/packages/core/src/NodeView.ts @@ -2,10 +2,10 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' import { NodeSelection } from '@tiptap/pm/state' import { NodeView as ProseMirrorNodeView } from '@tiptap/pm/view' -import { Editor as CoreEditor } from './Editor' -import { Node } from './Node' -import { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types' -import { isiOS } from './utilities/isiOS' +import { Editor as CoreEditor } from './Editor.js' +import { Node } from './Node.js' +import { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types.js' +import { isiOS } from './utilities/isiOS.js' export class NodeView< Component, diff --git a/packages/core/src/PasteRule.ts b/packages/core/src/PasteRule.ts index 287845ed61c..acc24faa3e7 100644 --- a/packages/core/src/PasteRule.ts +++ b/packages/core/src/PasteRule.ts @@ -1,17 +1,17 @@ import { EditorState, Plugin } from '@tiptap/pm/state' -import { CommandManager } from './CommandManager' -import { Editor } from './Editor' -import { createChainableState } from './helpers/createChainableState' +import { CommandManager } from './CommandManager.js' +import { Editor } from './Editor.js' +import { createChainableState } from './helpers/createChainableState.js' import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands, -} from './types' -import { isNumber } from './utilities/isNumber' -import { isRegExp } from './utilities/isRegExp' +} from './types.js' +import { isNumber } from './utilities/isNumber.js' +import { isRegExp } from './utilities/isRegExp.js' export type PasteRuleMatch = { index: number diff --git a/packages/core/src/commands/blur.ts b/packages/core/src/commands/blur.ts index ac603e821fd..511137bc1b6 100644 --- a/packages/core/src/commands/blur.ts +++ b/packages/core/src/commands/blur.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/clearContent.ts b/packages/core/src/commands/clearContent.ts index ccefd7b5307..6385452256c 100644 --- a/packages/core/src/commands/clearContent.ts +++ b/packages/core/src/commands/clearContent.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/clearNodes.ts b/packages/core/src/commands/clearNodes.ts index e4173a811df..aa41fcc3c1f 100644 --- a/packages/core/src/commands/clearNodes.ts +++ b/packages/core/src/commands/clearNodes.ts @@ -1,6 +1,6 @@ import { liftTarget } from '@tiptap/pm/transform' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/command.ts b/packages/core/src/commands/command.ts index 0cfba78378f..9262495c622 100644 --- a/packages/core/src/commands/command.ts +++ b/packages/core/src/commands/command.ts @@ -1,4 +1,4 @@ -import { Command, RawCommands } from '../types' +import { Command, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/createParagraphNear.ts b/packages/core/src/commands/createParagraphNear.ts index 8ad4fbac3cc..c0103989f16 100644 --- a/packages/core/src/commands/createParagraphNear.ts +++ b/packages/core/src/commands/createParagraphNear.ts @@ -1,6 +1,6 @@ import { createParagraphNear as originalCreateParagraphNear } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/deleteCurrentNode.ts b/packages/core/src/commands/deleteCurrentNode.ts index c910ec4b7ba..5f5914dfe31 100644 --- a/packages/core/src/commands/deleteCurrentNode.ts +++ b/packages/core/src/commands/deleteCurrentNode.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/deleteNode.ts b/packages/core/src/commands/deleteNode.ts index 75ca079a1b0..c1ddbecf019 100644 --- a/packages/core/src/commands/deleteNode.ts +++ b/packages/core/src/commands/deleteNode.ts @@ -1,7 +1,7 @@ import { NodeType } from '@tiptap/pm/model' -import { getNodeType } from '../helpers/getNodeType' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/deleteRange.ts b/packages/core/src/commands/deleteRange.ts index c9626927834..9c25a4c1378 100644 --- a/packages/core/src/commands/deleteRange.ts +++ b/packages/core/src/commands/deleteRange.ts @@ -1,4 +1,4 @@ -import { Range, RawCommands } from '../types' +import { Range, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/deleteSelection.ts b/packages/core/src/commands/deleteSelection.ts index 8e8d5be69df..a52b6b633ba 100644 --- a/packages/core/src/commands/deleteSelection.ts +++ b/packages/core/src/commands/deleteSelection.ts @@ -1,6 +1,6 @@ import { deleteSelection as originalDeleteSelection } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/enter.ts b/packages/core/src/commands/enter.ts index bdab0fbc046..5eb1e7265e5 100644 --- a/packages/core/src/commands/enter.ts +++ b/packages/core/src/commands/enter.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/exitCode.ts b/packages/core/src/commands/exitCode.ts index 7940a82d484..5242b998bb0 100644 --- a/packages/core/src/commands/exitCode.ts +++ b/packages/core/src/commands/exitCode.ts @@ -1,6 +1,6 @@ import { exitCode as originalExitCode } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/extendMarkRange.ts b/packages/core/src/commands/extendMarkRange.ts index a67badb68af..30e7c60a33c 100644 --- a/packages/core/src/commands/extendMarkRange.ts +++ b/packages/core/src/commands/extendMarkRange.ts @@ -1,9 +1,9 @@ import { MarkType } from '@tiptap/pm/model' import { TextSelection } from '@tiptap/pm/state' -import { getMarkRange } from '../helpers/getMarkRange' -import { getMarkType } from '../helpers/getMarkType' -import { RawCommands } from '../types' +import { getMarkRange } from '../helpers/getMarkRange.js' +import { getMarkType } from '../helpers/getMarkType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/first.ts b/packages/core/src/commands/first.ts index 6bd33368607..cf686a770b7 100644 --- a/packages/core/src/commands/first.ts +++ b/packages/core/src/commands/first.ts @@ -1,4 +1,4 @@ -import { Command, CommandProps, RawCommands } from '../types' +import { Command, CommandProps, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/focus.ts b/packages/core/src/commands/focus.ts index cebd877c04d..c7f22ce5a76 100644 --- a/packages/core/src/commands/focus.ts +++ b/packages/core/src/commands/focus.ts @@ -1,7 +1,7 @@ -import { isTextSelection } from '../helpers/isTextSelection' -import { resolveFocusPosition } from '../helpers/resolveFocusPosition' -import { FocusPosition, RawCommands } from '../types' -import { isiOS } from '../utilities/isiOS' +import { isTextSelection } from '../helpers/isTextSelection.js' +import { resolveFocusPosition } from '../helpers/resolveFocusPosition.js' +import { FocusPosition, RawCommands } from '../types.js' +import { isiOS } from '../utilities/isiOS.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/forEach.ts b/packages/core/src/commands/forEach.ts index 5d95b40eef5..2b1b983e322 100644 --- a/packages/core/src/commands/forEach.ts +++ b/packages/core/src/commands/forEach.ts @@ -1,4 +1,4 @@ -import { CommandProps, RawCommands } from '../types' +import { CommandProps, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/index.ts b/packages/core/src/commands/index.ts index a9711f9b3e7..2ab904d32dd 100644 --- a/packages/core/src/commands/index.ts +++ b/packages/core/src/commands/index.ts @@ -1,50 +1,50 @@ -export * from './blur' -export * from './clearContent' -export * from './clearNodes' -export * from './command' -export * from './createParagraphNear' -export * from './deleteCurrentNode' -export * from './deleteNode' -export * from './deleteRange' -export * from './deleteSelection' -export * from './enter' -export * from './exitCode' -export * from './extendMarkRange' -export * from './first' -export * from './focus' -export * from './forEach' -export * from './insertContent' -export * from './insertContentAt' -export * from './join' -export * from './keyboardShortcut' -export * from './lift' -export * from './liftEmptyBlock' -export * from './liftListItem' -export * from './newlineInCode' -export * from './resetAttributes' -export * from './scrollIntoView' -export * from './selectAll' -export * from './selectNodeBackward' -export * from './selectNodeForward' -export * from './selectParentNode' -export * from './selectTextblockEnd' -export * from './selectTextblockStart' -export * from './setContent' -export * from './setMark' -export * from './setMeta' -export * from './setNode' -export * from './setNodeSelection' -export * from './setTextSelection' -export * from './sinkListItem' -export * from './splitBlock' -export * from './splitListItem' -export * from './toggleList' -export * from './toggleMark' -export * from './toggleNode' -export * from './toggleWrap' -export * from './undoInputRule' -export * from './unsetAllMarks' -export * from './unsetMark' -export * from './updateAttributes' -export * from './wrapIn' -export * from './wrapInList' +export * from './blur.js' +export * from './clearContent.js' +export * from './clearNodes.js' +export * from './command.js' +export * from './createParagraphNear.js' +export * from './deleteCurrentNode.js' +export * from './deleteNode.js' +export * from './deleteRange.js' +export * from './deleteSelection.js' +export * from './enter.js' +export * from './exitCode.js' +export * from './extendMarkRange.js' +export * from './first.js' +export * from './focus.js' +export * from './forEach.js' +export * from './insertContent.js' +export * from './insertContentAt.js' +export * from './join.js' +export * from './keyboardShortcut.js' +export * from './lift.js' +export * from './liftEmptyBlock.js' +export * from './liftListItem.js' +export * from './newlineInCode.js' +export * from './resetAttributes.js' +export * from './scrollIntoView.js' +export * from './selectAll.js' +export * from './selectNodeBackward.js' +export * from './selectNodeForward.js' +export * from './selectParentNode.js' +export * from './selectTextblockEnd.js' +export * from './selectTextblockStart.js' +export * from './setContent.js' +export * from './setMark.js' +export * from './setMeta.js' +export * from './setNode.js' +export * from './setNodeSelection.js' +export * from './setTextSelection.js' +export * from './sinkListItem.js' +export * from './splitBlock.js' +export * from './splitListItem.js' +export * from './toggleList.js' +export * from './toggleMark.js' +export * from './toggleNode.js' +export * from './toggleWrap.js' +export * from './undoInputRule.js' +export * from './unsetAllMarks.js' +export * from './unsetMark.js' +export * from './updateAttributes.js' +export * from './wrapIn.js' +export * from './wrapInList.js' diff --git a/packages/core/src/commands/insertContent.ts b/packages/core/src/commands/insertContent.ts index fe158410d94..f7e75f26c09 100644 --- a/packages/core/src/commands/insertContent.ts +++ b/packages/core/src/commands/insertContent.ts @@ -1,6 +1,6 @@ import { ParseOptions } from '@tiptap/pm/model' -import { Content, RawCommands } from '../types' +import { Content, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/insertContentAt.ts b/packages/core/src/commands/insertContentAt.ts index b0d54092416..1836483706c 100644 --- a/packages/core/src/commands/insertContentAt.ts +++ b/packages/core/src/commands/insertContentAt.ts @@ -1,8 +1,8 @@ import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model' -import { createNodeFromContent } from '../helpers/createNodeFromContent' -import { selectionToInsertionEnd } from '../helpers/selectionToInsertionEnd' -import { Content, Range, RawCommands } from '../types' +import { createNodeFromContent } from '../helpers/createNodeFromContent.js' +import { selectionToInsertionEnd } from '../helpers/selectionToInsertionEnd.js' +import { Content, Range, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/join.ts b/packages/core/src/commands/join.ts index 4167aef0273..6e45f39ea2b 100644 --- a/packages/core/src/commands/join.ts +++ b/packages/core/src/commands/join.ts @@ -5,7 +5,7 @@ import { joinUp as originalJoinUp, } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/keyboardShortcut.ts b/packages/core/src/commands/keyboardShortcut.ts index 915224dfe5d..a9634f57849 100644 --- a/packages/core/src/commands/keyboardShortcut.ts +++ b/packages/core/src/commands/keyboardShortcut.ts @@ -1,6 +1,6 @@ -import { RawCommands } from '../types' -import { isiOS } from '../utilities/isiOS' -import { isMacOS } from '../utilities/isMacOS' +import { RawCommands } from '../types.js' +import { isiOS } from '../utilities/isiOS.js' +import { isMacOS } from '../utilities/isMacOS.js' function normalizeKeyName(name: string) { const parts = name.split(/-(?!$)/) diff --git a/packages/core/src/commands/lift.ts b/packages/core/src/commands/lift.ts index 783c23e542d..0ac6432df0e 100644 --- a/packages/core/src/commands/lift.ts +++ b/packages/core/src/commands/lift.ts @@ -1,9 +1,9 @@ import { lift as originalLift } from '@tiptap/pm/commands' import { NodeType } from '@tiptap/pm/model' -import { getNodeType } from '../helpers/getNodeType' -import { isNodeActive } from '../helpers/isNodeActive' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { isNodeActive } from '../helpers/isNodeActive.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/liftEmptyBlock.ts b/packages/core/src/commands/liftEmptyBlock.ts index f32d95b6f75..1adfee5b2b9 100644 --- a/packages/core/src/commands/liftEmptyBlock.ts +++ b/packages/core/src/commands/liftEmptyBlock.ts @@ -1,6 +1,6 @@ import { liftEmptyBlock as originalLiftEmptyBlock } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/liftListItem.ts b/packages/core/src/commands/liftListItem.ts index 2cdb06dcab0..ba9142f1c2a 100644 --- a/packages/core/src/commands/liftListItem.ts +++ b/packages/core/src/commands/liftListItem.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' import { liftListItem as originalLiftListItem } from '@tiptap/pm/schema-list' -import { getNodeType } from '../helpers/getNodeType' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/newlineInCode.ts b/packages/core/src/commands/newlineInCode.ts index 5dedcf435cd..41e28648a94 100644 --- a/packages/core/src/commands/newlineInCode.ts +++ b/packages/core/src/commands/newlineInCode.ts @@ -1,6 +1,6 @@ import { newlineInCode as originalNewlineInCode } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/resetAttributes.ts b/packages/core/src/commands/resetAttributes.ts index 69460f8b2ce..df3918d9f4d 100644 --- a/packages/core/src/commands/resetAttributes.ts +++ b/packages/core/src/commands/resetAttributes.ts @@ -1,10 +1,10 @@ import { MarkType, NodeType } from '@tiptap/pm/model' -import { getMarkType } from '../helpers/getMarkType' -import { getNodeType } from '../helpers/getNodeType' -import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName' -import { RawCommands } from '../types' -import { deleteProps } from '../utilities/deleteProps' +import { getMarkType } from '../helpers/getMarkType.js' +import { getNodeType } from '../helpers/getNodeType.js' +import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js' +import { RawCommands } from '../types.js' +import { deleteProps } from '../utilities/deleteProps.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/scrollIntoView.ts b/packages/core/src/commands/scrollIntoView.ts index 39e97a3676d..efc66edfed6 100644 --- a/packages/core/src/commands/scrollIntoView.ts +++ b/packages/core/src/commands/scrollIntoView.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/selectAll.ts b/packages/core/src/commands/selectAll.ts index 15518ea2d02..14cc9bb7b80 100644 --- a/packages/core/src/commands/selectAll.ts +++ b/packages/core/src/commands/selectAll.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/selectNodeBackward.ts b/packages/core/src/commands/selectNodeBackward.ts index e2331c32934..00a31fd3059 100644 --- a/packages/core/src/commands/selectNodeBackward.ts +++ b/packages/core/src/commands/selectNodeBackward.ts @@ -1,6 +1,6 @@ import { selectNodeBackward as originalSelectNodeBackward } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/selectNodeForward.ts b/packages/core/src/commands/selectNodeForward.ts index 4b0daa8dec2..98f3551c66d 100644 --- a/packages/core/src/commands/selectNodeForward.ts +++ b/packages/core/src/commands/selectNodeForward.ts @@ -1,6 +1,6 @@ import { selectNodeForward as originalSelectNodeForward } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/selectParentNode.ts b/packages/core/src/commands/selectParentNode.ts index ea64ab92c13..eaed8b032e4 100644 --- a/packages/core/src/commands/selectParentNode.ts +++ b/packages/core/src/commands/selectParentNode.ts @@ -1,6 +1,6 @@ import { selectParentNode as originalSelectParentNode } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/selectTextblockEnd.ts b/packages/core/src/commands/selectTextblockEnd.ts index 96b384cd9ca..1893123bd99 100644 --- a/packages/core/src/commands/selectTextblockEnd.ts +++ b/packages/core/src/commands/selectTextblockEnd.ts @@ -2,7 +2,7 @@ // TODO: add types to @types/prosemirror-commands import { selectTextblockEnd as originalSelectTextblockEnd } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/selectTextblockStart.ts b/packages/core/src/commands/selectTextblockStart.ts index 59d684d09a9..de122096a04 100644 --- a/packages/core/src/commands/selectTextblockStart.ts +++ b/packages/core/src/commands/selectTextblockStart.ts @@ -2,7 +2,7 @@ // TODO: add types to @types/prosemirror-commands import { selectTextblockStart as originalSelectTextblockStart } from '@tiptap/pm/commands' -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/setContent.ts b/packages/core/src/commands/setContent.ts index bd1cc107c44..11cb11bf432 100644 --- a/packages/core/src/commands/setContent.ts +++ b/packages/core/src/commands/setContent.ts @@ -1,7 +1,7 @@ import { ParseOptions } from '@tiptap/pm/model' -import { createDocument } from '../helpers/createDocument' -import { Content, RawCommands } from '../types' +import { createDocument } from '../helpers/createDocument.js' +import { Content, RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/setMark.ts b/packages/core/src/commands/setMark.ts index 59aa1ee8f3d..211369bb7c3 100644 --- a/packages/core/src/commands/setMark.ts +++ b/packages/core/src/commands/setMark.ts @@ -1,10 +1,10 @@ import { MarkType, ResolvedPos } from '@tiptap/pm/model' import { EditorState, Transaction } from '@tiptap/pm/state' -import { isTextSelection } from '../helpers' -import { getMarkAttributes } from '../helpers/getMarkAttributes' -import { getMarkType } from '../helpers/getMarkType' -import { RawCommands } from '../types' +import { getMarkAttributes } from '../helpers/getMarkAttributes.js' +import { getMarkType } from '../helpers/getMarkType.js' +import { isTextSelection } from '../helpers/index.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/setMeta.ts b/packages/core/src/commands/setMeta.ts index cae39082e7c..56c89bf8399 100644 --- a/packages/core/src/commands/setMeta.ts +++ b/packages/core/src/commands/setMeta.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/setNode.ts b/packages/core/src/commands/setNode.ts index 7cb3df2a863..a3ad1d91ec9 100644 --- a/packages/core/src/commands/setNode.ts +++ b/packages/core/src/commands/setNode.ts @@ -1,8 +1,8 @@ import { setBlockType } from '@tiptap/pm/commands' import { NodeType } from '@tiptap/pm/model' -import { getNodeType } from '../helpers/getNodeType' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/setNodeSelection.ts b/packages/core/src/commands/setNodeSelection.ts index 63756395c2c..61aaf70bd60 100644 --- a/packages/core/src/commands/setNodeSelection.ts +++ b/packages/core/src/commands/setNodeSelection.ts @@ -1,7 +1,7 @@ import { NodeSelection } from '@tiptap/pm/state' -import { RawCommands } from '../types' -import { minMax } from '../utilities/minMax' +import { RawCommands } from '../types.js' +import { minMax } from '../utilities/minMax.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/setTextSelection.ts b/packages/core/src/commands/setTextSelection.ts index 77cb4c27fab..077842b1b4f 100644 --- a/packages/core/src/commands/setTextSelection.ts +++ b/packages/core/src/commands/setTextSelection.ts @@ -1,7 +1,7 @@ import { TextSelection } from '@tiptap/pm/state' -import { Range, RawCommands } from '../types' -import { minMax } from '../utilities/minMax' +import { Range, RawCommands } from '../types.js' +import { minMax } from '../utilities/minMax.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/sinkListItem.ts b/packages/core/src/commands/sinkListItem.ts index 1df2e0825d7..111183b20ca 100644 --- a/packages/core/src/commands/sinkListItem.ts +++ b/packages/core/src/commands/sinkListItem.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' import { sinkListItem as originalSinkListItem } from '@tiptap/pm/schema-list' -import { getNodeType } from '../helpers/getNodeType' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/splitBlock.ts b/packages/core/src/commands/splitBlock.ts index d1fd53705bf..f63c8f15879 100644 --- a/packages/core/src/commands/splitBlock.ts +++ b/packages/core/src/commands/splitBlock.ts @@ -1,9 +1,9 @@ import { EditorState, NodeSelection, TextSelection } from '@tiptap/pm/state' import { canSplit } from '@tiptap/pm/transform' -import { defaultBlockAt } from '../helpers/defaultBlockAt' -import { getSplittedAttributes } from '../helpers/getSplittedAttributes' -import { RawCommands } from '../types' +import { defaultBlockAt } from '../helpers/defaultBlockAt.js' +import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js' +import { RawCommands } from '../types.js' function ensureMarks(state: EditorState, splittableMarks?: string[]) { const marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks()) diff --git a/packages/core/src/commands/splitListItem.ts b/packages/core/src/commands/splitListItem.ts index 8952bc4df86..3f08037e5ca 100644 --- a/packages/core/src/commands/splitListItem.ts +++ b/packages/core/src/commands/splitListItem.ts @@ -4,9 +4,9 @@ import { import { TextSelection } from '@tiptap/pm/state' import { canSplit } from '@tiptap/pm/transform' -import { getNodeType } from '../helpers/getNodeType' -import { getSplittedAttributes } from '../helpers/getSplittedAttributes' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/toggleList.ts b/packages/core/src/commands/toggleList.ts index 868e6ad862f..638fbe67829 100644 --- a/packages/core/src/commands/toggleList.ts +++ b/packages/core/src/commands/toggleList.ts @@ -2,10 +2,10 @@ import { NodeType } from '@tiptap/pm/model' import { Transaction } from '@tiptap/pm/state' import { canJoin } from '@tiptap/pm/transform' -import { findParentNode } from '../helpers/findParentNode' -import { getNodeType } from '../helpers/getNodeType' -import { isList } from '../helpers/isList' -import { RawCommands } from '../types' +import { findParentNode } from '../helpers/findParentNode.js' +import { getNodeType } from '../helpers/getNodeType.js' +import { isList } from '../helpers/isList.js' +import { RawCommands } from '../types.js' const joinListBackwards = (tr: Transaction, listType: NodeType): boolean => { const list = findParentNode(node => node.type === listType)(tr.selection) diff --git a/packages/core/src/commands/toggleMark.ts b/packages/core/src/commands/toggleMark.ts index 745b4af0c72..7b2eb7eb839 100644 --- a/packages/core/src/commands/toggleMark.ts +++ b/packages/core/src/commands/toggleMark.ts @@ -1,8 +1,8 @@ import { MarkType } from '@tiptap/pm/model' -import { getMarkType } from '../helpers/getMarkType' -import { isMarkActive } from '../helpers/isMarkActive' -import { RawCommands } from '../types' +import { getMarkType } from '../helpers/getMarkType.js' +import { isMarkActive } from '../helpers/isMarkActive.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/toggleNode.ts b/packages/core/src/commands/toggleNode.ts index 796ea6919c1..cbc4f6671ed 100644 --- a/packages/core/src/commands/toggleNode.ts +++ b/packages/core/src/commands/toggleNode.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' -import { getNodeType } from '../helpers/getNodeType' -import { isNodeActive } from '../helpers/isNodeActive' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { isNodeActive } from '../helpers/isNodeActive.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/toggleWrap.ts b/packages/core/src/commands/toggleWrap.ts index 9520800d6f6..b9638f39233 100644 --- a/packages/core/src/commands/toggleWrap.ts +++ b/packages/core/src/commands/toggleWrap.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' -import { getNodeType } from '../helpers/getNodeType' -import { isNodeActive } from '../helpers/isNodeActive' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { isNodeActive } from '../helpers/isNodeActive.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/undoInputRule.ts b/packages/core/src/commands/undoInputRule.ts index 6f93b18651b..3c6f9b7c2e0 100644 --- a/packages/core/src/commands/undoInputRule.ts +++ b/packages/core/src/commands/undoInputRule.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/unsetAllMarks.ts b/packages/core/src/commands/unsetAllMarks.ts index cdcffc79001..e3ae7ea239c 100644 --- a/packages/core/src/commands/unsetAllMarks.ts +++ b/packages/core/src/commands/unsetAllMarks.ts @@ -1,4 +1,4 @@ -import { RawCommands } from '../types' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/unsetMark.ts b/packages/core/src/commands/unsetMark.ts index 8f2e6b1491f..1aef4b14b40 100644 --- a/packages/core/src/commands/unsetMark.ts +++ b/packages/core/src/commands/unsetMark.ts @@ -1,8 +1,8 @@ import { MarkType } from '@tiptap/pm/model' -import { getMarkRange } from '../helpers/getMarkRange' -import { getMarkType } from '../helpers/getMarkType' -import { RawCommands } from '../types' +import { getMarkRange } from '../helpers/getMarkRange.js' +import { getMarkType } from '../helpers/getMarkType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/updateAttributes.ts b/packages/core/src/commands/updateAttributes.ts index cc68e6e00d7..10b0d2e8e4c 100644 --- a/packages/core/src/commands/updateAttributes.ts +++ b/packages/core/src/commands/updateAttributes.ts @@ -1,9 +1,9 @@ import { MarkType, NodeType } from '@tiptap/pm/model' -import { getMarkType } from '../helpers/getMarkType' -import { getNodeType } from '../helpers/getNodeType' -import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName' -import { RawCommands } from '../types' +import { getMarkType } from '../helpers/getMarkType.js' +import { getNodeType } from '../helpers/getNodeType.js' +import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/wrapIn.ts b/packages/core/src/commands/wrapIn.ts index 81fb2967426..c9a0da169c9 100644 --- a/packages/core/src/commands/wrapIn.ts +++ b/packages/core/src/commands/wrapIn.ts @@ -1,8 +1,8 @@ import { wrapIn as originalWrapIn } from '@tiptap/pm/commands' import { NodeType } from '@tiptap/pm/model' -import { getNodeType } from '../helpers/getNodeType' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/commands/wrapInList.ts b/packages/core/src/commands/wrapInList.ts index 1f83d32e9b5..5140457f682 100644 --- a/packages/core/src/commands/wrapInList.ts +++ b/packages/core/src/commands/wrapInList.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' import { wrapInList as originalWrapInList } from '@tiptap/pm/schema-list' -import { getNodeType } from '../helpers/getNodeType' -import { RawCommands } from '../types' +import { getNodeType } from '../helpers/getNodeType.js' +import { RawCommands } from '../types.js' declare module '@tiptap/core' { interface Commands { diff --git a/packages/core/src/extensions/clipboardTextSerializer.ts b/packages/core/src/extensions/clipboardTextSerializer.ts index 99e908dcaa5..0986fc81cba 100644 --- a/packages/core/src/extensions/clipboardTextSerializer.ts +++ b/packages/core/src/extensions/clipboardTextSerializer.ts @@ -1,8 +1,8 @@ import { Plugin, PluginKey } from '@tiptap/pm/state' -import { Extension } from '../Extension' -import { getTextBetween } from '../helpers/getTextBetween' -import { getTextSerializersFromSchema } from '../helpers/getTextSerializersFromSchema' +import { Extension } from '../Extension.js' +import { getTextBetween } from '../helpers/getTextBetween.js' +import { getTextSerializersFromSchema } from '../helpers/getTextSerializersFromSchema.js' export const ClipboardTextSerializer = Extension.create({ name: 'clipboardTextSerializer', diff --git a/packages/core/src/extensions/commands.ts b/packages/core/src/extensions/commands.ts index 90fb1789de0..e25e3bd11e8 100644 --- a/packages/core/src/extensions/commands.ts +++ b/packages/core/src/extensions/commands.ts @@ -1,7 +1,7 @@ -import * as commands from '../commands' -import { Extension } from '../Extension' +import * as commands from '../commands/index.js' +import { Extension } from '../Extension.js' -export * from '../commands' +export * from '../commands/index.js' export const Commands = Extension.create({ name: 'commands', diff --git a/packages/core/src/extensions/editable.ts b/packages/core/src/extensions/editable.ts index d373b102c55..60c977d3f1e 100644 --- a/packages/core/src/extensions/editable.ts +++ b/packages/core/src/extensions/editable.ts @@ -1,6 +1,6 @@ import { Plugin, PluginKey } from '@tiptap/pm/state' -import { Extension } from '../Extension' +import { Extension } from '../Extension.js' export const Editable = Extension.create({ name: 'editable', diff --git a/packages/core/src/extensions/focusEvents.ts b/packages/core/src/extensions/focusEvents.ts index 851748da9db..9565b8cbab6 100644 --- a/packages/core/src/extensions/focusEvents.ts +++ b/packages/core/src/extensions/focusEvents.ts @@ -1,6 +1,6 @@ import { Plugin, PluginKey } from '@tiptap/pm/state' -import { Extension } from '../Extension' +import { Extension } from '../Extension.js' export const FocusEvents = Extension.create({ name: 'focusEvents', diff --git a/packages/core/src/extensions/index.ts b/packages/core/src/extensions/index.ts index 31c68a82140..139cdd891b6 100644 --- a/packages/core/src/extensions/index.ts +++ b/packages/core/src/extensions/index.ts @@ -1,6 +1,6 @@ -export { ClipboardTextSerializer } from './clipboardTextSerializer' -export { Commands } from './commands' -export { Editable } from './editable' -export { FocusEvents } from './focusEvents' -export { Keymap } from './keymap' -export { Tabindex } from './tabindex' +export { ClipboardTextSerializer } from './clipboardTextSerializer.js' +export { Commands } from './commands.js' +export { Editable } from './editable.js' +export { FocusEvents } from './focusEvents.js' +export { Keymap } from './keymap.js' +export { Tabindex } from './tabindex.js' diff --git a/packages/core/src/extensions/keymap.ts b/packages/core/src/extensions/keymap.ts index 0056f685279..dbcbfece63e 100644 --- a/packages/core/src/extensions/keymap.ts +++ b/packages/core/src/extensions/keymap.ts @@ -1,10 +1,10 @@ import { Plugin, PluginKey, Selection } from '@tiptap/pm/state' -import { CommandManager } from '../CommandManager' -import { Extension } from '../Extension' -import { createChainableState } from '../helpers/createChainableState' -import { isiOS } from '../utilities/isiOS' -import { isMacOS } from '../utilities/isMacOS' +import { CommandManager } from '../CommandManager.js' +import { Extension } from '../Extension.js' +import { createChainableState } from '../helpers/createChainableState.js' +import { isiOS } from '../utilities/isiOS.js' +import { isMacOS } from '../utilities/isMacOS.js' export const Keymap = Extension.create({ name: 'keymap', diff --git a/packages/core/src/extensions/tabindex.ts b/packages/core/src/extensions/tabindex.ts index 7f26262a78b..6decde79edb 100644 --- a/packages/core/src/extensions/tabindex.ts +++ b/packages/core/src/extensions/tabindex.ts @@ -1,6 +1,6 @@ import { Plugin, PluginKey } from '@tiptap/pm/state' -import { Extension } from '../Extension' +import { Extension } from '../Extension.js' export const Tabindex = Extension.create({ name: 'tabindex', diff --git a/packages/core/src/helpers/createDocument.ts b/packages/core/src/helpers/createDocument.ts index 066d1b109fd..4eaf5837fc1 100644 --- a/packages/core/src/helpers/createDocument.ts +++ b/packages/core/src/helpers/createDocument.ts @@ -1,7 +1,7 @@ import { Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model' -import { Content } from '../types' -import { createNodeFromContent } from './createNodeFromContent' +import { Content } from '../types.js' +import { createNodeFromContent } from './createNodeFromContent.js' export function createDocument( content: Content, diff --git a/packages/core/src/helpers/createNodeFromContent.ts b/packages/core/src/helpers/createNodeFromContent.ts index 8ab2e043785..b6a7e748959 100644 --- a/packages/core/src/helpers/createNodeFromContent.ts +++ b/packages/core/src/helpers/createNodeFromContent.ts @@ -6,8 +6,8 @@ import { Schema, } from '@tiptap/pm/model' -import { Content } from '../types' -import { elementFromString } from '../utilities/elementFromString' +import { Content } from '../types.js' +import { elementFromString } from '../utilities/elementFromString.js' export type CreateNodeFromContentOptions = { slice?: boolean diff --git a/packages/core/src/helpers/findChildren.ts b/packages/core/src/helpers/findChildren.ts index 9c2c159c092..65fb0e4f91c 100644 --- a/packages/core/src/helpers/findChildren.ts +++ b/packages/core/src/helpers/findChildren.ts @@ -1,6 +1,6 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -import { NodeWithPos, Predicate } from '../types' +import { NodeWithPos, Predicate } from '../types.js' export function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[] { const nodesWithPos: NodeWithPos[] = [] diff --git a/packages/core/src/helpers/findChildrenInRange.ts b/packages/core/src/helpers/findChildrenInRange.ts index 839804f50b1..6a5bfa0320f 100644 --- a/packages/core/src/helpers/findChildrenInRange.ts +++ b/packages/core/src/helpers/findChildrenInRange.ts @@ -1,6 +1,6 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -import { NodeWithPos, Predicate, Range } from '../types' +import { NodeWithPos, Predicate, Range } from '../types.js' /** * Same as `findChildren` but searches only within a `range`. diff --git a/packages/core/src/helpers/findParentNode.ts b/packages/core/src/helpers/findParentNode.ts index e5fe70c9424..4acfc74e84a 100644 --- a/packages/core/src/helpers/findParentNode.ts +++ b/packages/core/src/helpers/findParentNode.ts @@ -1,7 +1,7 @@ import { Selection } from '@tiptap/pm/state' -import { Predicate } from '../types' -import { findParentNodeClosestToPos } from './findParentNodeClosestToPos' +import { Predicate } from '../types.js' +import { findParentNodeClosestToPos } from './findParentNodeClosestToPos.js' export function findParentNode(predicate: Predicate) { return (selection: Selection) => findParentNodeClosestToPos(selection.$from, predicate) diff --git a/packages/core/src/helpers/findParentNodeClosestToPos.ts b/packages/core/src/helpers/findParentNodeClosestToPos.ts index 676bc44b346..697a99a21eb 100644 --- a/packages/core/src/helpers/findParentNodeClosestToPos.ts +++ b/packages/core/src/helpers/findParentNodeClosestToPos.ts @@ -1,6 +1,6 @@ import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model' -import { Predicate } from '../types' +import { Predicate } from '../types.js' export function findParentNodeClosestToPos( $pos: ResolvedPos, diff --git a/packages/core/src/helpers/generateHTML.ts b/packages/core/src/helpers/generateHTML.ts index f3c9e8f08d1..db3cc2e0f2e 100644 --- a/packages/core/src/helpers/generateHTML.ts +++ b/packages/core/src/helpers/generateHTML.ts @@ -1,8 +1,8 @@ import { Node } from '@tiptap/pm/model' -import { Extensions, JSONContent } from '../types' -import { getHTMLFromFragment } from './getHTMLFromFragment' -import { getSchema } from './getSchema' +import { Extensions, JSONContent } from '../types.js' +import { getHTMLFromFragment } from './getHTMLFromFragment.js' +import { getSchema } from './getSchema.js' export function generateHTML(doc: JSONContent, extensions: Extensions): string { const schema = getSchema(extensions) diff --git a/packages/core/src/helpers/generateJSON.ts b/packages/core/src/helpers/generateJSON.ts index 141f7bbf497..e2accaf0872 100644 --- a/packages/core/src/helpers/generateJSON.ts +++ b/packages/core/src/helpers/generateJSON.ts @@ -1,8 +1,8 @@ import { DOMParser } from '@tiptap/pm/model' -import { Extensions } from '../types' -import { elementFromString } from '../utilities/elementFromString' -import { getSchema } from './getSchema' +import { Extensions } from '../types.js' +import { elementFromString } from '../utilities/elementFromString.js' +import { getSchema } from './getSchema.js' export function generateJSON(html: string, extensions: Extensions): Record { const schema = getSchema(extensions) diff --git a/packages/core/src/helpers/generateText.ts b/packages/core/src/helpers/generateText.ts index b9f592f3363..324be856bd8 100644 --- a/packages/core/src/helpers/generateText.ts +++ b/packages/core/src/helpers/generateText.ts @@ -1,9 +1,9 @@ import { Node } from '@tiptap/pm/model' -import { Extensions, JSONContent, TextSerializer } from '../types' -import { getSchema } from './getSchema' -import { getText } from './getText' -import { getTextSerializersFromSchema } from './getTextSerializersFromSchema' +import { Extensions, JSONContent, TextSerializer } from '../types.js' +import { getSchema } from './getSchema.js' +import { getText } from './getText.js' +import { getTextSerializersFromSchema } from './getTextSerializersFromSchema.js' export function generateText( doc: JSONContent, diff --git a/packages/core/src/helpers/getAttributes.ts b/packages/core/src/helpers/getAttributes.ts index 8f283fd4562..657a4dc49f0 100644 --- a/packages/core/src/helpers/getAttributes.ts +++ b/packages/core/src/helpers/getAttributes.ts @@ -1,9 +1,9 @@ import { MarkType, NodeType } from '@tiptap/pm/model' import { EditorState } from '@tiptap/pm/state' -import { getMarkAttributes } from './getMarkAttributes' -import { getNodeAttributes } from './getNodeAttributes' -import { getSchemaTypeNameByName } from './getSchemaTypeNameByName' +import { getMarkAttributes } from './getMarkAttributes.js' +import { getNodeAttributes } from './getNodeAttributes.js' +import { getSchemaTypeNameByName } from './getSchemaTypeNameByName.js' export function getAttributes( state: EditorState, diff --git a/packages/core/src/helpers/getAttributesFromExtensions.ts b/packages/core/src/helpers/getAttributesFromExtensions.ts index 70d1c8915df..2ae8e0f06c8 100644 --- a/packages/core/src/helpers/getAttributesFromExtensions.ts +++ b/packages/core/src/helpers/getAttributesFromExtensions.ts @@ -1,4 +1,4 @@ -import { MarkConfig, NodeConfig } from '..' +import { MarkConfig, NodeConfig } from '../index.js' import { AnyConfig, Attribute, @@ -6,9 +6,9 @@ import { ExtensionAttribute, Extensions, GlobalAttributes, -} from '../types' -import { getExtensionField } from './getExtensionField' -import { splitExtensions } from './splitExtensions' +} from '../types.js' +import { getExtensionField } from './getExtensionField.js' +import { splitExtensions } from './splitExtensions.js' /** * Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`. diff --git a/packages/core/src/helpers/getChangedRanges.ts b/packages/core/src/helpers/getChangedRanges.ts index d866e1d145c..95de0b74ead 100644 --- a/packages/core/src/helpers/getChangedRanges.ts +++ b/packages/core/src/helpers/getChangedRanges.ts @@ -1,7 +1,7 @@ import { Step, Transform } from '@tiptap/pm/transform' -import { Range } from '../types' -import { removeDuplicates } from '../utilities/removeDuplicates' +import { Range } from '../types.js' +import { removeDuplicates } from '../utilities/removeDuplicates.js' export type ChangedRange = { oldRange: Range, diff --git a/packages/core/src/helpers/getDebugJSON.ts b/packages/core/src/helpers/getDebugJSON.ts index 0c19aa2903c..530f3d456da 100644 --- a/packages/core/src/helpers/getDebugJSON.ts +++ b/packages/core/src/helpers/getDebugJSON.ts @@ -1,6 +1,6 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -import { JSONContent } from '../types' +import { JSONContent } from '../types.js' interface DebugJSONContent extends JSONContent { from: number diff --git a/packages/core/src/helpers/getExtensionField.ts b/packages/core/src/helpers/getExtensionField.ts index 545ddf291a6..ff5a1c24d13 100644 --- a/packages/core/src/helpers/getExtensionField.ts +++ b/packages/core/src/helpers/getExtensionField.ts @@ -1,4 +1,4 @@ -import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types' +import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types.js' export function getExtensionField( extension: AnyExtension, diff --git a/packages/core/src/helpers/getMarkAttributes.ts b/packages/core/src/helpers/getMarkAttributes.ts index 0b139609e59..f3a2a1cd843 100644 --- a/packages/core/src/helpers/getMarkAttributes.ts +++ b/packages/core/src/helpers/getMarkAttributes.ts @@ -1,7 +1,7 @@ import { Mark, MarkType } from '@tiptap/pm/model' import { EditorState } from '@tiptap/pm/state' -import { getMarkType } from './getMarkType' +import { getMarkType } from './getMarkType.js' export function getMarkAttributes( state: EditorState, diff --git a/packages/core/src/helpers/getMarkRange.ts b/packages/core/src/helpers/getMarkRange.ts index 4353347d96c..bded1ec6979 100644 --- a/packages/core/src/helpers/getMarkRange.ts +++ b/packages/core/src/helpers/getMarkRange.ts @@ -1,7 +1,7 @@ import { Mark as ProseMirrorMark, MarkType, ResolvedPos } from '@tiptap/pm/model' -import { Range } from '../types' -import { objectIncludes } from '../utilities/objectIncludes' +import { Range } from '../types.js' +import { objectIncludes } from '../utilities/objectIncludes.js' function findMarkInSet( marks: ProseMirrorMark[], diff --git a/packages/core/src/helpers/getMarksBetween.ts b/packages/core/src/helpers/getMarksBetween.ts index 6275aa18912..f9c8d2a769d 100644 --- a/packages/core/src/helpers/getMarksBetween.ts +++ b/packages/core/src/helpers/getMarksBetween.ts @@ -1,7 +1,7 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -import { MarkRange } from '../types' -import { getMarkRange } from './getMarkRange' +import { MarkRange } from '../types.js' +import { getMarkRange } from './getMarkRange.js' export function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[] { const marks: MarkRange[] = [] diff --git a/packages/core/src/helpers/getNodeAttributes.ts b/packages/core/src/helpers/getNodeAttributes.ts index 3cd23c0ebcc..10797770b44 100644 --- a/packages/core/src/helpers/getNodeAttributes.ts +++ b/packages/core/src/helpers/getNodeAttributes.ts @@ -1,7 +1,7 @@ import { Node, NodeType } from '@tiptap/pm/model' import { EditorState } from '@tiptap/pm/state' -import { getNodeType } from './getNodeType' +import { getNodeType } from './getNodeType.js' export function getNodeAttributes( state: EditorState, diff --git a/packages/core/src/helpers/getRenderedAttributes.ts b/packages/core/src/helpers/getRenderedAttributes.ts index b0290ebfb03..5dd0855a262 100644 --- a/packages/core/src/helpers/getRenderedAttributes.ts +++ b/packages/core/src/helpers/getRenderedAttributes.ts @@ -1,7 +1,7 @@ import { Mark, Node } from '@tiptap/pm/model' -import { ExtensionAttribute } from '../types' -import { mergeAttributes } from '../utilities/mergeAttributes' +import { ExtensionAttribute } from '../types.js' +import { mergeAttributes } from '../utilities/mergeAttributes.js' export function getRenderedAttributes( nodeOrMark: Node | Mark, diff --git a/packages/core/src/helpers/getSchema.ts b/packages/core/src/helpers/getSchema.ts index 45f6cf5b707..f9644f9f6e5 100644 --- a/packages/core/src/helpers/getSchema.ts +++ b/packages/core/src/helpers/getSchema.ts @@ -1,9 +1,9 @@ import { Schema } from '@tiptap/pm/model' -import { Editor } from '../Editor' -import { ExtensionManager } from '../ExtensionManager' -import { Extensions } from '../types' -import { getSchemaByResolvedExtensions } from './getSchemaByResolvedExtensions' +import { Editor } from '../Editor.js' +import { ExtensionManager } from '../ExtensionManager.js' +import { Extensions } from '../types.js' +import { getSchemaByResolvedExtensions } from './getSchemaByResolvedExtensions.js' export function getSchema(extensions: Extensions, editor?: Editor): Schema { const resolvedExtensions = ExtensionManager.resolve(extensions) diff --git a/packages/core/src/helpers/getSchemaByResolvedExtensions.ts b/packages/core/src/helpers/getSchemaByResolvedExtensions.ts index 1b8be561bd9..3fca356b82e 100644 --- a/packages/core/src/helpers/getSchemaByResolvedExtensions.ts +++ b/packages/core/src/helpers/getSchemaByResolvedExtensions.ts @@ -1,14 +1,14 @@ import { MarkSpec, NodeSpec, Schema } from '@tiptap/pm/model' -import { Editor, MarkConfig, NodeConfig } from '..' -import { AnyConfig, Extensions } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' -import { isEmptyObject } from '../utilities/isEmptyObject' -import { getAttributesFromExtensions } from './getAttributesFromExtensions' -import { getExtensionField } from './getExtensionField' -import { getRenderedAttributes } from './getRenderedAttributes' -import { injectExtensionAttributesToParseRule } from './injectExtensionAttributesToParseRule' -import { splitExtensions } from './splitExtensions' +import { Editor, MarkConfig, NodeConfig } from '../index.js' +import { AnyConfig, Extensions } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' +import { isEmptyObject } from '../utilities/isEmptyObject.js' +import { getAttributesFromExtensions } from './getAttributesFromExtensions.js' +import { getExtensionField } from './getExtensionField.js' +import { getRenderedAttributes } from './getRenderedAttributes.js' +import { injectExtensionAttributesToParseRule } from './injectExtensionAttributesToParseRule.js' +import { splitExtensions } from './splitExtensions.js' function cleanUpSchemaItem(data: T) { return Object.fromEntries( diff --git a/packages/core/src/helpers/getSplittedAttributes.ts b/packages/core/src/helpers/getSplittedAttributes.ts index 2a0977b4913..7fa385ef88b 100644 --- a/packages/core/src/helpers/getSplittedAttributes.ts +++ b/packages/core/src/helpers/getSplittedAttributes.ts @@ -1,4 +1,4 @@ -import { ExtensionAttribute } from '../types' +import { ExtensionAttribute } from '../types.js' export function getSplittedAttributes( extensionAttributes: ExtensionAttribute[], diff --git a/packages/core/src/helpers/getText.ts b/packages/core/src/helpers/getText.ts index e8621a01717..7a2f28fa772 100644 --- a/packages/core/src/helpers/getText.ts +++ b/packages/core/src/helpers/getText.ts @@ -1,7 +1,7 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -import { TextSerializer } from '../types' -import { getTextBetween } from './getTextBetween' +import { TextSerializer } from '../types.js' +import { getTextBetween } from './getTextBetween.js' export function getText( node: ProseMirrorNode, diff --git a/packages/core/src/helpers/getTextBetween.ts b/packages/core/src/helpers/getTextBetween.ts index 34e59667e93..f15f10517f7 100644 --- a/packages/core/src/helpers/getTextBetween.ts +++ b/packages/core/src/helpers/getTextBetween.ts @@ -1,6 +1,6 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -import { Range, TextSerializer } from '../types' +import { Range, TextSerializer } from '../types.js' export function getTextBetween( startNode: ProseMirrorNode, diff --git a/packages/core/src/helpers/getTextSerializersFromSchema.ts b/packages/core/src/helpers/getTextSerializersFromSchema.ts index f2eb80a1072..920d5d82cd1 100644 --- a/packages/core/src/helpers/getTextSerializersFromSchema.ts +++ b/packages/core/src/helpers/getTextSerializersFromSchema.ts @@ -1,6 +1,6 @@ import { Schema } from '@tiptap/pm/model' -import { TextSerializer } from '../types' +import { TextSerializer } from '../types.js' export function getTextSerializersFromSchema(schema: Schema): Record { return Object.fromEntries( diff --git a/packages/core/src/helpers/index.ts b/packages/core/src/helpers/index.ts index a6dbaeb8d8e..3328dc72d03 100644 --- a/packages/core/src/helpers/index.ts +++ b/packages/core/src/helpers/index.ts @@ -1,47 +1,47 @@ -export * from './combineTransactionSteps' -export * from './createChainableState' -export * from './createDocument' -export * from './createNodeFromContent' -export * from './defaultBlockAt' -export * from './findChildren' -export * from './findChildrenInRange' -export * from './findParentNode' -export * from './findParentNodeClosestToPos' -export * from './generateHTML' -export * from './generateJSON' -export * from './generateText' -export * from './getAttributes' -export * from './getAttributesFromExtensions' -export * from './getChangedRanges' -export * from './getDebugJSON' -export * from './getExtensionField' -export * from './getHTMLFromFragment' -export * from './getMarkAttributes' -export * from './getMarkRange' -export * from './getMarksBetween' -export * from './getMarkType' -export * from './getNodeAttributes' -export * from './getNodeType' -export * from './getRenderedAttributes' -export * from './getSchema' -export * from './getSchemaByResolvedExtensions' -export * from './getSchemaTypeByName' -export * from './getSchemaTypeNameByName' -export * from './getSplittedAttributes' -export * from './getText' -export * from './getTextBetween' -export * from './getTextContentFromNodes' -export * from './getTextSerializersFromSchema' -export * from './injectExtensionAttributesToParseRule' -export * from './isActive' -export * from './isExtensionRulesEnabled' -export * from './isList' -export * from './isMarkActive' -export * from './isNodeActive' -export * from './isNodeEmpty' -export * from './isNodeSelection' -export * from './isTextSelection' -export * from './posToDOMRect' -export * from './resolveFocusPosition' -export * from './selectionToInsertionEnd' -export * from './splitExtensions' +export * from './combineTransactionSteps.js' +export * from './createChainableState.js' +export * from './createDocument.js' +export * from './createNodeFromContent.js' +export * from './defaultBlockAt.js' +export * from './findChildren.js' +export * from './findChildrenInRange.js' +export * from './findParentNode.js' +export * from './findParentNodeClosestToPos.js' +export * from './generateHTML.js' +export * from './generateJSON.js' +export * from './generateText.js' +export * from './getAttributes.js' +export * from './getAttributesFromExtensions.js' +export * from './getChangedRanges.js' +export * from './getDebugJSON.js' +export * from './getExtensionField.js' +export * from './getHTMLFromFragment.js' +export * from './getMarkAttributes.js' +export * from './getMarkRange.js' +export * from './getMarksBetween.js' +export * from './getMarkType.js' +export * from './getNodeAttributes.js' +export * from './getNodeType.js' +export * from './getRenderedAttributes.js' +export * from './getSchema.js' +export * from './getSchemaByResolvedExtensions.js' +export * from './getSchemaTypeByName.js' +export * from './getSchemaTypeNameByName.js' +export * from './getSplittedAttributes.js' +export * from './getText.js' +export * from './getTextBetween.js' +export * from './getTextContentFromNodes.js' +export * from './getTextSerializersFromSchema.js' +export * from './injectExtensionAttributesToParseRule.js' +export * from './isActive.js' +export * from './isExtensionRulesEnabled.js' +export * from './isList.js' +export * from './isMarkActive.js' +export * from './isNodeActive.js' +export * from './isNodeEmpty.js' +export * from './isNodeSelection.js' +export * from './isTextSelection.js' +export * from './posToDOMRect.js' +export * from './resolveFocusPosition.js' +export * from './selectionToInsertionEnd.js' +export * from './splitExtensions.js' diff --git a/packages/core/src/helpers/injectExtensionAttributesToParseRule.ts b/packages/core/src/helpers/injectExtensionAttributesToParseRule.ts index 516ef2ba480..d248bdb3811 100644 --- a/packages/core/src/helpers/injectExtensionAttributesToParseRule.ts +++ b/packages/core/src/helpers/injectExtensionAttributesToParseRule.ts @@ -1,7 +1,7 @@ import { ParseRule } from '@tiptap/pm/model' -import { ExtensionAttribute } from '../types' -import { fromString } from '../utilities/fromString' +import { ExtensionAttribute } from '../types.js' +import { fromString } from '../utilities/fromString.js' /** * This function merges extension attributes into parserule attributes (`attrs` or `getAttrs`). diff --git a/packages/core/src/helpers/isActive.ts b/packages/core/src/helpers/isActive.ts index d2634aedd09..cbcb19f067c 100644 --- a/packages/core/src/helpers/isActive.ts +++ b/packages/core/src/helpers/isActive.ts @@ -1,8 +1,8 @@ import { EditorState } from '@tiptap/pm/state' -import { getSchemaTypeNameByName } from './getSchemaTypeNameByName' -import { isMarkActive } from './isMarkActive' -import { isNodeActive } from './isNodeActive' +import { getSchemaTypeNameByName } from './getSchemaTypeNameByName.js' +import { isMarkActive } from './isMarkActive.js' +import { isNodeActive } from './isNodeActive.js' export function isActive( state: EditorState, diff --git a/packages/core/src/helpers/isExtensionRulesEnabled.ts b/packages/core/src/helpers/isExtensionRulesEnabled.ts index 56d54c7fe02..45ca6786edc 100644 --- a/packages/core/src/helpers/isExtensionRulesEnabled.ts +++ b/packages/core/src/helpers/isExtensionRulesEnabled.ts @@ -1,4 +1,4 @@ -import { AnyExtension, EnableRules } from '../types' +import { AnyExtension, EnableRules } from '../types.js' export function isExtensionRulesEnabled(extension: AnyExtension, enabled: EnableRules): boolean { if (Array.isArray(enabled)) { diff --git a/packages/core/src/helpers/isList.ts b/packages/core/src/helpers/isList.ts index 87237845f92..5fcf712a085 100644 --- a/packages/core/src/helpers/isList.ts +++ b/packages/core/src/helpers/isList.ts @@ -1,8 +1,8 @@ -import { NodeConfig } from '..' -import { getExtensionField } from '../helpers/getExtensionField' -import { Extensions } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' -import { splitExtensions } from './splitExtensions' +import { getExtensionField } from '../helpers/getExtensionField.js' +import { NodeConfig } from '../index.js' +import { Extensions } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' +import { splitExtensions } from './splitExtensions.js' export function isList(name: string, extensions: Extensions): boolean { const { nodeExtensions } = splitExtensions(extensions) diff --git a/packages/core/src/helpers/isMarkActive.ts b/packages/core/src/helpers/isMarkActive.ts index c0869b6159f..7caefa28f93 100644 --- a/packages/core/src/helpers/isMarkActive.ts +++ b/packages/core/src/helpers/isMarkActive.ts @@ -1,9 +1,9 @@ import { MarkType } from '@tiptap/pm/model' import { EditorState } from '@tiptap/pm/state' -import { MarkRange } from '../types' -import { objectIncludes } from '../utilities/objectIncludes' -import { getMarkType } from './getMarkType' +import { MarkRange } from '../types.js' +import { objectIncludes } from '../utilities/objectIncludes.js' +import { getMarkType } from './getMarkType.js' export function isMarkActive( state: EditorState, diff --git a/packages/core/src/helpers/isNodeActive.ts b/packages/core/src/helpers/isNodeActive.ts index 5de5eebe8f8..6562c8c54d0 100644 --- a/packages/core/src/helpers/isNodeActive.ts +++ b/packages/core/src/helpers/isNodeActive.ts @@ -1,9 +1,9 @@ import { NodeType } from '@tiptap/pm/model' import { EditorState } from '@tiptap/pm/state' -import { NodeRange } from '../types' -import { objectIncludes } from '../utilities/objectIncludes' -import { getNodeType } from './getNodeType' +import { NodeRange } from '../types.js' +import { objectIncludes } from '../utilities/objectIncludes.js' +import { getNodeType } from './getNodeType.js' export function isNodeActive( state: EditorState, diff --git a/packages/core/src/helpers/posToDOMRect.ts b/packages/core/src/helpers/posToDOMRect.ts index 7a47153487c..adf0bc2e9f5 100644 --- a/packages/core/src/helpers/posToDOMRect.ts +++ b/packages/core/src/helpers/posToDOMRect.ts @@ -1,6 +1,6 @@ import { EditorView } from '@tiptap/pm/view' -import { minMax } from '../utilities/minMax' +import { minMax } from '../utilities/minMax.js' export function posToDOMRect(view: EditorView, from: number, to: number): DOMRect { const minPos = 0 diff --git a/packages/core/src/helpers/resolveFocusPosition.ts b/packages/core/src/helpers/resolveFocusPosition.ts index 20bea7bc0f7..ba272fe2007 100644 --- a/packages/core/src/helpers/resolveFocusPosition.ts +++ b/packages/core/src/helpers/resolveFocusPosition.ts @@ -1,8 +1,8 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' import { Selection, TextSelection } from '@tiptap/pm/state' -import { FocusPosition } from '../types' -import { minMax } from '../utilities/minMax' +import { FocusPosition } from '../types.js' +import { minMax } from '../utilities/minMax.js' export function resolveFocusPosition( doc: ProseMirrorNode, diff --git a/packages/core/src/helpers/splitExtensions.ts b/packages/core/src/helpers/splitExtensions.ts index 2914a3600fd..fbd9b13671f 100644 --- a/packages/core/src/helpers/splitExtensions.ts +++ b/packages/core/src/helpers/splitExtensions.ts @@ -1,7 +1,7 @@ -import { Extension } from '../Extension' -import { Mark } from '../Mark' -import { Node } from '../Node' -import { Extensions } from '../types' +import { Extension } from '../Extension.js' +import { Mark } from '../Mark.js' +import { Node } from '../Node.js' +import { Extensions } from '../types.js' export function splitExtensions(extensions: Extensions) { const baseExtensions = extensions.filter(extension => extension.type === 'extension') as Extension[] diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 854fdf490cc..c9223ef93f6 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,18 +1,18 @@ -export * from './CommandManager' -export * from './Editor' -export * from './Extension' -export * as extensions from './extensions' -export * from './helpers' -export * from './InputRule' -export * from './inputRules' -export * from './Mark' -export * from './Node' -export * from './NodeView' -export * from './PasteRule' -export * from './pasteRules' -export * from './Tracker' -export * from './types' -export * from './utilities' +export * from './CommandManager.js' +export * from './Editor.js' +export * from './Extension.js' +export * as extensions from './extensions/index.js' +export * from './helpers/index.js' +export * from './InputRule.js' +export * from './inputRules/index.js' +export * from './Mark.js' +export * from './Node.js' +export * from './NodeView.js' +export * from './PasteRule.js' +export * from './pasteRules/index.js' +export * from './Tracker.js' +export * from './types.js' +export * from './utilities/index.js' // eslint-disable-next-line export interface Commands {} diff --git a/packages/core/src/inputRules/index.ts b/packages/core/src/inputRules/index.ts index f3b6324333f..936d514a517 100644 --- a/packages/core/src/inputRules/index.ts +++ b/packages/core/src/inputRules/index.ts @@ -1,5 +1,5 @@ -export * from './markInputRule' -export * from './nodeInputRule' -export * from './textblockTypeInputRule' -export * from './textInputRule' -export * from './wrappingInputRule' +export * from './markInputRule.js' +export * from './nodeInputRule.js' +export * from './textblockTypeInputRule.js' +export * from './textInputRule.js' +export * from './wrappingInputRule.js' diff --git a/packages/core/src/inputRules/markInputRule.ts b/packages/core/src/inputRules/markInputRule.ts index 896008756ad..db0b82d11f1 100644 --- a/packages/core/src/inputRules/markInputRule.ts +++ b/packages/core/src/inputRules/markInputRule.ts @@ -1,9 +1,9 @@ import { MarkType } from '@tiptap/pm/model' -import { getMarksBetween } from '../helpers/getMarksBetween' -import { InputRule, InputRuleFinder } from '../InputRule' -import { ExtendedRegExpMatchArray } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' +import { getMarksBetween } from '../helpers/getMarksBetween.js' +import { InputRule, InputRuleFinder } from '../InputRule.js' +import { ExtendedRegExpMatchArray } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' /** * Build an input rule that adds a mark when the diff --git a/packages/core/src/inputRules/nodeInputRule.ts b/packages/core/src/inputRules/nodeInputRule.ts index 7cb6e6c9134..c617e40f421 100644 --- a/packages/core/src/inputRules/nodeInputRule.ts +++ b/packages/core/src/inputRules/nodeInputRule.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' -import { InputRule, InputRuleFinder } from '../InputRule' -import { ExtendedRegExpMatchArray } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' +import { InputRule, InputRuleFinder } from '../InputRule.js' +import { ExtendedRegExpMatchArray } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' /** * Build an input rule that adds a node when the diff --git a/packages/core/src/inputRules/textInputRule.ts b/packages/core/src/inputRules/textInputRule.ts index 75414b03916..b9c1318b378 100644 --- a/packages/core/src/inputRules/textInputRule.ts +++ b/packages/core/src/inputRules/textInputRule.ts @@ -1,4 +1,4 @@ -import { InputRule, InputRuleFinder } from '../InputRule' +import { InputRule, InputRuleFinder } from '../InputRule.js' /** * Build an input rule that replaces text when the diff --git a/packages/core/src/inputRules/textblockTypeInputRule.ts b/packages/core/src/inputRules/textblockTypeInputRule.ts index 86be95ec733..1abeb5a36df 100644 --- a/packages/core/src/inputRules/textblockTypeInputRule.ts +++ b/packages/core/src/inputRules/textblockTypeInputRule.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' -import { InputRule, InputRuleFinder } from '../InputRule' -import { ExtendedRegExpMatchArray } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' +import { InputRule, InputRuleFinder } from '../InputRule.js' +import { ExtendedRegExpMatchArray } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' /** * Build an input rule that changes the type of a textblock when the diff --git a/packages/core/src/inputRules/wrappingInputRule.ts b/packages/core/src/inputRules/wrappingInputRule.ts index c41504236c2..8e39f74f4d5 100644 --- a/packages/core/src/inputRules/wrappingInputRule.ts +++ b/packages/core/src/inputRules/wrappingInputRule.ts @@ -1,10 +1,10 @@ import { Node as ProseMirrorNode, NodeType } from '@tiptap/pm/model' import { canJoin, findWrapping } from '@tiptap/pm/transform' -import { Editor } from '../Editor' -import { InputRule, InputRuleFinder } from '../InputRule' -import { ExtendedRegExpMatchArray } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' +import { Editor } from '../Editor.js' +import { InputRule, InputRuleFinder } from '../InputRule.js' +import { ExtendedRegExpMatchArray } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' /** * Build an input rule for automatically wrapping a textblock when a diff --git a/packages/core/src/pasteRules/index.ts b/packages/core/src/pasteRules/index.ts index 0c7761eec18..24837696293 100644 --- a/packages/core/src/pasteRules/index.ts +++ b/packages/core/src/pasteRules/index.ts @@ -1,3 +1,3 @@ -export * from './markPasteRule' -export * from './nodePasteRule' -export * from './textPasteRule' +export * from './markPasteRule.js' +export * from './nodePasteRule.js' +export * from './textPasteRule.js' diff --git a/packages/core/src/pasteRules/markPasteRule.ts b/packages/core/src/pasteRules/markPasteRule.ts index 2b2789854fd..906bd7d9a60 100644 --- a/packages/core/src/pasteRules/markPasteRule.ts +++ b/packages/core/src/pasteRules/markPasteRule.ts @@ -1,9 +1,9 @@ import { MarkType } from '@tiptap/pm/model' -import { getMarksBetween } from '../helpers/getMarksBetween' -import { PasteRule, PasteRuleFinder } from '../PasteRule' -import { ExtendedRegExpMatchArray } from '../types' -import { callOrReturn } from '../utilities/callOrReturn' +import { getMarksBetween } from '../helpers/getMarksBetween.js' +import { PasteRule, PasteRuleFinder } from '../PasteRule.js' +import { ExtendedRegExpMatchArray } from '../types.js' +import { callOrReturn } from '../utilities/callOrReturn.js' /** * Build an paste rule that adds a mark when the diff --git a/packages/core/src/pasteRules/nodePasteRule.ts b/packages/core/src/pasteRules/nodePasteRule.ts index a36a02cd058..b7a0965edf0 100644 --- a/packages/core/src/pasteRules/nodePasteRule.ts +++ b/packages/core/src/pasteRules/nodePasteRule.ts @@ -1,8 +1,8 @@ import { NodeType } from '@tiptap/pm/model' -import { PasteRule, PasteRuleFinder } from '../PasteRule' -import { ExtendedRegExpMatchArray } from '../types' -import { callOrReturn } from '../utilities' +import { PasteRule, PasteRuleFinder } from '../PasteRule.js' +import { ExtendedRegExpMatchArray } from '../types.js' +import { callOrReturn } from '../utilities/index.js' /** * Build an paste rule that adds a node when the diff --git a/packages/core/src/pasteRules/textPasteRule.ts b/packages/core/src/pasteRules/textPasteRule.ts index 6e0d94c34b6..ca8a645ec07 100644 --- a/packages/core/src/pasteRules/textPasteRule.ts +++ b/packages/core/src/pasteRules/textPasteRule.ts @@ -1,4 +1,4 @@ -import { PasteRule, PasteRuleFinder } from '../PasteRule' +import { PasteRule, PasteRuleFinder } from '../PasteRule.js' /** * Build an paste rule that replaces text when the diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 8e1780e6ebe..0db899713c0 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -6,13 +6,13 @@ import { Decoration, EditorProps, EditorView, NodeView, } from '@tiptap/pm/view' +import { Editor } from './Editor.js' +import { Extension } from './Extension.js' import { Commands, ExtensionConfig, MarkConfig, NodeConfig, -} from '.' -import { Editor } from './Editor' -import { Extension } from './Extension' -import { Mark } from './Mark' -import { Node } from './Node' +} from './index.js' +import { Mark } from './Mark.js' +import { Node } from './Node.js' export type AnyConfig = ExtensionConfig | NodeConfig | MarkConfig export type AnyExtension = Extension | Node | Mark diff --git a/packages/core/src/utilities/callOrReturn.ts b/packages/core/src/utilities/callOrReturn.ts index fe312c0580d..53688324ae7 100644 --- a/packages/core/src/utilities/callOrReturn.ts +++ b/packages/core/src/utilities/callOrReturn.ts @@ -1,5 +1,5 @@ -import { MaybeReturnType } from '../types' -import { isFunction } from './isFunction' +import { MaybeReturnType } from '../types.js' +import { isFunction } from './isFunction.js' /** * Optionally calls `value` as a function. diff --git a/packages/core/src/utilities/index.ts b/packages/core/src/utilities/index.ts index bd4446f435d..36e90537202 100644 --- a/packages/core/src/utilities/index.ts +++ b/packages/core/src/utilities/index.ts @@ -1,20 +1,20 @@ -export * from './callOrReturn' -export * from './createStyleTag' -export * from './deleteProps' -export * from './elementFromString' -export * from './escapeForRegEx' -export * from './findDuplicates' -export * from './fromString' -export * from './isEmptyObject' -export * from './isFunction' -export * from './isiOS' -export * from './isMacOS' -export * from './isNumber' -export * from './isPlainObject' -export * from './isRegExp' -export * from './isString' -export * from './mergeAttributes' -export * from './mergeDeep' -export * from './minMax' -export * from './objectIncludes' -export * from './removeDuplicates' +export * from './callOrReturn.js' +export * from './createStyleTag.js' +export * from './deleteProps.js' +export * from './elementFromString.js' +export * from './escapeForRegEx.js' +export * from './findDuplicates.js' +export * from './fromString.js' +export * from './isEmptyObject.js' +export * from './isFunction.js' +export * from './isiOS.js' +export * from './isMacOS.js' +export * from './isNumber.js' +export * from './isPlainObject.js' +export * from './isRegExp.js' +export * from './isString.js' +export * from './mergeAttributes.js' +export * from './mergeDeep.js' +export * from './minMax.js' +export * from './objectIncludes.js' +export * from './removeDuplicates.js' diff --git a/packages/core/src/utilities/mergeDeep.ts b/packages/core/src/utilities/mergeDeep.ts index 4b54c3260d9..5c49cfa5d41 100644 --- a/packages/core/src/utilities/mergeDeep.ts +++ b/packages/core/src/utilities/mergeDeep.ts @@ -1,4 +1,4 @@ -import { isPlainObject } from './isPlainObject' +import { isPlainObject } from './isPlainObject.js' export function mergeDeep(target: Record, source: Record): Record { const output = { ...target } diff --git a/packages/core/src/utilities/objectIncludes.ts b/packages/core/src/utilities/objectIncludes.ts index 7dadc5033d2..5d4d3154838 100644 --- a/packages/core/src/utilities/objectIncludes.ts +++ b/packages/core/src/utilities/objectIncludes.ts @@ -1,4 +1,4 @@ -import { isRegExp } from './isRegExp' +import { isRegExp } from './isRegExp.js' /** * Check if object1 includes object2 diff --git a/packages/extension-blockquote/src/index.ts b/packages/extension-blockquote/src/index.ts index eb45e635436..b805f47ae8e 100644 --- a/packages/extension-blockquote/src/index.ts +++ b/packages/extension-blockquote/src/index.ts @@ -1,5 +1,5 @@ -import { Blockquote } from './blockquote' +import { Blockquote } from './blockquote.js' -export * from './blockquote' +export * from './blockquote.js' export default Blockquote diff --git a/packages/extension-bold/src/index.ts b/packages/extension-bold/src/index.ts index 079cb5dc41d..16582a53023 100644 --- a/packages/extension-bold/src/index.ts +++ b/packages/extension-bold/src/index.ts @@ -1,5 +1,5 @@ -import { Bold } from './bold' +import { Bold } from './bold.js' -export * from './bold' +export * from './bold.js' export default Bold diff --git a/packages/extension-bubble-menu/src/bubble-menu.ts b/packages/extension-bubble-menu/src/bubble-menu.ts index c8bb457c644..ba45d87d54b 100644 --- a/packages/extension-bubble-menu/src/bubble-menu.ts +++ b/packages/extension-bubble-menu/src/bubble-menu.ts @@ -1,6 +1,6 @@ import { Extension } from '@tiptap/core' -import { BubbleMenuPlugin, BubbleMenuPluginProps } from './bubble-menu-plugin' +import { BubbleMenuPlugin, BubbleMenuPluginProps } from './bubble-menu-plugin.js' export type BubbleMenuOptions = Omit & { element: HTMLElement | null, diff --git a/packages/extension-bubble-menu/src/index.ts b/packages/extension-bubble-menu/src/index.ts index df47407f603..ab3636dc87e 100644 --- a/packages/extension-bubble-menu/src/index.ts +++ b/packages/extension-bubble-menu/src/index.ts @@ -1,6 +1,6 @@ -import { BubbleMenu } from './bubble-menu' +import { BubbleMenu } from './bubble-menu.js' -export * from './bubble-menu' -export * from './bubble-menu-plugin' +export * from './bubble-menu.js' +export * from './bubble-menu-plugin.js' export default BubbleMenu diff --git a/packages/extension-bullet-list/src/bullet-list.ts b/packages/extension-bullet-list/src/bullet-list.ts index 77c0fa6a371..1bc8b99269c 100644 --- a/packages/extension-bullet-list/src/bullet-list.ts +++ b/packages/extension-bullet-list/src/bullet-list.ts @@ -1,7 +1,7 @@ import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core' -import ListItem from '../../extension-list-item/src' -import TextStyle from '../../extension-text-style/src' +import ListItem from '../../extension-list-item/src/index.js' +import TextStyle from '../../extension-text-style/src/index.js' export interface BulletListOptions { itemTypeName: string, diff --git a/packages/extension-bullet-list/src/index.ts b/packages/extension-bullet-list/src/index.ts index 11e0721685b..f8432e66f3c 100644 --- a/packages/extension-bullet-list/src/index.ts +++ b/packages/extension-bullet-list/src/index.ts @@ -1,5 +1,5 @@ -import { BulletList } from './bullet-list' +import { BulletList } from './bullet-list.js' -export * from './bullet-list' +export * from './bullet-list.js' export default BulletList diff --git a/packages/extension-character-count/src/index.ts b/packages/extension-character-count/src/index.ts index 29876dc4a7f..02623dffb0e 100644 --- a/packages/extension-character-count/src/index.ts +++ b/packages/extension-character-count/src/index.ts @@ -1,5 +1,5 @@ -import { CharacterCount } from './character-count' +import { CharacterCount } from './character-count.js' -export * from './character-count' +export * from './character-count.js' export default CharacterCount diff --git a/packages/extension-code-block-lowlight/src/code-block-lowlight.ts b/packages/extension-code-block-lowlight/src/code-block-lowlight.ts index f82f023b551..55c5ddc2aee 100644 --- a/packages/extension-code-block-lowlight/src/code-block-lowlight.ts +++ b/packages/extension-code-block-lowlight/src/code-block-lowlight.ts @@ -1,6 +1,6 @@ import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block' -import { LowlightPlugin } from './lowlight-plugin' +import { LowlightPlugin } from './lowlight-plugin.js' export interface CodeBlockLowlightOptions extends CodeBlockOptions { lowlight: any, diff --git a/packages/extension-code-block-lowlight/src/index.ts b/packages/extension-code-block-lowlight/src/index.ts index 257f48ac020..c82ac142e70 100644 --- a/packages/extension-code-block-lowlight/src/index.ts +++ b/packages/extension-code-block-lowlight/src/index.ts @@ -1,5 +1,5 @@ -import { CodeBlockLowlight } from './code-block-lowlight' +import { CodeBlockLowlight } from './code-block-lowlight.js' -export * from './code-block-lowlight' +export * from './code-block-lowlight.js' export default CodeBlockLowlight diff --git a/packages/extension-code-block/src/index.ts b/packages/extension-code-block/src/index.ts index daf6becc6d4..13af7609511 100644 --- a/packages/extension-code-block/src/index.ts +++ b/packages/extension-code-block/src/index.ts @@ -1,5 +1,5 @@ -import { CodeBlock } from './code-block' +import { CodeBlock } from './code-block.js' -export * from './code-block' +export * from './code-block.js' export default CodeBlock diff --git a/packages/extension-code/src/index.ts b/packages/extension-code/src/index.ts index b9c0edb7572..fb77ea39310 100644 --- a/packages/extension-code/src/index.ts +++ b/packages/extension-code/src/index.ts @@ -1,5 +1,5 @@ -import { Code } from './code' +import { Code } from './code.js' -export * from './code' +export * from './code.js' export default Code diff --git a/packages/extension-collaboration-cursor/src/index.ts b/packages/extension-collaboration-cursor/src/index.ts index 96a5ad8b2d3..5290a2a1cee 100644 --- a/packages/extension-collaboration-cursor/src/index.ts +++ b/packages/extension-collaboration-cursor/src/index.ts @@ -1,5 +1,5 @@ -import { CollaborationCursor } from './collaboration-cursor' +import { CollaborationCursor } from './collaboration-cursor.js' -export * from './collaboration-cursor' +export * from './collaboration-cursor.js' export default CollaborationCursor diff --git a/packages/extension-collaboration/src/index.ts b/packages/extension-collaboration/src/index.ts index a81f764b34c..07ec74d6f6f 100644 --- a/packages/extension-collaboration/src/index.ts +++ b/packages/extension-collaboration/src/index.ts @@ -1,6 +1,6 @@ -import { Collaboration } from './collaboration' +import { Collaboration } from './collaboration.js' -export * from './collaboration' -export * from './helpers/isChangeOrigin' +export * from './collaboration.js' +export * from './helpers/isChangeOrigin.js' export default Collaboration diff --git a/packages/extension-color/src/index.ts b/packages/extension-color/src/index.ts index d309001f76c..f33554250e6 100644 --- a/packages/extension-color/src/index.ts +++ b/packages/extension-color/src/index.ts @@ -1,5 +1,5 @@ -import { Color } from './color' +import { Color } from './color.js' -export * from './color' +export * from './color.js' export default Color diff --git a/packages/extension-document/src/index.ts b/packages/extension-document/src/index.ts index 09c18fff5d6..3a62be7c4ad 100644 --- a/packages/extension-document/src/index.ts +++ b/packages/extension-document/src/index.ts @@ -1,5 +1,5 @@ -import { Document } from './document' +import { Document } from './document.js' -export * from './document' +export * from './document.js' export default Document diff --git a/packages/extension-dropcursor/src/index.ts b/packages/extension-dropcursor/src/index.ts index 3dec2ee421f..dcbb962f9e1 100644 --- a/packages/extension-dropcursor/src/index.ts +++ b/packages/extension-dropcursor/src/index.ts @@ -1,5 +1,5 @@ -import { Dropcursor } from './dropcursor' +import { Dropcursor } from './dropcursor.js' -export * from './dropcursor' +export * from './dropcursor.js' export default Dropcursor diff --git a/packages/extension-floating-menu/src/floating-menu.ts b/packages/extension-floating-menu/src/floating-menu.ts index 770c409ea27..cd43952c93a 100644 --- a/packages/extension-floating-menu/src/floating-menu.ts +++ b/packages/extension-floating-menu/src/floating-menu.ts @@ -1,6 +1,6 @@ import { Extension } from '@tiptap/core' -import { FloatingMenuPlugin, FloatingMenuPluginProps } from './floating-menu-plugin' +import { FloatingMenuPlugin, FloatingMenuPluginProps } from './floating-menu-plugin.js' export type FloatingMenuOptions = Omit & { element: HTMLElement | null, diff --git a/packages/extension-floating-menu/src/index.ts b/packages/extension-floating-menu/src/index.ts index 27bee69f20d..a87776b5a41 100644 --- a/packages/extension-floating-menu/src/index.ts +++ b/packages/extension-floating-menu/src/index.ts @@ -1,6 +1,6 @@ -import { FloatingMenu } from './floating-menu' +import { FloatingMenu } from './floating-menu.js' -export * from './floating-menu' -export * from './floating-menu-plugin' +export * from './floating-menu.js' +export * from './floating-menu-plugin.js' export default FloatingMenu diff --git a/packages/extension-focus/src/index.ts b/packages/extension-focus/src/index.ts index 0631a4f17cc..a1dfee56653 100644 --- a/packages/extension-focus/src/index.ts +++ b/packages/extension-focus/src/index.ts @@ -1,5 +1,5 @@ -import { FocusClasses } from './focus' +import { FocusClasses } from './focus.js' -export * from './focus' +export * from './focus.js' export default FocusClasses diff --git a/packages/extension-font-family/src/index.ts b/packages/extension-font-family/src/index.ts index ec5078470cc..4ed9a470392 100644 --- a/packages/extension-font-family/src/index.ts +++ b/packages/extension-font-family/src/index.ts @@ -1,5 +1,5 @@ -import { FontFamily } from './font-family' +import { FontFamily } from './font-family.js' -export * from './font-family' +export * from './font-family.js' export default FontFamily diff --git a/packages/extension-gapcursor/src/index.ts b/packages/extension-gapcursor/src/index.ts index 27f61c36afb..352b847134b 100644 --- a/packages/extension-gapcursor/src/index.ts +++ b/packages/extension-gapcursor/src/index.ts @@ -1,5 +1,5 @@ -import { Gapcursor } from './gapcursor' +import { Gapcursor } from './gapcursor.js' -export * from './gapcursor' +export * from './gapcursor.js' export default Gapcursor diff --git a/packages/extension-hard-break/src/index.ts b/packages/extension-hard-break/src/index.ts index 9950a1948d9..75d1155bf16 100644 --- a/packages/extension-hard-break/src/index.ts +++ b/packages/extension-hard-break/src/index.ts @@ -1,5 +1,5 @@ -import { HardBreak } from './hard-break' +import { HardBreak } from './hard-break.js' -export * from './hard-break' +export * from './hard-break.js' export default HardBreak diff --git a/packages/extension-heading/src/index.ts b/packages/extension-heading/src/index.ts index 0d13101dec2..7c36f050eb3 100644 --- a/packages/extension-heading/src/index.ts +++ b/packages/extension-heading/src/index.ts @@ -1,5 +1,5 @@ -import { Heading } from './heading' +import { Heading } from './heading.js' -export * from './heading' +export * from './heading.js' export default Heading diff --git a/packages/extension-highlight/src/index.ts b/packages/extension-highlight/src/index.ts index dbcb577dca3..1d5f920e2c5 100644 --- a/packages/extension-highlight/src/index.ts +++ b/packages/extension-highlight/src/index.ts @@ -1,5 +1,5 @@ -import { Highlight } from './highlight' +import { Highlight } from './highlight.js' -export * from './highlight' +export * from './highlight.js' export default Highlight diff --git a/packages/extension-history/src/index.ts b/packages/extension-history/src/index.ts index d7abb71f9df..ce4e19b7a2e 100644 --- a/packages/extension-history/src/index.ts +++ b/packages/extension-history/src/index.ts @@ -1,5 +1,5 @@ -import { History } from './history' +import { History } from './history.js' -export * from './history' +export * from './history.js' export default History diff --git a/packages/extension-horizontal-rule/src/index.ts b/packages/extension-horizontal-rule/src/index.ts index 472f33c83df..4d901630d03 100644 --- a/packages/extension-horizontal-rule/src/index.ts +++ b/packages/extension-horizontal-rule/src/index.ts @@ -1,5 +1,5 @@ -import { HorizontalRule } from './horizontal-rule' +import { HorizontalRule } from './horizontal-rule.js' -export * from './horizontal-rule' +export * from './horizontal-rule.js' export default HorizontalRule diff --git a/packages/extension-image/src/index.ts b/packages/extension-image/src/index.ts index 6a7a689581d..b0198e4886b 100644 --- a/packages/extension-image/src/index.ts +++ b/packages/extension-image/src/index.ts @@ -1,5 +1,5 @@ -import { Image } from './image' +import { Image } from './image.js' -export * from './image' +export * from './image.js' export default Image diff --git a/packages/extension-italic/src/index.ts b/packages/extension-italic/src/index.ts index b80147ca14d..c76a706812b 100644 --- a/packages/extension-italic/src/index.ts +++ b/packages/extension-italic/src/index.ts @@ -1,5 +1,5 @@ -import { Italic } from './italic' +import { Italic } from './italic.js' -export * from './italic' +export * from './italic.js' export default Italic diff --git a/packages/extension-link/src/index.ts b/packages/extension-link/src/index.ts index cd9fb35922b..e3655ab64d2 100644 --- a/packages/extension-link/src/index.ts +++ b/packages/extension-link/src/index.ts @@ -1,5 +1,5 @@ -import { Link } from './link' +import { Link } from './link.js' -export * from './link' +export * from './link.js' export default Link diff --git a/packages/extension-link/src/link.ts b/packages/extension-link/src/link.ts index dde70e53e9d..224948e1104 100644 --- a/packages/extension-link/src/link.ts +++ b/packages/extension-link/src/link.ts @@ -2,9 +2,9 @@ import { Mark, mergeAttributes } from '@tiptap/core' import { Plugin } from '@tiptap/pm/state' import { registerCustomProtocol, reset } from 'linkifyjs' -import { autolink } from './helpers/autolink' -import { clickHandler } from './helpers/clickHandler' -import { pasteHandler } from './helpers/pasteHandler' +import { autolink } from './helpers/autolink.js' +import { clickHandler } from './helpers/clickHandler.js' +import { pasteHandler } from './helpers/pasteHandler.js' export interface LinkProtocolOptions { scheme: string; diff --git a/packages/extension-list-item/src/index.ts b/packages/extension-list-item/src/index.ts index 35e2d4b69b3..f5b8e98f70a 100644 --- a/packages/extension-list-item/src/index.ts +++ b/packages/extension-list-item/src/index.ts @@ -1,5 +1,5 @@ -import { ListItem } from './list-item' +import { ListItem } from './list-item.js' -export * from './list-item' +export * from './list-item.js' export default ListItem diff --git a/packages/extension-mention/src/index.ts b/packages/extension-mention/src/index.ts index 0c1654ac251..c9202499a35 100644 --- a/packages/extension-mention/src/index.ts +++ b/packages/extension-mention/src/index.ts @@ -1,5 +1,5 @@ -import { Mention } from './mention' +import { Mention } from './mention.js' -export * from './mention' +export * from './mention.js' export default Mention diff --git a/packages/extension-ordered-list/src/index.ts b/packages/extension-ordered-list/src/index.ts index bd3cd501aad..4419bbae06b 100644 --- a/packages/extension-ordered-list/src/index.ts +++ b/packages/extension-ordered-list/src/index.ts @@ -1,5 +1,5 @@ -import { OrderedList } from './ordered-list' +import { OrderedList } from './ordered-list.js' -export * from './ordered-list' +export * from './ordered-list.js' export default OrderedList diff --git a/packages/extension-ordered-list/src/ordered-list.ts b/packages/extension-ordered-list/src/ordered-list.ts index 920a30ab343..6f70a898174 100644 --- a/packages/extension-ordered-list/src/ordered-list.ts +++ b/packages/extension-ordered-list/src/ordered-list.ts @@ -1,7 +1,7 @@ import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core' -import ListItem from '../../extension-list-item/src' -import TextStyle from '../../extension-text-style/src' +import ListItem from '../../extension-list-item/src/index.js' +import TextStyle from '../../extension-text-style/src/index.js' export interface OrderedListOptions { itemTypeName: string, diff --git a/packages/extension-paragraph/src/index.ts b/packages/extension-paragraph/src/index.ts index 290e2b236c0..2dd2af3926c 100644 --- a/packages/extension-paragraph/src/index.ts +++ b/packages/extension-paragraph/src/index.ts @@ -1,5 +1,5 @@ -import { Paragraph } from './paragraph' +import { Paragraph } from './paragraph.js' -export * from './paragraph' +export * from './paragraph.js' export default Paragraph diff --git a/packages/extension-placeholder/src/index.ts b/packages/extension-placeholder/src/index.ts index bd138b128b2..bb8b784166e 100644 --- a/packages/extension-placeholder/src/index.ts +++ b/packages/extension-placeholder/src/index.ts @@ -1,5 +1,5 @@ -import { Placeholder } from './placeholder' +import { Placeholder } from './placeholder.js' -export * from './placeholder' +export * from './placeholder.js' export default Placeholder diff --git a/packages/extension-strike/src/index.ts b/packages/extension-strike/src/index.ts index f218f831e87..377a83ae6df 100644 --- a/packages/extension-strike/src/index.ts +++ b/packages/extension-strike/src/index.ts @@ -1,5 +1,5 @@ -import { Strike } from './strike' +import { Strike } from './strike.js' -export * from './strike' +export * from './strike.js' export default Strike diff --git a/packages/extension-subscript/src/index.ts b/packages/extension-subscript/src/index.ts index f1056848857..61106e2064b 100644 --- a/packages/extension-subscript/src/index.ts +++ b/packages/extension-subscript/src/index.ts @@ -1,5 +1,5 @@ -import { Subscript } from './subscript' +import { Subscript } from './subscript.js' -export * from './subscript' +export * from './subscript.js' export default Subscript diff --git a/packages/extension-superscript/src/index.ts b/packages/extension-superscript/src/index.ts index 23c2140ea88..264d99602a0 100644 --- a/packages/extension-superscript/src/index.ts +++ b/packages/extension-superscript/src/index.ts @@ -1,5 +1,5 @@ -import { Superscript } from './superscript' +import { Superscript } from './superscript.js' -export * from './superscript' +export * from './superscript.js' export default Superscript diff --git a/packages/extension-table-cell/src/index.ts b/packages/extension-table-cell/src/index.ts index d3091a48878..0f612923d81 100644 --- a/packages/extension-table-cell/src/index.ts +++ b/packages/extension-table-cell/src/index.ts @@ -1,5 +1,5 @@ -import { TableCell } from './table-cell' +import { TableCell } from './table-cell.js' -export * from './table-cell' +export * from './table-cell.js' export default TableCell diff --git a/packages/extension-table-header/src/index.ts b/packages/extension-table-header/src/index.ts index bfa5d100ede..9cfa04c3d3c 100644 --- a/packages/extension-table-header/src/index.ts +++ b/packages/extension-table-header/src/index.ts @@ -1,5 +1,5 @@ -import { TableHeader } from './table-header' +import { TableHeader } from './table-header.js' -export * from './table-header' +export * from './table-header.js' export default TableHeader diff --git a/packages/extension-table-row/src/index.ts b/packages/extension-table-row/src/index.ts index bdba9f60d83..c04e700227b 100644 --- a/packages/extension-table-row/src/index.ts +++ b/packages/extension-table-row/src/index.ts @@ -1,5 +1,5 @@ -import { TableRow } from './table-row' +import { TableRow } from './table-row.js' -export * from './table-row' +export * from './table-row.js' export default TableRow diff --git a/packages/extension-table/src/index.ts b/packages/extension-table/src/index.ts index 227e8b1e888..d7b617b456d 100644 --- a/packages/extension-table/src/index.ts +++ b/packages/extension-table/src/index.ts @@ -1,6 +1,6 @@ -import { Table } from './table' +import { Table } from './table.js' -export * from './table' -export * from './utilities/createTable' +export * from './table.js' +export * from './utilities/createTable.js' export default Table diff --git a/packages/extension-table/src/table.ts b/packages/extension-table/src/table.ts index 58fb5cece51..944f7bd0551 100644 --- a/packages/extension-table/src/table.ts +++ b/packages/extension-table/src/table.ts @@ -23,9 +23,9 @@ import { } from '@tiptap/pm/tables' import { NodeView } from '@tiptap/pm/view' -import { TableView } from './TableView' -import { createTable } from './utilities/createTable' -import { deleteTableWhenAllCellsSelected } from './utilities/deleteTableWhenAllCellsSelected' +import { TableView } from './TableView.js' +import { createTable } from './utilities/createTable.js' +import { deleteTableWhenAllCellsSelected } from './utilities/deleteTableWhenAllCellsSelected.js' export interface TableOptions { HTMLAttributes: Record diff --git a/packages/extension-table/src/utilities/createTable.ts b/packages/extension-table/src/utilities/createTable.ts index c28bbf37d65..d343a3e1706 100644 --- a/packages/extension-table/src/utilities/createTable.ts +++ b/packages/extension-table/src/utilities/createTable.ts @@ -1,7 +1,7 @@ import { Fragment, Node as ProsemirrorNode, Schema } from '@tiptap/pm/model' -import { createCell } from './createCell' -import { getTableNodeTypes } from './getTableNodeTypes' +import { createCell } from './createCell.js' +import { getTableNodeTypes } from './getTableNodeTypes.js' export function createTable( schema: Schema, diff --git a/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.ts b/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.ts index 50ebaeee83b..c054f4a9b7b 100644 --- a/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.ts +++ b/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.ts @@ -1,6 +1,6 @@ import { findParentNodeClosestToPos, KeyboardShortcutCommand } from '@tiptap/core' -import { isCellSelection } from './isCellSelection' +import { isCellSelection } from './isCellSelection.js' export const deleteTableWhenAllCellsSelected: KeyboardShortcutCommand = ({ editor }) => { const { selection } = editor.state diff --git a/packages/extension-task-item/src/index.ts b/packages/extension-task-item/src/index.ts index 99455780850..d5696e425e7 100644 --- a/packages/extension-task-item/src/index.ts +++ b/packages/extension-task-item/src/index.ts @@ -1,5 +1,5 @@ -import { TaskItem } from './task-item' +import { TaskItem } from './task-item.js' -export * from './task-item' +export * from './task-item.js' export default TaskItem diff --git a/packages/extension-task-list/src/index.ts b/packages/extension-task-list/src/index.ts index 2cfaeb5ba36..fdcc05ac148 100644 --- a/packages/extension-task-list/src/index.ts +++ b/packages/extension-task-list/src/index.ts @@ -1,5 +1,5 @@ -import { TaskList } from './task-list' +import { TaskList } from './task-list.js' -export * from './task-list' +export * from './task-list.js' export default TaskList diff --git a/packages/extension-text-align/src/index.ts b/packages/extension-text-align/src/index.ts index a87f3473042..448ac7715fe 100644 --- a/packages/extension-text-align/src/index.ts +++ b/packages/extension-text-align/src/index.ts @@ -1,5 +1,5 @@ -import { TextAlign } from './text-align' +import { TextAlign } from './text-align.js' -export * from './text-align' +export * from './text-align.js' export default TextAlign diff --git a/packages/extension-text-style/src/index.ts b/packages/extension-text-style/src/index.ts index f7396d77db0..87e4ac38a3e 100644 --- a/packages/extension-text-style/src/index.ts +++ b/packages/extension-text-style/src/index.ts @@ -1,5 +1,5 @@ -import { TextStyle } from './text-style' +import { TextStyle } from './text-style.js' -export * from './text-style' +export * from './text-style.js' export default TextStyle diff --git a/packages/extension-text/src/index.ts b/packages/extension-text/src/index.ts index e32a4a4f4c6..c1a4680360d 100644 --- a/packages/extension-text/src/index.ts +++ b/packages/extension-text/src/index.ts @@ -1,5 +1,5 @@ -import { Text } from './text' +import { Text } from './text.js' -export * from './text' +export * from './text.js' export default Text diff --git a/packages/extension-typography/src/index.ts b/packages/extension-typography/src/index.ts index dddec84169f..12800165277 100644 --- a/packages/extension-typography/src/index.ts +++ b/packages/extension-typography/src/index.ts @@ -1,5 +1,5 @@ -import { Typography } from './typography' +import { Typography } from './typography.js' -export * from './typography' +export * from './typography.js' export default Typography diff --git a/packages/extension-underline/src/index.ts b/packages/extension-underline/src/index.ts index 2d7f5423552..af593a0a8bd 100644 --- a/packages/extension-underline/src/index.ts +++ b/packages/extension-underline/src/index.ts @@ -1,5 +1,5 @@ -import { Underline } from './underline' +import { Underline } from './underline.js' -export * from './underline' +export * from './underline.js' export default Underline diff --git a/packages/extension-youtube/src/index.ts b/packages/extension-youtube/src/index.ts index 8b42aff9c1b..eec35c66dd6 100644 --- a/packages/extension-youtube/src/index.ts +++ b/packages/extension-youtube/src/index.ts @@ -1,5 +1,5 @@ -import { Youtube } from './youtube' +import { Youtube } from './youtube.js' -export * from './youtube' +export * from './youtube.js' export default Youtube diff --git a/packages/extension-youtube/src/youtube.ts b/packages/extension-youtube/src/youtube.ts index 3e65d9b14ba..c680a0631af 100644 --- a/packages/extension-youtube/src/youtube.ts +++ b/packages/extension-youtube/src/youtube.ts @@ -1,6 +1,6 @@ import { mergeAttributes, Node, nodePasteRule } from '@tiptap/core' -import { getEmbedUrlFromYoutubeUrl, isValidYoutubeUrl, YOUTUBE_REGEX_GLOBAL } from './utils' +import { getEmbedUrlFromYoutubeUrl, isValidYoutubeUrl, YOUTUBE_REGEX_GLOBAL } from './utils.js' export interface YoutubeOptions { addPasteHandler: boolean; diff --git a/packages/html/src/generateHTML.ts b/packages/html/src/generateHTML.ts index b943737cc60..dc011e79208 100644 --- a/packages/html/src/generateHTML.ts +++ b/packages/html/src/generateHTML.ts @@ -1,7 +1,7 @@ import { Extensions, getSchema, JSONContent } from '@tiptap/core' import { Node } from '@tiptap/pm/model' -import { getHTMLFromFragment } from './getHTMLFromFragment' +import { getHTMLFromFragment } from './getHTMLFromFragment.js' export function generateHTML(doc: JSONContent, extensions: Extensions): string { const schema = getSchema(extensions) diff --git a/packages/html/src/index.ts b/packages/html/src/index.ts index 33db29a8f87..051a3eef22a 100644 --- a/packages/html/src/index.ts +++ b/packages/html/src/index.ts @@ -1,2 +1,2 @@ -export * from './generateHTML' -export * from './generateJSON' +export * from './generateHTML.js' +export * from './generateJSON.js' diff --git a/packages/react/src/Editor.ts b/packages/react/src/Editor.ts index 3807746c106..24f2c0f527c 100644 --- a/packages/react/src/Editor.ts +++ b/packages/react/src/Editor.ts @@ -1,8 +1,8 @@ import { Editor as CoreEditor } from '@tiptap/core' import React from 'react' -import { EditorContentProps, EditorContentState } from './EditorContent' -import { ReactRenderer } from './ReactRenderer' +import { EditorContentProps, EditorContentState } from './EditorContent.js' +import { ReactRenderer } from './ReactRenderer.js' type ContentComponent = React.Component & { setRenderer(id: string, renderer: ReactRenderer): void; diff --git a/packages/react/src/EditorContent.tsx b/packages/react/src/EditorContent.tsx index 0a7ea773238..f65276f4d07 100644 --- a/packages/react/src/EditorContent.tsx +++ b/packages/react/src/EditorContent.tsx @@ -1,8 +1,8 @@ import React, { HTMLProps } from 'react' import ReactDOM, { flushSync } from 'react-dom' -import { Editor } from './Editor' -import { ReactRenderer } from './ReactRenderer' +import { Editor } from './Editor.js' +import { ReactRenderer } from './ReactRenderer.js' const Portals: React.FC<{ renderers: Record }> = ({ renderers }) => { return ( diff --git a/packages/react/src/NodeViewContent.tsx b/packages/react/src/NodeViewContent.tsx index 61fda9a064e..51d7c5dde55 100644 --- a/packages/react/src/NodeViewContent.tsx +++ b/packages/react/src/NodeViewContent.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { useReactNodeView } from './useReactNodeView' +import { useReactNodeView } from './useReactNodeView.js' export interface NodeViewContentProps { [key: string]: any, diff --git a/packages/react/src/NodeViewWrapper.tsx b/packages/react/src/NodeViewWrapper.tsx index c5a19e40c47..5fc36cfd9a1 100644 --- a/packages/react/src/NodeViewWrapper.tsx +++ b/packages/react/src/NodeViewWrapper.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { useReactNodeView } from './useReactNodeView' +import { useReactNodeView } from './useReactNodeView.js' export interface NodeViewWrapperProps { [key: string]: any, diff --git a/packages/react/src/ReactNodeViewRenderer.tsx b/packages/react/src/ReactNodeViewRenderer.tsx index 514cb9b3f67..899907c585e 100644 --- a/packages/react/src/ReactNodeViewRenderer.tsx +++ b/packages/react/src/ReactNodeViewRenderer.tsx @@ -10,9 +10,9 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' import { Decoration, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view' import React from 'react' -import { Editor } from './Editor' -import { ReactRenderer } from './ReactRenderer' -import { ReactNodeViewContext, ReactNodeViewContextProps } from './useReactNodeView' +import { Editor } from './Editor.js' +import { ReactRenderer } from './ReactRenderer.js' +import { ReactNodeViewContext, ReactNodeViewContextProps } from './useReactNodeView.js' export interface ReactNodeViewRendererOptions extends NodeViewRendererOptions { update: diff --git a/packages/react/src/ReactRenderer.tsx b/packages/react/src/ReactRenderer.tsx index a47a93dea56..3151d39b304 100644 --- a/packages/react/src/ReactRenderer.tsx +++ b/packages/react/src/ReactRenderer.tsx @@ -1,7 +1,7 @@ import { Editor } from '@tiptap/core' import React from 'react' -import { Editor as ExtendedEditor } from './Editor' +import { Editor as ExtendedEditor } from './Editor.js' function isClassComponent(Component: any) { return !!( diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 19e6d22fdc7..ed60661e292 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,10 +1,10 @@ -export * from './BubbleMenu' -export { Editor } from './Editor' -export * from './EditorContent' -export * from './FloatingMenu' -export * from './NodeViewContent' -export * from './NodeViewWrapper' -export * from './ReactNodeViewRenderer' -export * from './ReactRenderer' -export * from './useEditor' +export * from './BubbleMenu.js' +export { Editor } from './Editor.js' +export * from './EditorContent.js' +export * from './FloatingMenu.js' +export * from './NodeViewContent.js' +export * from './NodeViewWrapper.js' +export * from './ReactNodeViewRenderer.js' +export * from './ReactRenderer.js' +export * from './useEditor.js' export * from '@tiptap/core' diff --git a/packages/react/src/useEditor.ts b/packages/react/src/useEditor.ts index 7ef95608366..fdede2825ea 100644 --- a/packages/react/src/useEditor.ts +++ b/packages/react/src/useEditor.ts @@ -6,7 +6,7 @@ import { useState, } from 'react' -import { Editor } from './Editor' +import { Editor } from './Editor.js' function useForceUpdate() { const [, setValue] = useState(0) diff --git a/packages/starter-kit/src/index.ts b/packages/starter-kit/src/index.ts index 7e4dafc7e45..13c66842058 100644 --- a/packages/starter-kit/src/index.ts +++ b/packages/starter-kit/src/index.ts @@ -1,6 +1,6 @@ -import { StarterKit } from './starter-kit' +import { StarterKit } from './starter-kit.js' -export type { StarterKitOptions } from './starter-kit' -export * from './starter-kit' +export type { StarterKitOptions } from './starter-kit.js' +export * from './starter-kit.js' export default StarterKit diff --git a/packages/suggestion/src/index.ts b/packages/suggestion/src/index.ts index 5e319dd40c8..4f760332c5e 100644 --- a/packages/suggestion/src/index.ts +++ b/packages/suggestion/src/index.ts @@ -1,6 +1,6 @@ -import { Suggestion } from './suggestion' +import { Suggestion } from './suggestion.js' -export * from './findSuggestionMatch' -export * from './suggestion' +export * from './findSuggestionMatch.js' +export * from './suggestion.js' export default Suggestion diff --git a/packages/suggestion/src/suggestion.ts b/packages/suggestion/src/suggestion.ts index 486d1aaf169..f75d24002c1 100644 --- a/packages/suggestion/src/suggestion.ts +++ b/packages/suggestion/src/suggestion.ts @@ -2,7 +2,7 @@ import { Editor, Range } from '@tiptap/core' import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state' import { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view' -import { findSuggestionMatch } from './findSuggestionMatch' +import { findSuggestionMatch } from './findSuggestionMatch.js' export interface SuggestionOptions { pluginKey?: PluginKey diff --git a/packages/vue-2/src/EditorContent.ts b/packages/vue-2/src/EditorContent.ts index f95ad8efe6b..872a90136f5 100644 --- a/packages/vue-2/src/EditorContent.ts +++ b/packages/vue-2/src/EditorContent.ts @@ -1,6 +1,6 @@ import Vue, { Component, PropType } from 'vue' -import { Editor } from './Editor' +import { Editor } from './Editor.js' export interface EditorContentInterface extends Vue { editor: Editor, diff --git a/packages/vue-2/src/VueNodeViewRenderer.ts b/packages/vue-2/src/VueNodeViewRenderer.ts index bf21b1351cf..c3714484233 100644 --- a/packages/vue-2/src/VueNodeViewRenderer.ts +++ b/packages/vue-2/src/VueNodeViewRenderer.ts @@ -11,8 +11,8 @@ import { Decoration, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view' import Vue from 'vue' import { PropType, VueConstructor } from 'vue/types/umd' -import { Editor } from './Editor' -import { VueRenderer } from './VueRenderer' +import { Editor } from './Editor.js' +import { VueRenderer } from './VueRenderer.js' export const nodeViewProps = { editor: { diff --git a/packages/vue-2/src/index.ts b/packages/vue-2/src/index.ts index 3641fd38d8b..375253cef55 100644 --- a/packages/vue-2/src/index.ts +++ b/packages/vue-2/src/index.ts @@ -1,9 +1,9 @@ -export * from './BubbleMenu' -export { Editor } from './Editor' -export * from './EditorContent' -export * from './FloatingMenu' -export * from './NodeViewContent' -export * from './NodeViewWrapper' -export * from './VueNodeViewRenderer' -export * from './VueRenderer' +export * from './BubbleMenu.js' +export { Editor } from './Editor.js' +export * from './EditorContent.js' +export * from './FloatingMenu.js' +export * from './NodeViewContent.js' +export * from './NodeViewWrapper.js' +export * from './VueNodeViewRenderer.js' +export * from './VueRenderer.js' export * from '@tiptap/core' diff --git a/packages/vue-3/src/Editor.ts b/packages/vue-3/src/Editor.ts index 26b2a9bc224..0933a79924c 100644 --- a/packages/vue-3/src/Editor.ts +++ b/packages/vue-3/src/Editor.ts @@ -9,7 +9,7 @@ import { Ref, } from 'vue' -import { VueRenderer } from './VueRenderer' +import { VueRenderer } from './VueRenderer.js' function useDebouncedRef(value: T) { return customRef((track, trigger) => { diff --git a/packages/vue-3/src/EditorContent.ts b/packages/vue-3/src/EditorContent.ts index d2ffa2b2e2c..09f1b51c426 100644 --- a/packages/vue-3/src/EditorContent.ts +++ b/packages/vue-3/src/EditorContent.ts @@ -13,7 +13,7 @@ import { watchEffect, } from 'vue' -import { Editor } from './Editor' +import { Editor } from './Editor.js' export const EditorContent = defineComponent({ name: 'EditorContent', diff --git a/packages/vue-3/src/VueNodeViewRenderer.ts b/packages/vue-3/src/VueNodeViewRenderer.ts index 8b9fe6020be..80e4650c89b 100644 --- a/packages/vue-3/src/VueNodeViewRenderer.ts +++ b/packages/vue-3/src/VueNodeViewRenderer.ts @@ -17,8 +17,8 @@ import { ref, } from 'vue' -import { Editor } from './Editor' -import { VueRenderer } from './VueRenderer' +import { Editor } from './Editor.js' +import { VueRenderer } from './VueRenderer.js' export const nodeViewProps = { editor: { diff --git a/packages/vue-3/src/VueRenderer.ts b/packages/vue-3/src/VueRenderer.ts index 90dda6c8fa0..ca75954bddb 100644 --- a/packages/vue-3/src/VueRenderer.ts +++ b/packages/vue-3/src/VueRenderer.ts @@ -1,7 +1,7 @@ import { Editor } from '@tiptap/core' import { Component, markRaw, reactive } from 'vue' -import { Editor as ExtendedEditor } from './Editor' +import { Editor as ExtendedEditor } from './Editor.js' export interface VueRendererOptions { editor: Editor, diff --git a/packages/vue-3/src/index.ts b/packages/vue-3/src/index.ts index 47c222d589b..bf7833f2b27 100644 --- a/packages/vue-3/src/index.ts +++ b/packages/vue-3/src/index.ts @@ -1,10 +1,10 @@ -export * from './BubbleMenu' -export { Editor } from './Editor' -export * from './EditorContent' -export * from './FloatingMenu' -export * from './NodeViewContent' -export * from './NodeViewWrapper' -export * from './useEditor' -export * from './VueNodeViewRenderer' -export * from './VueRenderer' +export * from './BubbleMenu.js' +export { Editor } from './Editor.js' +export * from './EditorContent.js' +export * from './FloatingMenu.js' +export * from './NodeViewContent.js' +export * from './NodeViewWrapper.js' +export * from './useEditor.js' +export * from './VueNodeViewRenderer.js' +export * from './VueRenderer.js' export * from '@tiptap/core' diff --git a/packages/vue-3/src/useEditor.ts b/packages/vue-3/src/useEditor.ts index e2333fc4f60..e75d7f41c1e 100644 --- a/packages/vue-3/src/useEditor.ts +++ b/packages/vue-3/src/useEditor.ts @@ -1,7 +1,7 @@ import { EditorOptions } from '@tiptap/core' import { onBeforeUnmount, onMounted, shallowRef } from 'vue' -import { Editor } from './Editor' +import { Editor } from './Editor.js' export const useEditor = (options: Partial = {}) => { const editor = shallowRef() diff --git a/tests/cypress/support/e2e.js b/tests/cypress/support/e2e.js index d68db96df26..b6ca3466221 100644 --- a/tests/cypress/support/e2e.js +++ b/tests/cypress/support/e2e.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands.js' // Alternatively you can use CommonJS syntax: // require('./commands')