@remirror/react-utils
Advanced tools
Comparing version 1.0.0-next.60 to 1.0.0-pr706
@@ -1,2 +0,1 @@ | ||
export type { RemirrorComponentStaticProperties, RemirrorComponentType, RemirrorElement, } from './react-utils'; | ||
export { RemirrorType, addKeyToElement, asDefaultProps, getElementProps, isReactDOMElement, isReactFragment, isRemirrorElement, isRemirrorProvider, isValidElement, oneChildOnly, propIsFunction, } from './react-utils'; | ||
export { addKeyToElement, getElementProps, isReactDOMElement, isReactFragment, isValidElement, propIsFunction, } from './react-utils'; |
@@ -1,33 +0,4 @@ | ||
import { ComponentType, Fragment, ReactElement, ReactNode } from 'react'; | ||
import { Fragment, ReactElement, ReactNode } from 'react'; | ||
import type { AnyFunction, UnknownShape } from '@remirror/core-types'; | ||
export interface RemirrorComponentStaticProperties { | ||
/** | ||
* Identifies this as a remirror specific component | ||
*/ | ||
$$remirrorType: RemirrorType; | ||
} | ||
export declare type RemirrorComponentType<Props extends object = object> = ComponentType<Props> & RemirrorComponentStaticProperties; | ||
export declare type RemirrorElement<Options extends object = any> = ReactElement & { | ||
type: RemirrorComponentType<Options>; | ||
}; | ||
/** | ||
* These are the constants used to determine whether an element is a remirror constant. | ||
*/ | ||
export declare enum RemirrorType { | ||
SSR = "ssr", | ||
Editor = "editor", | ||
/** | ||
* The `RemirrorProvider` component. | ||
*/ | ||
Provider = "provider", | ||
/** | ||
* Marks the provider for i18n. | ||
*/ | ||
I18nProvider = "i18n-provider", | ||
/** | ||
* Marks this as a provider for the remirror theme. | ||
*/ | ||
ThemeProvider = "theme-provider" | ||
} | ||
/** | ||
* A drop in replacement for built in React.isValidElement which accepts a test value of any type | ||
@@ -63,24 +34,2 @@ * | ||
/** | ||
* Utility for properly typechecking static defaultProps for a class component in react. | ||
* | ||
* ```ts | ||
* static defaultProps = asDefaultProps<RemirrorProps>()({ | ||
* initialContent: EMPTY_PARAGRAPH_NODE, | ||
* }); | ||
* ``` | ||
*/ | ||
export declare const asDefaultProps: <Props extends object>() => <DefaultProps extends Partial<Props>>(props: DefaultProps) => DefaultProps; | ||
/** | ||
* Checks if this element has a type of any RemirrorComponent | ||
* | ||
* @param value - the value to check | ||
*/ | ||
export declare const isRemirrorElement: <Options extends object = any>(value: unknown) => value is RemirrorElement<Options>; | ||
/** | ||
* Finds if this is a RemirrorProvider (which provides the RemirrorInjectedProps into the context); | ||
* | ||
* @param value - the value to check | ||
*/ | ||
export declare const isRemirrorProvider: <Options extends object = any>(value: unknown) => value is RemirrorElement<Options>; | ||
/** | ||
* Will throw an error if the child provided is not a function. | ||
@@ -96,7 +45,2 @@ * | ||
/** | ||
* A drop in replacement for React.Children.only which provides more readable errors | ||
* when the child is not a react element or undefined. | ||
*/ | ||
export declare function oneChildOnly<Props extends object = any>(value: unknown): ReactElement<Props>; | ||
/** | ||
* Add the specified key to an element when it is a valid react element. | ||
@@ -103,0 +47,0 @@ * |
{ | ||
"name": "@remirror/react-utils", | ||
"version": "1.0.0-next.60", | ||
"version": "1.0.0-pr706", | ||
"description": "A small set of utilities for react components in remirror.", | ||
@@ -11,4 +11,4 @@ "keywords": [ | ||
], | ||
"homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/@remirror/react-utils", | ||
"repository": "https://github.com/remirror/remirror/tree/HEAD/packages/@remirror/react-utils", | ||
"homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/remirror__react-utils", | ||
"repository": "https://github.com/remirror/remirror/tree/HEAD/packages/remirror__react-utils", | ||
"license": "MIT", | ||
@@ -19,9 +19,20 @@ "contributors": [ | ||
"sideEffects": false, | ||
"main": "dist/react-utils.cjs.js", | ||
"module": "dist/react-utils.esm.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/remirror-react-utils.esm.js", | ||
"require": "./dist/remirror-react-utils.cjs.js", | ||
"browser": "./dist/remirror-react-utils.browser.esm.js", | ||
"types": "./dist/remirror-react-utils.cjs.d.ts", | ||
"default": "./dist/remirror-react-utils.esm.js" | ||
}, | ||
"./package.json": "./package.json", | ||
"./types/*": "./dist/declarations/src/*.d.ts" | ||
}, | ||
"main": "dist/remirror-react-utils.cjs.js", | ||
"module": "dist/remirror-react-utils.esm.js", | ||
"browser": { | ||
"./dist/react-utils.cjs.js": "./dist/react-utils.browser.cjs.js", | ||
"./dist/react-utils.esm.js": "./dist/react-utils.browser.esm.js" | ||
"./dist/remirror-react-utils.cjs.js": "./dist/remirror-react-utils.browser.cjs.js", | ||
"./dist/remirror-react-utils.esm.js": "./dist/remirror-react-utils.browser.esm.js" | ||
}, | ||
"types": "dist/react-utils.cjs.d.ts", | ||
"types": "dist/remirror-react-utils.cjs.d.ts", | ||
"files": [ | ||
@@ -31,21 +42,27 @@ "dist" | ||
"dependencies": { | ||
"@babel/runtime": "^7.12.0", | ||
"@remirror/core-constants": "1.0.0-next.60", | ||
"@remirror/core-helpers": "1.0.0-next.60", | ||
"@remirror/core-types": "1.0.0-next.60" | ||
"@babel/runtime": "^7.12.13", | ||
"@remirror/core-constants": "1.0.0-pr706", | ||
"@remirror/core-helpers": "1.0.0-pr706", | ||
"@remirror/core-types": "1.0.0-pr706" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^16.9.53", | ||
"@types/react": "^17.0.1", | ||
"react": "^17.0.1" | ||
}, | ||
"peerDependencies": { | ||
"@types/react": "^16.8.0", | ||
"react": "^16.8.0 || ^17" | ||
"@types/react": "^16.14.0 || ^17", | ||
"react": "^16.14.0 || ^17" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@types/react": { | ||
"optional": true | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"meta": { | ||
"@remirror": { | ||
"sizeLimit": "5 KB" | ||
} | ||
}, | ||
"rn:dev": "src/index.ts" | ||
} |
@@ -10,4 +10,4 @@ # @remirror/react-utils | ||
[license]: https://flat.badgen.net/badge/license/MIT/purple | ||
[size]: https://bundlephobia.com/result?p=@remirror/react-utils@next | ||
[size-badge]: https://flat.badgen.net/bundlephobia/minzip/@remirror/react-utils@next | ||
[size]: https://bundlephobia.com/result?p=@remirror/react-utils | ||
[size-badge]: https://flat.badgen.net/bundlephobia/minzip/@remirror/react-utils | ||
[typescript]: https://flat.badgen.net/badge/icon/TypeScript?icon=typescript&label | ||
@@ -26,4 +26,4 @@ [downloads-badge]: https://badgen.net/npm/dw/@remirror/react-utils/red?icon=npm | ||
This is included by default when you install the recommended `remirror` package. All exports are also available via the entry-point, `remirror/react/utils`. | ||
This is included by default when you install the recommended `remirror` package. All exports are also available via the entry-point, `remirror/react`. | ||
<br /> |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
35757
1
29920
404
1
1
+ Added@linaria/core@3.0.0-beta.22(transitive)
+ Added@linaria/logger@3.0.0-beta.20(transitive)
+ Added@linaria/utils@3.0.0-beta.20(transitive)
+ Added@remirror/core-constants@1.0.0-pr706(transitive)
+ Added@remirror/core-helpers@1.0.0-pr706(transitive)
+ Added@remirror/core-types@1.0.0-pr706(transitive)
+ Added@remirror/pm@1.0.0-pr706(transitive)
+ Added@types/react@17.0.83(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedprosemirror-paste-rules@0.0.0-pr706(transitive)
+ Addedprosemirror-suggest@1.0.0-pr706(transitive)
+ Addedprosemirror-trailing-node@0.0.0-pr706(transitive)
+ Addedtype-fest@0.20.2(transitive)
- Removed@linaria/core@3.0.0-beta.13(transitive)
- Removed@remirror/core-constants@1.0.0-next.601.0.2(transitive)
- Removed@remirror/core-helpers@1.0.0-next.601.0.6(transitive)
- Removed@remirror/core-types@1.0.0-next.60(transitive)
- Removed@remirror/pm@1.0.0-next.60(transitive)
- Removed@remirror/types@0.1.1(transitive)
- Removed@types/react@16.14.62(transitive)
- Removedprosemirror-suggest@1.1.4(transitive)
- Removedtype-fest@0.18.11.4.0(transitive)
Updated@babel/runtime@^7.12.13