@atlaskit/editor-plugin-code-block 1.4.0 → 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
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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").
|
|
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
|
-
}
|
|
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").
|
|
12
|
-
import("
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import("@atlaskit/editor-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import("@atlaskit/editor-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import("@atlaskit/editor-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import("@atlaskit/editor-common/types").
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
import("@atlaskit/editor-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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.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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^37.0.0",
|
|
37
37
|
"@atlaskit/code": "^15.3.0",
|
|
38
|
-
"@atlaskit/editor-common": "^
|
|
38
|
+
"@atlaskit/editor-common": "^83.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-composition": "^1.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|