@atlaskit/editor-plugin-panel 0.1.13 → 0.2.0
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 +17 -0
- package/dist/cjs/plugin.js +21 -8
- package/dist/cjs/pm-plugins/keymaps.js +2 -2
- package/dist/es2019/plugin.js +23 -8
- package/dist/es2019/pm-plugins/keymaps.js +2 -2
- package/dist/esm/plugin.js +21 -8
- package/dist/esm/pm-plugins/keymaps.js +2 -2
- package/package.json +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#64335](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64335) [`efc8826c907f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/efc8826c907f) - [ux] [ED-16509] Restart numbered list inserting nodes via QUICK INSERT, nodes including : panels, expands, decisions, tables, layout, quotes, actions, dividers, headings. Changes are being guarded behind feature flag platform.editor.ordered-list-inserting-nodes_bh0vo
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 0.1.14
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#63930](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63930) [`ab09a2d6f8f4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab09a2d6f8f4) - ED-21649 Fixed issue with media content getting lost on backspace
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 0.1.13
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -11,6 +11,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
12
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
13
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
16
|
var _actions = require("./actions");
|
|
16
17
|
var _keymaps = _interopRequireDefault(require("./pm-plugins/keymaps"));
|
|
@@ -68,7 +69,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
68
69
|
attributes: {
|
|
69
70
|
panelType: _adfSchema.PanelType.INFO
|
|
70
71
|
},
|
|
71
|
-
api: api
|
|
72
|
+
api: api,
|
|
73
|
+
insert: insert
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
76
|
}, {
|
|
@@ -85,7 +87,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
85
87
|
attributes: {
|
|
86
88
|
panelType: _adfSchema.PanelType.NOTE
|
|
87
89
|
},
|
|
88
|
-
api: api
|
|
90
|
+
api: api,
|
|
91
|
+
insert: insert
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
}, {
|
|
@@ -103,7 +106,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
103
106
|
attributes: {
|
|
104
107
|
panelType: _adfSchema.PanelType.SUCCESS
|
|
105
108
|
},
|
|
106
|
-
api: api
|
|
109
|
+
api: api,
|
|
110
|
+
insert: insert
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
113
|
}, {
|
|
@@ -120,7 +124,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
120
124
|
attributes: {
|
|
121
125
|
panelType: _adfSchema.PanelType.WARNING
|
|
122
126
|
},
|
|
123
|
-
api: api
|
|
127
|
+
api: api,
|
|
128
|
+
insert: insert
|
|
124
129
|
});
|
|
125
130
|
}
|
|
126
131
|
}, {
|
|
@@ -137,7 +142,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
137
142
|
attributes: {
|
|
138
143
|
panelType: _adfSchema.PanelType.ERROR
|
|
139
144
|
},
|
|
140
|
-
api: api
|
|
145
|
+
api: api,
|
|
146
|
+
insert: insert
|
|
141
147
|
});
|
|
142
148
|
}
|
|
143
149
|
}];
|
|
@@ -162,7 +168,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
162
168
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
163
169
|
panelColor: _colors.T50
|
|
164
170
|
},
|
|
165
|
-
api: api
|
|
171
|
+
api: api,
|
|
172
|
+
insert: insert
|
|
166
173
|
});
|
|
167
174
|
}
|
|
168
175
|
});
|
|
@@ -191,8 +198,14 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
191
198
|
function createPanelAction(_ref4) {
|
|
192
199
|
var state = _ref4.state,
|
|
193
200
|
attributes = _ref4.attributes,
|
|
194
|
-
api = _ref4.api
|
|
195
|
-
|
|
201
|
+
api = _ref4.api,
|
|
202
|
+
insert = _ref4.insert;
|
|
203
|
+
var panel = state.schema.nodes.panel;
|
|
204
|
+
var node = panel.createAndFill(attributes);
|
|
205
|
+
if (!node) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
var tr = state.selection.empty && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.ordered-list-inserting-nodes_bh0vo') ? insert(node) : (0, _utils.createWrapSelectionTransaction)({
|
|
196
209
|
state: state,
|
|
197
210
|
type: state.schema.nodes.panel,
|
|
198
211
|
nodeAttributes: attributes
|
|
@@ -52,12 +52,12 @@ function keymapPlugin() {
|
|
|
52
52
|
var isPreviousNodeAPanel = previousNodeType === panel;
|
|
53
53
|
var isParentNodeAPanel = parentNodeType === panel;
|
|
54
54
|
var nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
|
|
55
|
-
var
|
|
55
|
+
var hasParentNodeofTypeList = (0, _utils2.hasParentNodeOfType)([bulletList, orderedList])(selection);
|
|
56
56
|
|
|
57
57
|
// Stops merging panels when deleting empty paragraph in between
|
|
58
58
|
// Stops merging blockquotes with panels when deleting from start of blockquote
|
|
59
59
|
|
|
60
|
-
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || (0, _utils2.hasParentNodeOfType)(blockquote)(selection) && !
|
|
60
|
+
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || (0, _utils2.hasParentNodeOfType)(blockquote)(selection) && !hasParentNodeofTypeList ||
|
|
61
61
|
// Lift line of panel content up and out of the panel, when backspacing
|
|
62
62
|
// at the start of a panel, if the node before the panel is an 'isolating' node
|
|
63
63
|
// (for e.g. a table, or an expand), otherwise the default prosemirror backspace
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -4,6 +4,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
|
|
6
6
|
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { T50 } from '@atlaskit/theme/colors';
|
|
8
9
|
import { insertPanelWithAnalytics } from './actions';
|
|
9
10
|
import keymap from './pm-plugins/keymaps';
|
|
@@ -56,7 +57,8 @@ const panelPlugin = ({
|
|
|
56
57
|
attributes: {
|
|
57
58
|
panelType: PanelType.INFO
|
|
58
59
|
},
|
|
59
|
-
api
|
|
60
|
+
api,
|
|
61
|
+
insert
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
}, {
|
|
@@ -71,7 +73,8 @@ const panelPlugin = ({
|
|
|
71
73
|
attributes: {
|
|
72
74
|
panelType: PanelType.NOTE
|
|
73
75
|
},
|
|
74
|
-
api
|
|
76
|
+
api,
|
|
77
|
+
insert
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
}, {
|
|
@@ -87,7 +90,8 @@ const panelPlugin = ({
|
|
|
87
90
|
attributes: {
|
|
88
91
|
panelType: PanelType.SUCCESS
|
|
89
92
|
},
|
|
90
|
-
api
|
|
93
|
+
api,
|
|
94
|
+
insert
|
|
91
95
|
});
|
|
92
96
|
}
|
|
93
97
|
}, {
|
|
@@ -102,7 +106,8 @@ const panelPlugin = ({
|
|
|
102
106
|
attributes: {
|
|
103
107
|
panelType: PanelType.WARNING
|
|
104
108
|
},
|
|
105
|
-
api
|
|
109
|
+
api,
|
|
110
|
+
insert
|
|
106
111
|
});
|
|
107
112
|
}
|
|
108
113
|
}, {
|
|
@@ -117,7 +122,8 @@ const panelPlugin = ({
|
|
|
117
122
|
attributes: {
|
|
118
123
|
panelType: PanelType.ERROR
|
|
119
124
|
},
|
|
120
|
-
api
|
|
125
|
+
api,
|
|
126
|
+
insert
|
|
121
127
|
});
|
|
122
128
|
}
|
|
123
129
|
}];
|
|
@@ -140,7 +146,8 @@ const panelPlugin = ({
|
|
|
140
146
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
141
147
|
panelColor: T50
|
|
142
148
|
},
|
|
143
|
-
api
|
|
149
|
+
api,
|
|
150
|
+
insert
|
|
144
151
|
});
|
|
145
152
|
}
|
|
146
153
|
});
|
|
@@ -166,9 +173,17 @@ const panelPlugin = ({
|
|
|
166
173
|
function createPanelAction({
|
|
167
174
|
state,
|
|
168
175
|
attributes,
|
|
169
|
-
api
|
|
176
|
+
api,
|
|
177
|
+
insert
|
|
170
178
|
}) {
|
|
171
|
-
const
|
|
179
|
+
const {
|
|
180
|
+
panel
|
|
181
|
+
} = state.schema.nodes;
|
|
182
|
+
const node = panel.createAndFill(attributes);
|
|
183
|
+
if (!node) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
const tr = state.selection.empty && getBooleanFF('platform.editor.ordered-list-inserting-nodes_bh0vo') ? insert(node) : createWrapSelectionTransaction({
|
|
172
187
|
state,
|
|
173
188
|
type: state.schema.nodes.panel,
|
|
174
189
|
nodeAttributes: attributes
|
|
@@ -53,12 +53,12 @@ export function keymapPlugin() {
|
|
|
53
53
|
const isPreviousNodeAPanel = previousNodeType === panel;
|
|
54
54
|
const isParentNodeAPanel = parentNodeType === panel;
|
|
55
55
|
const nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
|
|
56
|
-
const
|
|
56
|
+
const hasParentNodeofTypeList = hasParentNodeOfType([bulletList, orderedList])(selection);
|
|
57
57
|
|
|
58
58
|
// Stops merging panels when deleting empty paragraph in between
|
|
59
59
|
// Stops merging blockquotes with panels when deleting from start of blockquote
|
|
60
60
|
|
|
61
|
-
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !
|
|
61
|
+
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !hasParentNodeofTypeList ||
|
|
62
62
|
// Lift line of panel content up and out of the panel, when backspacing
|
|
63
63
|
// at the start of a panel, if the node before the panel is an 'isolating' node
|
|
64
64
|
// (for e.g. a table, or an expand), otherwise the default prosemirror backspace
|
package/dist/esm/plugin.js
CHANGED
|
@@ -4,6 +4,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { IconCustomPanel, IconPanel, IconPanelError, IconPanelNote, IconPanelSuccess, IconPanelWarning } from '@atlaskit/editor-common/quick-insert';
|
|
6
6
|
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { T50 } from '@atlaskit/theme/colors';
|
|
8
9
|
import { insertPanelWithAnalytics } from './actions';
|
|
9
10
|
import keymap from './pm-plugins/keymaps';
|
|
@@ -61,7 +62,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
61
62
|
attributes: {
|
|
62
63
|
panelType: PanelType.INFO
|
|
63
64
|
},
|
|
64
|
-
api: api
|
|
65
|
+
api: api,
|
|
66
|
+
insert: insert
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
}, {
|
|
@@ -78,7 +80,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
78
80
|
attributes: {
|
|
79
81
|
panelType: PanelType.NOTE
|
|
80
82
|
},
|
|
81
|
-
api: api
|
|
83
|
+
api: api,
|
|
84
|
+
insert: insert
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
87
|
}, {
|
|
@@ -96,7 +99,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
96
99
|
attributes: {
|
|
97
100
|
panelType: PanelType.SUCCESS
|
|
98
101
|
},
|
|
99
|
-
api: api
|
|
102
|
+
api: api,
|
|
103
|
+
insert: insert
|
|
100
104
|
});
|
|
101
105
|
}
|
|
102
106
|
}, {
|
|
@@ -113,7 +117,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
113
117
|
attributes: {
|
|
114
118
|
panelType: PanelType.WARNING
|
|
115
119
|
},
|
|
116
|
-
api: api
|
|
120
|
+
api: api,
|
|
121
|
+
insert: insert
|
|
117
122
|
});
|
|
118
123
|
}
|
|
119
124
|
}, {
|
|
@@ -130,7 +135,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
130
135
|
attributes: {
|
|
131
136
|
panelType: PanelType.ERROR
|
|
132
137
|
},
|
|
133
|
-
api: api
|
|
138
|
+
api: api,
|
|
139
|
+
insert: insert
|
|
134
140
|
});
|
|
135
141
|
}
|
|
136
142
|
}];
|
|
@@ -155,7 +161,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
155
161
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
156
162
|
panelColor: T50
|
|
157
163
|
},
|
|
158
|
-
api: api
|
|
164
|
+
api: api,
|
|
165
|
+
insert: insert
|
|
159
166
|
});
|
|
160
167
|
}
|
|
161
168
|
});
|
|
@@ -184,8 +191,14 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
184
191
|
function createPanelAction(_ref4) {
|
|
185
192
|
var state = _ref4.state,
|
|
186
193
|
attributes = _ref4.attributes,
|
|
187
|
-
api = _ref4.api
|
|
188
|
-
|
|
194
|
+
api = _ref4.api,
|
|
195
|
+
insert = _ref4.insert;
|
|
196
|
+
var panel = state.schema.nodes.panel;
|
|
197
|
+
var node = panel.createAndFill(attributes);
|
|
198
|
+
if (!node) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
var tr = state.selection.empty && getBooleanFF('platform.editor.ordered-list-inserting-nodes_bh0vo') ? insert(node) : createWrapSelectionTransaction({
|
|
189
202
|
state: state,
|
|
190
203
|
type: state.schema.nodes.panel,
|
|
191
204
|
nodeAttributes: attributes
|
|
@@ -45,12 +45,12 @@ export function keymapPlugin() {
|
|
|
45
45
|
var isPreviousNodeAPanel = previousNodeType === panel;
|
|
46
46
|
var isParentNodeAPanel = parentNodeType === panel;
|
|
47
47
|
var nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
|
|
48
|
-
var
|
|
48
|
+
var hasParentNodeofTypeList = hasParentNodeOfType([bulletList, orderedList])(selection);
|
|
49
49
|
|
|
50
50
|
// Stops merging panels when deleting empty paragraph in between
|
|
51
51
|
// Stops merging blockquotes with panels when deleting from start of blockquote
|
|
52
52
|
|
|
53
|
-
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !
|
|
53
|
+
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !hasParentNodeofTypeList ||
|
|
54
54
|
// Lift line of panel content up and out of the panel, when backspacing
|
|
55
55
|
// at the start of a panel, if the node before the panel is an 'isolating' node
|
|
56
56
|
// (for e.g. a table, or an expand), otherwise the default prosemirror backspace
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: Jenga",
|
|
12
12
|
"inPublicMirror": false,
|
|
13
|
-
"releaseModel": "continuous"
|
|
13
|
+
"releaseModel": "continuous",
|
|
14
|
+
"runReact18": false
|
|
14
15
|
},
|
|
15
16
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
16
17
|
"main": "dist/cjs/index.js",
|
|
@@ -32,14 +33,15 @@
|
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@atlaskit/adf-schema": "^35.2.0",
|
|
35
|
-
"@atlaskit/editor-common": "^76.
|
|
36
|
+
"@atlaskit/editor-common": "^76.34.0",
|
|
36
37
|
"@atlaskit/editor-palette": "1.5.2",
|
|
37
38
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
38
39
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
39
40
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
40
|
-
"@atlaskit/editor-shared-styles": "^2.
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
41
42
|
"@atlaskit/emoji": "^67.6.0",
|
|
42
43
|
"@atlaskit/icon": "^22.0.0",
|
|
44
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
43
45
|
"@atlaskit/theme": "^12.6.0",
|
|
44
46
|
"@babel/runtime": "^7.0.0"
|
|
45
47
|
},
|
|
@@ -98,5 +100,10 @@
|
|
|
98
100
|
]
|
|
99
101
|
}
|
|
100
102
|
},
|
|
101
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
103
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
104
|
+
"platform-feature-flags": {
|
|
105
|
+
"platform.editor.ordered-list-inserting-nodes_bh0vo": {
|
|
106
|
+
"type": "boolean"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
102
109
|
}
|