@atlaskit/editor-plugin-type-ahead 1.0.2 → 1.0.4

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,42 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224) [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) - ED-22219: adf-schema updated to 35.5.2
8
+ - Updated dependencies
9
+
10
+ ## 1.0.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [#75482](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75482) [`18b5a6fb910a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18b5a6fb910a) - # MAJOR CHANGE to `@atlaskit/prosemirror-input-rules` package.
15
+
16
+ ## WHY?
17
+
18
+ Removing editor-common dependencies from prosemirror-input-rules package.
19
+
20
+ This makes it easier for editor updates because it simplifies our dependency graph.
21
+
22
+ ## WHAT and HOW?
23
+
24
+ These are no longer available via `@atlaskit/prosemirror-input-rules` but are available from `@atlaskit/editor-common/types`:
25
+
26
+ - InputRuleWrapper
27
+ - InputRuleHandler
28
+ - OnHandlerApply
29
+ - createRule
30
+
31
+ These have changed from a `SafePlugin` to a `SafePluginSpec`. In order to update your code you need to instantiate a `SafePlugin` (ie. `new SafePlugin(createPlugin( ... ))`).
32
+
33
+ `SafePlugin` exists in `@atlaskit/editor-common/safe-plugin`.
34
+
35
+ - createPlugin
36
+ - createInputRulePlugin
37
+
38
+ - Updated dependencies
39
+
3
40
  ## 1.0.2
4
41
 
5
42
  ### Patch Changes
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  exports.inputRulePlugin = inputRulePlugin;
8
8
  var _analytics = require("@atlaskit/editor-common/analytics");
9
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
+ var _utils = require("@atlaskit/editor-common/utils");
9
11
  var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
10
12
  var _openTypeaheadAtCursor = require("../transforms/open-typeahead-at-cursor");
11
13
  function inputRulePlugin(schema, typeAheads, featureFlags) {
@@ -18,7 +20,7 @@ function inputRulePlugin(schema, typeAheads, featureFlags) {
18
20
  return acc;
19
21
  }
20
22
  var regex = new RegExp("(^|[.!?\\s".concat(_prosemirrorInputRules.leafNodeReplacementCharacter, "])(").concat(trigger, ")$"));
21
- acc.push((0, _prosemirrorInputRules.createRule)(regex, function (state, match) {
23
+ acc.push((0, _utils.createRule)(regex, function (state, match) {
22
24
  return (0, _openTypeaheadAtCursor.openTypeAheadAtCursor)({
23
25
  triggerHandler: typeAhead,
24
26
  inputMethod: _analytics.INPUT_METHOD.KEYBOARD
@@ -28,9 +30,9 @@ function inputRulePlugin(schema, typeAheads, featureFlags) {
28
30
  }));
29
31
  return acc;
30
32
  }, []);
31
- var plugin = (0, _prosemirrorInputRules.createPlugin)('type-ahead', rules, {
33
+ var plugin = new _safePlugin.SafePlugin((0, _prosemirrorInputRules.createPlugin)('type-ahead', rules, {
32
34
  allowInsertTextOnDocument: false
33
- });
35
+ }));
34
36
  return plugin;
35
37
  }
36
38
  var _default = exports.default = inputRulePlugin;
@@ -1,5 +1,7 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { createPlugin, createRule, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { createRule } from '@atlaskit/editor-common/utils';
4
+ import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
3
5
  import { openTypeAheadAtCursor } from '../transforms/open-typeahead-at-cursor';
4
6
  export function inputRulePlugin(schema, typeAheads, featureFlags) {
5
7
  if (!typeAheads || typeAheads.length === 0) {
@@ -21,9 +23,9 @@ export function inputRulePlugin(schema, typeAheads, featureFlags) {
21
23
  }));
22
24
  return acc;
23
25
  }, []);
24
- const plugin = createPlugin('type-ahead', rules, {
26
+ const plugin = new SafePlugin(createPlugin('type-ahead', rules, {
25
27
  allowInsertTextOnDocument: false
26
- });
28
+ }));
27
29
  return plugin;
28
30
  }
29
31
  export default inputRulePlugin;
@@ -1,5 +1,7 @@
1
1
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import { createPlugin, createRule, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
2
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { createRule } from '@atlaskit/editor-common/utils';
4
+ import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
3
5
  import { openTypeAheadAtCursor } from '../transforms/open-typeahead-at-cursor';
4
6
  export function inputRulePlugin(schema, typeAheads, featureFlags) {
5
7
  if (!typeAheads || typeAheads.length === 0) {
@@ -21,9 +23,9 @@ export function inputRulePlugin(schema, typeAheads, featureFlags) {
21
23
  }));
22
24
  return acc;
23
25
  }, []);
24
- var plugin = createPlugin('type-ahead', rules, {
26
+ var plugin = new SafePlugin(createPlugin('type-ahead', rules, {
25
27
  allowInsertTextOnDocument: false
26
- });
28
+ }));
27
29
  return plugin;
28
30
  }
29
31
  export default inputRulePlugin;
@@ -1,4 +1,4 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { TypeAheadHandler } from '../types';
@@ -1,4 +1,4 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { TypeAheadHandler } from '../types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,17 +32,17 @@
32
32
  ".": "./src/index.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^35.5.1",
35
+ "@atlaskit/adf-schema": "^35.5.2",
36
36
  "@atlaskit/analytics-next": "^9.2.0",
37
- "@atlaskit/editor-common": "^78.0.0",
37
+ "@atlaskit/editor-common": "^78.10.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
39
39
  "@atlaskit/editor-prosemirror": "3.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^2.9.0",
41
41
  "@atlaskit/menu": "^2.1.0",
42
42
  "@atlaskit/platform-feature-flags": "^0.2.0",
43
- "@atlaskit/prosemirror-input-rules": "^2.4.0",
43
+ "@atlaskit/prosemirror-input-rules": "^3.0.0",
44
44
  "@atlaskit/theme": "^12.6.0",
45
- "@atlaskit/tokens": "^1.37.0",
45
+ "@atlaskit/tokens": "^1.39.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1",
48
48
  "lodash": "^4.17.21",