@atlaskit/editor-plugin-block-type 7.1.1 → 7.1.2
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 7.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`db97eb262cc5a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/db97eb262cc5a) -
|
|
8
|
+
replace platform_editor_toolbar_aifc with separate experiements for jira and confluence
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.1.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -15,7 +15,6 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
15
15
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
16
16
|
var _types = require("@atlaskit/editor-common/types");
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
18
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
20
19
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
21
20
|
var _blockType = require("./pm-plugins/commands/block-type");
|
|
@@ -106,6 +105,9 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
|
106
105
|
var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
107
106
|
var options = _ref3.config,
|
|
108
107
|
api = _ref3.api;
|
|
108
|
+
var isToolbarAIFCEnabled = (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
|
|
109
|
+
exposure: true
|
|
110
|
+
});
|
|
109
111
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
|
|
110
112
|
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
111
113
|
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
@@ -128,7 +130,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
|
128
130
|
shouldUseDefaultRole: false
|
|
129
131
|
});
|
|
130
132
|
};
|
|
131
|
-
if (
|
|
133
|
+
if (isToolbarAIFCEnabled) {
|
|
132
134
|
var _api$toolbar;
|
|
133
135
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api));
|
|
134
136
|
} else {
|
|
@@ -219,7 +221,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
|
219
221
|
return _main.pluginKey.getState(editorState);
|
|
220
222
|
},
|
|
221
223
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
|
222
|
-
pluginsOptions: _objectSpread(_objectSpread({}, !
|
|
224
|
+
pluginsOptions: _objectSpread(_objectSpread({}, !isToolbarAIFCEnabled && {
|
|
223
225
|
selectionToolbar: function selectionToolbar() {
|
|
224
226
|
var _api$userPreferences, _api$selectionToolbar;
|
|
225
227
|
var toolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
|
|
@@ -6,7 +6,6 @@ import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages'
|
|
|
6
6
|
import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
7
7
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
9
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
11
|
import { clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
|
@@ -94,6 +93,9 @@ const blockTypePlugin = ({
|
|
|
94
93
|
config: options,
|
|
95
94
|
api
|
|
96
95
|
}) => {
|
|
96
|
+
const isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
|
|
97
|
+
exposure: true
|
|
98
|
+
});
|
|
97
99
|
const primaryToolbarComponent = ({
|
|
98
100
|
popupsMountPoint,
|
|
99
101
|
popupsBoundariesElement,
|
|
@@ -117,7 +119,7 @@ const blockTypePlugin = ({
|
|
|
117
119
|
shouldUseDefaultRole: false
|
|
118
120
|
});
|
|
119
121
|
};
|
|
120
|
-
if (
|
|
122
|
+
if (isToolbarAIFCEnabled) {
|
|
121
123
|
var _api$toolbar;
|
|
122
124
|
api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api));
|
|
123
125
|
} else {
|
|
@@ -207,7 +209,7 @@ const blockTypePlugin = ({
|
|
|
207
209
|
},
|
|
208
210
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
|
209
211
|
pluginsOptions: {
|
|
210
|
-
...(!
|
|
212
|
+
...(!isToolbarAIFCEnabled && {
|
|
211
213
|
selectionToolbar: () => {
|
|
212
214
|
var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
|
|
213
215
|
const toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.preferences) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.toolbarDockingPosition : api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking;
|
|
@@ -10,7 +10,6 @@ import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages'
|
|
|
10
10
|
import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
11
11
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
15
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
15
|
import { clearFormatting as _clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
|
@@ -99,6 +98,9 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
|
99
98
|
var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
100
99
|
var options = _ref3.config,
|
|
101
100
|
api = _ref3.api;
|
|
101
|
+
var isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
|
|
102
|
+
exposure: true
|
|
103
|
+
});
|
|
102
104
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
|
|
103
105
|
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
104
106
|
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
@@ -121,7 +123,7 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
|
121
123
|
shouldUseDefaultRole: false
|
|
122
124
|
});
|
|
123
125
|
};
|
|
124
|
-
if (
|
|
126
|
+
if (isToolbarAIFCEnabled) {
|
|
125
127
|
var _api$toolbar;
|
|
126
128
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api));
|
|
127
129
|
} else {
|
|
@@ -212,7 +214,7 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
|
212
214
|
return pluginKey.getState(editorState);
|
|
213
215
|
},
|
|
214
216
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
|
215
|
-
pluginsOptions: _objectSpread(_objectSpread({}, !
|
|
217
|
+
pluginsOptions: _objectSpread(_objectSpread({}, !isToolbarAIFCEnabled && {
|
|
216
218
|
selectionToolbar: function selectionToolbar() {
|
|
217
219
|
var _api$userPreferences, _api$selectionToolbar;
|
|
218
220
|
var toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"@atlaskit/primitives": "^14.13.0",
|
|
50
50
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
51
51
|
"@atlaskit/theme": "^20.0.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^12.5.0",
|
|
53
53
|
"@atlaskit/tokens": "^6.2.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^108.
|
|
58
|
+
"@atlaskit/editor-common": "^108.3.0",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
61
61
|
"react-intl-next": "npm:react-intl@^5.18.1"
|