From a40d77243ab39c1cf734bc13de2ec97789696c7a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 03:59:36 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- e2e/src/createEditorView.ts | 18 +++++++++--------- e2e/src/lit/components/Editor.ts | 8 ++++---- e2e/src/lit/index.ts | 2 +- e2e/src/react/components/Editor.tsx | 10 +++++----- e2e/src/react/components/Link.tsx | 2 +- e2e/src/solid/components/Editor.tsx | 6 +++--- e2e/src/solid/index.tsx | 6 +++--- e2e/vite.config.ts | 4 ++-- eslint.config.mjs | 2 +- examples/lit/src/components/Editor.ts | 6 +++--- examples/lit/src/createEditorView.ts | 12 ++++++------ examples/lit/src/my-element.ts | 2 +- examples/react/components/Editor.tsx | 10 +++++----- examples/react/createEditorView.ts | 12 ++++++------ examples/solid/src/components/Editor.tsx | 4 ++-- examples/solid/src/createEditorView.ts | 12 ++++++------ examples/solid/src/index.tsx | 6 +++--- examples/svelte/src/libs/createEditorView.ts | 12 ++++++------ examples/vue/createEditorView.ts | 12 ++++++------ packages/lit/src/Provider.ts | 4 ++-- packages/lit/src/index.ts | 6 +++--- packages/lit/src/markView/LitMarkView.ts | 8 ++++---- packages/lit/src/markView/index.ts | 2 +- packages/lit/src/markView/markViewContext.ts | 2 +- packages/lit/src/nodeView/LitNodeView.ts | 8 ++++---- packages/lit/src/nodeView/index.ts | 2 +- packages/lit/src/nodeView/nodeViewContext.ts | 4 ++-- packages/lit/src/pluginView/LitPluginView.ts | 6 +++--- packages/lit/src/pluginView/index.ts | 2 +- .../lit/src/pluginView/pluginViewContext.ts | 2 +- packages/lit/src/widgetView/LitWidgetView.ts | 6 +++--- .../src/widgetView/useLitWidgetViewCreator.ts | 4 ++-- .../lit/src/widgetView/widgetViewContext.ts | 2 +- packages/react/src/index.ts | 2 +- packages/react/src/markView/ReactMarkView.tsx | 8 ++++---- packages/react/src/markView/markViewContext.ts | 2 +- .../src/markView/useReactMarkViewCreator.ts | 4 ++-- packages/react/src/nodeView/ReactNodeView.tsx | 8 ++++---- packages/react/src/nodeView/nodeViewContext.ts | 2 +- .../src/nodeView/useReactNodeViewCreator.ts | 4 ++-- .../react/src/pluginView/ReactPluginView.tsx | 8 ++++---- .../react/src/pluginView/pluginViewContext.ts | 2 +- .../pluginView/useReactPluginViewCreator.ts | 4 ++-- .../react/src/widgetView/ReactWidgetView.tsx | 6 +++--- packages/react/src/widgetView/index.ts | 2 +- .../widgetView/useReactWidgetViewCreator.ts | 4 ++-- .../react/src/widgetView/widgetViewContext.ts | 2 +- packages/solid/src/Provider.tsx | 2 +- packages/solid/src/index.ts | 4 ++-- packages/solid/src/markView/SolidMarkView.tsx | 12 ++++++------ packages/solid/src/markView/markViewContext.ts | 2 +- .../src/markView/useSolidMarkViewCreator.ts | 2 +- packages/solid/src/nodeView/SolidNodeView.tsx | 12 ++++++------ packages/solid/src/nodeView/nodeViewContext.ts | 2 +- .../src/nodeView/useSolidNodeViewCreator.ts | 2 +- .../solid/src/pluginView/SolidPluginView.tsx | 14 +++++++------- .../solid/src/pluginView/pluginViewContext.ts | 2 +- .../pluginView/useSolidPluginViewCreator.ts | 2 +- .../solid/src/widgetView/SolidWidgetView.tsx | 10 +++++----- .../widgetView/useSolidWidgetViewCreator.ts | 4 ++-- .../solid/src/widgetView/widgetViewContext.ts | 2 +- packages/svelte/src/Provider.ts | 4 ++-- packages/svelte/src/index.ts | 4 ++-- packages/svelte/src/markView/SvelteMarkView.ts | 10 +++++----- .../svelte/src/markView/markViewContext.ts | 2 +- packages/svelte/src/mount.ts | 2 +- packages/svelte/src/nodeView/SvelteNodeView.ts | 10 +++++----- .../svelte/src/nodeView/nodeViewContext.ts | 2 +- .../svelte/src/pluginView/SveltePluginView.ts | 8 ++++---- .../svelte/src/pluginView/pluginViewContext.ts | 2 +- .../svelte/src/widgetView/SvelteWidgetView.ts | 6 +++--- .../widgetView/useSvelteWidgetViewCreator.ts | 4 ++-- .../svelte/src/widgetView/widgetViewContext.ts | 2 +- packages/vue/src/Provider.tsx | 6 +++--- packages/vue/src/index.ts | 4 ++-- packages/vue/src/markView/VueMarkView.tsx | 10 +++++----- packages/vue/src/markView/markViewContext.ts | 2 +- packages/vue/src/nodeView/VueNodeView.tsx | 10 +++++----- packages/vue/src/nodeView/nodeViewContext.ts | 2 +- packages/vue/src/pluginView/VuePluginView.tsx | 8 ++++---- .../vue/src/pluginView/pluginViewContext.ts | 2 +- packages/vue/src/widgetView/VueWidgetView.tsx | 6 +++--- .../src/widgetView/useVueWidgetViewCreator.ts | 4 ++-- .../vue/src/widgetView/widgetViewContext.ts | 2 +- 84 files changed, 223 insertions(+), 223 deletions(-) diff --git a/e2e/src/createEditorView.ts b/e2e/src/createEditorView.ts index 0c38448..ba7435e 100644 --- a/e2e/src/createEditorView.ts +++ b/e2e/src/createEditorView.ts @@ -1,18 +1,18 @@ -import 'prosemirror-example-setup/style/style.css' -import 'prosemirror-menu/style/menu.css' -import 'prosemirror-view/style/prosemirror.css' - -import { exampleSetup } from 'prosemirror-example-setup' -import { keymap } from 'prosemirror-keymap' -import { DOMParser } from 'prosemirror-model' -import { schema } from 'prosemirror-schema-basic' import type { Plugin } from 'prosemirror-state' -import { EditorState } from 'prosemirror-state' import type { MarkViewConstructor, NodeViewConstructor, } from 'prosemirror-view' +import { exampleSetup } from 'prosemirror-example-setup' + +import { keymap } from 'prosemirror-keymap' +import { DOMParser } from 'prosemirror-model' +import { schema } from 'prosemirror-schema-basic' +import { EditorState } from 'prosemirror-state' import { EditorView } from 'prosemirror-view' +import 'prosemirror-example-setup/style/style.css' +import 'prosemirror-menu/style/menu.css' +import 'prosemirror-view/style/prosemirror.css' export function createEditorView( element: HTMLElement | ShadowRoot, diff --git a/e2e/src/lit/components/Editor.ts b/e2e/src/lit/components/Editor.ts index 900ba4c..8beaa0c 100644 --- a/e2e/src/lit/components/Editor.ts +++ b/e2e/src/lit/components/Editor.ts @@ -1,3 +1,5 @@ +import type { RefOrCallback } from 'lit/directives/ref.js' +import type { EditorView } from 'prosemirror-view' import { ShallowLitElement, useMarkViewFactory, @@ -7,17 +9,15 @@ import { } from '@prosemirror-adapter/lit' import { html } from 'lit' import { customElement } from 'lit/decorators.js' +import { ref } from 'lit/directives/ref.js' import { Plugin } from 'prosemirror-state' -import type { EditorView } from 'prosemirror-view' import { DecorationSet } from 'prosemirror-view' -import type { RefOrCallback } from 'lit/directives/ref.js' -import { ref } from 'lit/directives/ref.js' import { createEditorView } from '../../createEditorView' import { Hashes } from './Hashes' import { Heading } from './Heading' +import { Link } from './Link' import { Paragraph } from './Paragraph' import { Size } from './Size' -import { Link } from './Link' @customElement('my-editor') export class MyEditor extends ShallowLitElement { diff --git a/e2e/src/lit/index.ts b/e2e/src/lit/index.ts index f034630..f8fd842 100644 --- a/e2e/src/lit/index.ts +++ b/e2e/src/lit/index.ts @@ -1,7 +1,7 @@ +import { ShallowLitElement } from '@prosemirror-adapter/lit' import { html } from 'lit' import { customElement, state } from 'lit/decorators.js' import { keyed } from 'lit/directives/keyed.js' -import { ShallowLitElement } from '@prosemirror-adapter/lit' export * from './components/Editor' export { ProsemirrorAdapterProvider } from '@prosemirror-adapter/lit' diff --git a/e2e/src/react/components/Editor.tsx b/e2e/src/react/components/Editor.tsx index f2f6124..4209355 100644 --- a/e2e/src/react/components/Editor.tsx +++ b/e2e/src/react/components/Editor.tsx @@ -1,18 +1,18 @@ -import './Editor.css' +import type { EditorView } from 'prosemirror-view' +import type { FC } from 'react' import { useMarkViewFactory, useNodeViewFactory, usePluginViewFactory, useWidgetViewFactory } from '@prosemirror-adapter/react' -import type { EditorView } from 'prosemirror-view' +import { Plugin } from 'prosemirror-state' import { DecorationSet } from 'prosemirror-view' -import type { FC } from 'react' import { useEffect, useRef } from 'react' -import { Plugin } from 'prosemirror-state' import { createEditorView } from '../../createEditorView' import { Hashes } from './Hashes' import { Heading } from './Heading' +import { Link } from './Link' import { Paragraph } from './Paragraph' import { Size } from './Size' -import { Link } from './Link' +import './Editor.css' export const Editor: FC = () => { const viewRef = useRef() diff --git a/e2e/src/react/components/Link.tsx b/e2e/src/react/components/Link.tsx index 8600d65..5ab5452 100644 --- a/e2e/src/react/components/Link.tsx +++ b/e2e/src/react/components/Link.tsx @@ -1,5 +1,5 @@ -import { useEffect, useState } from 'react' import { useMarkViewContext } from '@prosemirror-adapter/react' +import { useEffect, useState } from 'react' const colors = [ '#f06292', diff --git a/e2e/src/solid/components/Editor.tsx b/e2e/src/solid/components/Editor.tsx index 99874eb..271103a 100644 --- a/e2e/src/solid/components/Editor.tsx +++ b/e2e/src/solid/components/Editor.tsx @@ -1,4 +1,3 @@ -import { DecorationSet } from 'prosemirror-view' import { useMarkViewFactory, useNodeViewFactory, @@ -6,12 +5,13 @@ import { useWidgetViewFactory, } from '@prosemirror-adapter/solid' import { Plugin } from 'prosemirror-state' +import { DecorationSet } from 'prosemirror-view' import { createEditorView } from '../../createEditorView' -import { Paragraph } from './Paragraph' import { Hashes } from './Hashes' import { Heading } from './Heading' -import { Size } from './Size' import { Link } from './Link' +import { Paragraph } from './Paragraph' +import { Size } from './Size' export function Editor() { const nodeViewFactory = useNodeViewFactory() diff --git a/e2e/src/solid/index.tsx b/e2e/src/solid/index.tsx index b5c64c4..27dd28e 100644 --- a/e2e/src/solid/index.tsx +++ b/e2e/src/solid/index.tsx @@ -1,9 +1,9 @@ +import { ProsemirrorAdapterProvider } from '@prosemirror-adapter/solid' + /* @refresh reload */ import { render } from 'solid-js/web' - -import './index.css' -import { ProsemirrorAdapterProvider } from '@prosemirror-adapter/solid' import { Editor } from './components/Editor' +import './index.css' const root = document.getElementById('root') diff --git a/e2e/vite.config.ts b/e2e/vite.config.ts index 79a96ce..ea72b1b 100644 --- a/e2e/vite.config.ts +++ b/e2e/vite.config.ts @@ -1,9 +1,9 @@ import { resolve } from 'node:path' +import { svelte } from '@sveltejs/vite-plugin-svelte' import react from '@vitejs/plugin-react' import vue from '@vitejs/plugin-vue' -import { svelte } from '@sveltejs/vite-plugin-svelte' -import solid from 'vite-plugin-solid' import { defineConfig } from 'vite' +import solid from 'vite-plugin-solid' export default defineConfig({ root: 'src', diff --git a/eslint.config.mjs b/eslint.config.mjs index cffee3e..1d748ba 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,7 +1,7 @@ import antfu from '@antfu/eslint-config' +import { fixupPluginRules } from '@eslint/compat' import react from 'eslint-plugin-react' import hooks from 'eslint-plugin-react-hooks' -import { fixupPluginRules } from '@eslint/compat' export default antfu( { diff --git a/examples/lit/src/components/Editor.ts b/examples/lit/src/components/Editor.ts index 550eac1..ab8e3d3 100644 --- a/examples/lit/src/components/Editor.ts +++ b/examples/lit/src/components/Editor.ts @@ -1,3 +1,5 @@ +import type { RefOrCallback } from 'lit/directives/ref.js' +import type { EditorView } from 'prosemirror-view' import { ShallowLitElement, useNodeViewFactory, @@ -6,11 +8,9 @@ import { } from '@prosemirror-adapter/lit' import { html } from 'lit' import { customElement } from 'lit/decorators.js' +import { ref } from 'lit/directives/ref.js' import { Plugin } from 'prosemirror-state' -import type { EditorView } from 'prosemirror-view' import { DecorationSet } from 'prosemirror-view' -import type { RefOrCallback } from 'lit/directives/ref.js' -import { ref } from 'lit/directives/ref.js' import { createEditorView } from '../createEditorView' import { Hashes } from './Hashes' import { Heading } from './Heading' diff --git a/examples/lit/src/createEditorView.ts b/examples/lit/src/createEditorView.ts index 1e5003b..99f973e 100644 --- a/examples/lit/src/createEditorView.ts +++ b/examples/lit/src/createEditorView.ts @@ -1,15 +1,15 @@ -import 'prosemirror-view/style/prosemirror.css' -import 'prosemirror-example-setup/style/style.css' -import 'prosemirror-menu/style/menu.css' - +import type { Plugin } from 'prosemirror-state' +import type { NodeViewConstructor } from 'prosemirror-view' import { exampleSetup } from 'prosemirror-example-setup' + import { keymap } from 'prosemirror-keymap' import { DOMParser } from 'prosemirror-model' import { schema } from 'prosemirror-schema-basic' -import type { Plugin } from 'prosemirror-state' import { EditorState } from 'prosemirror-state' -import type { NodeViewConstructor } from 'prosemirror-view' import { EditorView } from 'prosemirror-view' +import 'prosemirror-view/style/prosemirror.css' +import 'prosemirror-example-setup/style/style.css' +import 'prosemirror-menu/style/menu.css' export function createEditorView(element: HTMLElement, nodeViews: Record, plugins: Plugin[]) { const content = document.querySelector('#content') diff --git a/examples/lit/src/my-element.ts b/examples/lit/src/my-element.ts index 6799170..c36c150 100644 --- a/examples/lit/src/my-element.ts +++ b/examples/lit/src/my-element.ts @@ -1,7 +1,7 @@ +import { ShallowLitElement } from '@prosemirror-adapter/lit' import { html } from 'lit' import { customElement, state } from 'lit/decorators.js' import { keyed } from 'lit/directives/keyed.js' -import { ShallowLitElement } from '@prosemirror-adapter/lit' export * from './components/Editor' export { ProsemirrorAdapterProvider } from '@prosemirror-adapter/lit' diff --git a/examples/react/components/Editor.tsx b/examples/react/components/Editor.tsx index e25b7a7..5425acb 100644 --- a/examples/react/components/Editor.tsx +++ b/examples/react/components/Editor.tsx @@ -1,17 +1,17 @@ -import './Editor.css' +import type { EditorView } from 'prosemirror-view' +import type { FC } from 'react' import { useNodeViewFactory, usePluginViewFactory, useWidgetViewFactory } from '@prosemirror-adapter/react' -import type { EditorView } from 'prosemirror-view' +import { Plugin } from 'prosemirror-state' import { DecorationSet } from 'prosemirror-view' -import type { FC } from 'react' import { useCallback, useRef } from 'react' -import { Plugin } from 'prosemirror-state' import { createEditorView } from '../createEditorView' +import { Hashes } from './Hashes' import { Heading } from './Heading' import { Paragraph } from './Paragraph' import { Size } from './Size' -import { Hashes } from './Hashes' +import './Editor.css' export const Editor: FC = () => { const viewRef = useRef() diff --git a/examples/react/createEditorView.ts b/examples/react/createEditorView.ts index 1e5003b..99f973e 100644 --- a/examples/react/createEditorView.ts +++ b/examples/react/createEditorView.ts @@ -1,15 +1,15 @@ -import 'prosemirror-view/style/prosemirror.css' -import 'prosemirror-example-setup/style/style.css' -import 'prosemirror-menu/style/menu.css' - +import type { Plugin } from 'prosemirror-state' +import type { NodeViewConstructor } from 'prosemirror-view' import { exampleSetup } from 'prosemirror-example-setup' + import { keymap } from 'prosemirror-keymap' import { DOMParser } from 'prosemirror-model' import { schema } from 'prosemirror-schema-basic' -import type { Plugin } from 'prosemirror-state' import { EditorState } from 'prosemirror-state' -import type { NodeViewConstructor } from 'prosemirror-view' import { EditorView } from 'prosemirror-view' +import 'prosemirror-view/style/prosemirror.css' +import 'prosemirror-example-setup/style/style.css' +import 'prosemirror-menu/style/menu.css' export function createEditorView(element: HTMLElement, nodeViews: Record, plugins: Plugin[]) { const content = document.querySelector('#content') diff --git a/examples/solid/src/components/Editor.tsx b/examples/solid/src/components/Editor.tsx index 396673a..c89217c 100644 --- a/examples/solid/src/components/Editor.tsx +++ b/examples/solid/src/components/Editor.tsx @@ -1,14 +1,14 @@ -import { DecorationSet } from 'prosemirror-view' import { useNodeViewFactory, usePluginViewFactory, useWidgetViewFactory, } from '@prosemirror-adapter/solid' import { Plugin } from 'prosemirror-state' +import { DecorationSet } from 'prosemirror-view' import { createEditorView } from '../createEditorView' -import { Paragraph } from './Paragraph' import { Hashes } from './Hashes' import { Heading } from './Heading' +import { Paragraph } from './Paragraph' import { Size } from './Size' export function Editor() { diff --git a/examples/solid/src/createEditorView.ts b/examples/solid/src/createEditorView.ts index 1e5003b..99f973e 100644 --- a/examples/solid/src/createEditorView.ts +++ b/examples/solid/src/createEditorView.ts @@ -1,15 +1,15 @@ -import 'prosemirror-view/style/prosemirror.css' -import 'prosemirror-example-setup/style/style.css' -import 'prosemirror-menu/style/menu.css' - +import type { Plugin } from 'prosemirror-state' +import type { NodeViewConstructor } from 'prosemirror-view' import { exampleSetup } from 'prosemirror-example-setup' + import { keymap } from 'prosemirror-keymap' import { DOMParser } from 'prosemirror-model' import { schema } from 'prosemirror-schema-basic' -import type { Plugin } from 'prosemirror-state' import { EditorState } from 'prosemirror-state' -import type { NodeViewConstructor } from 'prosemirror-view' import { EditorView } from 'prosemirror-view' +import 'prosemirror-view/style/prosemirror.css' +import 'prosemirror-example-setup/style/style.css' +import 'prosemirror-menu/style/menu.css' export function createEditorView(element: HTMLElement, nodeViews: Record, plugins: Plugin[]) { const content = document.querySelector('#content') diff --git a/examples/solid/src/index.tsx b/examples/solid/src/index.tsx index af4fc4b..0b68e17 100644 --- a/examples/solid/src/index.tsx +++ b/examples/solid/src/index.tsx @@ -1,9 +1,9 @@ +import { ProsemirrorAdapterProvider } from '@prosemirror-adapter/solid' + /* @refresh reload */ import { render } from 'solid-js/web' - -import './index.css' -import { ProsemirrorAdapterProvider } from '@prosemirror-adapter/solid' import { Editor } from './components/Editor' +import './index.css' const root = document.getElementById('root') diff --git a/examples/svelte/src/libs/createEditorView.ts b/examples/svelte/src/libs/createEditorView.ts index 1e5003b..99f973e 100644 --- a/examples/svelte/src/libs/createEditorView.ts +++ b/examples/svelte/src/libs/createEditorView.ts @@ -1,15 +1,15 @@ -import 'prosemirror-view/style/prosemirror.css' -import 'prosemirror-example-setup/style/style.css' -import 'prosemirror-menu/style/menu.css' - +import type { Plugin } from 'prosemirror-state' +import type { NodeViewConstructor } from 'prosemirror-view' import { exampleSetup } from 'prosemirror-example-setup' + import { keymap } from 'prosemirror-keymap' import { DOMParser } from 'prosemirror-model' import { schema } from 'prosemirror-schema-basic' -import type { Plugin } from 'prosemirror-state' import { EditorState } from 'prosemirror-state' -import type { NodeViewConstructor } from 'prosemirror-view' import { EditorView } from 'prosemirror-view' +import 'prosemirror-view/style/prosemirror.css' +import 'prosemirror-example-setup/style/style.css' +import 'prosemirror-menu/style/menu.css' export function createEditorView(element: HTMLElement, nodeViews: Record, plugins: Plugin[]) { const content = document.querySelector('#content') diff --git a/examples/vue/createEditorView.ts b/examples/vue/createEditorView.ts index 1e5003b..99f973e 100644 --- a/examples/vue/createEditorView.ts +++ b/examples/vue/createEditorView.ts @@ -1,15 +1,15 @@ -import 'prosemirror-view/style/prosemirror.css' -import 'prosemirror-example-setup/style/style.css' -import 'prosemirror-menu/style/menu.css' - +import type { Plugin } from 'prosemirror-state' +import type { NodeViewConstructor } from 'prosemirror-view' import { exampleSetup } from 'prosemirror-example-setup' + import { keymap } from 'prosemirror-keymap' import { DOMParser } from 'prosemirror-model' import { schema } from 'prosemirror-schema-basic' -import type { Plugin } from 'prosemirror-state' import { EditorState } from 'prosemirror-state' -import type { NodeViewConstructor } from 'prosemirror-view' import { EditorView } from 'prosemirror-view' +import 'prosemirror-view/style/prosemirror.css' +import 'prosemirror-example-setup/style/style.css' +import 'prosemirror-menu/style/menu.css' export function createEditorView(element: HTMLElement, nodeViews: Record, plugins: Plugin[]) { const content = document.querySelector('#content') diff --git a/packages/lit/src/Provider.ts b/packages/lit/src/Provider.ts index c0505a6..c00abaa 100644 --- a/packages/lit/src/Provider.ts +++ b/packages/lit/src/Provider.ts @@ -1,6 +1,8 @@ import { ContextProvider } from '@lit-labs/context' import { customElement } from 'lit/decorators.js' import { useLitRenderer } from './LitRenderer' +import { markViewFactoryKey } from './markView' +import { useLitMarkViewCreator } from './markView/useLitMarkViewCreator' import { nodeViewFactoryKey } from './nodeView' import { useLitNodeViewCreator } from './nodeView/useLitNodeViewCreator' import { pluginViewFactoryKey } from './pluginView' @@ -8,8 +10,6 @@ import { useLitPluginViewCreator } from './pluginView/useLitPluginViewCreator' import { ShallowLitElement } from './utils/ShallowLitElement' import { widgetViewFactoryKey } from './widgetView' import { useLitWidgetViewCreator } from './widgetView/useLitWidgetViewCreator' -import { markViewFactoryKey } from './markView' -import { useLitMarkViewCreator } from './markView/useLitMarkViewCreator' @customElement('prosemirror-adapter-provider') export class ProsemirrorAdapterProvider extends ShallowLitElement { diff --git a/packages/lit/src/index.ts b/packages/lit/src/index.ts index e483983..5b9b1c2 100644 --- a/packages/lit/src/index.ts +++ b/packages/lit/src/index.ts @@ -1,6 +1,6 @@ -export * from './utils' -export * from './Provider' -export * from './nodeView' export * from './markView' +export * from './nodeView' export * from './pluginView' +export * from './Provider' +export * from './utils' export * from './widgetView' diff --git a/packages/lit/src/markView/LitMarkView.ts b/packages/lit/src/markView/LitMarkView.ts index f1d00a3..d8e57dd 100644 --- a/packages/lit/src/markView/LitMarkView.ts +++ b/packages/lit/src/markView/LitMarkView.ts @@ -1,14 +1,14 @@ import type { Context } from '@lit-labs/context' +import type { LitRenderer } from '../LitRenderer' +import type { LitMarkViewComponent } from './LitMarkViewOptions' +import type { MarkViewContext } from './markViewContext' import { ContextProvider } from '@lit-labs/context' + import { CoreMarkView } from '@prosemirror-adapter/core' import { customElement } from 'lit/decorators.js' import { nanoid } from 'nanoid' - -import type { LitRenderer } from '../LitRenderer' import { ShallowLitElement } from '../utils' import { markViewContextKey } from './markViewContext' -import type { MarkViewContext } from './markViewContext' -import type { LitMarkViewComponent } from './LitMarkViewOptions' declare global { interface HTMLElementTagNameMap { diff --git a/packages/lit/src/markView/index.ts b/packages/lit/src/markView/index.ts index 909774e..564af67 100644 --- a/packages/lit/src/markView/index.ts +++ b/packages/lit/src/markView/index.ts @@ -1,3 +1,3 @@ -export * from './markViewContext' export * from './LitMarkView' export * from './LitMarkViewOptions' +export * from './markViewContext' diff --git a/packages/lit/src/markView/markViewContext.ts b/packages/lit/src/markView/markViewContext.ts index e2ae6a2..617cf2d 100644 --- a/packages/lit/src/markView/markViewContext.ts +++ b/packages/lit/src/markView/markViewContext.ts @@ -1,9 +1,9 @@ -import { ContextConsumer, createContext } from '@lit-labs/context' import type { LitElement } from 'lit' import type { RefOrCallback } from 'lit/directives/ref.js' import type { Mark } from 'prosemirror-model' import type { EditorView, MarkViewConstructor } from 'prosemirror-view' import type { LitMarkViewUserOptions } from './LitMarkViewOptions' +import { ContextConsumer, createContext } from '@lit-labs/context' export interface MarkViewContext { // won't change diff --git a/packages/lit/src/nodeView/LitNodeView.ts b/packages/lit/src/nodeView/LitNodeView.ts index bc348d0..8a3838c 100644 --- a/packages/lit/src/nodeView/LitNodeView.ts +++ b/packages/lit/src/nodeView/LitNodeView.ts @@ -1,14 +1,14 @@ import type { Context } from '@lit-labs/context' +import type { LitRenderer } from '../LitRenderer' +import type { LitNodeViewComponent } from './LitNodeViewOptions' +import type { NodeViewContext } from './nodeViewContext' import { ContextProvider } from '@lit-labs/context' + import { CoreNodeView } from '@prosemirror-adapter/core' import { customElement } from 'lit/decorators.js' import { nanoid } from 'nanoid' - -import type { LitRenderer } from '../LitRenderer' import { ShallowLitElement } from '../utils' import { nodeViewContextKey } from './nodeViewContext' -import type { NodeViewContext } from './nodeViewContext' -import type { LitNodeViewComponent } from './LitNodeViewOptions' declare global { interface HTMLElementTagNameMap { diff --git a/packages/lit/src/nodeView/index.ts b/packages/lit/src/nodeView/index.ts index b0a559c..a9b10f0 100644 --- a/packages/lit/src/nodeView/index.ts +++ b/packages/lit/src/nodeView/index.ts @@ -1,3 +1,3 @@ -export * from './nodeViewContext' export * from './LitNodeView' export * from './LitNodeViewOptions' +export * from './nodeViewContext' diff --git a/packages/lit/src/nodeView/nodeViewContext.ts b/packages/lit/src/nodeView/nodeViewContext.ts index eb04021..05dba94 100644 --- a/packages/lit/src/nodeView/nodeViewContext.ts +++ b/packages/lit/src/nodeView/nodeViewContext.ts @@ -1,9 +1,9 @@ -import { ContextConsumer, createContext } from '@lit-labs/context' import type { LitElement } from 'lit' +import type { RefOrCallback } from 'lit/directives/ref.js' import type { Attrs, Node } from 'prosemirror-model' import type { Decoration, DecorationSource, EditorView, NodeViewConstructor } from 'prosemirror-view' -import type { RefOrCallback } from 'lit/directives/ref.js' import type { LitNodeViewUserOptions } from './LitNodeViewOptions' +import { ContextConsumer, createContext } from '@lit-labs/context' export interface NodeViewContext { // won't change diff --git a/packages/lit/src/pluginView/LitPluginView.ts b/packages/lit/src/pluginView/LitPluginView.ts index dcfa826..c3a3f37 100644 --- a/packages/lit/src/pluginView/LitPluginView.ts +++ b/packages/lit/src/pluginView/LitPluginView.ts @@ -1,13 +1,13 @@ import type { Context } from '@lit-labs/context' +import type { LitRenderer } from '../LitRenderer' +import type { LitPluginViewComponent } from './LitPluginViewOptions' +import type { PluginViewContext } from './pluginViewContext' import { ContextProvider } from '@lit-labs/context' import { CorePluginView } from '@prosemirror-adapter/core' import { customElement } from 'lit/decorators.js' import { nanoid } from 'nanoid' -import type { LitRenderer } from '../LitRenderer' import { ShallowLitElement } from '../utils' -import type { LitPluginViewComponent } from './LitPluginViewOptions' import { pluginViewContextKey } from './pluginViewContext' -import type { PluginViewContext } from './pluginViewContext' declare global { interface HTMLElementTagNameMap { diff --git a/packages/lit/src/pluginView/index.ts b/packages/lit/src/pluginView/index.ts index fdd2688..08e1539 100644 --- a/packages/lit/src/pluginView/index.ts +++ b/packages/lit/src/pluginView/index.ts @@ -1,3 +1,3 @@ -export * from './pluginViewContext' export * from './LitPluginView' export * from './LitPluginViewOptions' +export * from './pluginViewContext' diff --git a/packages/lit/src/pluginView/pluginViewContext.ts b/packages/lit/src/pluginView/pluginViewContext.ts index da09363..0b2a6c2 100644 --- a/packages/lit/src/pluginView/pluginViewContext.ts +++ b/packages/lit/src/pluginView/pluginViewContext.ts @@ -2,8 +2,8 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' import type { LitElement } from 'lit' import type { EditorState } from 'prosemirror-state' import type { EditorView } from 'prosemirror-view' -import { ContextConsumer, createContext } from '@lit-labs/context' import type { LitPluginViewUserOptions } from './LitPluginViewOptions' +import { ContextConsumer, createContext } from '@lit-labs/context' export interface PluginViewContext { view: EditorView diff --git a/packages/lit/src/widgetView/LitWidgetView.ts b/packages/lit/src/widgetView/LitWidgetView.ts index cdba2a5..a2712ed 100644 --- a/packages/lit/src/widgetView/LitWidgetView.ts +++ b/packages/lit/src/widgetView/LitWidgetView.ts @@ -1,13 +1,13 @@ import type { Context } from '@lit-labs/context' +import type { LitRenderer } from '../LitRenderer' +import type { LitWidgetViewComponent } from './LitWidgetViewOptions' +import type { WidgetViewContext } from './widgetViewContext' import { ContextProvider } from '@lit-labs/context' import { CoreWidgetView } from '@prosemirror-adapter/core' import { customElement } from 'lit/decorators.js' import { nanoid } from 'nanoid' -import type { LitRenderer } from '../LitRenderer' import { ShallowLitElement } from '../utils' -import type { LitWidgetViewComponent } from './LitWidgetViewOptions' import { widgetViewContextKey } from './widgetViewContext' -import type { WidgetViewContext } from './widgetViewContext' declare global { interface HTMLElementTagNameMap { diff --git a/packages/lit/src/widgetView/useLitWidgetViewCreator.ts b/packages/lit/src/widgetView/useLitWidgetViewCreator.ts index 3579ee9..9b3c530 100644 --- a/packages/lit/src/widgetView/useLitWidgetViewCreator.ts +++ b/packages/lit/src/widgetView/useLitWidgetViewCreator.ts @@ -1,8 +1,8 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' -import { Decoration } from 'prosemirror-view' import type { LitRendererResult } from '../LitRenderer' -import { LitWidgetView } from './LitWidgetView' import type { LitWidgetViewUserOptions } from './LitWidgetViewOptions' +import { Decoration } from 'prosemirror-view' +import { LitWidgetView } from './LitWidgetView' export function useLitWidgetViewCreator(renderLitRenderer: LitRendererResult['renderLitRenderer'], removeLitRenderer: LitRendererResult['removeLitRenderer']) { const createWidgetPluginView = (options: LitWidgetViewUserOptions): WidgetDecorationFactory => { diff --git a/packages/lit/src/widgetView/widgetViewContext.ts b/packages/lit/src/widgetView/widgetViewContext.ts index 7a92c01..9b320a9 100644 --- a/packages/lit/src/widgetView/widgetViewContext.ts +++ b/packages/lit/src/widgetView/widgetViewContext.ts @@ -1,8 +1,8 @@ -import { ContextConsumer, createContext } from '@lit-labs/context' import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' import type { LitElement } from 'lit' import type { EditorView } from 'prosemirror-view' import type { LitWidgetViewUserOptions } from './LitWidgetViewOptions' +import { ContextConsumer, createContext } from '@lit-labs/context' export interface WidgetViewContext { view: EditorView diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index a00f2c2..c20f9ae 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,5 +1,5 @@ -export * from './Provider' export * from './markView' export * from './nodeView' export * from './pluginView' +export * from './Provider' export * from './widgetView' diff --git a/packages/react/src/markView/ReactMarkView.tsx b/packages/react/src/markView/ReactMarkView.tsx index e38bcf7..3b14cc0 100644 --- a/packages/react/src/markView/ReactMarkView.tsx +++ b/packages/react/src/markView/ReactMarkView.tsx @@ -1,12 +1,12 @@ +import type { ReactRenderer } from '../ReactRenderer' +import type { MarkViewContext } from './markViewContext' +import type { ReactMarkViewComponent } from './ReactMarkViewOptions' import { CoreMarkView } from '@prosemirror-adapter/core' + import { nanoid } from 'nanoid' import React from 'react' import { createPortal } from 'react-dom' - -import type { ReactRenderer } from '../ReactRenderer' -import type { MarkViewContext } from './markViewContext' import { markViewContext } from './markViewContext' -import type { ReactMarkViewComponent } from './ReactMarkViewOptions' export class ReactMarkView extends CoreMarkView diff --git a/packages/react/src/markView/markViewContext.ts b/packages/react/src/markView/markViewContext.ts index 5595b69..8f113c0 100644 --- a/packages/react/src/markView/markViewContext.ts +++ b/packages/react/src/markView/markViewContext.ts @@ -1,7 +1,7 @@ import type { Mark } from 'prosemirror-model' import type { EditorView, MarkViewConstructor } from 'prosemirror-view' -import { createContext, useContext } from 'react' import type { ReactMarkViewUserOptions } from './ReactMarkViewOptions' +import { createContext, useContext } from 'react' export type MarkViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/react/src/markView/useReactMarkViewCreator.ts b/packages/react/src/markView/useReactMarkViewCreator.ts index 526cecd..b8f9c11 100644 --- a/packages/react/src/markView/useReactMarkViewCreator.ts +++ b/packages/react/src/markView/useReactMarkViewCreator.ts @@ -1,8 +1,8 @@ import type { MarkViewConstructor } from 'prosemirror-view' -import { useCallback } from 'react' import type { ReactRendererResult } from '../ReactRenderer' -import { ReactMarkView } from './ReactMarkView' import type { ReactMarkViewUserOptions } from './ReactMarkViewOptions' +import { useCallback } from 'react' +import { ReactMarkView } from './ReactMarkView' export function useReactMarkViewCreator( renderReactRenderer: ReactRendererResult['renderReactRenderer'], diff --git a/packages/react/src/nodeView/ReactNodeView.tsx b/packages/react/src/nodeView/ReactNodeView.tsx index 9194d30..2ee15f9 100644 --- a/packages/react/src/nodeView/ReactNodeView.tsx +++ b/packages/react/src/nodeView/ReactNodeView.tsx @@ -1,12 +1,12 @@ +import type { ReactRenderer } from '../ReactRenderer' +import type { NodeViewContext } from './nodeViewContext' +import type { ReactNodeViewComponent } from './ReactNodeViewOptions' import { CoreNodeView } from '@prosemirror-adapter/core' + import { nanoid } from 'nanoid' import React from 'react' import { createPortal } from 'react-dom' - -import type { ReactRenderer } from '../ReactRenderer' -import type { NodeViewContext } from './nodeViewContext' import { nodeViewContext } from './nodeViewContext' -import type { ReactNodeViewComponent } from './ReactNodeViewOptions' export class ReactNodeView extends CoreNodeView implements ReactRenderer { key: string = nanoid() diff --git a/packages/react/src/nodeView/nodeViewContext.ts b/packages/react/src/nodeView/nodeViewContext.ts index 2eb5a23..474e9fd 100644 --- a/packages/react/src/nodeView/nodeViewContext.ts +++ b/packages/react/src/nodeView/nodeViewContext.ts @@ -1,7 +1,7 @@ import type { Attrs, Node } from 'prosemirror-model' import type { Decoration, DecorationSource, EditorView, NodeViewConstructor } from 'prosemirror-view' -import { createContext, useContext } from 'react' import type { ReactNodeViewUserOptions } from './ReactNodeViewOptions' +import { createContext, useContext } from 'react' export type NodeViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/react/src/nodeView/useReactNodeViewCreator.ts b/packages/react/src/nodeView/useReactNodeViewCreator.ts index c40c26d..2c8a47f 100644 --- a/packages/react/src/nodeView/useReactNodeViewCreator.ts +++ b/packages/react/src/nodeView/useReactNodeViewCreator.ts @@ -1,8 +1,8 @@ import type { NodeViewConstructor } from 'prosemirror-view' -import { useCallback } from 'react' import type { ReactRendererResult } from '../ReactRenderer' -import { ReactNodeView } from './ReactNodeView' import type { ReactNodeViewUserOptions } from './ReactNodeViewOptions' +import { useCallback } from 'react' +import { ReactNodeView } from './ReactNodeView' export function useReactNodeViewCreator(renderReactRenderer: ReactRendererResult['renderReactRenderer'], removeReactRenderer: ReactRendererResult['removeReactRenderer']) { const createReactNodeView = useCallback( diff --git a/packages/react/src/pluginView/ReactPluginView.tsx b/packages/react/src/pluginView/ReactPluginView.tsx index 746fe71..37972f3 100644 --- a/packages/react/src/pluginView/ReactPluginView.tsx +++ b/packages/react/src/pluginView/ReactPluginView.tsx @@ -1,11 +1,11 @@ +import type { ReactRenderer } from '../ReactRenderer' +import type { PluginViewContext } from './pluginViewContext' +import type { ReactPluginViewComponent } from './ReactPluginViewOptions' import { CorePluginView } from '@prosemirror-adapter/core' -import React from 'react' import { nanoid } from 'nanoid' +import React from 'react' import { createPortal } from 'react-dom' -import type { ReactRenderer } from '../ReactRenderer' -import type { PluginViewContext } from './pluginViewContext' import { pluginViewContext } from './pluginViewContext' -import type { ReactPluginViewComponent } from './ReactPluginViewOptions' export class ReactPluginView extends CorePluginView implements ReactRenderer { key: string = nanoid() diff --git a/packages/react/src/pluginView/pluginViewContext.ts b/packages/react/src/pluginView/pluginViewContext.ts index f05d2b1..2580fe4 100644 --- a/packages/react/src/pluginView/pluginViewContext.ts +++ b/packages/react/src/pluginView/pluginViewContext.ts @@ -1,8 +1,8 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' import type { EditorState } from 'prosemirror-state' import type { EditorView } from 'prosemirror-view' -import { createContext, useContext } from 'react' import type { ReactPluginViewUserOptions } from './ReactPluginViewOptions' +import { createContext, useContext } from 'react' export type PluginViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/react/src/pluginView/useReactPluginViewCreator.ts b/packages/react/src/pluginView/useReactPluginViewCreator.ts index 4903798..2bc252d 100644 --- a/packages/react/src/pluginView/useReactPluginViewCreator.ts +++ b/packages/react/src/pluginView/useReactPluginViewCreator.ts @@ -1,8 +1,8 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' -import { useCallback } from 'react' import type { ReactRendererResult } from '../ReactRenderer' -import { ReactPluginView } from './ReactPluginView' import type { ReactPluginViewUserOptions } from './ReactPluginViewOptions' +import { useCallback } from 'react' +import { ReactPluginView } from './ReactPluginView' export function useReactPluginViewCreator(renderReactRenderer: ReactRendererResult['renderReactRenderer'], removeReactRenderer: ReactRendererResult['removeReactRenderer']) { const createReactPluginView = useCallback((options: ReactPluginViewUserOptions): PluginViewSpec => { diff --git a/packages/react/src/widgetView/ReactWidgetView.tsx b/packages/react/src/widgetView/ReactWidgetView.tsx index f995aa9..91e21fc 100644 --- a/packages/react/src/widgetView/ReactWidgetView.tsx +++ b/packages/react/src/widgetView/ReactWidgetView.tsx @@ -1,10 +1,10 @@ +import type { ReactRenderer } from '../ReactRenderer' +import type { ReactWidgetViewComponent } from './ReactWidgetViewOptions' +import type { WidgetViewContext } from './widgetViewContext' import { CoreWidgetView } from '@prosemirror-adapter/core' import { nanoid } from 'nanoid' import React from 'react' import { createPortal } from 'react-dom' -import type { ReactRenderer } from '../ReactRenderer' -import type { ReactWidgetViewComponent } from './ReactWidgetViewOptions' -import type { WidgetViewContext } from './widgetViewContext' import { widgetViewContext } from './widgetViewContext' export class ReactWidgetView extends CoreWidgetView implements ReactRenderer { diff --git a/packages/react/src/widgetView/index.ts b/packages/react/src/widgetView/index.ts index 1240078..5e41db4 100644 --- a/packages/react/src/widgetView/index.ts +++ b/packages/react/src/widgetView/index.ts @@ -1,3 +1,3 @@ -export * from './widgetViewContext' export * from './ReactWidgetView' export * from './ReactWidgetViewOptions' +export * from './widgetViewContext' diff --git a/packages/react/src/widgetView/useReactWidgetViewCreator.ts b/packages/react/src/widgetView/useReactWidgetViewCreator.ts index dbc1fca..7dcbf55 100644 --- a/packages/react/src/widgetView/useReactWidgetViewCreator.ts +++ b/packages/react/src/widgetView/useReactWidgetViewCreator.ts @@ -1,9 +1,9 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' +import type { ReactRendererResult } from '../ReactRenderer' +import type { ReactWidgetViewUserOptions } from './ReactWidgetViewOptions' import { Decoration } from 'prosemirror-view' import { useCallback } from 'react' -import type { ReactRendererResult } from '../ReactRenderer' import { ReactWidgetView } from './ReactWidgetView' -import type { ReactWidgetViewUserOptions } from './ReactWidgetViewOptions' export function useReactWidgetViewCreator(renderReactRenderer: ReactRendererResult['renderReactRenderer'], removeReactRenderer: ReactRendererResult['removeReactRenderer']) { const createWidgetPluginView = useCallback((options: ReactWidgetViewUserOptions): WidgetDecorationFactory => { diff --git a/packages/react/src/widgetView/widgetViewContext.ts b/packages/react/src/widgetView/widgetViewContext.ts index cc042d7..aa84203 100644 --- a/packages/react/src/widgetView/widgetViewContext.ts +++ b/packages/react/src/widgetView/widgetViewContext.ts @@ -1,7 +1,7 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' import type { EditorView } from 'prosemirror-view' -import { createContext, useContext } from 'react' import type { ReactWidgetViewUserOptions } from './ReactWidgetViewOptions' +import { createContext, useContext } from 'react' export interface WidgetViewContext { view: EditorView diff --git a/packages/solid/src/Provider.tsx b/packages/solid/src/Provider.tsx index 4a150c2..83a01c9 100644 --- a/packages/solid/src/Provider.tsx +++ b/packages/solid/src/Provider.tsx @@ -1,5 +1,6 @@ import { type Component, For, type ParentProps } from 'solid-js' import { createMarkViewContext } from './markView' +import { useSolidMarkViewCreator } from './markView/useSolidMarkViewCreator' import { createNodeViewContext } from './nodeView' import { useSolidNodeViewCreator } from './nodeView/useSolidNodeViewCreator' import { createPluginViewContext } from './pluginView' @@ -7,7 +8,6 @@ import { useSolidPluginViewCreator } from './pluginView/useSolidPluginViewCreato import { useSolidRenderer } from './SolidRenderer' import { createWidgetViewContext } from './widgetView' import { useSolidWidgetViewCreator } from './widgetView/useSolidWidgetViewCreator' -import { useSolidMarkViewCreator } from './markView/useSolidMarkViewCreator' export const ProsemirrorAdapterProvider: Component = (props) => { const { renderSolidRenderer, removeSolidRenderer, portals } diff --git a/packages/solid/src/index.ts b/packages/solid/src/index.ts index c4abf85..c20f9ae 100644 --- a/packages/solid/src/index.ts +++ b/packages/solid/src/index.ts @@ -1,5 +1,5 @@ -export * from './Provider' -export * from './nodeView' export * from './markView' +export * from './nodeView' export * from './pluginView' +export * from './Provider' export * from './widgetView' diff --git a/packages/solid/src/markView/SolidMarkView.tsx b/packages/solid/src/markView/SolidMarkView.tsx index 317b383..2b22c05 100644 --- a/packages/solid/src/markView/SolidMarkView.tsx +++ b/packages/solid/src/markView/SolidMarkView.tsx @@ -1,14 +1,14 @@ +import type { Setter } from 'solid-js' +import type { SolidRenderer } from '../SolidRenderer' +import type { MarkViewContext, MarkViewContextProps } from './markViewContext' + +import type { SolidMarkViewComponent } from './SolidMarkViewOptions' import { CoreMarkView, type CoreMarkViewSpec } from '@prosemirror-adapter/core' import { nanoid } from 'nanoid' -import { Dynamic, Portal } from 'solid-js/web' - -import type { Setter } from 'solid-js' import { createSignal } from 'solid-js' -import type { SolidRenderer } from '../SolidRenderer' +import { Dynamic, Portal } from 'solid-js/web' import { hidePortalDiv } from '../utils/hidePortalDiv' -import type { MarkViewContext, MarkViewContextProps } from './markViewContext' import { markViewContext } from './markViewContext' -import type { SolidMarkViewComponent } from './SolidMarkViewOptions' export class SolidMarkView extends CoreMarkView diff --git a/packages/solid/src/markView/markViewContext.ts b/packages/solid/src/markView/markViewContext.ts index 5cbf429..059b0b0 100644 --- a/packages/solid/src/markView/markViewContext.ts +++ b/packages/solid/src/markView/markViewContext.ts @@ -1,7 +1,7 @@ import type { Mark } from 'prosemirror-model' import type { EditorView, MarkViewConstructor } from 'prosemirror-view' -import { type Accessor, createContext, useContext } from 'solid-js' import type { SolidMarkViewUserOptions } from './SolidMarkViewOptions' +import { type Accessor, createContext, useContext } from 'solid-js' export type MarkViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/solid/src/markView/useSolidMarkViewCreator.ts b/packages/solid/src/markView/useSolidMarkViewCreator.ts index 5390c6b..7ac53aa 100644 --- a/packages/solid/src/markView/useSolidMarkViewCreator.ts +++ b/packages/solid/src/markView/useSolidMarkViewCreator.ts @@ -1,7 +1,7 @@ import type { MarkViewConstructor } from 'prosemirror-view' import type { SolidRendererResult } from '../SolidRenderer' -import { SolidMarkView } from './SolidMarkView' import type { SolidMarkViewUserOptions } from './SolidMarkViewOptions' +import { SolidMarkView } from './SolidMarkView' export function useSolidMarkViewCreator( renderSolidRenderer: SolidRendererResult['renderSolidRenderer'], diff --git a/packages/solid/src/nodeView/SolidNodeView.tsx b/packages/solid/src/nodeView/SolidNodeView.tsx index e06a5d0..ae49d64 100644 --- a/packages/solid/src/nodeView/SolidNodeView.tsx +++ b/packages/solid/src/nodeView/SolidNodeView.tsx @@ -1,14 +1,14 @@ +import type { Setter } from 'solid-js' +import type { SolidRenderer } from '../SolidRenderer' +import type { NodeViewContext, NodeViewContextProps } from './nodeViewContext' + +import type { SolidNodeViewComponent } from './SolidNodeViewOptions' import { CoreNodeView, type CoreNodeViewSpec } from '@prosemirror-adapter/core' import { nanoid } from 'nanoid' -import { Dynamic, Portal } from 'solid-js/web' - -import type { Setter } from 'solid-js' import { createSignal } from 'solid-js' -import type { SolidRenderer } from '../SolidRenderer' +import { Dynamic, Portal } from 'solid-js/web' import { hidePortalDiv } from '../utils/hidePortalDiv' -import type { NodeViewContext, NodeViewContextProps } from './nodeViewContext' import { nodeViewContext } from './nodeViewContext' -import type { SolidNodeViewComponent } from './SolidNodeViewOptions' export class SolidNodeView extends CoreNodeView diff --git a/packages/solid/src/nodeView/nodeViewContext.ts b/packages/solid/src/nodeView/nodeViewContext.ts index 9540d21..1dd2bef 100644 --- a/packages/solid/src/nodeView/nodeViewContext.ts +++ b/packages/solid/src/nodeView/nodeViewContext.ts @@ -1,4 +1,3 @@ -import { type Accessor, createContext, useContext } from 'solid-js' import type { Attrs, Node } from 'prosemirror-model' import type { Decoration, @@ -7,6 +6,7 @@ import type { NodeViewConstructor, } from 'prosemirror-view' import type { SolidNodeViewUserOptions } from './SolidNodeViewOptions' +import { type Accessor, createContext, useContext } from 'solid-js' export type NodeViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/solid/src/nodeView/useSolidNodeViewCreator.ts b/packages/solid/src/nodeView/useSolidNodeViewCreator.ts index 16dbb35..277852e 100644 --- a/packages/solid/src/nodeView/useSolidNodeViewCreator.ts +++ b/packages/solid/src/nodeView/useSolidNodeViewCreator.ts @@ -1,7 +1,7 @@ import type { NodeViewConstructor } from 'prosemirror-view' import type { SolidRendererResult } from '../SolidRenderer' -import { SolidNodeView } from './SolidNodeView' import type { SolidNodeViewUserOptions } from './SolidNodeViewOptions' +import { SolidNodeView } from './SolidNodeView' export function useSolidNodeViewCreator( renderSolidRenderer: SolidRendererResult['renderSolidRenderer'], diff --git a/packages/solid/src/pluginView/SolidPluginView.tsx b/packages/solid/src/pluginView/SolidPluginView.tsx index 4153a2f..553bcb3 100644 --- a/packages/solid/src/pluginView/SolidPluginView.tsx +++ b/packages/solid/src/pluginView/SolidPluginView.tsx @@ -1,19 +1,19 @@ import type { CorePluginViewSpec } from '@prosemirror-adapter/core' -import { CorePluginView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' import type { JSX, Setter } from 'solid-js' -import { createSignal } from 'solid-js' - -import { Dynamic, Portal } from 'solid-js/web' import type { SolidRenderer } from '../SolidRenderer' -import { hidePortalDiv } from '../utils/hidePortalDiv' import type { PluginViewContext, PluginViewContextProps, } from './pluginViewContext' -import { pluginViewContext } from './pluginViewContext' import type { SolidPluginViewComponent } from './SolidPluginViewOptions' +import { CorePluginView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { createSignal } from 'solid-js' +import { Dynamic, Portal } from 'solid-js/web' +import { hidePortalDiv } from '../utils/hidePortalDiv' +import { pluginViewContext } from './pluginViewContext' + export class SolidPluginView extends CorePluginView implements SolidRenderer { diff --git a/packages/solid/src/pluginView/pluginViewContext.ts b/packages/solid/src/pluginView/pluginViewContext.ts index 7011eb7..70f34cf 100644 --- a/packages/solid/src/pluginView/pluginViewContext.ts +++ b/packages/solid/src/pluginView/pluginViewContext.ts @@ -1,8 +1,8 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' import type { EditorState } from 'prosemirror-state' import type { EditorView } from 'prosemirror-view' -import { type Accessor, createContext, useContext } from 'solid-js' import type { SolidPluginViewUserOptions } from './SolidPluginViewOptions' +import { type Accessor, createContext, useContext } from 'solid-js' export type PluginViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/solid/src/pluginView/useSolidPluginViewCreator.ts b/packages/solid/src/pluginView/useSolidPluginViewCreator.ts index ec4f211..9405d72 100644 --- a/packages/solid/src/pluginView/useSolidPluginViewCreator.ts +++ b/packages/solid/src/pluginView/useSolidPluginViewCreator.ts @@ -1,7 +1,7 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' import type { SolidRendererResult } from '../SolidRenderer' -import { SolidPluginView } from './SolidPluginView' import type { SolidPluginViewUserOptions } from './SolidPluginViewOptions' +import { SolidPluginView } from './SolidPluginView' export function useSolidPluginViewCreator( renderSolidRenderer: SolidRendererResult['renderSolidRenderer'], diff --git a/packages/solid/src/widgetView/SolidWidgetView.tsx b/packages/solid/src/widgetView/SolidWidgetView.tsx index 53bafc0..e0afaa4 100644 --- a/packages/solid/src/widgetView/SolidWidgetView.tsx +++ b/packages/solid/src/widgetView/SolidWidgetView.tsx @@ -1,16 +1,16 @@ import type { CoreWidgetViewSpec } from '@prosemirror-adapter/core' -import { CoreWidgetView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' -import { Dynamic, Portal } from 'solid-js/web' import type { JSX, Setter } from 'solid-js' -import { createSignal } from 'solid-js' import type { SolidRenderer } from '../SolidRenderer' -import { hidePortalDiv } from '../utils/hidePortalDiv' import type { SolidWidgetViewComponent } from './SolidWidgetViewOptions' import type { WidgetViewContext, WidgetViewContextProps, } from './widgetViewContext' +import { CoreWidgetView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { createSignal } from 'solid-js' +import { Dynamic, Portal } from 'solid-js/web' +import { hidePortalDiv } from '../utils/hidePortalDiv' import { widgetViewContext } from './widgetViewContext' export class SolidWidgetView diff --git a/packages/solid/src/widgetView/useSolidWidgetViewCreator.ts b/packages/solid/src/widgetView/useSolidWidgetViewCreator.ts index 473e940..7d0d38f 100644 --- a/packages/solid/src/widgetView/useSolidWidgetViewCreator.ts +++ b/packages/solid/src/widgetView/useSolidWidgetViewCreator.ts @@ -2,10 +2,10 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec, } from '@prosemirror-adapter/core' -import { Decoration } from 'prosemirror-view' import type { SolidRendererResult } from '../SolidRenderer' -import { SolidWidgetView } from './SolidWidgetView' import type { SolidWidgetViewUserOptions } from './SolidWidgetViewOptions' +import { Decoration } from 'prosemirror-view' +import { SolidWidgetView } from './SolidWidgetView' export function useSolidWidgetViewCreator( renderSolidRenderer: SolidRendererResult['renderSolidRenderer'], diff --git a/packages/solid/src/widgetView/widgetViewContext.ts b/packages/solid/src/widgetView/widgetViewContext.ts index 2bbbe5f..5ff3dc3 100644 --- a/packages/solid/src/widgetView/widgetViewContext.ts +++ b/packages/solid/src/widgetView/widgetViewContext.ts @@ -3,8 +3,8 @@ import type { WidgetDecorationSpec, } from '@prosemirror-adapter/core' import type { EditorView } from 'prosemirror-view' -import { type Accessor, createContext, useContext } from 'solid-js' import type { SolidWidgetViewUserOptions } from './SolidWidgetViewOptions' +import { type Accessor, createContext, useContext } from 'solid-js' export interface WidgetViewContextProps { view: EditorView diff --git a/packages/svelte/src/Provider.ts b/packages/svelte/src/Provider.ts index 7018959..f9225cc 100644 --- a/packages/svelte/src/Provider.ts +++ b/packages/svelte/src/Provider.ts @@ -1,4 +1,6 @@ import { setContext } from 'svelte' +import { markViewFactoryKey } from './markView' +import { useSvelteMarkViewCreator } from './markView/useSvelteMarkViewCreator' import { nodeViewFactoryKey } from './nodeView' import { useSvelteNodeViewCreator } from './nodeView/useSvelteNodeViewCreator' import { pluginViewFactoryKey } from './pluginView' @@ -6,8 +8,6 @@ import { useSveltePluginViewCreator } from './pluginView/useSveltePluginViewCrea import { useSvelteRenderer } from './SvelteRenderer' import { widgetViewFactoryKey } from './widgetView' import { useSvelteWidgetViewCreator } from './widgetView/useSvelteWidgetViewCreator' -import { markViewFactoryKey } from './markView' -import { useSvelteMarkViewCreator } from './markView/useSvelteMarkViewCreator' export function useProsemirrorAdapterProvider() { const { diff --git a/packages/svelte/src/index.ts b/packages/svelte/src/index.ts index c4abf85..c20f9ae 100644 --- a/packages/svelte/src/index.ts +++ b/packages/svelte/src/index.ts @@ -1,5 +1,5 @@ -export * from './Provider' -export * from './nodeView' export * from './markView' +export * from './nodeView' export * from './pluginView' +export * from './Provider' export * from './widgetView' diff --git a/packages/svelte/src/markView/SvelteMarkView.ts b/packages/svelte/src/markView/SvelteMarkView.ts index a75d3f5..156ea1a 100644 --- a/packages/svelte/src/markView/SvelteMarkView.ts +++ b/packages/svelte/src/markView/SvelteMarkView.ts @@ -1,13 +1,13 @@ -import { CoreMarkView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' import type { Writable } from 'svelte/store' -import { writable } from 'svelte/store' - import type { SvelteRenderer } from '../SvelteRenderer' -import { mount } from '../mount' import type { MarkViewContext, MarkViewContextMap } from './markViewContext' import type { SvelteMarkViewComponent } from './SvelteMarkViewOptions' +import { CoreMarkView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { writable } from 'svelte/store' +import { mount } from '../mount' + export class SvelteMarkView extends CoreMarkView implements SvelteRenderer { key: string = nanoid() diff --git a/packages/svelte/src/markView/markViewContext.ts b/packages/svelte/src/markView/markViewContext.ts index 2921640..6462e07 100644 --- a/packages/svelte/src/markView/markViewContext.ts +++ b/packages/svelte/src/markView/markViewContext.ts @@ -1,9 +1,9 @@ import type { Mark } from 'prosemirror-model' import type { EditorView, MarkViewConstructor } from 'prosemirror-view' -import { getContext } from 'svelte' import type { Writable } from 'svelte/store' import type { Obj2Map } from '../types' import type { SvelteMarkViewUserOptions } from './SvelteMarkViewOptions' +import { getContext } from 'svelte' export interface MarkViewContext { // won't change diff --git a/packages/svelte/src/mount.ts b/packages/svelte/src/mount.ts index 3995afa..d667110 100644 --- a/packages/svelte/src/mount.ts +++ b/packages/svelte/src/mount.ts @@ -1,8 +1,8 @@ -import * as svelte from 'svelte' import type { SvelteClassComponentConstructor, SvelteComponentConstructor, } from './types' +import * as svelte from 'svelte' const isSvelte5 = !!svelte.mount && !!svelte.flushSync diff --git a/packages/svelte/src/nodeView/SvelteNodeView.ts b/packages/svelte/src/nodeView/SvelteNodeView.ts index 1a68faa..4394fb1 100644 --- a/packages/svelte/src/nodeView/SvelteNodeView.ts +++ b/packages/svelte/src/nodeView/SvelteNodeView.ts @@ -1,13 +1,13 @@ -import { CoreNodeView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' import type { Writable } from 'svelte/store' -import { writable } from 'svelte/store' - import type { SvelteRenderer } from '../SvelteRenderer' -import { mount } from '../mount' import type { NodeViewContext, NodeViewContextMap } from './nodeViewContext' import type { SvelteNodeViewComponent } from './SvelteNodeViewOptions' +import { CoreNodeView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { writable } from 'svelte/store' +import { mount } from '../mount' + export class SvelteNodeView extends CoreNodeView implements SvelteRenderer { key: string = nanoid() diff --git a/packages/svelte/src/nodeView/nodeViewContext.ts b/packages/svelte/src/nodeView/nodeViewContext.ts index 24345dc..2a9c5ca 100644 --- a/packages/svelte/src/nodeView/nodeViewContext.ts +++ b/packages/svelte/src/nodeView/nodeViewContext.ts @@ -1,9 +1,9 @@ import type { Attrs, Node } from 'prosemirror-model' import type { Decoration, DecorationSource, EditorView, NodeViewConstructor } from 'prosemirror-view' -import { getContext } from 'svelte' import type { Writable } from 'svelte/store' import type { Obj2Map } from '../types' import type { SvelteNodeViewUserOptions } from './SvelteNodeViewOptions' +import { getContext } from 'svelte' export interface NodeViewContext { // won't change diff --git a/packages/svelte/src/pluginView/SveltePluginView.ts b/packages/svelte/src/pluginView/SveltePluginView.ts index 1516f92..c72e17a 100644 --- a/packages/svelte/src/pluginView/SveltePluginView.ts +++ b/packages/svelte/src/pluginView/SveltePluginView.ts @@ -1,11 +1,11 @@ -import { CorePluginView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' import type { Writable } from 'svelte/store' -import { writable } from 'svelte/store' import type { SvelteRenderer } from '../SvelteRenderer' -import { mount } from '../mount' import type { PluginViewContext, PluginViewContextMap } from './pluginViewContext' import type { SveltePluginViewComponent } from './SveltePluginViewOptions' +import { CorePluginView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { writable } from 'svelte/store' +import { mount } from '../mount' export class SveltePluginView extends CorePluginView implements SvelteRenderer { key: string = nanoid() diff --git a/packages/svelte/src/pluginView/pluginViewContext.ts b/packages/svelte/src/pluginView/pluginViewContext.ts index 8ab1aac..f36443f 100644 --- a/packages/svelte/src/pluginView/pluginViewContext.ts +++ b/packages/svelte/src/pluginView/pluginViewContext.ts @@ -1,10 +1,10 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' import type { EditorState } from 'prosemirror-state' import type { EditorView } from 'prosemirror-view' -import { getContext } from 'svelte' import type { Writable } from 'svelte/store' import type { Obj2Map } from '../types' import type { SveltePluginViewUserOptions } from './SveltePluginViewOptions' +import { getContext } from 'svelte' export type PluginViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/svelte/src/widgetView/SvelteWidgetView.ts b/packages/svelte/src/widgetView/SvelteWidgetView.ts index 04e84b1..6a5c0b5 100644 --- a/packages/svelte/src/widgetView/SvelteWidgetView.ts +++ b/packages/svelte/src/widgetView/SvelteWidgetView.ts @@ -1,9 +1,9 @@ -import { CoreWidgetView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' import type { SvelteRenderer } from '../SvelteRenderer' -import { mount } from '../mount' import type { SvelteWidgetViewComponent } from './SvelteWidgetViewOptions' import type { WidgetViewContext, WidgetViewContextMap } from './widgetViewContext' +import { CoreWidgetView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { mount } from '../mount' export class SvelteWidgetView extends CoreWidgetView implements SvelteRenderer { key: string = nanoid() diff --git a/packages/svelte/src/widgetView/useSvelteWidgetViewCreator.ts b/packages/svelte/src/widgetView/useSvelteWidgetViewCreator.ts index 5400752..c111510 100644 --- a/packages/svelte/src/widgetView/useSvelteWidgetViewCreator.ts +++ b/packages/svelte/src/widgetView/useSvelteWidgetViewCreator.ts @@ -1,8 +1,8 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' -import { Decoration } from 'prosemirror-view' import type { SvelteRendererResult } from '../SvelteRenderer' -import { SvelteWidgetView } from './SvelteWidgetView' import type { SvelteWidgetViewUserOptions } from './SvelteWidgetViewOptions' +import { Decoration } from 'prosemirror-view' +import { SvelteWidgetView } from './SvelteWidgetView' export function useSvelteWidgetViewCreator(renderSvelteRenderer: SvelteRendererResult['renderSvelteRenderer'], removeSvelteRenderer: SvelteRendererResult['removeSvelteRenderer']) { const createWidgetPluginView = (options: SvelteWidgetViewUserOptions): WidgetDecorationFactory => { diff --git a/packages/svelte/src/widgetView/widgetViewContext.ts b/packages/svelte/src/widgetView/widgetViewContext.ts index 25f22aa..433f5d9 100644 --- a/packages/svelte/src/widgetView/widgetViewContext.ts +++ b/packages/svelte/src/widgetView/widgetViewContext.ts @@ -1,8 +1,8 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' import type { EditorView } from 'prosemirror-view' -import { getContext } from 'svelte' import type { Obj2Map } from '../types' import type { SvelteWidgetViewUserOptions } from './SvelteWidgetViewOptions' +import { getContext } from 'svelte' export interface WidgetViewContext { view: EditorView diff --git a/packages/vue/src/Provider.tsx b/packages/vue/src/Provider.tsx index 84c0bcd..312f3c3 100644 --- a/packages/vue/src/Provider.tsx +++ b/packages/vue/src/Provider.tsx @@ -3,16 +3,16 @@ import { h, provide, } from 'vue' +import { markViewFactoryKey } from './markView' +import { useVueMarkViewCreator } from './markView/useVueMarkViewCreator' import { nodeViewFactoryKey } from './nodeView' import { useVueNodeViewCreator } from './nodeView/useVueNodeViewCreator' + import { pluginViewFactoryKey } from './pluginView' import { useVuePluginViewCreator } from './pluginView/useVuePluginViewCreator' - import { useVueRenderer } from './VueRenderer' import { useVueWidgetViewCreator } from './widgetView/useVueWidgetViewCreator' import { widgetViewFactoryKey } from './widgetView/widgetViewContext' -import { useVueMarkViewCreator } from './markView/useVueMarkViewCreator' -import { markViewFactoryKey } from './markView' export type CreateVueNodeView = ReturnType export type CreateVueMarkView = ReturnType diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts index c4abf85..c20f9ae 100644 --- a/packages/vue/src/index.ts +++ b/packages/vue/src/index.ts @@ -1,5 +1,5 @@ -export * from './Provider' -export * from './nodeView' export * from './markView' +export * from './nodeView' export * from './pluginView' +export * from './Provider' export * from './widgetView' diff --git a/packages/vue/src/markView/VueMarkView.tsx b/packages/vue/src/markView/VueMarkView.tsx index c5a4cd0..67a5c0a 100644 --- a/packages/vue/src/markView/VueMarkView.tsx +++ b/packages/vue/src/markView/VueMarkView.tsx @@ -1,12 +1,12 @@ -import { CoreMarkView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' -import { Teleport, defineComponent, markRaw, provide, shallowRef } from 'vue' - import type { VueRenderer, VueRendererComponent } from '../VueRenderer' import type { MarkViewContext } from './markViewContext' -import { markViewContext } from './markViewContext' import type { VueMarkViewComponent } from './VueMarkViewOptions' +import { CoreMarkView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { defineComponent, markRaw, provide, shallowRef, Teleport } from 'vue' +import { markViewContext } from './markViewContext' + export class VueMarkView extends CoreMarkView implements VueRenderer { diff --git a/packages/vue/src/markView/markViewContext.ts b/packages/vue/src/markView/markViewContext.ts index 37dd9da..d1c13d5 100644 --- a/packages/vue/src/markView/markViewContext.ts +++ b/packages/vue/src/markView/markViewContext.ts @@ -1,8 +1,8 @@ import type { Mark } from 'prosemirror-model' import type { EditorView, MarkViewConstructor } from 'prosemirror-view' import type { InjectionKey, ShallowRef, VNodeRef } from 'vue' -import { inject } from 'vue' import type { VueMarkViewUserOptions } from './VueMarkViewOptions' +import { inject } from 'vue' export interface MarkViewContext { // won't change diff --git a/packages/vue/src/nodeView/VueNodeView.tsx b/packages/vue/src/nodeView/VueNodeView.tsx index 9bd6044..9d410a0 100644 --- a/packages/vue/src/nodeView/VueNodeView.tsx +++ b/packages/vue/src/nodeView/VueNodeView.tsx @@ -1,12 +1,12 @@ -import { CoreNodeView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' -import { Teleport, defineComponent, markRaw, provide, shallowRef } from 'vue' - import type { VueRenderer, VueRendererComponent } from '../VueRenderer' import type { NodeViewContext } from './nodeViewContext' -import { nodeViewContext } from './nodeViewContext' import type { VueNodeViewComponent } from './VueNodeViewOptions' +import { CoreNodeView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { defineComponent, markRaw, provide, shallowRef, Teleport } from 'vue' +import { nodeViewContext } from './nodeViewContext' + export class VueNodeView extends CoreNodeView implements VueRenderer { key: string = nanoid() diff --git a/packages/vue/src/nodeView/nodeViewContext.ts b/packages/vue/src/nodeView/nodeViewContext.ts index c39b58e..1336185 100644 --- a/packages/vue/src/nodeView/nodeViewContext.ts +++ b/packages/vue/src/nodeView/nodeViewContext.ts @@ -1,8 +1,8 @@ import type { Attrs, Node } from 'prosemirror-model' import type { Decoration, DecorationSource, EditorView, NodeViewConstructor } from 'prosemirror-view' import type { InjectionKey, ShallowRef, VNodeRef } from 'vue' -import { inject } from 'vue' import type { VueNodeViewUserOptions } from './VueNodeViewOptions' +import { inject } from 'vue' export interface NodeViewContext { // won't change diff --git a/packages/vue/src/pluginView/VuePluginView.tsx b/packages/vue/src/pluginView/VuePluginView.tsx index 71e461a..242900e 100644 --- a/packages/vue/src/pluginView/VuePluginView.tsx +++ b/packages/vue/src/pluginView/VuePluginView.tsx @@ -1,10 +1,10 @@ -import { CorePluginView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' -import { Teleport, defineComponent, markRaw, provide, shallowRef } from 'vue' import type { VueRenderer, VueRendererComponent } from '../VueRenderer' import type { PluginViewContext } from './pluginViewContext' -import { pluginViewContext } from './pluginViewContext' import type { VuePluginViewComponent } from './VuePluginViewOptions' +import { CorePluginView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { defineComponent, markRaw, provide, shallowRef, Teleport } from 'vue' +import { pluginViewContext } from './pluginViewContext' export class VuePluginView extends CorePluginView implements VueRenderer { key: string = nanoid() diff --git a/packages/vue/src/pluginView/pluginViewContext.ts b/packages/vue/src/pluginView/pluginViewContext.ts index 04f0b9e..13c78af 100644 --- a/packages/vue/src/pluginView/pluginViewContext.ts +++ b/packages/vue/src/pluginView/pluginViewContext.ts @@ -2,8 +2,8 @@ import type { PluginViewSpec } from '@prosemirror-adapter/core' import type { EditorState } from 'prosemirror-state' import type { EditorView } from 'prosemirror-view' import type { InjectionKey, ShallowRef } from 'vue' -import { inject } from 'vue' import type { VuePluginViewUserOptions } from './VuePluginViewOptions' +import { inject } from 'vue' export type PluginViewContentRef = (element: HTMLElement | null) => void diff --git a/packages/vue/src/widgetView/VueWidgetView.tsx b/packages/vue/src/widgetView/VueWidgetView.tsx index 6a3825b..9c33456 100644 --- a/packages/vue/src/widgetView/VueWidgetView.tsx +++ b/packages/vue/src/widgetView/VueWidgetView.tsx @@ -1,9 +1,9 @@ -import { CoreWidgetView } from '@prosemirror-adapter/core' -import { nanoid } from 'nanoid' -import { Teleport, defineComponent, markRaw, provide } from 'vue' import type { VueRenderer, VueRendererComponent } from '../VueRenderer' import type { VueWidgetViewComponent } from './VueWidgetViewOptions' import type { WidgetViewContext } from './widgetViewContext' +import { CoreWidgetView } from '@prosemirror-adapter/core' +import { nanoid } from 'nanoid' +import { defineComponent, markRaw, provide, Teleport } from 'vue' import { widgetViewContext } from './widgetViewContext' export class VueWidgetView extends CoreWidgetView implements VueRenderer { diff --git a/packages/vue/src/widgetView/useVueWidgetViewCreator.ts b/packages/vue/src/widgetView/useVueWidgetViewCreator.ts index f9b666a..a3efbd2 100644 --- a/packages/vue/src/widgetView/useVueWidgetViewCreator.ts +++ b/packages/vue/src/widgetView/useVueWidgetViewCreator.ts @@ -1,8 +1,8 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' -import { Decoration } from 'prosemirror-view' import type { VueRendererResult } from '../VueRenderer' -import { VueWidgetView } from './VueWidgetView' import type { VueWidgetViewUserOptions } from './VueWidgetViewOptions' +import { Decoration } from 'prosemirror-view' +import { VueWidgetView } from './VueWidgetView' export function useVueWidgetViewCreator(renderVueRenderer: VueRendererResult['renderVueRenderer'], removeVueRenderer: VueRendererResult['removeVueRenderer']) { const createWidgetPluginView = (options: VueWidgetViewUserOptions): WidgetDecorationFactory => { diff --git a/packages/vue/src/widgetView/widgetViewContext.ts b/packages/vue/src/widgetView/widgetViewContext.ts index f574c9e..18fab5a 100644 --- a/packages/vue/src/widgetView/widgetViewContext.ts +++ b/packages/vue/src/widgetView/widgetViewContext.ts @@ -1,8 +1,8 @@ import type { WidgetDecorationFactory, WidgetDecorationSpec } from '@prosemirror-adapter/core' import type { EditorView } from 'prosemirror-view' import type { InjectionKey } from 'vue' -import { inject } from 'vue' import type { VueWidgetViewUserOptions } from './VueWidgetViewOptions' +import { inject } from 'vue' export interface WidgetViewContext { view: EditorView