@atlaskit/editor-plugin-panel 0.1.14 → 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 CHANGED
@@ -1,5 +1,15 @@
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
+
3
13
  ## 0.1.14
4
14
 
5
15
  ### Patch Changes
@@ -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
- var tr = (0, _utils.createWrapSelectionTransaction)({
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
@@ -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 tr = createWrapSelectionTransaction({
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
@@ -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
- var tr = createWrapSelectionTransaction({
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "0.1.14",
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",
@@ -33,14 +33,15 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^35.2.0",
36
- "@atlaskit/editor-common": "^76.33.0",
36
+ "@atlaskit/editor-common": "^76.34.0",
37
37
  "@atlaskit/editor-palette": "1.5.2",
38
38
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
39
39
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
40
40
  "@atlaskit/editor-prosemirror": "1.1.0",
41
- "@atlaskit/editor-shared-styles": "^2.8.0",
41
+ "@atlaskit/editor-shared-styles": "^2.9.0",
42
42
  "@atlaskit/emoji": "^67.6.0",
43
43
  "@atlaskit/icon": "^22.0.0",
44
+ "@atlaskit/platform-feature-flags": "^0.2.0",
44
45
  "@atlaskit/theme": "^12.6.0",
45
46
  "@babel/runtime": "^7.0.0"
46
47
  },
@@ -99,5 +100,10 @@
99
100
  ]
100
101
  }
101
102
  },
102
- "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
+ }
103
109
  }