@remirror/extension-react-ssr
Advanced tools
Comparing version 0.0.0-pr2169.2 to 0.0.0-pr2222.1
@@ -1,2 +0,58 @@ | ||
export { ManagerStoreReactComponent } from './_tsup-dts-rollup'; | ||
export { SsrTransformer } from './_tsup-dts-rollup'; | ||
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 }; |
{ | ||
"name": "@remirror/extension-react-ssr", | ||
"version": "0.0.0-pr2169.2", | ||
"version": "0.0.0-pr2222.1", | ||
"description": "If server side support is important to you, then this is perfect for your remirror editor in react.", | ||
@@ -42,11 +42,10 @@ "keywords": [ | ||
"@babel/runtime": "^7.22.3", | ||
"@remirror/core": "0.0.0-pr2169.2", | ||
"@remirror/extension-react-component": "0.0.0-pr2169.2", | ||
"@remirror/messages": "0.0.0-pr2169.2", | ||
"@remirror/react-utils": "0.0.0-pr2169.2" | ||
"@remirror/core": "0.0.0-pr2222.1", | ||
"@remirror/extension-react-component": "0.0.0-pr2222.1", | ||
"@remirror/messages": "0.0.0-pr2222.1", | ||
"@remirror/react-utils": "0.0.0-pr2222.1" | ||
}, | ||
"devDependencies": { | ||
"@remirror/cli": "0.0.0-pr2169.2", | ||
"@remirror/pm": "0.0.0-pr2169.2", | ||
"@remirror/react": "0.0.0-pr2169.2", | ||
"@remirror/pm": "0.0.0-pr2222.1", | ||
"@remirror/react": "0.0.0-pr2222.1", | ||
"@types/react": "^18.2.0", | ||
@@ -56,3 +55,3 @@ "react": "^18.2.0" | ||
"peerDependencies": { | ||
"@remirror/pm": "0.0.0-pr2169.2", | ||
"@remirror/pm": "0.0.0-pr2222.1", | ||
"@types/react": "^16.14.0 || ^17 || ^18", | ||
@@ -70,7 +69,4 @@ "react": "^16.14.0 || ^17 || ^18" | ||
"@remirror": { | ||
"sizeLimit": "10 KB" | ||
}, | ||
"scripts": { | ||
"build": "remirror-cli build" | ||
"sizeLimit": "5 KB" | ||
} | ||
} |
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
70569
4
11
146
+ Added@lingui/core@4.14.1(transitive)
+ Added@lingui/detect-locale@4.14.1(transitive)
+ Added@lingui/message-utils@4.14.1(transitive)
+ Added@messageformat/parser@5.1.1(transitive)
+ Added@remirror/core@0.0.0-pr2222.1(transitive)
+ Added@remirror/core-constants@0.0.0-pr2222.1(transitive)
+ Added@remirror/core-helpers@0.0.0-pr2222.1(transitive)
+ Added@remirror/core-types@0.0.0-pr2222.1(transitive)
+ Added@remirror/core-utils@0.0.0-pr2222.1(transitive)
+ Added@remirror/extension-react-component@0.0.0-pr2222.1(transitive)
+ Added@remirror/i18n@0.0.0-pr2222.1(transitive)
+ Added@remirror/icons@0.0.0-pr2222.1(transitive)
+ Added@remirror/messages@0.0.0-pr2222.1(transitive)
+ Added@remirror/pm@0.0.0-pr2222.1(transitive)
+ Added@remirror/react-utils@0.0.0-pr2222.1(transitive)
+ Added@remirror/types@0.0.0-pr2222.1(transitive)
+ Addedjs-sha256@0.10.1(transitive)
+ Addedmake-plural@6.2.2(transitive)
+ Addedmoo@0.5.2(transitive)
+ Addedprosemirror-paste-rules@0.0.0-pr2222.1(transitive)
+ Addedprosemirror-suggest@0.0.0-pr2222.1(transitive)
+ Addedprosemirror-trailing-node@0.0.0-pr2222.1(transitive)
+ Addedunraw@3.0.0(transitive)
- Removed@remirror/core@0.0.0-pr2169.2(transitive)
- Removed@remirror/core-constants@0.0.0-pr2169.2(transitive)
- Removed@remirror/core-helpers@0.0.0-pr2169.2(transitive)
- Removed@remirror/core-types@0.0.0-pr2169.2(transitive)
- Removed@remirror/core-utils@0.0.0-pr2169.2(transitive)
- Removed@remirror/extension-react-component@0.0.0-pr2169.2(transitive)
- Removed@remirror/icons@0.0.0-pr2169.2(transitive)
- Removed@remirror/messages@0.0.0-pr2169.2(transitive)
- Removed@remirror/pm@0.0.0-pr2169.2(transitive)
- Removed@remirror/react-utils@0.0.0-pr2169.2(transitive)
- Removed@remirror/types@0.0.0-pr2169.2(transitive)
- Removedprosemirror-paste-rules@0.0.0-pr2169.2(transitive)
- Removedprosemirror-suggest@0.0.0-pr2169.2(transitive)
- Removedprosemirror-trailing-node@0.0.0-pr2169.2(transitive)