@atlaskit/editor-plugin-rule 12.0.0 → 12.0.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-rule
2
2
 
3
+ ## 12.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`346f91cfe1997`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/346f91cfe1997) -
8
+ Clean up prefer static regex violations
9
+ - Updated dependencies
10
+
11
+ ## 12.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 12.0.0
4
18
 
5
19
  ### Major Changes
@@ -48,13 +48,14 @@ var createHorizontalRuleAutoformat = function createHorizontalRuleAutoformat(sta
48
48
  }
49
49
  return createHorizontalRule(state, start, end, _analytics.INPUT_METHOD.FORMATTING, editorAnalyticsAPI);
50
50
  };
51
+
52
+ // eslint-disable-next-line require-unicode-regexp
53
+ var HORIZONTAL_RULE_AUTOFORMAT_REGEX = /^(\-\-\-|\*\*\*)$/;
51
54
  function inputRulePlugin(schema, editorAnalyticsAPI) {
52
55
  var rules = [];
53
56
  if (schema.nodes.rule) {
54
57
  // '---' and '***' for hr
55
- rules.push(
56
- // eslint-disable-next-line require-unicode-regexp
57
- (0, _utils.createRule)(/^(\-\-\-|\*\*\*)$/, function (state, _match, start, end) {
58
+ rules.push((0, _utils.createRule)(HORIZONTAL_RULE_AUTOFORMAT_REGEX, function (state, _match, start, end) {
58
59
  return createHorizontalRuleAutoformat(state, start, end, editorAnalyticsAPI);
59
60
  }));
60
61
 
@@ -45,13 +45,14 @@ const createHorizontalRuleAutoformat = (state, start, end, editorAnalyticsAPI) =
45
45
  }
46
46
  return createHorizontalRule(state, start, end, INPUT_METHOD.FORMATTING, editorAnalyticsAPI);
47
47
  };
48
+
49
+ // eslint-disable-next-line require-unicode-regexp
50
+ const HORIZONTAL_RULE_AUTOFORMAT_REGEX = /^(\-\-\-|\*\*\*)$/;
48
51
  export function inputRulePlugin(schema, editorAnalyticsAPI) {
49
52
  const rules = [];
50
53
  if (schema.nodes.rule) {
51
54
  // '---' and '***' for hr
52
- rules.push(
53
- // eslint-disable-next-line require-unicode-regexp
54
- createRule(/^(\-\-\-|\*\*\*)$/, (state, _match, start, end) => createHorizontalRuleAutoformat(state, start, end, editorAnalyticsAPI)));
55
+ rules.push(createRule(HORIZONTAL_RULE_AUTOFORMAT_REGEX, (state, _match, start, end) => createHorizontalRuleAutoformat(state, start, end, editorAnalyticsAPI)));
55
56
 
56
57
  // '---' and '***' after shift+enter for hr
57
58
  rules.push(createRule(
@@ -41,13 +41,14 @@ var createHorizontalRuleAutoformat = function createHorizontalRuleAutoformat(sta
41
41
  }
42
42
  return createHorizontalRule(state, start, end, INPUT_METHOD.FORMATTING, editorAnalyticsAPI);
43
43
  };
44
+
45
+ // eslint-disable-next-line require-unicode-regexp
46
+ var HORIZONTAL_RULE_AUTOFORMAT_REGEX = /^(\-\-\-|\*\*\*)$/;
44
47
  export function inputRulePlugin(schema, editorAnalyticsAPI) {
45
48
  var rules = [];
46
49
  if (schema.nodes.rule) {
47
50
  // '---' and '***' for hr
48
- rules.push(
49
- // eslint-disable-next-line require-unicode-regexp
50
- createRule(/^(\-\-\-|\*\*\*)$/, function (state, _match, start, end) {
51
+ rules.push(createRule(HORIZONTAL_RULE_AUTOFORMAT_REGEX, function (state, _match, start, end) {
51
52
  return createHorizontalRuleAutoformat(state, start, end, editorAnalyticsAPI);
52
53
  }));
53
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-rule",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "Rule plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -19,7 +19,7 @@
19
19
  "sideEffects": false,
20
20
  "atlaskit:src": "src/index.ts",
21
21
  "dependencies": {
22
- "@atlaskit/adf-schema": "^55.0.0",
22
+ "@atlaskit/adf-schema": "^56.0.0",
23
23
  "@atlaskit/editor-plugin-analytics": "^12.0.0",
24
24
  "@atlaskit/editor-prosemirror": "^8.0.0",
25
25
  "@atlaskit/platform-feature-flags": "^2.0.0",
@@ -27,7 +27,7 @@
27
27
  "@babel/runtime": "^7.0.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@atlaskit/editor-common": "^116.0.0",
30
+ "@atlaskit/editor-common": "^116.17.0",
31
31
  "react": "^18.2.0",
32
32
  "react-dom": "^18.2.0"
33
33
  },