Require file extensions for imports and exports (#4001)

* Require .js endings

* add extension alias for cypress to resolve ts files with js endings
This commit is contained in:
Ben Asher 2023-06-30 12:03:49 -07:00 committed by GitHub
parent 75f0418f03
commit e97630c639
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
238 changed files with 690 additions and 673 deletions

View File

@ -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',

View File

@ -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: {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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 => {

View File

@ -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

View File

@ -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 }) => {

View File

@ -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: {

View File

@ -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: {

View File

@ -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',

View File

@ -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({

View File

@ -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',

View File

@ -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: {

View File

@ -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')

View File

@ -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: {

View File

@ -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',

View File

@ -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

View File

@ -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: {

View File

@ -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: {

View File

@ -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: {

View File

@ -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({

View File

@ -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: {

View File

@ -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: {

View File

@ -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',

View File

@ -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',

View File

@ -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

View File

@ -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'

View File

@ -1,4 +1,4 @@
import LinterPlugin from '../LinterPlugin'
import LinterPlugin from '../LinterPlugin.js'
export class BadWords extends LinterPlugin {

View File

@ -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) {

View File

@ -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

View File

@ -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: {

View File

@ -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: {

View File

@ -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({

View File

@ -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: {

View File

@ -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

View File

@ -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 }

View File

@ -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<Options = any, Storage = any> {

View File

@ -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

View File

@ -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

View File

@ -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<Options = any, Storage = any> {

View File

@ -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<Options = any, Storage = any> {

View File

@ -2,11 +2,11 @@ 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 { isAndroid } from './utilities/isAndroid'
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 { isAndroid } from './utilities/isAndroid.js'
import { isiOS } from './utilities/isiOS.js'
export class NodeView<
Component,

View File

@ -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

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { Command, RawCommands } from '../types'
import { Command, RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { Range, RawCommands } from '../types'
import { Range, RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { Command, CommandProps, RawCommands } from '../types'
import { Command, CommandProps, RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { CommandProps, RawCommands } from '../types'
import { CommandProps, RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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'

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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(/-(?!$)/)

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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())

View File

@ -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<ReturnType> {

View File

@ -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)

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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<ReturnType> {

View File

@ -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',

Some files were not shown because too many files have changed in this diff Show More