@handlewithcare/react-prosemirror 3.1.6 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ import React, { ReactNode } from "react";
2
+ interface RegistrarProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function EditorStateSelectorsRegistrar({ children }: RegistrarProps): React.JSX.Element;
6
+ interface ProviderProps {
7
+ children: JSX.Element | null;
8
+ }
9
+ export declare function EditorStateSelectorsProvider({ children }: ProviderProps): JSX.Element | null;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import { EditorState } from "prosemirror-state";
2
+ export interface EditorStateStore {
3
+ getState: () => EditorState;
4
+ subscribe: (listener: () => void) => () => void;
5
+ setState: (state: EditorState) => void;
6
+ notifyListeners: () => void;
7
+ }
8
+ export declare function createEditorStateStore(): EditorStateStore;
9
+ export declare const EditorStateStoreContext: import("react").Context<EditorStateStore>;
@@ -0,0 +1,10 @@
1
+ import { EditorState } from "prosemirror-state";
2
+ /**
3
+ * Select a piece of the EditorState, a la Redux’s
4
+ * `useSelector`.
5
+ *
6
+ * This hook will only trigger a re-render of the
7
+ * consuming component if the return value of the selector
8
+ * changes.
9
+ */
10
+ export declare function useEditorStateSelector<Result>(selector: (state: EditorState) => Result): Result;
@@ -7,6 +7,7 @@ export { useEditorEventCallback } from "./hooks/useEditorEventCallback.js";
7
7
  export { useEditorEventListener } from "./hooks/useEditorEventListener.js";
8
8
  export { useEditorState } from "./hooks/useEditorState.js";
9
9
  export { useNodePos } from "./hooks/useNodePos.js";
10
+ export { useEditorStateSelector } from "./hooks/useEditorStateSelector.js";
10
11
  export { useStopEvent } from "./hooks/useStopEvent.js";
11
12
  export { useSelectNode } from "./hooks/useSelectNode.js";
12
13
  export { useIgnoreMutation } from "./hooks/useIgnoreMutation.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handlewithcare/react-prosemirror",
3
- "version": "3.1.6",
3
+ "version": "3.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "CompositionContext", {
6
- enumerable: true,
7
- get: function() {
8
- return CompositionContext;
9
- }
10
- });
11
- const _react = require("react");
12
- const CompositionContext = (0, _react.createContext)({
13
- freezeFrom: null
14
- });
@@ -1,4 +0,0 @@
1
- import { createContext } from "react";
2
- export const CompositionContext = createContext({
3
- freezeFrom: null
4
- });
@@ -1,4 +0,0 @@
1
- export interface CompositionContextValue {
2
- freezeFrom: number | null;
3
- }
4
- export declare const CompositionContext: import("react").Context<CompositionContextValue>;