@atlaskit/editor-plugin-expand 9.1.6 → 9.1.8

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,19 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 9.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.1.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [`9ed32aea2c1d3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed32aea2c1d3) -
14
+ Replace feature experiment util with cross platform alternative for platform_editor_block_menu
15
+ - Updated dependencies
16
+
3
17
  ## 9.1.6
4
18
 
5
19
  ### Patch Changes
@@ -13,7 +13,7 @@ var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
15
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
16
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
17
17
  var _toggleExpandRange = require("../editor-commands/toggleExpandRange");
18
18
  var _ExpandBlockMenuItem = require("../ui/ExpandBlockMenuItem");
19
19
  var _commands = require("./commands");
@@ -28,7 +28,7 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
28
28
  var _ref$config = _ref.config,
29
29
  options = _ref$config === void 0 ? {} : _ref$config,
30
30
  api = _ref.api;
31
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
31
+ if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
32
32
  var _api$blockMenu;
33
33
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
34
34
  type: 'block-menu-item',
@@ -21,6 +21,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
22
  var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
23
23
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
24
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
24
25
  var _renderExpandButton = require("../../ui/renderExpandButton");
25
26
  var _commands = require("../commands");
26
27
  var _ExpandButton = require("../ui/ExpandButton");
@@ -442,7 +443,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
442
443
  this.getPos = getPos;
443
444
  this.view = view;
444
445
  this.node = _node;
445
- if ((0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3')) {
446
+ if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true, {
447
+ exposure: true
448
+ }) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3')) {
446
449
  var _expandedState$get;
447
450
  this.isExpanded.expanded = (_expandedState$get = _expand.expandedState.get(_node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false;
448
451
  this.isExpanded.localId = _node.attrs.localId;
@@ -551,7 +554,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
551
554
  }
552
555
  this.node = node;
553
556
  var currentExpanded = (_expandedState$get2 = _expand.expandedState.get(node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
554
- var hasChanged = (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
557
+ var hasChanged = (0, _experiments.editorExperiment)('platform_editor_block_menu', true, {
558
+ exposure: true
559
+ }) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
555
560
  if (hasChanged) {
556
561
  this.updateExpandToggleIcon(node);
557
562
  this.updateDisplayStyle(node);
@@ -584,7 +589,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
584
589
  }
585
590
  }
586
591
  this.updateExpandBodyContentEditable();
587
- this.isExpanded = (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? {
592
+ this.isExpanded = (0, _experiments.editorExperiment)('platform_editor_block_menu', true, {
593
+ exposure: true
594
+ }) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? {
588
595
  expanded: expanded !== null && expanded !== void 0 ? expanded : false,
589
596
  localId: node.attrs.localId
590
597
  } : {
@@ -14,7 +14,7 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
16
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
17
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
18
  var _toggleExpandRange = require("../editor-commands/toggleExpandRange");
19
19
  var _ExpandBlockMenuItem = require("../ui/ExpandBlockMenuItem");
20
20
  var _commands = require("./commands");
@@ -28,7 +28,7 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
28
28
  var _ref$config = _ref.config,
29
29
  options = _ref$config === void 0 ? {} : _ref$config,
30
30
  api = _ref.api;
31
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
31
+ if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
32
32
  var _api$blockMenu;
33
33
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
34
34
  type: 'block-menu-item',
@@ -6,7 +6,7 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
6
6
  import { IconExpand } from '@atlaskit/editor-common/quick-insert';
7
7
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
10
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
11
11
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
12
12
  const EXPAND_NODE_NAME = 'expand';
@@ -22,7 +22,7 @@ export let expandPlugin = ({
22
22
  api
23
23
  }) => {
24
24
  var _api$analytics, _api$analytics2;
25
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
25
+ if (editorExperiment('platform_editor_block_menu', true)) {
26
26
  var _api$blockMenu;
27
27
  api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents([{
28
28
  type: 'block-menu-item',
@@ -12,6 +12,7 @@ import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { redo, undo } from '@atlaskit/prosemirror-history';
14
14
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
16
  import { renderExpandButton } from '../../ui/renderExpandButton';
16
17
  import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
17
18
  import { ExpandButton } from '../ui/ExpandButton';
@@ -442,7 +443,9 @@ export class ExpandNodeView {
442
443
  this.getPos = getPos;
443
444
  this.view = view;
444
445
  this.node = _node;
445
- if (expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3')) {
446
+ if (editorExperiment('platform_editor_block_menu', true, {
447
+ exposure: true
448
+ }) && fg('platform_editor_block_menu_v2_patch_3')) {
446
449
  var _expandedState$get;
447
450
  this.isExpanded.expanded = (_expandedState$get = expandedState.get(_node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false;
448
451
  this.isExpanded.localId = _node.attrs.localId;
@@ -545,7 +548,9 @@ export class ExpandNodeView {
545
548
  }
546
549
  this.node = node;
547
550
  const currentExpanded = (_expandedState$get2 = expandedState.get(node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
548
- const hasChanged = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
551
+ const hasChanged = editorExperiment('platform_editor_block_menu', true, {
552
+ exposure: true
553
+ }) && fg('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
549
554
  if (hasChanged) {
550
555
  this.updateExpandToggleIcon(node);
551
556
  this.updateDisplayStyle(node);
@@ -574,7 +579,9 @@ export class ExpandNodeView {
574
579
  }
575
580
  }
576
581
  this.updateExpandBodyContentEditable();
577
- this.isExpanded = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? {
582
+ this.isExpanded = editorExperiment('platform_editor_block_menu', true, {
583
+ exposure: true
584
+ }) && fg('platform_editor_block_menu_v2_patch_3') ? {
578
585
  expanded: expanded !== null && expanded !== void 0 ? expanded : false,
579
586
  localId: node.attrs.localId
580
587
  } : {
@@ -7,7 +7,7 @@ import { IconExpand } from '@atlaskit/editor-common/quick-insert';
7
7
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
11
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
12
12
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
13
13
  const EXPAND_NODE_NAME = 'expand';
@@ -22,7 +22,7 @@ export let expandPlugin = ({
22
22
  config: options = {},
23
23
  api
24
24
  }) => {
25
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
25
+ if (editorExperiment('platform_editor_block_menu', true)) {
26
26
  var _api$blockMenu;
27
27
  api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents([{
28
28
  type: 'block-menu-item',
@@ -6,7 +6,7 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
6
6
  import { IconExpand } from '@atlaskit/editor-common/quick-insert';
7
7
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
10
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
11
11
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
12
12
  var EXPAND_NODE_NAME = 'expand';
@@ -22,7 +22,7 @@ export var expandPlugin = function expandPlugin(_ref) {
22
22
  var _ref$config = _ref.config,
23
23
  options = _ref$config === void 0 ? {} : _ref$config,
24
24
  api = _ref.api;
25
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
25
+ if (editorExperiment('platform_editor_block_menu', true)) {
26
26
  var _api$blockMenu;
27
27
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
28
28
  type: 'block-menu-item',
@@ -14,6 +14,7 @@ import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { redo, undo } from '@atlaskit/prosemirror-history';
16
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
18
  import { renderExpandButton } from '../../ui/renderExpandButton';
18
19
  import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
19
20
  import { ExpandButton } from '../ui/ExpandButton';
@@ -434,7 +435,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
434
435
  this.getPos = getPos;
435
436
  this.view = view;
436
437
  this.node = _node;
437
- if (expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3')) {
438
+ if (editorExperiment('platform_editor_block_menu', true, {
439
+ exposure: true
440
+ }) && fg('platform_editor_block_menu_v2_patch_3')) {
438
441
  var _expandedState$get;
439
442
  this.isExpanded.expanded = (_expandedState$get = expandedState.get(_node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false;
440
443
  this.isExpanded.localId = _node.attrs.localId;
@@ -543,7 +546,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
543
546
  }
544
547
  this.node = node;
545
548
  var currentExpanded = (_expandedState$get2 = expandedState.get(node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
546
- var hasChanged = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
549
+ var hasChanged = editorExperiment('platform_editor_block_menu', true, {
550
+ exposure: true
551
+ }) && fg('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
547
552
  if (hasChanged) {
548
553
  this.updateExpandToggleIcon(node);
549
554
  this.updateDisplayStyle(node);
@@ -576,7 +581,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
576
581
  }
577
582
  }
578
583
  this.updateExpandBodyContentEditable();
579
- this.isExpanded = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? {
584
+ this.isExpanded = editorExperiment('platform_editor_block_menu', true, {
585
+ exposure: true
586
+ }) && fg('platform_editor_block_menu_v2_patch_3') ? {
580
587
  expanded: expanded !== null && expanded !== void 0 ? expanded : false,
581
588
  localId: node.attrs.localId
582
589
  } : {
@@ -7,7 +7,7 @@ import { IconExpand } from '@atlaskit/editor-common/quick-insert';
7
7
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
11
  import { toggleExpandRange } from '../editor-commands/toggleExpandRange';
12
12
  import { createExpandBlockMenuItem } from '../ui/ExpandBlockMenuItem';
13
13
  var EXPAND_NODE_NAME = 'expand';
@@ -22,7 +22,7 @@ export var expandPlugin = function expandPlugin(_ref) {
22
22
  var _ref$config = _ref.config,
23
23
  options = _ref$config === void 0 ? {} : _ref$config,
24
24
  api = _ref.api;
25
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
25
+ if (editorExperiment('platform_editor_block_menu', true)) {
26
26
  var _api$blockMenu;
27
27
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
28
28
  type: 'block-menu-item',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "9.1.6",
3
+ "version": "9.1.8",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/icon-lab": "^6.0.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
49
  "@atlaskit/prosemirror-history": "^0.2.0",
50
- "@atlaskit/tmp-editor-statsig": "^43.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^44.0.0",
51
51
  "@atlaskit/tokens": "^11.1.0",
52
52
  "@atlaskit/tooltip": "^21.0.0",
53
53
  "@babel/runtime": "^7.0.0",