@atlaskit/editor-plugin-selection-extension 6.0.7 → 6.0.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 +10 -0
- package/dist/cjs/selectionExtensionPlugin.js +1 -2
- package/dist/cjs/ui/extension/SelectionExtensionComponentWrapper.js +4 -8
- package/dist/es2019/selectionExtensionPlugin.js +1 -2
- package/dist/es2019/ui/extension/SelectionExtensionComponentWrapper.js +4 -8
- package/dist/esm/selectionExtensionPlugin.js +1 -2
- package/dist/esm/ui/extension/SelectionExtensionComponentWrapper.js +4 -8
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 6.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ef001bf65d48f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef001bf65d48f) -
|
|
8
|
+
Remove usage of `platform_editor_toolbar_aifc` inside editor packages - instead rely on checking
|
|
9
|
+
for new toolbar plugin option, make `enableNewToolbarExperience` mandatory for consumers to opt in
|
|
10
|
+
to new toolbar experience
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 6.0.7
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -13,7 +13,6 @@ var _usePluginStateEffect = require("@atlaskit/editor-common/use-plugin-state-ef
|
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
15
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
16
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
16
|
var _insertAdfAtEndOfDoc2 = require("./pm-plugins/actions/insertAdfAtEndOfDoc");
|
|
18
17
|
var _replaceWithAdf2 = require("./pm-plugins/actions/replaceWithAdf");
|
|
19
18
|
var _main = require("./pm-plugins/main");
|
|
@@ -33,7 +32,7 @@ var selectionExtensionPlugin = exports.selectionExtensionPlugin = function selec
|
|
|
33
32
|
};
|
|
34
33
|
var cachedSelection;
|
|
35
34
|
var cachedOverflowMenuOptions;
|
|
36
|
-
var isToolbarAIFCEnabled = (0
|
|
35
|
+
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
37
36
|
var _ref2 = config || {},
|
|
38
37
|
_ref2$extensionList = _ref2.extensionList,
|
|
39
38
|
extensionList = _ref2$extensionList === void 0 ? [] : _ref2$extensionList,
|
|
@@ -9,16 +9,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
11
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
13
|
var SelectionExtensionComponentWrapper = exports.SelectionExtensionComponentWrapper = function SelectionExtensionComponentWrapper(_ref) {
|
|
15
14
|
var api = _ref.api,
|
|
16
15
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI;
|
|
17
16
|
var componentRef = (0, _react.useRef)();
|
|
18
|
-
var isToolbarAIFCEnabled = (0,
|
|
19
|
-
exposure: true
|
|
20
|
-
});
|
|
21
|
-
var isToolbarAIFCSelectionExtensionEnabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_selection_extension', 'isEnabled', true);
|
|
17
|
+
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_selection_extension', 'isEnabled', true);
|
|
22
18
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selectionExtension', 'editorViewMode'], function (states) {
|
|
23
19
|
var _states$selectionExte, _states$editorViewMod;
|
|
24
20
|
return {
|
|
@@ -57,7 +53,7 @@ var SelectionExtensionComponentWrapper = exports.SelectionExtensionComponentWrap
|
|
|
57
53
|
if (!extension) {
|
|
58
54
|
return;
|
|
59
55
|
}
|
|
60
|
-
if (isToolbarAIFCEnabled
|
|
56
|
+
if (isToolbarAIFCEnabled) {
|
|
61
57
|
var currentComponent;
|
|
62
58
|
if ('contentComponent' in extension && extension.contentComponent !== undefined) {
|
|
63
59
|
currentComponent = extension.contentComponent;
|
|
@@ -91,12 +87,12 @@ var SelectionExtensionComponentWrapper = exports.SelectionExtensionComponentWrap
|
|
|
91
87
|
// Sets reference to active component
|
|
92
88
|
componentRef.current = extension.component;
|
|
93
89
|
}
|
|
94
|
-
}, [activeExtension, editorAnalyticsAPI, isToolbarAIFCEnabled
|
|
90
|
+
}, [activeExtension, editorAnalyticsAPI, isToolbarAIFCEnabled]);
|
|
95
91
|
var extension = activeExtension === null || activeExtension === void 0 ? void 0 : activeExtension.extension;
|
|
96
92
|
if (!extension) {
|
|
97
93
|
return null;
|
|
98
94
|
}
|
|
99
|
-
if (isToolbarAIFCEnabled
|
|
95
|
+
if (isToolbarAIFCEnabled) {
|
|
100
96
|
var hasContentComponent = function hasContentComponent(ext) {
|
|
101
97
|
return 'contentComponent' in ext && ext.contentComponent !== undefined;
|
|
102
98
|
};
|
|
@@ -5,7 +5,6 @@ import { usePluginStateEffect } from '@atlaskit/editor-common/use-plugin-state-e
|
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
import { insertAdfAtEndOfDoc } from './pm-plugins/actions/insertAdfAtEndOfDoc';
|
|
10
9
|
import { replaceWithAdf } from './pm-plugins/actions/replaceWithAdf';
|
|
11
10
|
import { createPlugin, selectionExtensionPluginKey } from './pm-plugins/main';
|
|
@@ -26,7 +25,7 @@ export const selectionExtensionPlugin = ({
|
|
|
26
25
|
};
|
|
27
26
|
let cachedSelection;
|
|
28
27
|
let cachedOverflowMenuOptions;
|
|
29
|
-
const isToolbarAIFCEnabled =
|
|
28
|
+
const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
30
29
|
const {
|
|
31
30
|
extensionList = [],
|
|
32
31
|
extensions = {}
|
|
@@ -2,16 +2,12 @@ import React, { useCallback, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
export const SelectionExtensionComponentWrapper = ({
|
|
7
6
|
api,
|
|
8
7
|
editorAnalyticsAPI
|
|
9
8
|
}) => {
|
|
10
9
|
const componentRef = useRef();
|
|
11
|
-
const isToolbarAIFCEnabled =
|
|
12
|
-
exposure: true
|
|
13
|
-
});
|
|
14
|
-
const isToolbarAIFCSelectionExtensionEnabled = expValEquals('platform_editor_toolbar_aifc_selection_extension', 'isEnabled', true);
|
|
10
|
+
const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && expValEquals('platform_editor_toolbar_aifc_selection_extension', 'isEnabled', true);
|
|
15
11
|
const {
|
|
16
12
|
activeExtension,
|
|
17
13
|
mode
|
|
@@ -51,7 +47,7 @@ export const SelectionExtensionComponentWrapper = ({
|
|
|
51
47
|
if (!extension) {
|
|
52
48
|
return;
|
|
53
49
|
}
|
|
54
|
-
if (isToolbarAIFCEnabled
|
|
50
|
+
if (isToolbarAIFCEnabled) {
|
|
55
51
|
let currentComponent;
|
|
56
52
|
if ('contentComponent' in extension && extension.contentComponent !== undefined) {
|
|
57
53
|
currentComponent = extension.contentComponent;
|
|
@@ -85,12 +81,12 @@ export const SelectionExtensionComponentWrapper = ({
|
|
|
85
81
|
// Sets reference to active component
|
|
86
82
|
componentRef.current = extension.component;
|
|
87
83
|
}
|
|
88
|
-
}, [activeExtension, editorAnalyticsAPI, isToolbarAIFCEnabled
|
|
84
|
+
}, [activeExtension, editorAnalyticsAPI, isToolbarAIFCEnabled]);
|
|
89
85
|
const extension = activeExtension === null || activeExtension === void 0 ? void 0 : activeExtension.extension;
|
|
90
86
|
if (!extension) {
|
|
91
87
|
return null;
|
|
92
88
|
}
|
|
93
|
-
if (isToolbarAIFCEnabled
|
|
89
|
+
if (isToolbarAIFCEnabled) {
|
|
94
90
|
const hasContentComponent = ext => {
|
|
95
91
|
return 'contentComponent' in ext && ext.contentComponent !== undefined;
|
|
96
92
|
};
|
|
@@ -6,7 +6,6 @@ import { usePluginStateEffect } from '@atlaskit/editor-common/use-plugin-state-e
|
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
8
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
9
|
import { insertAdfAtEndOfDoc as _insertAdfAtEndOfDoc } from './pm-plugins/actions/insertAdfAtEndOfDoc';
|
|
11
10
|
import { replaceWithAdf as _replaceWithAdf } from './pm-plugins/actions/replaceWithAdf';
|
|
12
11
|
import { createPlugin, selectionExtensionPluginKey } from './pm-plugins/main';
|
|
@@ -26,7 +25,7 @@ export var selectionExtensionPlugin = function selectionExtensionPlugin(_ref) {
|
|
|
26
25
|
};
|
|
27
26
|
var cachedSelection;
|
|
28
27
|
var cachedOverflowMenuOptions;
|
|
29
|
-
var isToolbarAIFCEnabled =
|
|
28
|
+
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
30
29
|
var _ref2 = config || {},
|
|
31
30
|
_ref2$extensionList = _ref2.extensionList,
|
|
32
31
|
extensionList = _ref2$extensionList === void 0 ? [] : _ref2$extensionList,
|
|
@@ -2,15 +2,11 @@ import React, { useCallback, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
export var SelectionExtensionComponentWrapper = function SelectionExtensionComponentWrapper(_ref) {
|
|
7
6
|
var api = _ref.api,
|
|
8
7
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI;
|
|
9
8
|
var componentRef = useRef();
|
|
10
|
-
var isToolbarAIFCEnabled =
|
|
11
|
-
exposure: true
|
|
12
|
-
});
|
|
13
|
-
var isToolbarAIFCSelectionExtensionEnabled = expValEquals('platform_editor_toolbar_aifc_selection_extension', 'isEnabled', true);
|
|
9
|
+
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && expValEquals('platform_editor_toolbar_aifc_selection_extension', 'isEnabled', true);
|
|
14
10
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['selectionExtension', 'editorViewMode'], function (states) {
|
|
15
11
|
var _states$selectionExte, _states$editorViewMod;
|
|
16
12
|
return {
|
|
@@ -49,7 +45,7 @@ export var SelectionExtensionComponentWrapper = function SelectionExtensionCompo
|
|
|
49
45
|
if (!extension) {
|
|
50
46
|
return;
|
|
51
47
|
}
|
|
52
|
-
if (isToolbarAIFCEnabled
|
|
48
|
+
if (isToolbarAIFCEnabled) {
|
|
53
49
|
var currentComponent;
|
|
54
50
|
if ('contentComponent' in extension && extension.contentComponent !== undefined) {
|
|
55
51
|
currentComponent = extension.contentComponent;
|
|
@@ -83,12 +79,12 @@ export var SelectionExtensionComponentWrapper = function SelectionExtensionCompo
|
|
|
83
79
|
// Sets reference to active component
|
|
84
80
|
componentRef.current = extension.component;
|
|
85
81
|
}
|
|
86
|
-
}, [activeExtension, editorAnalyticsAPI, isToolbarAIFCEnabled
|
|
82
|
+
}, [activeExtension, editorAnalyticsAPI, isToolbarAIFCEnabled]);
|
|
87
83
|
var extension = activeExtension === null || activeExtension === void 0 ? void 0 : activeExtension.extension;
|
|
88
84
|
if (!extension) {
|
|
89
85
|
return null;
|
|
90
86
|
}
|
|
91
|
-
if (isToolbarAIFCEnabled
|
|
87
|
+
if (isToolbarAIFCEnabled) {
|
|
92
88
|
var hasContentComponent = function hasContentComponent(ext) {
|
|
93
89
|
return 'contentComponent' in ext && ext.contentComponent !== undefined;
|
|
94
90
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.8",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-toolbar": "^3.2.0",
|
|
43
43
|
"@atlaskit/editor-plugin-user-preferences": "^4.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
45
|
+
"@atlaskit/editor-shared-styles": "^3.7.0",
|
|
46
46
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
47
47
|
"@atlaskit/editor-toolbar": "^0.15.0",
|
|
48
48
|
"@atlaskit/icon": "^28.5.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
51
51
|
"@atlaskit/primitives": "^14.15.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^13.10.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"react-intl-next": "npm:react-intl@^5.18.1",
|