@atlaskit/editor-plugin-expand 3.2.15 → 3.3.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,23 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#166502](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/166502)
8
+ [`ea1ed63fc9615`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ea1ed63fc9615) -
9
+ ED-28032 add keyboard shortcuts for new resizing experience behind
10
+ platform_editor_breakout_resizing
11
+
12
+ ## 3.2.16
13
+
14
+ ### Patch Changes
15
+
16
+ - [#165113](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/165113)
17
+ [`867bcb05452bf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/867bcb05452bf) -
18
+ Cleaned up platform_editor_controls_patch_analytics and platform_editor_controls_patch_analytics_2
19
+ - Updated dependencies
20
+
3
21
  ## 3.2.15
4
22
 
5
23
  ### Patch Changes
@@ -15,7 +15,6 @@ var _utils = require("@atlaskit/editor-common/utils");
15
15
  var _state2 = require("@atlaskit/editor-prosemirror/state");
16
16
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
17
  var _utils3 = require("@atlaskit/editor-tables/utils");
18
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
18
  var _utils4 = require("../utils");
20
19
  var _pluginFactory = require("./pm-plugins/plugin-factory");
21
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -40,7 +39,7 @@ var deleteExpandAtPos = exports.deleteExpandAtPos = function deleteExpandAtPos(e
40
39
  action: _analytics.ACTION.DELETED,
41
40
  actionSubject: expandNode.type === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT.EXPAND : _analytics.ACTION_SUBJECT.NESTED_EXPAND,
42
41
  attributes: {
43
- inputMethod: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? _analytics.INPUT_METHOD.FLOATING_TB : _analytics.INPUT_METHOD.TOOLBAR
42
+ inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
44
43
  },
45
44
  eventType: _analytics.EVENT_TYPE.TRACK
46
45
  };
@@ -19,6 +19,8 @@ var _utils = require("@atlaskit/editor-common/utils");
19
19
  var _history = require("@atlaskit/editor-prosemirror/history");
20
20
  var _model = require("@atlaskit/editor-prosemirror/model");
21
21
  var _state = require("@atlaskit/editor-prosemirror/state");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
24
  var _commands = require("../commands");
23
25
  var _ExpandIconButton = require("../ui/ExpandIconButton");
24
26
  function buildExpandClassName(type, expanded) {
@@ -202,6 +204,17 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
202
204
  _this.handleUndoFromTitle(event);
203
205
  return;
204
206
  }
207
+ if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
208
+ if ((event.ctrlKey || event.metaKey) && event.altKey && (event.code === 'BracketLeft' || event.code === 'BracketRight')) {
209
+ _this.view.dispatchEvent(new KeyboardEvent('keydown', {
210
+ key: event.key,
211
+ code: event.code,
212
+ metaKey: event.metaKey,
213
+ ctrlKey: event.ctrlKey,
214
+ altKey: event.altKey
215
+ }));
216
+ }
217
+ }
205
218
  });
206
219
  (0, _defineProperty2.default)(this, "deleteExpand", function (event) {
207
220
  if (!_this.input) {
@@ -16,7 +16,6 @@ var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _state2 = require("@atlaskit/editor-prosemirror/state");
17
17
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
18
18
  var _utils3 = require("@atlaskit/editor-tables/utils");
19
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
19
  var _utils4 = require("../utils");
21
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -101,7 +100,7 @@ var deleteExpandAtPos = exports.deleteExpandAtPos = function deleteExpandAtPos(e
101
100
  action: _analytics.ACTION.DELETED,
102
101
  actionSubject: expandNode.type === state.schema.nodes.expand ? _analytics.ACTION_SUBJECT.EXPAND : _analytics.ACTION_SUBJECT.NESTED_EXPAND,
103
102
  attributes: {
104
- inputMethod: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? _analytics.INPUT_METHOD.FLOATING_TB : _analytics.INPUT_METHOD.TOOLBAR
103
+ inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
105
104
  },
106
105
  eventType: _analytics.EVENT_TYPE.TRACK
107
106
  };
@@ -20,6 +20,7 @@ var _history = require("@atlaskit/editor-prosemirror/history");
20
20
  var _model = require("@atlaskit/editor-prosemirror/model");
21
21
  var _state = require("@atlaskit/editor-prosemirror/state");
22
22
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
24
  var _commands = require("../commands");
24
25
  var _ExpandButton = require("../ui/ExpandButton");
25
26
  var _NodeView = require("../ui/NodeView");
@@ -162,6 +163,17 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
162
163
  _this.handleUndoFromTitle(event);
163
164
  return;
164
165
  }
166
+ if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
167
+ if ((event.ctrlKey || event.metaKey) && event.altKey && (event.code === 'BracketLeft' || event.code === 'BracketRight')) {
168
+ _this.view.dispatchEvent(new KeyboardEvent('keydown', {
169
+ key: event.key,
170
+ code: event.code,
171
+ metaKey: event.metaKey,
172
+ ctrlKey: event.ctrlKey,
173
+ altKey: event.altKey
174
+ }));
175
+ }
176
+ }
165
177
  });
166
178
  (0, _defineProperty2.default)(this, "deleteEmptyExpand", function () {
167
179
  var state = _this.view.state;
@@ -7,7 +7,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
7
7
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { findTable } from '@atlaskit/editor-tables/utils';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { isNestedInExpand } from '../utils';
12
11
  import { createCommand } from './pm-plugins/plugin-factory';
13
12
  export const setExpandRef = ref => createCommand({
@@ -24,7 +23,7 @@ export const deleteExpandAtPos = editorAnalyticsAPI => (expandNodePos, expandNod
24
23
  action: ACTION.DELETED,
25
24
  actionSubject: expandNode.type === state.schema.nodes.expand ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
26
25
  attributes: {
27
- inputMethod: fg('platform_editor_controls_patch_analytics_2') ? INPUT_METHOD.FLOATING_TB : INPUT_METHOD.TOOLBAR
26
+ inputMethod: INPUT_METHOD.FLOATING_TB
28
27
  },
29
28
  eventType: EVENT_TYPE.TRACK
30
29
  };
@@ -9,6 +9,8 @@ import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
9
9
  import { redo, undo } from '@atlaskit/editor-prosemirror/history';
10
10
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
11
11
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { expValEquals } from "@atlaskit/tmp-editor-statsig/exp-val-equals";
12
14
  import { deleteExpandAtPos, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
13
15
  import { ExpandIconButton } from '../ui/ExpandIconButton';
14
16
  function buildExpandClassName(type, expanded) {
@@ -188,6 +190,17 @@ export class ExpandNodeView {
188
190
  this.handleUndoFromTitle(event);
189
191
  return;
190
192
  }
193
+ if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
194
+ if ((event.ctrlKey || event.metaKey) && event.altKey && (event.code === 'BracketLeft' || event.code === 'BracketRight')) {
195
+ this.view.dispatchEvent(new KeyboardEvent('keydown', {
196
+ key: event.key,
197
+ code: event.code,
198
+ metaKey: event.metaKey,
199
+ ctrlKey: event.ctrlKey,
200
+ altKey: event.altKey
201
+ }));
202
+ }
203
+ }
191
204
  });
192
205
  _defineProperty(this, "deleteExpand", event => {
193
206
  if (!this.input) {
@@ -8,7 +8,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { findTable } from '@atlaskit/editor-tables/utils';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { isNestedInExpand } from '../utils';
13
12
 
14
13
  // Creates either an expand or a nestedExpand node based on the current selection
@@ -82,7 +81,7 @@ export const deleteExpandAtPos = editorAnalyticsAPI => (expandNodePos, expandNod
82
81
  action: ACTION.DELETED,
83
82
  actionSubject: expandNode.type === state.schema.nodes.expand ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
84
83
  attributes: {
85
- inputMethod: fg('platform_editor_controls_patch_analytics_2') ? INPUT_METHOD.FLOATING_TB : INPUT_METHOD.TOOLBAR
84
+ inputMethod: INPUT_METHOD.FLOATING_TB
86
85
  },
87
86
  eventType: EVENT_TYPE.TRACK
88
87
  };
@@ -10,6 +10,7 @@ import { redo, undo } from '@atlaskit/editor-prosemirror/history';
10
10
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
11
11
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
14
  import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
14
15
  import { ExpandButton } from '../ui/ExpandButton';
15
16
  import { buildExpandClassName, toDOM } from '../ui/NodeView';
@@ -148,6 +149,17 @@ export class ExpandNodeView {
148
149
  this.handleUndoFromTitle(event);
149
150
  return;
150
151
  }
152
+ if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
153
+ if ((event.ctrlKey || event.metaKey) && event.altKey && (event.code === 'BracketLeft' || event.code === 'BracketRight')) {
154
+ this.view.dispatchEvent(new KeyboardEvent('keydown', {
155
+ key: event.key,
156
+ code: event.code,
157
+ metaKey: event.metaKey,
158
+ ctrlKey: event.ctrlKey,
159
+ altKey: event.altKey
160
+ }));
161
+ }
162
+ }
151
163
  });
152
164
  _defineProperty(this, "deleteEmptyExpand", () => {
153
165
  const {
@@ -10,7 +10,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
10
10
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
11
11
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
12
12
  import { findTable } from '@atlaskit/editor-tables/utils';
13
- import { fg } from '@atlaskit/platform-feature-flags';
14
13
  import { isNestedInExpand } from '../utils';
15
14
  import { createCommand } from './pm-plugins/plugin-factory';
16
15
  export var setExpandRef = function setExpandRef(ref) {
@@ -33,7 +32,7 @@ export var deleteExpandAtPos = function deleteExpandAtPos(editorAnalyticsAPI) {
33
32
  action: ACTION.DELETED,
34
33
  actionSubject: expandNode.type === state.schema.nodes.expand ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
35
34
  attributes: {
36
- inputMethod: fg('platform_editor_controls_patch_analytics_2') ? INPUT_METHOD.FLOATING_TB : INPUT_METHOD.TOOLBAR
35
+ inputMethod: INPUT_METHOD.FLOATING_TB
37
36
  },
38
37
  eventType: EVENT_TYPE.TRACK
39
38
  };
@@ -11,6 +11,8 @@ import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
11
11
  import { redo, undo } from '@atlaskit/editor-prosemirror/history';
12
12
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
13
13
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
15
+ import { expValEquals } from "@atlaskit/tmp-editor-statsig/exp-val-equals";
14
16
  import { deleteExpandAtPos, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
15
17
  import { ExpandIconButton } from '../ui/ExpandIconButton';
16
18
  function buildExpandClassName(type, expanded) {
@@ -194,6 +196,17 @@ export var ExpandNodeView = /*#__PURE__*/function () {
194
196
  _this.handleUndoFromTitle(event);
195
197
  return;
196
198
  }
199
+ if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
200
+ if ((event.ctrlKey || event.metaKey) && event.altKey && (event.code === 'BracketLeft' || event.code === 'BracketRight')) {
201
+ _this.view.dispatchEvent(new KeyboardEvent('keydown', {
202
+ key: event.key,
203
+ code: event.code,
204
+ metaKey: event.metaKey,
205
+ ctrlKey: event.ctrlKey,
206
+ altKey: event.altKey
207
+ }));
208
+ }
209
+ }
197
210
  });
198
211
  _defineProperty(this, "deleteExpand", function (event) {
199
212
  if (!_this.input) {
@@ -11,7 +11,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
11
11
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
13
13
  import { findTable } from '@atlaskit/editor-tables/utils';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { isNestedInExpand } from '../utils';
16
15
 
17
16
  // Creates either an expand or a nestedExpand node based on the current selection
@@ -95,7 +94,7 @@ export var deleteExpandAtPos = function deleteExpandAtPos(editorAnalyticsAPI) {
95
94
  action: ACTION.DELETED,
96
95
  actionSubject: expandNode.type === state.schema.nodes.expand ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
97
96
  attributes: {
98
- inputMethod: fg('platform_editor_controls_patch_analytics_2') ? INPUT_METHOD.FLOATING_TB : INPUT_METHOD.TOOLBAR
97
+ inputMethod: INPUT_METHOD.FLOATING_TB
99
98
  },
100
99
  eventType: EVENT_TYPE.TRACK
101
100
  };
@@ -12,6 +12,7 @@ import { redo, undo } from '@atlaskit/editor-prosemirror/history';
12
12
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
13
13
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
16
  import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
16
17
  import { ExpandButton } from '../ui/ExpandButton';
17
18
  import { buildExpandClassName, toDOM } from '../ui/NodeView';
@@ -154,6 +155,17 @@ export var ExpandNodeView = /*#__PURE__*/function () {
154
155
  _this.handleUndoFromTitle(event);
155
156
  return;
156
157
  }
158
+ if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
159
+ if ((event.ctrlKey || event.metaKey) && event.altKey && (event.code === 'BracketLeft' || event.code === 'BracketRight')) {
160
+ _this.view.dispatchEvent(new KeyboardEvent('keydown', {
161
+ key: event.key,
162
+ code: event.code,
163
+ metaKey: event.metaKey,
164
+ ctrlKey: event.ctrlKey,
165
+ altKey: event.altKey
166
+ }));
167
+ }
168
+ }
157
169
  });
158
170
  _defineProperty(this, "deleteEmptyExpand", function () {
159
171
  var state = _this.view.state;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "3.2.15",
3
+ "version": "3.3.0",
4
4
  "description": "Expand 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": "^47.6.0",
37
37
  "@atlaskit/button": "^23.2.0",
38
- "@atlaskit/editor-common": "^106.1.0",
38
+ "@atlaskit/editor-common": "^106.3.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
41
41
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
@@ -47,9 +47,9 @@
47
47
  "@atlaskit/editor-tables": "^2.9.0",
48
48
  "@atlaskit/icon": "^26.4.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
- "@atlaskit/tmp-editor-statsig": "^5.7.0",
51
- "@atlaskit/tokens": "^5.0.0",
52
- "@atlaskit/tooltip": "^20.2.0",
50
+ "@atlaskit/tmp-editor-statsig": "^5.14.0",
51
+ "@atlaskit/tokens": "^5.1.0",
52
+ "@atlaskit/tooltip": "^20.3.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "@emotion/react": "^11.7.1",
55
55
  "uuid": "^3.1.0",
@@ -112,7 +112,7 @@
112
112
  "platform_editor_disable_unnecessary_expand_renders": {
113
113
  "type": "boolean"
114
114
  },
115
- "platform_editor_controls_patch_analytics_2": {
115
+ "platform_editor_breakout_resizing_hello_release": {
116
116
  "type": "boolean"
117
117
  }
118
118
  }