@atlaskit/editor-plugin-code-block 1.1.7 → 1.1.9
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 +14 -0
- package/dist/cjs/nodeviews/code-block.js +7 -13
- package/dist/cjs/plugin.js +1 -2
- package/dist/cjs/pm-plugins/main.js +2 -5
- package/dist/es2019/nodeviews/code-block.js +5 -11
- package/dist/es2019/plugin.js +1 -2
- package/dist/es2019/pm-plugins/main.js +2 -3
- package/dist/esm/nodeviews/code-block.js +7 -13
- package/dist/esm/plugin.js +1 -2
- package/dist/esm/pm-plugins/main.js +2 -5
- package/dist/types/nodeviews/code-block.d.ts +3 -5
- package/dist/types/plugin.d.ts +1 -3
- package/dist/types/pm-plugins/main.d.ts +2 -138
- package/dist/types-ts4.5/nodeviews/code-block.d.ts +3 -5
- package/dist/types-ts4.5/plugin.d.ts +1 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -167
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 1.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106) [`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) - Bump ADF-schema package to version 35.0.0
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 1.1.8
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#91080](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91080) [`ef9f3c4ad482`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef9f3c4ad482) - Revert change for disable code block in live view
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 1.1.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ var _actions = require("../actions");
|
|
|
16
16
|
var _mainState = require("../pm-plugins/main-state");
|
|
17
17
|
var _classNames = require("../ui/class-names");
|
|
18
18
|
var MATCH_NEWLINES = new RegExp('\n', 'g');
|
|
19
|
-
var toDOM = function toDOM(node
|
|
19
|
+
var toDOM = function toDOM(node) {
|
|
20
20
|
return ['div', {
|
|
21
21
|
class: 'code-block'
|
|
22
22
|
}, ['div', {
|
|
@@ -32,7 +32,7 @@ var toDOM = function toDOM(node, isViewOnly) {
|
|
|
32
32
|
}, ['code', {
|
|
33
33
|
'data-language': node.attrs.language || '',
|
|
34
34
|
spellcheck: 'false',
|
|
35
|
-
contenteditable:
|
|
35
|
+
contenteditable: 'true',
|
|
36
36
|
'data-testid': 'code-block--code'
|
|
37
37
|
}, 0]]], ['div', {
|
|
38
38
|
class: _classNames.codeBlockClassNames.end,
|
|
@@ -40,9 +40,8 @@ var toDOM = function toDOM(node, isViewOnly) {
|
|
|
40
40
|
}]];
|
|
41
41
|
};
|
|
42
42
|
var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
43
|
-
function CodeBlockView(_node, view, getPos
|
|
44
|
-
var _this = this
|
|
45
|
-
_api$editorViewMode;
|
|
43
|
+
function CodeBlockView(_node, view, getPos) {
|
|
44
|
+
var _this = this;
|
|
46
45
|
(0, _classCallCheck2.default)(this, CodeBlockView);
|
|
47
46
|
(0, _defineProperty2.default)(this, "ensureLineNumbers", (0, _rafSchd.default)(function () {
|
|
48
47
|
var lines = 1;
|
|
@@ -59,8 +58,7 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
|
59
58
|
_this.lineNumberGutter.removeChild(_this.lineNumberGutter.lastChild);
|
|
60
59
|
}
|
|
61
60
|
}));
|
|
62
|
-
var
|
|
63
|
-
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(_node, isViewOnly)),
|
|
61
|
+
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(_node)),
|
|
64
62
|
dom = _DOMSerializer$render.dom,
|
|
65
63
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
66
64
|
this.getPos = getPos;
|
|
@@ -69,7 +67,6 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
|
69
67
|
this.dom = dom;
|
|
70
68
|
this.contentDOM = contentDOM;
|
|
71
69
|
this.lineNumberGutter = this.dom.querySelector(".".concat(_classNames.codeBlockClassNames.gutter));
|
|
72
|
-
this.api = api;
|
|
73
70
|
this.ensureLineNumbers();
|
|
74
71
|
}
|
|
75
72
|
(0, _createClass2.default)(CodeBlockView, [{
|
|
@@ -121,7 +118,6 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
|
121
118
|
}, {
|
|
122
119
|
key: "update",
|
|
123
120
|
value: function update(node) {
|
|
124
|
-
var _this$api;
|
|
125
121
|
if (node.type !== this.node.type) {
|
|
126
122
|
return false;
|
|
127
123
|
}
|
|
@@ -136,8 +132,6 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
|
136
132
|
(0, _actions.resetShouldIgnoreFollowingMutations)(this.view.state, this.view.dispatch);
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
|
-
var editorViewModePluginState = (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.editorViewMode) === null || _this$api === void 0 ? void 0 : _this$api.sharedState.currentState();
|
|
140
|
-
this.contentDOM.setAttribute('contenteditable', (editorViewModePluginState === null || editorViewModePluginState === void 0 ? void 0 : editorViewModePluginState.mode) === 'view' || !this.view.editable ? 'false' : 'true');
|
|
141
135
|
return true;
|
|
142
136
|
}
|
|
143
137
|
}, {
|
|
@@ -154,6 +148,6 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
|
154
148
|
}]);
|
|
155
149
|
return CodeBlockView;
|
|
156
150
|
}();
|
|
157
|
-
var codeBlockNodeView = exports.codeBlockNodeView = function codeBlockNodeView(node, view, getPos
|
|
158
|
-
return new CodeBlockView(node, view, getPos
|
|
151
|
+
var codeBlockNodeView = exports.codeBlockNodeView = function codeBlockNodeView(node, view, getPos) {
|
|
152
|
+
return new CodeBlockView(node, view, getPos);
|
|
159
153
|
};
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -40,8 +40,7 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
|
|
|
40
40
|
var getIntl = _ref2.getIntl;
|
|
41
41
|
return (0, _main.createPlugin)(_objectSpread(_objectSpread({}, options), {}, {
|
|
42
42
|
getIntl: getIntl,
|
|
43
|
-
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
44
|
-
api: api
|
|
43
|
+
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
45
44
|
}));
|
|
46
45
|
}
|
|
47
46
|
}, {
|
|
@@ -24,8 +24,7 @@ var createPlugin = exports.createPlugin = function createPlugin(_ref) {
|
|
|
24
24
|
getIntl = _ref.getIntl,
|
|
25
25
|
appearance = _ref.appearance,
|
|
26
26
|
_ref$allowComposition = _ref.allowCompositionInputOverride,
|
|
27
|
-
allowCompositionInputOverride = _ref$allowComposition === void 0 ? false : _ref$allowComposition
|
|
28
|
-
api = _ref.api;
|
|
27
|
+
allowCompositionInputOverride = _ref$allowComposition === void 0 ? false : _ref$allowComposition;
|
|
29
28
|
var handleDOMEvents = {};
|
|
30
29
|
|
|
31
30
|
// ME-1599: Composition on mobile was causing the DOM observer to mutate the code block
|
|
@@ -102,9 +101,7 @@ var createPlugin = exports.createPlugin = function createPlugin(_ref) {
|
|
|
102
101
|
key: _pluginKey.pluginKey,
|
|
103
102
|
props: {
|
|
104
103
|
nodeViews: {
|
|
105
|
-
codeBlock:
|
|
106
|
-
return (0, _codeBlock.codeBlockNodeView)(node, view, getPos, api);
|
|
107
|
-
}
|
|
104
|
+
codeBlock: _codeBlock.codeBlockNodeView
|
|
108
105
|
},
|
|
109
106
|
handleClickOn: (0, _selection.createSelectionClickHandler)(['codeBlock'], function (target) {
|
|
110
107
|
return !!(target.closest(".".concat(_classNames.codeBlockClassNames.gutter)) || target.classList.contains(_classNames.codeBlockClassNames.content));
|
|
@@ -6,7 +6,7 @@ import { resetShouldIgnoreFollowingMutations } from '../actions';
|
|
|
6
6
|
import { getPluginState } from '../pm-plugins/main-state';
|
|
7
7
|
import { codeBlockClassNames } from '../ui/class-names';
|
|
8
8
|
const MATCH_NEWLINES = new RegExp('\n', 'g');
|
|
9
|
-
const toDOM =
|
|
9
|
+
const toDOM = node => ['div', {
|
|
10
10
|
class: 'code-block'
|
|
11
11
|
}, ['div', {
|
|
12
12
|
class: codeBlockClassNames.start,
|
|
@@ -21,15 +21,14 @@ const toDOM = (node, isViewOnly) => ['div', {
|
|
|
21
21
|
}, ['code', {
|
|
22
22
|
'data-language': node.attrs.language || '',
|
|
23
23
|
spellcheck: 'false',
|
|
24
|
-
contenteditable:
|
|
24
|
+
contenteditable: 'true',
|
|
25
25
|
'data-testid': 'code-block--code'
|
|
26
26
|
}, 0]]], ['div', {
|
|
27
27
|
class: codeBlockClassNames.end,
|
|
28
28
|
contenteditable: 'false'
|
|
29
29
|
}]];
|
|
30
30
|
export class CodeBlockView {
|
|
31
|
-
constructor(_node, view, getPos
|
|
32
|
-
var _api$editorViewMode, _api$editorViewMode$s;
|
|
31
|
+
constructor(_node, view, getPos) {
|
|
33
32
|
_defineProperty(this, "ensureLineNumbers", rafSchedule(() => {
|
|
34
33
|
let lines = 1;
|
|
35
34
|
this.node.forEach(node => {
|
|
@@ -45,18 +44,16 @@ export class CodeBlockView {
|
|
|
45
44
|
this.lineNumberGutter.removeChild(this.lineNumberGutter.lastChild);
|
|
46
45
|
}
|
|
47
46
|
}));
|
|
48
|
-
const isViewOnly = (api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : (_api$editorViewMode$s = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode$s === void 0 ? void 0 : _api$editorViewMode$s.mode) === 'view' || !view.editable;
|
|
49
47
|
const {
|
|
50
48
|
dom,
|
|
51
49
|
contentDOM
|
|
52
|
-
} = DOMSerializer.renderSpec(document, toDOM(_node
|
|
50
|
+
} = DOMSerializer.renderSpec(document, toDOM(_node));
|
|
53
51
|
this.getPos = getPos;
|
|
54
52
|
this.view = view;
|
|
55
53
|
this.node = _node;
|
|
56
54
|
this.dom = dom;
|
|
57
55
|
this.contentDOM = contentDOM;
|
|
58
56
|
this.lineNumberGutter = this.dom.querySelector(`.${codeBlockClassNames.gutter}`);
|
|
59
|
-
this.api = api;
|
|
60
57
|
this.ensureLineNumbers();
|
|
61
58
|
}
|
|
62
59
|
updateDOMAndSelection(savedInnerHTML, newCursorPosition) {
|
|
@@ -100,7 +97,6 @@ export class CodeBlockView {
|
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
update(node) {
|
|
103
|
-
var _this$api, _this$api$editorViewM;
|
|
104
100
|
if (node.type !== this.node.type) {
|
|
105
101
|
return false;
|
|
106
102
|
}
|
|
@@ -115,8 +111,6 @@ export class CodeBlockView {
|
|
|
115
111
|
resetShouldIgnoreFollowingMutations(this.view.state, this.view.dispatch);
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
|
-
const editorViewModePluginState = (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$editorViewM = _this$api.editorViewMode) === null || _this$api$editorViewM === void 0 ? void 0 : _this$api$editorViewM.sharedState.currentState();
|
|
119
|
-
this.contentDOM.setAttribute('contenteditable', (editorViewModePluginState === null || editorViewModePluginState === void 0 ? void 0 : editorViewModePluginState.mode) === 'view' || !this.view.editable ? 'false' : 'true');
|
|
120
114
|
return true;
|
|
121
115
|
}
|
|
122
116
|
ignoreMutation(record) {
|
|
@@ -129,4 +123,4 @@ export class CodeBlockView {
|
|
|
129
123
|
return record.target === this.lineNumberGutter || record.target.parentNode === this.lineNumberGutter;
|
|
130
124
|
}
|
|
131
125
|
}
|
|
132
|
-
export const codeBlockNodeView = (node, view, getPos
|
|
126
|
+
export const codeBlockNodeView = (node, view, getPos) => new CodeBlockView(node, view, getPos);
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -32,8 +32,7 @@ const codeBlockPlugin = ({
|
|
|
32
32
|
return createPlugin({
|
|
33
33
|
...options,
|
|
34
34
|
getIntl,
|
|
35
|
-
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
36
|
-
api
|
|
35
|
+
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
}, {
|
|
@@ -12,8 +12,7 @@ export const createPlugin = ({
|
|
|
12
12
|
useLongPressSelection = false,
|
|
13
13
|
getIntl,
|
|
14
14
|
appearance,
|
|
15
|
-
allowCompositionInputOverride = false
|
|
16
|
-
api
|
|
15
|
+
allowCompositionInputOverride = false
|
|
17
16
|
}) => {
|
|
18
17
|
const handleDOMEvents = {};
|
|
19
18
|
|
|
@@ -92,7 +91,7 @@ export const createPlugin = ({
|
|
|
92
91
|
key: pluginKey,
|
|
93
92
|
props: {
|
|
94
93
|
nodeViews: {
|
|
95
|
-
codeBlock:
|
|
94
|
+
codeBlock: codeBlockNodeView
|
|
96
95
|
},
|
|
97
96
|
handleClickOn: createSelectionClickHandler(['codeBlock'], target => !!(target.closest(`.${codeBlockClassNames.gutter}`) || target.classList.contains(codeBlockClassNames.content)), {
|
|
98
97
|
useLongPressSelection
|
|
@@ -9,7 +9,7 @@ import { resetShouldIgnoreFollowingMutations } from '../actions';
|
|
|
9
9
|
import { getPluginState } from '../pm-plugins/main-state';
|
|
10
10
|
import { codeBlockClassNames } from '../ui/class-names';
|
|
11
11
|
var MATCH_NEWLINES = new RegExp('\n', 'g');
|
|
12
|
-
var toDOM = function toDOM(node
|
|
12
|
+
var toDOM = function toDOM(node) {
|
|
13
13
|
return ['div', {
|
|
14
14
|
class: 'code-block'
|
|
15
15
|
}, ['div', {
|
|
@@ -25,7 +25,7 @@ var toDOM = function toDOM(node, isViewOnly) {
|
|
|
25
25
|
}, ['code', {
|
|
26
26
|
'data-language': node.attrs.language || '',
|
|
27
27
|
spellcheck: 'false',
|
|
28
|
-
contenteditable:
|
|
28
|
+
contenteditable: 'true',
|
|
29
29
|
'data-testid': 'code-block--code'
|
|
30
30
|
}, 0]]], ['div', {
|
|
31
31
|
class: codeBlockClassNames.end,
|
|
@@ -33,9 +33,8 @@ var toDOM = function toDOM(node, isViewOnly) {
|
|
|
33
33
|
}]];
|
|
34
34
|
};
|
|
35
35
|
export var CodeBlockView = /*#__PURE__*/function () {
|
|
36
|
-
function CodeBlockView(_node, view, getPos
|
|
37
|
-
var _this = this
|
|
38
|
-
_api$editorViewMode;
|
|
36
|
+
function CodeBlockView(_node, view, getPos) {
|
|
37
|
+
var _this = this;
|
|
39
38
|
_classCallCheck(this, CodeBlockView);
|
|
40
39
|
_defineProperty(this, "ensureLineNumbers", rafSchedule(function () {
|
|
41
40
|
var lines = 1;
|
|
@@ -52,8 +51,7 @@ export var CodeBlockView = /*#__PURE__*/function () {
|
|
|
52
51
|
_this.lineNumberGutter.removeChild(_this.lineNumberGutter.lastChild);
|
|
53
52
|
}
|
|
54
53
|
}));
|
|
55
|
-
var
|
|
56
|
-
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(_node, isViewOnly)),
|
|
54
|
+
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(_node)),
|
|
57
55
|
dom = _DOMSerializer$render.dom,
|
|
58
56
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
59
57
|
this.getPos = getPos;
|
|
@@ -62,7 +60,6 @@ export var CodeBlockView = /*#__PURE__*/function () {
|
|
|
62
60
|
this.dom = dom;
|
|
63
61
|
this.contentDOM = contentDOM;
|
|
64
62
|
this.lineNumberGutter = this.dom.querySelector(".".concat(codeBlockClassNames.gutter));
|
|
65
|
-
this.api = api;
|
|
66
63
|
this.ensureLineNumbers();
|
|
67
64
|
}
|
|
68
65
|
_createClass(CodeBlockView, [{
|
|
@@ -114,7 +111,6 @@ export var CodeBlockView = /*#__PURE__*/function () {
|
|
|
114
111
|
}, {
|
|
115
112
|
key: "update",
|
|
116
113
|
value: function update(node) {
|
|
117
|
-
var _this$api;
|
|
118
114
|
if (node.type !== this.node.type) {
|
|
119
115
|
return false;
|
|
120
116
|
}
|
|
@@ -129,8 +125,6 @@ export var CodeBlockView = /*#__PURE__*/function () {
|
|
|
129
125
|
resetShouldIgnoreFollowingMutations(this.view.state, this.view.dispatch);
|
|
130
126
|
}
|
|
131
127
|
}
|
|
132
|
-
var editorViewModePluginState = (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.editorViewMode) === null || _this$api === void 0 ? void 0 : _this$api.sharedState.currentState();
|
|
133
|
-
this.contentDOM.setAttribute('contenteditable', (editorViewModePluginState === null || editorViewModePluginState === void 0 ? void 0 : editorViewModePluginState.mode) === 'view' || !this.view.editable ? 'false' : 'true');
|
|
134
128
|
return true;
|
|
135
129
|
}
|
|
136
130
|
}, {
|
|
@@ -147,6 +141,6 @@ export var CodeBlockView = /*#__PURE__*/function () {
|
|
|
147
141
|
}]);
|
|
148
142
|
return CodeBlockView;
|
|
149
143
|
}();
|
|
150
|
-
export var codeBlockNodeView = function codeBlockNodeView(node, view, getPos
|
|
151
|
-
return new CodeBlockView(node, view, getPos
|
|
144
|
+
export var codeBlockNodeView = function codeBlockNodeView(node, view, getPos) {
|
|
145
|
+
return new CodeBlockView(node, view, getPos);
|
|
152
146
|
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -33,8 +33,7 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
|
|
|
33
33
|
var getIntl = _ref2.getIntl;
|
|
34
34
|
return createPlugin(_objectSpread(_objectSpread({}, options), {}, {
|
|
35
35
|
getIntl: getIntl,
|
|
36
|
-
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
37
|
-
api: api
|
|
36
|
+
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
38
37
|
}));
|
|
39
38
|
}
|
|
40
39
|
}, {
|
|
@@ -17,8 +17,7 @@ export var createPlugin = function createPlugin(_ref) {
|
|
|
17
17
|
getIntl = _ref.getIntl,
|
|
18
18
|
appearance = _ref.appearance,
|
|
19
19
|
_ref$allowComposition = _ref.allowCompositionInputOverride,
|
|
20
|
-
allowCompositionInputOverride = _ref$allowComposition === void 0 ? false : _ref$allowComposition
|
|
21
|
-
api = _ref.api;
|
|
20
|
+
allowCompositionInputOverride = _ref$allowComposition === void 0 ? false : _ref$allowComposition;
|
|
22
21
|
var handleDOMEvents = {};
|
|
23
22
|
|
|
24
23
|
// ME-1599: Composition on mobile was causing the DOM observer to mutate the code block
|
|
@@ -95,9 +94,7 @@ export var createPlugin = function createPlugin(_ref) {
|
|
|
95
94
|
key: pluginKey,
|
|
96
95
|
props: {
|
|
97
96
|
nodeViews: {
|
|
98
|
-
codeBlock:
|
|
99
|
-
return codeBlockNodeView(node, view, getPos, api);
|
|
100
|
-
}
|
|
97
|
+
codeBlock: codeBlockNodeView
|
|
101
98
|
},
|
|
102
99
|
handleClickOn: createSelectionClickHandler(['codeBlock'], function (target) {
|
|
103
100
|
return !!(target.closest(".".concat(codeBlockClassNames.gutter)) || target.classList.contains(codeBlockClassNames.content));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { CodeBlockPlugin } from '../index';
|
|
5
4
|
export declare class CodeBlockView {
|
|
6
5
|
node: Node;
|
|
7
6
|
dom: HTMLElement;
|
|
@@ -9,8 +8,7 @@ export declare class CodeBlockView {
|
|
|
9
8
|
lineNumberGutter: HTMLElement;
|
|
10
9
|
getPos: getPosHandlerNode;
|
|
11
10
|
view: EditorView;
|
|
12
|
-
|
|
13
|
-
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode, api?: ExtractInjectionAPI<CodeBlockPlugin>);
|
|
11
|
+
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode);
|
|
14
12
|
updateDOMAndSelection(savedInnerHTML: string, newCursorPosition: number): void;
|
|
15
13
|
coalesceDOMElements(): void;
|
|
16
14
|
private ensureLineNumbers;
|
|
@@ -20,4 +18,4 @@ export declare class CodeBlockView {
|
|
|
20
18
|
target: Element;
|
|
21
19
|
}): boolean;
|
|
22
20
|
}
|
|
23
|
-
export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler
|
|
21
|
+
export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler) => CodeBlockView;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -3,15 +3,13 @@ import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor
|
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
5
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
7
6
|
import type { CodeBlockOptions } from './types';
|
|
8
7
|
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
9
8
|
pluginConfiguration: CodeBlockOptions | undefined;
|
|
10
9
|
dependencies: [
|
|
11
10
|
DecorationsPlugin,
|
|
12
11
|
CompositionPlugin,
|
|
13
|
-
OptionalPlugin<AnalyticsPlugin
|
|
14
|
-
OptionalPlugin<EditorViewModePlugin>
|
|
12
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
15
13
|
];
|
|
16
14
|
actions: {
|
|
17
15
|
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
@@ -1,146 +1,10 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import type { EditorAppearance
|
|
4
|
-
import type { CodeBlockPlugin } from '../index';
|
|
3
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
5
4
|
import type { CodeBlockState } from './main-state';
|
|
6
|
-
export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride,
|
|
5
|
+
export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride, }: {
|
|
7
6
|
useLongPressSelection?: boolean | undefined;
|
|
8
7
|
getIntl: () => IntlShape;
|
|
9
8
|
appearance: EditorAppearance;
|
|
10
9
|
allowCompositionInputOverride?: boolean | undefined;
|
|
11
|
-
api?: import("@atlaskit/editor-common/types").PublicPluginAPI<[import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
|
|
12
|
-
pluginConfiguration: import("../types").CodeBlockOptions | undefined;
|
|
13
|
-
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
14
|
-
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
15
|
-
actions: {
|
|
16
|
-
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
17
|
-
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
18
|
-
};
|
|
19
|
-
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
|
|
20
|
-
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
21
|
-
}, undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
22
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
23
|
-
sharedState: {
|
|
24
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
25
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
26
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
27
|
-
};
|
|
28
|
-
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
29
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
30
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
31
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
32
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
33
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
34
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
35
|
-
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
36
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
37
|
-
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
38
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
39
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
40
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
41
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
42
|
-
sharedState: {
|
|
43
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
44
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
45
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
46
|
-
};
|
|
47
|
-
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
48
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
49
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
50
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
51
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
52
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
53
|
-
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
54
|
-
actions: {
|
|
55
|
-
getAvatarColor: (str: string) => {
|
|
56
|
-
index: number;
|
|
57
|
-
color: import("@atlaskit/editor-common/collab").Color;
|
|
58
|
-
};
|
|
59
|
-
addInlineCommentMark: (props: {
|
|
60
|
-
from: number;
|
|
61
|
-
to: number;
|
|
62
|
-
mark: import("prosemirror-model").Mark;
|
|
63
|
-
}) => boolean;
|
|
64
|
-
};
|
|
65
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
66
|
-
pluginConfiguration?: {
|
|
67
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
68
|
-
} | undefined;
|
|
69
|
-
commands: {
|
|
70
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
71
|
-
};
|
|
72
|
-
actions: {
|
|
73
|
-
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
74
|
-
};
|
|
75
|
-
}, {
|
|
76
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
77
|
-
} | undefined>>];
|
|
78
|
-
actions: {
|
|
79
|
-
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
80
|
-
};
|
|
81
|
-
}, import("../types").CodeBlockOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
82
|
-
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
83
|
-
actions: {
|
|
84
|
-
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
85
|
-
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
86
|
-
};
|
|
87
|
-
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
|
|
88
|
-
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
89
|
-
}, undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
90
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
91
|
-
sharedState: {
|
|
92
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
93
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
94
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
95
|
-
};
|
|
96
|
-
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
97
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
98
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
99
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
100
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
101
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
102
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
103
|
-
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
104
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
105
|
-
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
106
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
107
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
108
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
109
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
110
|
-
sharedState: {
|
|
111
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
112
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
113
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
114
|
-
};
|
|
115
|
-
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
116
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
117
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
118
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
119
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
120
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
121
|
-
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
122
|
-
actions: {
|
|
123
|
-
getAvatarColor: (str: string) => {
|
|
124
|
-
index: number;
|
|
125
|
-
color: import("@atlaskit/editor-common/collab").Color;
|
|
126
|
-
};
|
|
127
|
-
addInlineCommentMark: (props: {
|
|
128
|
-
from: number;
|
|
129
|
-
to: number;
|
|
130
|
-
mark: import("prosemirror-model").Mark;
|
|
131
|
-
}) => boolean;
|
|
132
|
-
};
|
|
133
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
134
|
-
pluginConfiguration?: {
|
|
135
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
136
|
-
} | undefined;
|
|
137
|
-
commands: {
|
|
138
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
139
|
-
};
|
|
140
|
-
actions: {
|
|
141
|
-
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
142
|
-
};
|
|
143
|
-
}, {
|
|
144
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
145
|
-
} | undefined>>]> | undefined;
|
|
146
10
|
}) => SafePlugin<CodeBlockState>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { CodeBlockPlugin } from '../index';
|
|
5
4
|
export declare class CodeBlockView {
|
|
6
5
|
node: Node;
|
|
7
6
|
dom: HTMLElement;
|
|
@@ -9,8 +8,7 @@ export declare class CodeBlockView {
|
|
|
9
8
|
lineNumberGutter: HTMLElement;
|
|
10
9
|
getPos: getPosHandlerNode;
|
|
11
10
|
view: EditorView;
|
|
12
|
-
|
|
13
|
-
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode, api?: ExtractInjectionAPI<CodeBlockPlugin>);
|
|
11
|
+
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode);
|
|
14
12
|
updateDOMAndSelection(savedInnerHTML: string, newCursorPosition: number): void;
|
|
15
13
|
coalesceDOMElements(): void;
|
|
16
14
|
private ensureLineNumbers;
|
|
@@ -20,4 +18,4 @@ export declare class CodeBlockView {
|
|
|
20
18
|
target: Element;
|
|
21
19
|
}): boolean;
|
|
22
20
|
}
|
|
23
|
-
export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler
|
|
21
|
+
export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler) => CodeBlockView;
|
|
@@ -3,15 +3,13 @@ import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor
|
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
5
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
7
6
|
import type { CodeBlockOptions } from './types';
|
|
8
7
|
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
9
8
|
pluginConfiguration: CodeBlockOptions | undefined;
|
|
10
9
|
dependencies: [
|
|
11
10
|
DecorationsPlugin,
|
|
12
11
|
CompositionPlugin,
|
|
13
|
-
OptionalPlugin<AnalyticsPlugin
|
|
14
|
-
OptionalPlugin<EditorViewModePlugin>
|
|
12
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
15
13
|
];
|
|
16
14
|
actions: {
|
|
17
15
|
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
@@ -1,175 +1,10 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import type { EditorAppearance
|
|
4
|
-
import type { CodeBlockPlugin } from '../index';
|
|
3
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
5
4
|
import type { CodeBlockState } from './main-state';
|
|
6
|
-
export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride,
|
|
5
|
+
export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride, }: {
|
|
7
6
|
useLongPressSelection?: boolean | undefined;
|
|
8
7
|
getIntl: () => IntlShape;
|
|
9
8
|
appearance: EditorAppearance;
|
|
10
9
|
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<"editorViewMode", {
|
|
41
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
42
|
-
dependencies: [
|
|
43
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
44
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
45
|
-
dependencies: [
|
|
46
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
47
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
48
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
49
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>,
|
|
50
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
51
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
52
|
-
sharedState: {
|
|
53
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
54
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
55
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
56
|
-
};
|
|
57
|
-
dependencies: [
|
|
58
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
59
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
60
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
61
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
62
|
-
];
|
|
63
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
64
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
65
|
-
];
|
|
66
|
-
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
67
|
-
actions: {
|
|
68
|
-
getAvatarColor: (str: string) => {
|
|
69
|
-
index: number;
|
|
70
|
-
color: import("@atlaskit/editor-common/collab").Color;
|
|
71
|
-
};
|
|
72
|
-
addInlineCommentMark: (props: {
|
|
73
|
-
from: number;
|
|
74
|
-
to: number;
|
|
75
|
-
mark: import("prosemirror-model").Mark;
|
|
76
|
-
}) => boolean;
|
|
77
|
-
};
|
|
78
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
79
|
-
];
|
|
80
|
-
pluginConfiguration?: {
|
|
81
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
82
|
-
} | undefined;
|
|
83
|
-
commands: {
|
|
84
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
85
|
-
};
|
|
86
|
-
actions: {
|
|
87
|
-
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
88
|
-
};
|
|
89
|
-
}, {
|
|
90
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
91
|
-
} | undefined>>
|
|
92
|
-
];
|
|
93
|
-
actions: {
|
|
94
|
-
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
95
|
-
};
|
|
96
|
-
}, import("../types").CodeBlockOptions | undefined>,
|
|
97
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
98
|
-
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
99
|
-
actions: {
|
|
100
|
-
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
101
|
-
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
102
|
-
};
|
|
103
|
-
}, undefined>,
|
|
104
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"composition", {
|
|
105
|
-
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
106
|
-
}, undefined>,
|
|
107
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
108
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
109
|
-
sharedState: {
|
|
110
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
111
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
112
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
113
|
-
};
|
|
114
|
-
dependencies: [
|
|
115
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
116
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
117
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
118
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
119
|
-
];
|
|
120
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
121
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
|
|
122
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
123
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
124
|
-
dependencies: [
|
|
125
|
-
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
126
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
127
|
-
dependencies: [
|
|
128
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
129
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
130
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
131
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>,
|
|
132
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
133
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
134
|
-
sharedState: {
|
|
135
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
136
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
137
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
138
|
-
};
|
|
139
|
-
dependencies: [
|
|
140
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
141
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
142
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
143
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
144
|
-
];
|
|
145
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
146
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
147
|
-
];
|
|
148
|
-
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
149
|
-
actions: {
|
|
150
|
-
getAvatarColor: (str: string) => {
|
|
151
|
-
index: number;
|
|
152
|
-
color: import("@atlaskit/editor-common/collab").Color;
|
|
153
|
-
};
|
|
154
|
-
addInlineCommentMark: (props: {
|
|
155
|
-
from: number;
|
|
156
|
-
to: number;
|
|
157
|
-
mark: import("prosemirror-model").Mark;
|
|
158
|
-
}) => boolean;
|
|
159
|
-
};
|
|
160
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
161
|
-
];
|
|
162
|
-
pluginConfiguration?: {
|
|
163
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
164
|
-
} | undefined;
|
|
165
|
-
commands: {
|
|
166
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
167
|
-
};
|
|
168
|
-
actions: {
|
|
169
|
-
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
170
|
-
};
|
|
171
|
-
}, {
|
|
172
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
173
|
-
} | undefined>>
|
|
174
|
-
]> | undefined;
|
|
175
10
|
}) => SafePlugin<CodeBlockState>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,13 +33,12 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/adf-schema": "^35.
|
|
36
|
+
"@atlaskit/adf-schema": "^35.9.0",
|
|
37
37
|
"@atlaskit/code": "^15.1.0",
|
|
38
|
-
"@atlaskit/editor-common": "^78.
|
|
38
|
+
"@atlaskit/editor-common": "^78.28.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-composition": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^1.0.0",
|
|
43
42
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
44
43
|
"@atlaskit/icon": "^22.1.0",
|
|
45
44
|
"@atlaskit/prosemirror-input-rules": "^3.0.0",
|