@remirror/core-constants
Advanced tools
Comparing version 1.0.0-next.0 to 1.0.0-next.1
# @remirror/core-constants | ||
## 1.0.0-next.1 | ||
> 2020-07-05 | ||
### Patch Changes | ||
- Fix missing dist files from previous publish. | ||
## 1.0.0-next.0 | ||
@@ -4,0 +12,0 @@ |
@@ -1,11 +0,1 @@ | ||
// are you seeing an error that a default export doesn't exist but your source file has a default export? | ||
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook | ||
// curious why you need to? | ||
// this file exists so that you can import from the entrypoint normally | ||
// except that it points to your source file and you don't need to run build constantly | ||
// which means we need to re-export all of the modules from your source file | ||
// and since export * doesn't include default exports, we need to read your source file | ||
// to check for a default export and re-export it if it exists | ||
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯ | ||
export * from "../src/index"; | ||
export * from "./declarations/src/index"; |
@@ -1,19 +0,7 @@ | ||
"use strict"; | ||
// this file might look strange and you might be wondering what it's for | ||
// it's lets you import your source files by importing this entrypoint | ||
// as you would import it if it was built with preconstruct build | ||
// this file is slightly different to some others though | ||
// it has a require hook which compiles your code with Babel | ||
// this means that you don't have to set up @babel/register or anything like that | ||
// but you can still require this module and it'll be compiled | ||
'use strict'; | ||
// this bit of code imports the require hook and registers it | ||
let unregister = require("/Users/ifiokjr/Coding/kickjump/remirror/prs/node_modules/.pnpm/@preconstruct/hook@0.1.0/node_modules/@preconstruct/hook/dist/hook.cjs.js").___internalHook("/Users/ifiokjr/Coding/kickjump/remirror/prs"); | ||
// this re-exports the source file | ||
module.exports = require("/Users/ifiokjr/Coding/kickjump/remirror/prs/packages/@remirror/core-constants/src/index.ts"); | ||
// this unregisters the require hook so that any modules required after this one | ||
// aren't compiled with the require hook in case you have some other require hook | ||
// or something that should be used on other modules | ||
unregister(); | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./core-constants.cjs.prod.js"); | ||
} else { | ||
module.exports = require("./core-constants.cjs.dev.js"); | ||
} |
@@ -1,15 +0,316 @@ | ||
// 👋 hey!! | ||
// you might be reading this and seeing .esm in the filename | ||
// and being confused why there is commonjs below this filename | ||
// DON'T WORRY! | ||
// this is intentional | ||
// it's only commonjs with `preconstruct dev` | ||
// when you run `preconstruct build`, it will be ESM | ||
// why is it commonjs? | ||
// we need to re-export every export from the source file | ||
// but we can't do that with ESM without knowing what the exports are (because default exports aren't included in export/import *) | ||
// and they could change after running `preconstruct dev` so we can't look at the file without forcing people to | ||
// run preconstruct dev again which wouldn't be ideal | ||
// this solution could change but for now, it's working | ||
/** | ||
* The editor class name | ||
*/ | ||
var EDITOR_CLASS_NAME = 'remirror-editor'; | ||
/** | ||
* The editor class selector | ||
*/ | ||
module.exports = require("/Users/ifiokjr/Coding/kickjump/remirror/prs/packages/@remirror/core-constants/src/index.ts") | ||
var EDITOR_CLASS_SELECTOR = /*#__PURE__*/".".concat(EDITOR_CLASS_NAME); | ||
/** | ||
* The css class added to a node that is selected. | ||
*/ | ||
var SELECTED_NODE_CLASS_NAME = 'ProseMirror-selectednode'; | ||
/** | ||
* The css selector for a selected node. | ||
*/ | ||
var SELECTED_NODE_CLASS_SELECTOR = /*#__PURE__*/".".concat(SELECTED_NODE_CLASS_NAME); | ||
/** | ||
* ProseMirror uses the Unicode Character 'OBJECT REPLACEMENT CHARACTER' | ||
* (U+FFFC) as text representation for leaf nodes, i.e. nodes that don't have | ||
* any content or text property (e.g. hardBreak, emoji, mention, rule) It was | ||
* introduced because of https://github.com/ProseMirror/prosemirror/issues/262 | ||
* This can be used in an input rule regex to be able to include or exclude such | ||
* nodes. | ||
*/ | ||
var LEAF_NODE_REPLACING_CHARACTER = "\uFFFC"; | ||
/** | ||
* The null character. | ||
* | ||
* See {@link https://stackoverflow.com/a/6380172} | ||
*/ | ||
var NULL_CHARACTER = '\0'; | ||
/** | ||
* A character useful for separating inline nodes. | ||
* | ||
* @remarks | ||
* Typically used in decorations as follows. | ||
* | ||
* ```ts | ||
* document.createTextNode(ZERO_WIDTH_SPACE_CHAR); | ||
* ``` | ||
* | ||
* This produces the html entity '8203' | ||
*/ | ||
var ZERO_WIDTH_SPACE_CHAR = "\u200B"; | ||
/** | ||
* The non breaking space character. | ||
*/ | ||
var NON_BREAKING_SPACE_CHAR = "\xA0"; | ||
/** | ||
* A default empty object node. Useful for resetting the content of a | ||
* prosemirror document. | ||
*/ | ||
var EMPTY_PARAGRAPH_NODE = { | ||
type: 'doc', | ||
content: [{ | ||
type: 'paragraph' | ||
}] | ||
}; | ||
var EMPTY_NODE = { | ||
type: 'doc', | ||
content: [] | ||
}; | ||
/** | ||
* Marks are categorized into different groups. One motivation for this was to | ||
* allow the `code` mark to exclude other marks, without needing to explicitly | ||
* name them. Explicit naming requires the named mark to exist in the schema. | ||
* This is undesirable because we want to construct different schemas that have | ||
* different sets of nodes/marks. | ||
*/ | ||
var MarkGroup; | ||
(function (MarkGroup) { | ||
MarkGroup["FontStyle"] = "fontStyle"; | ||
MarkGroup["Link"] = "link"; | ||
MarkGroup["Color"] = "color"; | ||
MarkGroup["Alignment"] = "alignment"; | ||
MarkGroup["Indentation"] = "indentation"; | ||
MarkGroup["Behavior"] = "behavior"; | ||
MarkGroup["Code"] = "code"; | ||
})(MarkGroup || (MarkGroup = {})); | ||
var NodeGroup; | ||
/** | ||
* Defines the type of the extension. | ||
*/ | ||
(function (NodeGroup) { | ||
NodeGroup["Inline"] = "inline"; | ||
NodeGroup["Block"] = "block"; | ||
})(NodeGroup || (NodeGroup = {})); | ||
var ExtensionType; | ||
/** | ||
* These are the default supported tag strings which help categorize different | ||
* behaviors that extensions can exhibit. | ||
* | ||
* @remarks | ||
* | ||
* Any extension can register itself with multiple such behaviors and these | ||
* categorizations can be used by other extensions when running commands and | ||
* updating the document. | ||
*/ | ||
(function (ExtensionType) { | ||
ExtensionType["Node"] = "node"; | ||
ExtensionType["Mark"] = "mark"; | ||
ExtensionType["Plain"] = "plain"; | ||
})(ExtensionType || (ExtensionType = {})); | ||
var ExtensionTag; | ||
/** | ||
* The identifier key which is used to check objects for whether they are a | ||
* certain type. | ||
* | ||
* @remarks | ||
* | ||
* Just pretend you don't know this exists. | ||
* | ||
* @internal | ||
*/ | ||
(function (ExtensionTag) { | ||
ExtensionTag["LastNodeCompatible"] = "lastNodeCompatible"; | ||
ExtensionTag["FormattingMark"] = "formattingMark"; | ||
ExtensionTag["FormattingNode"] = "formattingNode"; | ||
ExtensionTag["NodeCursor"] = "nodeCursor"; | ||
})(ExtensionTag || (ExtensionTag = {})); | ||
var __INTERNAL_REMIRROR_IDENTIFIER_KEY__ = /*#__PURE__*/Symbol.for('__remirror__'); | ||
/** | ||
* These constants are stored on the `REMIRROR_IDENTIFIER_KEY` property of | ||
* `remirror` related constructors and instances in order to identify them as | ||
* being internal to Remirror. | ||
* | ||
* @remarks | ||
* | ||
* This helps to prevent issues around check types via `instanceof` which can | ||
* lead to false negatives. | ||
* | ||
* @internal | ||
*/ | ||
var RemirrorIdentifier; | ||
/** | ||
* The priority of extension which determines what order it is loaded into the | ||
* editor. | ||
* | ||
* @remarks | ||
* | ||
* Higher priority extension (higher numberic value) will ensure the extension | ||
* has a higher preference in your editor. In the case where you load two | ||
* identical extensions into your editor (same name, or same constructor), the | ||
* extension with the higher priority is the one that will be loaded. | ||
* | ||
* The higher the numeric value the higher the priority. The priority can also | ||
* be passed a number but naming things in this `enum` should help provide some | ||
* context to the numbers. | ||
* | ||
* By default all extensions are created with a `ExtensionPriority.Default`. | ||
*/ | ||
(function (RemirrorIdentifier) { | ||
RemirrorIdentifier["PlainExtension"] = "RemirrorPlainExtension"; | ||
RemirrorIdentifier["NodeExtension"] = "RemirrorNodeExtension"; | ||
RemirrorIdentifier["MarkExtension"] = "RemirrorMarkExtension"; | ||
RemirrorIdentifier["PlainExtensionConstructor"] = "RemirrorPlainExtensionConstructor"; | ||
RemirrorIdentifier["NodeExtensionConstructor"] = "RemirrorNodeExtensionConstructor"; | ||
RemirrorIdentifier["MarkExtensionConstructor"] = "RemirrorMarkExtensionConstructor"; | ||
RemirrorIdentifier["Manager"] = "RemirrorManager"; | ||
RemirrorIdentifier["Preset"] = "RemirrorPreset"; | ||
RemirrorIdentifier["PresetConstructor"] = "RemirrorPresetConstructor"; | ||
})(RemirrorIdentifier || (RemirrorIdentifier = {})); | ||
var ExtensionPriority; | ||
/** | ||
* Identifies the stage the extension manager is at. | ||
*/ | ||
(function (ExtensionPriority) { | ||
ExtensionPriority[ExtensionPriority["Critical"] = 1000000] = "Critical"; | ||
ExtensionPriority[ExtensionPriority["Highest"] = 100000] = "Highest"; | ||
ExtensionPriority[ExtensionPriority["High"] = 10000] = "High"; | ||
ExtensionPriority[ExtensionPriority["Medium"] = 1000] = "Medium"; | ||
ExtensionPriority[ExtensionPriority["Default"] = 100] = "Default"; | ||
ExtensionPriority[ExtensionPriority["Low"] = 10] = "Low"; | ||
ExtensionPriority[ExtensionPriority["Lowest"] = 0] = "Lowest"; | ||
})(ExtensionPriority || (ExtensionPriority = {})); | ||
var ManagerPhase; | ||
(function (ManagerPhase) { | ||
ManagerPhase[ManagerPhase["None"] = 0] = "None"; | ||
ManagerPhase[ManagerPhase["Create"] = 1] = "Create"; | ||
ManagerPhase[ManagerPhase["EditorView"] = 2] = "EditorView"; | ||
ManagerPhase[ManagerPhase["Runtime"] = 3] = "Runtime"; | ||
ManagerPhase[ManagerPhase["Destroy"] = 4] = "Destroy"; | ||
})(ManagerPhase || (ManagerPhase = {})); | ||
/** | ||
* The error codes for errors used throughout the codebase. | ||
* | ||
* @remarks | ||
* | ||
* They can be removed but should never be changed since they are also used to | ||
* reference the errors within search engines. | ||
*/ | ||
var ErrorConstant; | ||
(function (ErrorConstant) { | ||
ErrorConstant["PROD"] = "RMR0000"; | ||
ErrorConstant["UNKNOWN"] = "RMR0001"; | ||
ErrorConstant["INVALID_COMMAND_ARGUMENTS"] = "RMR0002"; | ||
ErrorConstant["CUSTOM"] = "RMR0003"; | ||
ErrorConstant["CORE_HELPERS"] = "RMR0004"; | ||
ErrorConstant["MUTATION"] = "RMR0005"; | ||
ErrorConstant["INTERNAL"] = "RMR0006"; | ||
ErrorConstant["MISSING_REQUIRED_EXTENSION"] = "RMR0007"; | ||
ErrorConstant["MANAGER_PHASE_ERROR"] = "RMR0008"; | ||
ErrorConstant["NEW_EDITOR_MANAGER"] = "RMR0009"; | ||
ErrorConstant["INVALID_PRESET_EXTENSION"] = "RMR0010"; | ||
ErrorConstant["INVALID_MANAGER_ARGUMENTS"] = "RMR0011"; | ||
ErrorConstant["COMMANDS_CALLED_IN_OUTER_SCOPE"] = "RMR0012"; | ||
ErrorConstant["HELPERS_CALLED_IN_OUTER_SCOPE"] = "RMR0013"; | ||
ErrorConstant["INVALID_MANAGER_EXTENSION"] = "RMR0014"; | ||
ErrorConstant["INVALID_MANAGER_PRESET"] = "RMR0015"; | ||
ErrorConstant["DUPLICATE_COMMAND_NAMES"] = "RMR0016"; | ||
ErrorConstant["DUPLICATE_HELPER_NAMES"] = "RMR0017"; | ||
ErrorConstant["NON_CHAINABLE_COMMAND"] = "RMR0018"; | ||
ErrorConstant["INVALID_EXTENSION"] = "RMR0019"; | ||
ErrorConstant["INVALID_PRESET"] = "RMR0020"; | ||
ErrorConstant["INVALID_NAME"] = "RMR0050"; | ||
ErrorConstant["EXTENSION"] = "RMR0100"; | ||
ErrorConstant["EXTENSION_SPEC"] = "RMR0101"; | ||
ErrorConstant["EXTENSION_EXTRA_ATTRIBUTES"] = "RMR0102"; | ||
ErrorConstant["REACT_PROVIDER_CONTEXT"] = "RMR0200"; | ||
ErrorConstant["REACT_GET_ROOT_PROPS"] = "RMR0201"; | ||
ErrorConstant["REACT_EDITOR_VIEW"] = "RMR0202"; | ||
ErrorConstant["REACT_CONTROLLED"] = "RMR0202"; | ||
ErrorConstant["I18N_CONTEXT"] = "RMR0300"; | ||
})(ErrorConstant || (ErrorConstant = {})); | ||
/** | ||
* The size of the default indentation size (in pt). | ||
*/ | ||
var INDENT_MARGIN_PT_SIZE = 36; | ||
/** | ||
* The levels of indentation supported by default. Can be overridden. | ||
*/ | ||
var INDENT_LEVELS = [0, 7]; | ||
/** | ||
* The min indentation level. | ||
*/ | ||
var MIN_INDENT_LEVEL = 0; | ||
/** | ||
* The default maximum level of indentation allowed. | ||
*/ | ||
var MAX_INDENT_LEVEL = 7; | ||
/** | ||
* The attribute to use for storing the indent value. | ||
*/ | ||
var INDENT_ATTRIBUTE = 'data-indent'; | ||
/** | ||
* Values which can safely be ignored when styling nodes. | ||
*/ | ||
var EMPTY_CSS_VALUE = /*#__PURE__*/new Set(['', '0%', '0pt', '0px']); | ||
/** | ||
* The default line spacing values. | ||
*/ | ||
var LINE_SPACING_VALUES = ['100%', '115%', '150%', // Default value. | ||
'200%']; | ||
/** | ||
* Regex for accepting a value as a valid alignment name. | ||
*/ | ||
var ALIGN_PATTERN = /(left|right|center|justify)/; | ||
/** | ||
* Regex for matching sizes in the DOM. | ||
*/ | ||
var SIZE_PATTERN = /([\d.]+)(px|pt)/i; | ||
/** | ||
* The default pixel to pt font size ratio. | ||
* | ||
* @see https://github.com/chanzuckerberg/czi-prosemirror/blob/52e34840d73fccc46637314bf4b4be71147112d4/src/convertToCSSPTValue.js#L7 | ||
*/ | ||
var PIXEL_TO_PT_RATIO = 0.7518796992481203; // 1 / 1.33. | ||
/** | ||
* The default pt to pixel ratio. | ||
*/ | ||
var PT_TO_PIXEL_RATIO = 1.33; | ||
/** | ||
* The default font sizes for the editor. | ||
*/ | ||
var FONT_PT_SIZES = [8, 9, 10, 11, 12, 14, 18, 24, 30, 36, 48, 60, 72, 90]; | ||
var CSS_ROTATE_PATTERN = /rotate\(([\d.]+)rad\)/i; | ||
export { ALIGN_PATTERN, CSS_ROTATE_PATTERN, EDITOR_CLASS_NAME, EDITOR_CLASS_SELECTOR, EMPTY_CSS_VALUE, EMPTY_NODE, EMPTY_PARAGRAPH_NODE, ErrorConstant, ExtensionPriority, ExtensionTag, ExtensionType, FONT_PT_SIZES, INDENT_ATTRIBUTE, INDENT_LEVELS, INDENT_MARGIN_PT_SIZE, LEAF_NODE_REPLACING_CHARACTER, LINE_SPACING_VALUES, MAX_INDENT_LEVEL, MIN_INDENT_LEVEL, ManagerPhase, MarkGroup, NON_BREAKING_SPACE_CHAR, NULL_CHARACTER, NodeGroup, PIXEL_TO_PT_RATIO, PT_TO_PIXEL_RATIO, RemirrorIdentifier, SELECTED_NODE_CLASS_NAME, SELECTED_NODE_CLASS_SELECTOR, SIZE_PATTERN, ZERO_WIDTH_SPACE_CHAR, __INTERNAL_REMIRROR_IDENTIFIER_KEY__ }; |
{ | ||
"name": "@remirror/core-constants", | ||
"version": "1.0.0-next.0", | ||
"version": "1.0.0-next.1", | ||
"description": "The core constants used throughout the remirror codebase", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/remirror/remirror/tree/next/packages/@remirror/core-constants", |
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
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
44380
13
1118
2