@remirror/core-helpers
Advanced tools
Comparing version 0.0.0-pr1242.4 to 0.0.0-pr1305.1
@@ -0,0 +0,0 @@ import { BaseError } from 'make-error'; |
@@ -0,0 +0,0 @@ import type { ClassName } from '@linaria/core/types/cx'; |
@@ -0,0 +0,0 @@ /** |
export * from './core-errors'; | ||
export * from './core-helpers'; | ||
export * from './freeze'; |
@@ -624,3 +624,3 @@ 'use strict'; | ||
function omitUndefined(object) { | ||
return omit__default['default'](object, value => !isUndefined(value)); | ||
return omit__default["default"](object, value => !isUndefined(value)); | ||
} | ||
@@ -656,3 +656,3 @@ /** | ||
var isEqual = fastDeepEqual__default['default']; | ||
var isEqual = fastDeepEqual__default["default"]; | ||
/** | ||
@@ -725,3 +725,3 @@ * Create a unique array in a non-mutating manner | ||
return deepmerge__default['default'].all(objects, { | ||
return deepmerge__default["default"].all(objects, { | ||
isMergeableObject: isPlainObject | ||
@@ -1027,41 +1027,36 @@ }); | ||
var ERROR_INFORMATION_URL = 'https://remirror.io/docs/errors'; | ||
var errorMessageMap = {}; // This will be removed in a production environment. | ||
if (process.env.NODE_ENV !== 'production') { | ||
errorMessageMap = { | ||
[coreConstants.ErrorConstant.PROD]: 'An error occurred with the `Remirror` setup in production. Any details are purposefully being withheld.', | ||
[coreConstants.ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[coreConstants.ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[coreConstants.ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[coreConstants.ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[coreConstants.ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[coreConstants.ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[coreConstants.ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[coreConstants.ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[coreConstants.ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[coreConstants.ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[coreConstants.ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[coreConstants.ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[coreConstants.ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[coreConstants.ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[coreConstants.ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[coreConstants.ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[coreConstants.ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[coreConstants.ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[coreConstants.ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[coreConstants.ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirror` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[coreConstants.ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[coreConstants.ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[coreConstants.ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[coreConstants.ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[coreConstants.ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[coreConstants.ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[coreConstants.ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[coreConstants.ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
} | ||
var errorMessageMap = { | ||
[coreConstants.ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[coreConstants.ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[coreConstants.ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[coreConstants.ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[coreConstants.ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[coreConstants.ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[coreConstants.ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[coreConstants.ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[coreConstants.ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[coreConstants.ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[coreConstants.ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[coreConstants.ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[coreConstants.ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[coreConstants.ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[coreConstants.ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[coreConstants.ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[coreConstants.ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[coreConstants.ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[coreConstants.ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[coreConstants.ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[coreConstants.ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[coreConstants.ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[coreConstants.ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[coreConstants.ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[coreConstants.ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[coreConstants.ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[coreConstants.ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[coreConstants.ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
/** | ||
@@ -1071,3 +1066,2 @@ * Checks whether the passed code is an `ErrorConstant`. | ||
function isErrorConstant(code) { | ||
@@ -1150,13 +1144,4 @@ return isString(code) && includes(values(coreConstants.ErrorConstant), code); | ||
return; | ||
} // When not in 'DEV' strip the message but still throw | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
throw RemirrorError.create({ | ||
code: coreConstants.ErrorConstant.PROD | ||
}); | ||
} // When not in production we allow the message to pass through | ||
// **This is never called in production builds.** | ||
throw RemirrorError.create(options); | ||
@@ -1209,71 +1194,47 @@ } | ||
enumerable: true, | ||
get: function () { | ||
return omit__default['default']; | ||
} | ||
get: function () { return omit__default["default"]; } | ||
}); | ||
Object.defineProperty(exports, 'pick', { | ||
enumerable: true, | ||
get: function () { | ||
return object_pick__default['default']; | ||
} | ||
get: function () { return object_pick__default["default"]; } | ||
}); | ||
Object.defineProperty(exports, 'camelCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.camelCase; | ||
} | ||
get: function () { return caseAnything.camelCase; } | ||
}); | ||
Object.defineProperty(exports, 'capitalCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.capitalCase; | ||
} | ||
get: function () { return caseAnything.capitalCase; } | ||
}); | ||
Object.defineProperty(exports, 'constantCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.constantCase; | ||
} | ||
get: function () { return caseAnything.constantCase; } | ||
}); | ||
Object.defineProperty(exports, 'kebabCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.kebabCase; | ||
} | ||
get: function () { return caseAnything.kebabCase; } | ||
}); | ||
Object.defineProperty(exports, 'pascalCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.pascalCase; | ||
} | ||
get: function () { return caseAnything.pascalCase; } | ||
}); | ||
Object.defineProperty(exports, 'pathCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.pathCase; | ||
} | ||
get: function () { return caseAnything.pathCase; } | ||
}); | ||
Object.defineProperty(exports, 'snakeCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.snakeCase; | ||
} | ||
get: function () { return caseAnything.snakeCase; } | ||
}); | ||
Object.defineProperty(exports, 'spaceCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.spaceCase; | ||
} | ||
get: function () { return caseAnything.spaceCase; } | ||
}); | ||
Object.defineProperty(exports, 'debounce', { | ||
enumerable: true, | ||
get: function () { | ||
return throttleDebounce.debounce; | ||
} | ||
get: function () { return throttleDebounce.debounce; } | ||
}); | ||
Object.defineProperty(exports, 'throttle', { | ||
enumerable: true, | ||
get: function () { | ||
return throttleDebounce.throttle; | ||
} | ||
get: function () { return throttleDebounce.throttle; } | ||
}); | ||
@@ -1280,0 +1241,0 @@ exports.Cast = Cast; |
@@ -1014,41 +1014,36 @@ import { BaseError } from 'make-error'; | ||
var ERROR_INFORMATION_URL = 'https://remirror.io/docs/errors'; | ||
var errorMessageMap = {}; // This will be removed in a production environment. | ||
if (process.env.NODE_ENV !== 'production') { | ||
errorMessageMap = { | ||
[ErrorConstant.PROD]: 'An error occurred with the `Remirror` setup in production. Any details are purposefully being withheld.', | ||
[ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirror` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
} | ||
var errorMessageMap = { | ||
[ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
/** | ||
@@ -1058,3 +1053,2 @@ * Checks whether the passed code is an `ErrorConstant`. | ||
function isErrorConstant(code) { | ||
@@ -1137,13 +1131,4 @@ return isString(code) && includes(values(ErrorConstant), code); | ||
return; | ||
} // When not in 'DEV' strip the message but still throw | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
throw RemirrorError.create({ | ||
code: ErrorConstant.PROD | ||
}); | ||
} // When not in production we allow the message to pass through | ||
// **This is never called in production builds.** | ||
throw RemirrorError.create(options); | ||
@@ -1150,0 +1135,0 @@ } |
@@ -624,3 +624,3 @@ 'use strict'; | ||
function omitUndefined(object) { | ||
return omit__default['default'](object, value => !isUndefined(value)); | ||
return omit__default["default"](object, value => !isUndefined(value)); | ||
} | ||
@@ -656,3 +656,3 @@ /** | ||
var isEqual = fastDeepEqual__default['default']; | ||
var isEqual = fastDeepEqual__default["default"]; | ||
/** | ||
@@ -725,3 +725,3 @@ * Create a unique array in a non-mutating manner | ||
return deepmerge__default['default'].all(objects, { | ||
return deepmerge__default["default"].all(objects, { | ||
isMergeableObject: isPlainObject | ||
@@ -1027,41 +1027,36 @@ }); | ||
var ERROR_INFORMATION_URL = 'https://remirror.io/docs/errors'; | ||
var errorMessageMap = {}; // This will be removed in a production environment. | ||
if (process.env.NODE_ENV !== 'production') { | ||
errorMessageMap = { | ||
[coreConstants.ErrorConstant.PROD]: 'An error occurred with the `Remirror` setup in production. Any details are purposefully being withheld.', | ||
[coreConstants.ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[coreConstants.ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[coreConstants.ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[coreConstants.ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[coreConstants.ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[coreConstants.ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[coreConstants.ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[coreConstants.ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[coreConstants.ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[coreConstants.ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[coreConstants.ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[coreConstants.ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[coreConstants.ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[coreConstants.ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[coreConstants.ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[coreConstants.ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[coreConstants.ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[coreConstants.ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[coreConstants.ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[coreConstants.ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirror` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[coreConstants.ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[coreConstants.ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[coreConstants.ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[coreConstants.ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[coreConstants.ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[coreConstants.ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[coreConstants.ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[coreConstants.ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
} | ||
var errorMessageMap = { | ||
[coreConstants.ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[coreConstants.ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[coreConstants.ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[coreConstants.ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[coreConstants.ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[coreConstants.ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[coreConstants.ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[coreConstants.ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[coreConstants.ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[coreConstants.ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[coreConstants.ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[coreConstants.ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[coreConstants.ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[coreConstants.ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[coreConstants.ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[coreConstants.ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[coreConstants.ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[coreConstants.ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[coreConstants.ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[coreConstants.ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[coreConstants.ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[coreConstants.ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[coreConstants.ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[coreConstants.ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[coreConstants.ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[coreConstants.ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[coreConstants.ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[coreConstants.ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
/** | ||
@@ -1071,3 +1066,2 @@ * Checks whether the passed code is an `ErrorConstant`. | ||
function isErrorConstant(code) { | ||
@@ -1150,13 +1144,4 @@ return isString(code) && includes(values(coreConstants.ErrorConstant), code); | ||
return; | ||
} // When not in 'DEV' strip the message but still throw | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
throw RemirrorError.create({ | ||
code: coreConstants.ErrorConstant.PROD | ||
}); | ||
} // When not in production we allow the message to pass through | ||
// **This is never called in production builds.** | ||
throw RemirrorError.create(options); | ||
@@ -1209,71 +1194,47 @@ } | ||
enumerable: true, | ||
get: function () { | ||
return omit__default['default']; | ||
} | ||
get: function () { return omit__default["default"]; } | ||
}); | ||
Object.defineProperty(exports, 'pick', { | ||
enumerable: true, | ||
get: function () { | ||
return object_pick__default['default']; | ||
} | ||
get: function () { return object_pick__default["default"]; } | ||
}); | ||
Object.defineProperty(exports, 'camelCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.camelCase; | ||
} | ||
get: function () { return caseAnything.camelCase; } | ||
}); | ||
Object.defineProperty(exports, 'capitalCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.capitalCase; | ||
} | ||
get: function () { return caseAnything.capitalCase; } | ||
}); | ||
Object.defineProperty(exports, 'constantCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.constantCase; | ||
} | ||
get: function () { return caseAnything.constantCase; } | ||
}); | ||
Object.defineProperty(exports, 'kebabCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.kebabCase; | ||
} | ||
get: function () { return caseAnything.kebabCase; } | ||
}); | ||
Object.defineProperty(exports, 'pascalCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.pascalCase; | ||
} | ||
get: function () { return caseAnything.pascalCase; } | ||
}); | ||
Object.defineProperty(exports, 'pathCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.pathCase; | ||
} | ||
get: function () { return caseAnything.pathCase; } | ||
}); | ||
Object.defineProperty(exports, 'snakeCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.snakeCase; | ||
} | ||
get: function () { return caseAnything.snakeCase; } | ||
}); | ||
Object.defineProperty(exports, 'spaceCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.spaceCase; | ||
} | ||
get: function () { return caseAnything.spaceCase; } | ||
}); | ||
Object.defineProperty(exports, 'debounce', { | ||
enumerable: true, | ||
get: function () { | ||
return throttleDebounce.debounce; | ||
} | ||
get: function () { return throttleDebounce.debounce; } | ||
}); | ||
Object.defineProperty(exports, 'throttle', { | ||
enumerable: true, | ||
get: function () { | ||
return throttleDebounce.throttle; | ||
} | ||
get: function () { return throttleDebounce.throttle; } | ||
}); | ||
@@ -1280,0 +1241,0 @@ exports.Cast = Cast; |
@@ -624,3 +624,3 @@ 'use strict'; | ||
function omitUndefined(object) { | ||
return omit__default['default'](object, value => !isUndefined(value)); | ||
return omit__default["default"](object, value => !isUndefined(value)); | ||
} | ||
@@ -656,3 +656,3 @@ /** | ||
var isEqual = fastDeepEqual__default['default']; | ||
var isEqual = fastDeepEqual__default["default"]; | ||
/** | ||
@@ -725,3 +725,3 @@ * Create a unique array in a non-mutating manner | ||
return deepmerge__default['default'].all(objects, { | ||
return deepmerge__default["default"].all(objects, { | ||
isMergeableObject: isPlainObject | ||
@@ -1027,3 +1027,36 @@ }); | ||
var ERROR_INFORMATION_URL = 'https://remirror.io/docs/errors'; | ||
var errorMessageMap = {}; // This will be removed in a production environment. | ||
var errorMessageMap = { | ||
[coreConstants.ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[coreConstants.ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[coreConstants.ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[coreConstants.ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[coreConstants.ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[coreConstants.ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[coreConstants.ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[coreConstants.ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[coreConstants.ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[coreConstants.ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[coreConstants.ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[coreConstants.ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[coreConstants.ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[coreConstants.ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[coreConstants.ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[coreConstants.ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[coreConstants.ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[coreConstants.ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[coreConstants.ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[coreConstants.ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[coreConstants.ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[coreConstants.ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[coreConstants.ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[coreConstants.ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[coreConstants.ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[coreConstants.ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[coreConstants.ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[coreConstants.ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[coreConstants.ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[coreConstants.ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
/** | ||
@@ -1033,3 +1066,2 @@ * Checks whether the passed code is an `ErrorConstant`. | ||
function isErrorConstant(code) { | ||
@@ -1112,10 +1144,5 @@ return isString(code) && includes(values(coreConstants.ErrorConstant), code); | ||
return; | ||
} // When not in 'DEV' strip the message but still throw | ||
} | ||
{ | ||
throw RemirrorError.create({ | ||
code: coreConstants.ErrorConstant.PROD | ||
}); | ||
} // When not in production we allow the message to pass through | ||
throw RemirrorError.create(options); | ||
} | ||
@@ -1147,71 +1174,47 @@ /** | ||
enumerable: true, | ||
get: function () { | ||
return omit__default['default']; | ||
} | ||
get: function () { return omit__default["default"]; } | ||
}); | ||
Object.defineProperty(exports, 'pick', { | ||
enumerable: true, | ||
get: function () { | ||
return object_pick__default['default']; | ||
} | ||
get: function () { return object_pick__default["default"]; } | ||
}); | ||
Object.defineProperty(exports, 'camelCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.camelCase; | ||
} | ||
get: function () { return caseAnything.camelCase; } | ||
}); | ||
Object.defineProperty(exports, 'capitalCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.capitalCase; | ||
} | ||
get: function () { return caseAnything.capitalCase; } | ||
}); | ||
Object.defineProperty(exports, 'constantCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.constantCase; | ||
} | ||
get: function () { return caseAnything.constantCase; } | ||
}); | ||
Object.defineProperty(exports, 'kebabCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.kebabCase; | ||
} | ||
get: function () { return caseAnything.kebabCase; } | ||
}); | ||
Object.defineProperty(exports, 'pascalCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.pascalCase; | ||
} | ||
get: function () { return caseAnything.pascalCase; } | ||
}); | ||
Object.defineProperty(exports, 'pathCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.pathCase; | ||
} | ||
get: function () { return caseAnything.pathCase; } | ||
}); | ||
Object.defineProperty(exports, 'snakeCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.snakeCase; | ||
} | ||
get: function () { return caseAnything.snakeCase; } | ||
}); | ||
Object.defineProperty(exports, 'spaceCase', { | ||
enumerable: true, | ||
get: function () { | ||
return caseAnything.spaceCase; | ||
} | ||
get: function () { return caseAnything.spaceCase; } | ||
}); | ||
Object.defineProperty(exports, 'debounce', { | ||
enumerable: true, | ||
get: function () { | ||
return throttleDebounce.debounce; | ||
} | ||
get: function () { return throttleDebounce.debounce; } | ||
}); | ||
Object.defineProperty(exports, 'throttle', { | ||
enumerable: true, | ||
get: function () { | ||
return throttleDebounce.throttle; | ||
} | ||
get: function () { return throttleDebounce.throttle; } | ||
}); | ||
@@ -1218,0 +1221,0 @@ exports.Cast = Cast; |
@@ -1014,41 +1014,36 @@ import { BaseError } from 'make-error'; | ||
var ERROR_INFORMATION_URL = 'https://remirror.io/docs/errors'; | ||
var errorMessageMap = {}; // This will be removed in a production environment. | ||
if (process.env.NODE_ENV !== 'production') { | ||
errorMessageMap = { | ||
[ErrorConstant.PROD]: 'An error occurred with the `Remirror` setup in production. Any details are purposefully being withheld.', | ||
[ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirror` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
} | ||
var errorMessageMap = { | ||
[ErrorConstant.UNKNOWN]: "An error occurred but we're not quite sure why. 🧐", | ||
[ErrorConstant.INVALID_COMMAND_ARGUMENTS]: 'The arguments passed to the command method were invalid.', | ||
[ErrorConstant.CUSTOM]: 'This is a custom error, possibly thrown by an external library.', | ||
[ErrorConstant.CORE_HELPERS]: 'An error occurred in a function called from the `@remirror/core-helpers` library.', | ||
[ErrorConstant.MUTATION]: 'Mutation of immutable value detected.', | ||
[ErrorConstant.INTERNAL]: 'This is an error which should not occur and is internal to the remirror codebase.', | ||
[ErrorConstant.MISSING_REQUIRED_EXTENSION]: 'Your editor is missing a required extension.', | ||
[ErrorConstant.MANAGER_PHASE_ERROR]: 'This occurs when accessing a method or property before it is available.', | ||
[ErrorConstant.INVALID_GET_EXTENSION]: 'The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.', | ||
[ErrorConstant.INVALID_MANAGER_ARGUMENTS]: 'Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.', | ||
[ErrorConstant.SCHEMA]: "There is a problem with the schema or you are trying to access a node / mark that doesn't exists.", | ||
[ErrorConstant.HELPERS_CALLED_IN_OUTER_SCOPE]: 'The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).', | ||
[ErrorConstant.INVALID_MANAGER_EXTENSION]: 'You requested an invalid extension from the manager.', | ||
[ErrorConstant.DUPLICATE_COMMAND_NAMES]: 'Command method names must be unique within the editor.', | ||
[ErrorConstant.DUPLICATE_HELPER_NAMES]: 'Helper method names must be unique within the editor.', | ||
[ErrorConstant.NON_CHAINABLE_COMMAND]: 'Attempted to chain a non chainable command.', | ||
[ErrorConstant.INVALID_EXTENSION]: 'The provided extension is invalid.', | ||
[ErrorConstant.INVALID_CONTENT]: 'The content provided to the editor is not supported.', | ||
[ErrorConstant.INVALID_NAME]: 'An invalid name was used for the extension.', | ||
[ErrorConstant.EXTENSION]: 'An error occurred within an extension. More details should be made available.', | ||
[ErrorConstant.EXTENSION_SPEC]: 'The spec was defined without calling the `defaults`, `parse` or `dom` methods.', | ||
[ErrorConstant.EXTENSION_EXTRA_ATTRIBUTES]: 'Extra attributes must either be a string or an object.', | ||
[ErrorConstant.INVALID_SET_EXTENSION_OPTIONS]: 'A call to `extension.setOptions` was made with invalid keys.', | ||
[ErrorConstant.REACT_PROVIDER_CONTEXT]: '`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.', | ||
[ErrorConstant.REACT_GET_ROOT_PROPS]: '`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.', | ||
[ErrorConstant.REACT_EDITOR_VIEW]: 'A problem occurred adding the editor view to the dom.', | ||
[ErrorConstant.REACT_CONTROLLED]: 'There is a problem with your controlled editor setup.', | ||
[ErrorConstant.REACT_NODE_VIEW]: 'Something went wrong with your custom ReactNodeView Component.', | ||
[ErrorConstant.REACT_GET_CONTEXT]: 'You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.', | ||
[ErrorConstant.REACT_COMPONENTS]: 'An error occurred within a remirror component.', | ||
[ErrorConstant.REACT_HOOKS]: 'An error occurred within a remirror hook.', | ||
[ErrorConstant.I18N_CONTEXT]: 'You called `useI18n()` outside of an `I18nProvider` context.' | ||
}; | ||
/** | ||
@@ -1058,3 +1053,2 @@ * Checks whether the passed code is an `ErrorConstant`. | ||
function isErrorConstant(code) { | ||
@@ -1137,13 +1131,4 @@ return isString(code) && includes(values(ErrorConstant), code); | ||
return; | ||
} // When not in 'DEV' strip the message but still throw | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
throw RemirrorError.create({ | ||
code: ErrorConstant.PROD | ||
}); | ||
} // When not in production we allow the message to pass through | ||
// **This is never called in production builds.** | ||
throw RemirrorError.create(options); | ||
@@ -1150,0 +1135,0 @@ } |
{ | ||
"name": "@remirror/core-helpers", | ||
"version": "0.0.0-pr1242.4", | ||
"version": "0.0.0-pr1305.1", | ||
"description": "Provide helper functions for the remirror codebase, kinda like a tiny lodash", | ||
@@ -40,4 +40,4 @@ "homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/remirror__core-helpers", | ||
"@linaria/core": "3.0.0-beta.4", | ||
"@remirror/core-constants": "0.0.0-pr1242.4", | ||
"@remirror/types": "0.0.0-pr1242.4", | ||
"@remirror/core-constants": "0.0.0-pr1305.1", | ||
"@remirror/types": "0.0.0-pr1305.1", | ||
"@types/object.omit": "^3.0.0", | ||
@@ -44,0 +44,0 @@ "@types/object.pick": "^1.3.1", |
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
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
197101
17
6045
+ Added@remirror/core-constants@0.0.0-pr1305.1(transitive)
+ Added@remirror/types@0.0.0-pr1305.1(transitive)
- Removed@remirror/core-constants@0.0.0-pr1242.4(transitive)
- Removed@remirror/types@0.0.0-pr1242.4(transitive)