@remirror/extension-react-ssr
Advanced tools
Comparing version 0.0.0-pr2223.1 to 0.0.0-pr2271.1
@@ -1,58 +0,1 @@ | ||
import { ComponentType, PropsWithChildren } from 'react'; | ||
import { AnyExtension, EditorState } from '@remirror/core'; | ||
import { NodeViewComponentProps } from '@remirror/extension-react-component'; | ||
type SsrTransformer = (element: JSX.Element, state?: EditorState) => JSX.Element; | ||
interface ManagerStoreReactComponent { | ||
Component: ComponentType<PropsWithChildren<NodeViewComponentProps>>; | ||
props: Omit<NodeViewComponentProps, 'node' | 'view'>; | ||
} | ||
declare global { | ||
namespace Remirror { | ||
interface ExcludeOptions { | ||
/** | ||
* Whether to use the SSR component when not in a DOM environment | ||
* | ||
* @defaultValue undefined | ||
*/ | ||
reactSSR?: boolean; | ||
} | ||
interface ManagerStore<Extension extends AnyExtension> { | ||
/** | ||
* The transformer for updating the SSR rendering of the prosemirror state | ||
* and allowing it to render without defects. | ||
*/ | ||
ssrTransformer: SsrTransformer; | ||
/** | ||
* Components for ssr transformations. | ||
*/ | ||
components: Record<string, ManagerStoreReactComponent>; | ||
} | ||
interface BaseExtension { | ||
/** | ||
* A method for transforming the original JSX element received by the | ||
* extension. This is typically for usage in server side rendered | ||
* environment. | ||
* | ||
* @remarks | ||
* | ||
* Some extensions add decorations to the ProsemirrorView based on their | ||
* state. These decorations can touch any node or mark and it would be | ||
* very difficult to model this without transforming the complete produced | ||
* JSX element. | ||
* | ||
* An example is that all empty paragraphs in prosemirror automatically | ||
* have a `<br />` tag injected into them during runtime. The | ||
* ReactSSRSerializer which transform the `toDOM` method output for | ||
* paragraph tags `[p, 0]` into JSX `<p />` has no way of knowing about | ||
* this. That is where this creator method can help. We can transform the | ||
* automatically generated JSX and inject `<br />` tags for the initial | ||
* server render. That way there is no jump or layout adjustment when the | ||
* document first loads on the browser. | ||
*/ | ||
createSSRTransformer?(): SsrTransformer; | ||
} | ||
} | ||
} | ||
export type { ManagerStoreReactComponent, SsrTransformer }; | ||
export {}; |
{ | ||
"name": "@remirror/extension-react-ssr", | ||
"version": "0.0.0-pr2223.1", | ||
"version": "0.0.0-pr2271.1", | ||
"description": "If server side support is important to you, then this is perfect for your remirror editor in react.", | ||
@@ -42,10 +42,11 @@ "keywords": [ | ||
"@babel/runtime": "^7.22.3", | ||
"@remirror/core": "0.0.0-pr2223.1", | ||
"@remirror/extension-react-component": "0.0.0-pr2223.1", | ||
"@remirror/messages": "0.0.0-pr2223.1", | ||
"@remirror/react-utils": "0.0.0-pr2223.1" | ||
"@remirror/core": "0.0.0-pr2271.1", | ||
"@remirror/extension-react-component": "0.0.0-pr2271.1", | ||
"@remirror/messages": "0.0.0-pr2271.1", | ||
"@remirror/react-utils": "0.0.0-pr2271.1" | ||
}, | ||
"devDependencies": { | ||
"@remirror/pm": "0.0.0-pr2223.1", | ||
"@remirror/react": "0.0.0-pr2223.1", | ||
"@remirror/cli": "0.0.0-pr2271.1", | ||
"@remirror/pm": "0.0.0-pr2271.1", | ||
"@remirror/react": "0.0.0-pr2271.1", | ||
"@types/react": "^18.2.0", | ||
@@ -55,3 +56,3 @@ "react": "^18.2.0" | ||
"peerDependencies": { | ||
"@remirror/pm": "0.0.0-pr2223.1", | ||
"@remirror/pm": "0.0.0-pr2271.1", | ||
"@types/react": "^16.14.0 || ^17 || ^18", | ||
@@ -69,4 +70,7 @@ "react": "^16.14.0 || ^17 || ^18" | ||
"@remirror": { | ||
"sizeLimit": "5 KB" | ||
"sizeLimit": "10 KB" | ||
}, | ||
"scripts": { | ||
"build": "remirror-cli build" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13
152
65046
5
+ Added@remirror/core@0.0.0-pr2271.1(transitive)
+ Added@remirror/core-constants@0.0.0-pr2271.1(transitive)
+ Added@remirror/core-helpers@0.0.0-pr2271.1(transitive)
+ Added@remirror/core-types@0.0.0-pr2271.1(transitive)
+ Added@remirror/core-utils@0.0.0-pr2271.1(transitive)
+ Added@remirror/extension-react-component@0.0.0-pr2271.1(transitive)
+ Added@remirror/icons@0.0.0-pr2271.1(transitive)
+ Added@remirror/messages@0.0.0-pr2271.1(transitive)
+ Added@remirror/pm@0.0.0-pr2271.1(transitive)
+ Added@remirror/react-utils@0.0.0-pr2271.1(transitive)
+ Added@remirror/types@0.0.0-pr2271.1(transitive)
+ Addedprosemirror-paste-rules@0.0.0-pr2271.1(transitive)
+ Addedprosemirror-suggest@0.0.0-pr2271.1(transitive)
+ Addedprosemirror-trailing-node@0.0.0-pr2271.1(transitive)
- Removed@lingui/core@4.14.1(transitive)
- Removed@lingui/detect-locale@4.14.1(transitive)
- Removed@lingui/message-utils@4.14.1(transitive)
- Removed@messageformat/parser@5.1.1(transitive)
- Removed@remirror/core@0.0.0-pr2223.1(transitive)
- Removed@remirror/core-constants@0.0.0-pr2223.1(transitive)
- Removed@remirror/core-helpers@0.0.0-pr2223.1(transitive)
- Removed@remirror/core-types@0.0.0-pr2223.1(transitive)
- Removed@remirror/core-utils@0.0.0-pr2223.1(transitive)
- Removed@remirror/extension-react-component@0.0.0-pr2223.1(transitive)
- Removed@remirror/i18n@0.0.0-pr2223.1(transitive)
- Removed@remirror/icons@0.0.0-pr2223.1(transitive)
- Removed@remirror/messages@0.0.0-pr2223.1(transitive)
- Removed@remirror/pm@0.0.0-pr2223.1(transitive)
- Removed@remirror/react-utils@0.0.0-pr2223.1(transitive)
- Removed@remirror/types@0.0.0-pr2223.1(transitive)
- Removedjs-sha256@0.10.1(transitive)
- Removedmake-plural@6.2.2(transitive)
- Removedmoo@0.5.2(transitive)
- Removedprosemirror-paste-rules@0.0.0-pr2223.1(transitive)
- Removedprosemirror-suggest@0.0.0-pr2223.1(transitive)
- Removedprosemirror-trailing-node@0.0.0-pr2223.1(transitive)
- Removedunraw@3.0.0(transitive)