@atlaskit/editor-plugin-code-block 1.3.4 → 1.4.1

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,23 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 1.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#114156](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114156)
14
+ [`bc6a63af2d1d0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc6a63af2d1d0) -
15
+ Bump adf-schema to 37.0.0 and adf-schema-json to 1.16.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 1.3.4
4
22
 
5
23
  ### Patch Changes
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.codeBlockNodeView = exports.CodeBlockView = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -100,7 +99,7 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
100
99
  codeElement.innerHTML = savedInnerHTML;
101
100
 
102
101
  // We need to set cursor for the DOM update
103
- var textElement = (0, _toConsumableArray2.default)(codeElement.childNodes).find(function (child) {
102
+ var textElement = Array.from(codeElement.childNodes).find(function (child) {
104
103
  return child.nodeName === '#text';
105
104
  });
106
105
  var sel = window.getSelection();
@@ -82,7 +82,7 @@ export class CodeBlockView {
82
82
  codeElement.innerHTML = savedInnerHTML;
83
83
 
84
84
  // We need to set cursor for the DOM update
85
- const textElement = [...codeElement.childNodes].find(child => child.nodeName === '#text');
85
+ const textElement = Array.from(codeElement.childNodes).find(child => child.nodeName === '#text');
86
86
  const sel = window.getSelection();
87
87
  const range = document.createRange();
88
88
  range.setStart(textElement, newCursorPosition);
@@ -1,4 +1,3 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/createClass";
4
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
@@ -93,7 +92,7 @@ export var CodeBlockView = /*#__PURE__*/function () {
93
92
  codeElement.innerHTML = savedInnerHTML;
94
93
 
95
94
  // We need to set cursor for the DOM update
96
- var textElement = _toConsumableArray(codeElement.childNodes).find(function (child) {
95
+ var textElement = Array.from(codeElement.childNodes).find(function (child) {
97
96
  return child.nodeName === '#text';
98
97
  });
99
98
  var sel = window.getSelection();
@@ -8,7 +8,7 @@ export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance
8
8
  getIntl: () => IntlShape;
9
9
  appearance: EditorAppearance;
10
10
  allowCompositionInputOverride?: boolean | undefined;
11
- api?: import("@atlaskit/editor-common/types").PublicPluginAPI<[import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
11
+ api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"codeBlock", {
12
12
  pluginConfiguration: import("../types").CodeBlockOptions | undefined;
13
13
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
14
14
  sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
@@ -36,27 +36,5 @@ export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance
36
36
  actions: {
37
37
  insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
38
38
  };
39
- }, import("../types").CodeBlockOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
40
- sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
41
- actions: {
42
- hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
43
- removeDecoration: import("@atlaskit/editor-common/types").Command;
44
- };
45
- }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
46
- sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
47
- }, undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
48
- pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
49
- sharedState: {
50
- createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
51
- attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
52
- performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
53
- };
54
- dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
55
- pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
56
- sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
57
- }, import("@atlaskit/editor-common/types").FeatureFlags>>];
58
- actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
59
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
60
- sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
61
- }, undefined>>]> | undefined;
39
+ }> | undefined;
62
40
  }) => SafePlugin<CodeBlockState>;
@@ -8,70 +8,40 @@ export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance
8
8
  getIntl: () => IntlShape;
9
9
  appearance: EditorAppearance;
10
10
  allowCompositionInputOverride?: boolean | undefined;
11
- api?: import("@atlaskit/editor-common/types").PublicPluginAPI<[
12
- import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
13
- pluginConfiguration: import("../types").CodeBlockOptions | undefined;
14
- dependencies: [
15
- import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
16
- sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
17
- actions: {
18
- hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
19
- removeDecoration: import("@atlaskit/editor-common/types").Command;
20
- };
21
- }, undefined>,
22
- import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
23
- sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
24
- }, undefined>,
25
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
26
- pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
27
- sharedState: {
28
- createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
29
- attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
30
- performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
31
- };
32
- dependencies: [
33
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
34
- pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
35
- sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
36
- }, import("@atlaskit/editor-common/types").FeatureFlags>>
37
- ];
38
- actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
39
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
40
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
41
- sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
42
- }, undefined>>
43
- ];
44
- actions: {
45
- insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
46
- };
47
- }, import("../types").CodeBlockOptions | undefined>,
48
- import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
49
- sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
50
- actions: {
51
- hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
52
- removeDecoration: import("@atlaskit/editor-common/types").Command;
53
- };
54
- }, undefined>,
55
- import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
56
- sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
57
- }, undefined>,
58
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
59
- pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
60
- sharedState: {
61
- createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
62
- attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
63
- performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
64
- };
65
- dependencies: [
66
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
67
- pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
68
- sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
69
- }, import("@atlaskit/editor-common/types").FeatureFlags>>
70
- ];
71
- actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
72
- }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
73
- import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
74
- sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
75
- }, undefined>>
76
- ]> | undefined;
11
+ api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"codeBlock", {
12
+ pluginConfiguration: import("../types").CodeBlockOptions | undefined;
13
+ dependencies: [
14
+ import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
15
+ sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
16
+ actions: {
17
+ hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
18
+ removeDecoration: import("@atlaskit/editor-common/types").Command;
19
+ };
20
+ }, undefined>,
21
+ import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
22
+ sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
23
+ }, undefined>,
24
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
25
+ pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
26
+ sharedState: {
27
+ createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
28
+ attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
29
+ performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
30
+ };
31
+ dependencies: [
32
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
33
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
34
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
35
+ }, import("@atlaskit/editor-common/types").FeatureFlags>>
36
+ ];
37
+ actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
38
+ }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
39
+ import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
40
+ sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
41
+ }, undefined>>
42
+ ];
43
+ actions: {
44
+ insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
45
+ };
46
+ }> | undefined;
77
47
  }) => SafePlugin<CodeBlockState>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "1.3.4",
3
+ "version": "1.4.1",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,7 +21,10 @@
21
21
  "types": "dist/types/index.d.ts",
22
22
  "typesVersions": {
23
23
  ">=4.5 <4.9": {
24
- "*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
24
+ "*": [
25
+ "dist/types-ts4.5/*",
26
+ "dist/types-ts4.5/index.d.ts"
27
+ ]
25
28
  }
26
29
  },
27
30
  "sideEffects": false,
@@ -30,15 +33,15 @@
30
33
  ".": "./src/index.ts"
31
34
  },
32
35
  "dependencies": {
33
- "@atlaskit/adf-schema": "^36.10.7",
34
- "@atlaskit/code": "^15.2.0",
35
- "@atlaskit/editor-common": "^82.6.0",
36
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
36
+ "@atlaskit/adf-schema": "^37.0.0",
37
+ "@atlaskit/code": "^15.3.0",
38
+ "@atlaskit/editor-common": "^83.0.0",
39
+ "@atlaskit/editor-plugin-analytics": "^1.3.0",
37
40
  "@atlaskit/editor-plugin-composition": "^1.1.0",
38
41
  "@atlaskit/editor-plugin-decorations": "^1.1.0",
39
42
  "@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
40
43
  "@atlaskit/editor-prosemirror": "4.0.1",
41
- "@atlaskit/icon": "^22.3.0",
44
+ "@atlaskit/icon": "^22.4.0",
42
45
  "@atlaskit/platform-feature-flags": "^0.2.0",
43
46
  "@atlaskit/prosemirror-input-rules": "^3.1.0",
44
47
  "@babel/runtime": "^7.0.0",
@@ -53,18 +56,35 @@
53
56
  },
54
57
  "techstack": {
55
58
  "@atlassian/frontend": {
56
- "import-structure": ["atlassian-conventions"],
57
- "circular-dependencies": ["file-and-folder-level"]
59
+ "import-structure": [
60
+ "atlassian-conventions"
61
+ ],
62
+ "circular-dependencies": [
63
+ "file-and-folder-level"
64
+ ]
58
65
  },
59
66
  "@repo/internal": {
60
67
  "dom-events": "use-bind-event-listener",
61
- "analytics": ["analytics-next"],
62
- "design-tokens": ["color"],
63
- "theming": ["react-context"],
64
- "ui-components": ["lite-mode"],
68
+ "analytics": [
69
+ "analytics-next"
70
+ ],
71
+ "design-tokens": [
72
+ "color"
73
+ ],
74
+ "theming": [
75
+ "react-context"
76
+ ],
77
+ "ui-components": [
78
+ "lite-mode"
79
+ ],
65
80
  "deprecation": "no-deprecated-imports",
66
- "styling": ["emotion", "emotion"],
67
- "imports": ["import-no-extraneous-disable-for-examples-and-docs"]
81
+ "styling": [
82
+ "emotion",
83
+ "emotion"
84
+ ],
85
+ "imports": [
86
+ "import-no-extraneous-disable-for-examples-and-docs"
87
+ ]
68
88
  }
69
89
  },
70
90
  "stricter": {