@atlaskit/editor-plugin-block-type 20.0.8 → 20.0.9
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 +6 -0
- package/dist/cjs/blockTypePlugin.js +3 -3
- package/dist/cjs/pm-plugins/ui/FloatingToolbarComponent.js +2 -2
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/index.js +4 -4
- package/dist/es2019/blockTypePlugin.js +1 -1
- package/dist/es2019/pm-plugins/ui/FloatingToolbarComponent.js +1 -1
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/index.js +2 -2
- package/dist/esm/blockTypePlugin.js +1 -1
- package/dist/esm/pm-plugins/ui/FloatingToolbarComponent.js +1 -1
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/index.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -17,7 +17,7 @@ var _types = require("@atlaskit/editor-common/types");
|
|
|
17
17
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
18
18
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
19
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
|
-
var
|
|
20
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
21
21
|
var _blockType = require("./pm-plugins/commands/block-type");
|
|
22
22
|
var _inputRule = _interopRequireDefault(require("./pm-plugins/input-rule"));
|
|
23
23
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
@@ -141,7 +141,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
|
141
141
|
component: primaryToolbarComponent
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
if ((0,
|
|
144
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
145
145
|
var _api$blockMenu;
|
|
146
146
|
api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents((0, _ui.getBlockTypeComponents)(api));
|
|
147
147
|
}
|
|
@@ -242,7 +242,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
|
242
242
|
selectionToolbar: function selectionToolbar() {
|
|
243
243
|
var _api$userPreferences, _api$selectionToolbar;
|
|
244
244
|
var toolbarDocking = (0, _fg.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;
|
|
245
|
-
if (toolbarDocking === 'none' && (0,
|
|
245
|
+
if (toolbarDocking === 'none' && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
246
246
|
exposure: true
|
|
247
247
|
})) {
|
|
248
248
|
var toolbarCustom = {
|
|
@@ -9,7 +9,7 @@ exports.FloatingToolbarComponent = FloatingToolbarComponent;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
-
var
|
|
12
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
13
13
|
var _ToolbarBlockType = _interopRequireDefault(require("./ToolbarBlockType"));
|
|
14
14
|
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); }
|
|
15
15
|
var FloatingToolbarSettings = {
|
|
@@ -50,7 +50,7 @@ function FloatingToolbarComponent(_ref) {
|
|
|
50
50
|
return /*#__PURE__*/_react.default.createElement(_ToolbarBlockType.default, {
|
|
51
51
|
isSmall: FloatingToolbarSettings.isSmall,
|
|
52
52
|
isDisabled: FloatingToolbarSettings.disabled,
|
|
53
|
-
isReducedSpacing: (0,
|
|
53
|
+
isReducedSpacing: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? false : FloatingToolbarSettings.isToolbarReducedSpacing,
|
|
54
54
|
setTextLevel: boundSetBlockType,
|
|
55
55
|
currentBlockType: currentBlockType,
|
|
56
56
|
blockTypesDisabled: blockTypesDisabled,
|
|
@@ -21,7 +21,7 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
21
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
22
|
var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
|
|
23
23
|
var _primitives = require("@atlaskit/primitives");
|
|
24
|
-
var
|
|
24
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
25
25
|
var _themeMutationObserver = require("@atlaskit/tokens/theme-mutation-observer");
|
|
26
26
|
var _blockTypes = require("../../block-types");
|
|
27
27
|
var _blocktypeButton = require("./blocktype-button");
|
|
@@ -99,7 +99,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
99
99
|
value: blockType,
|
|
100
100
|
'aria-label': (0, _keymaps.tooltip)(keyMap, formatMessage(blockType.title)),
|
|
101
101
|
key: "".concat(blockType.name, "-").concat(index),
|
|
102
|
-
elemBefore: (0,
|
|
102
|
+
elemBefore: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? icon : undefined,
|
|
103
103
|
elemAfter:
|
|
104
104
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
105
105
|
(0, _react2.jsx)("div", {
|
|
@@ -111,7 +111,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
111
111
|
});
|
|
112
112
|
if ((availableBlockTypesInDropdown !== null && availableBlockTypesInDropdown !== void 0 ? availableBlockTypesInDropdown : []).map(function (blockType) {
|
|
113
113
|
return blockType.name;
|
|
114
|
-
}).includes('blockquote') && (0,
|
|
114
|
+
}).includes('blockquote') && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'control')) {
|
|
115
115
|
var clearFormattingItem = {
|
|
116
116
|
content: (0, _react2.jsx)("div", null, (0, _react2.jsx)("p", null, _messages.toolbarMessages.clearFormatting.defaultMessage)),
|
|
117
117
|
value: {
|
|
@@ -300,6 +300,6 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
}]);
|
|
303
|
-
}(_react.default.PureComponent); // eslint-disable-next-line @typescript-eslint/
|
|
303
|
+
}(_react.default.PureComponent); // eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
304
304
|
var _default_1 = (0, _reactIntl.injectIntl)(ToolbarBlockType);
|
|
305
305
|
var _default = exports.default = _default_1;
|
|
@@ -8,7 +8,7 @@ import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
|
8
8
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
11
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
12
12
|
import { clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
|
13
13
|
import inputRulePlugin from './pm-plugins/input-rule';
|
|
14
14
|
import keymapPlugin from './pm-plugins/keymap';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import ToolbarBlockType from './ToolbarBlockType';
|
|
6
6
|
const FloatingToolbarSettings = {
|
|
7
7
|
isSmall: true,
|
|
@@ -16,7 +16,7 @@ import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
16
16
|
import TextIcon from '@atlaskit/icon/core/text';
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
18
18
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
19
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
19
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
20
20
|
import { ThemeMutationObserver } from '@atlaskit/tokens/theme-mutation-observer';
|
|
21
21
|
import { NORMAL_TEXT } from '../../block-types';
|
|
22
22
|
import { BlockTypeButton } from './blocktype-button';
|
|
@@ -272,6 +272,6 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
275
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
276
276
|
const _default_1 = injectIntl(ToolbarBlockType);
|
|
277
277
|
export default _default_1;
|
|
@@ -12,7 +12,7 @@ import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
|
12
12
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
15
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
16
16
|
import { clearFormatting as _clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
|
17
17
|
import inputRulePlugin from './pm-plugins/input-rule';
|
|
18
18
|
import keymapPlugin from './pm-plugins/keymap';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import ToolbarBlockType from './ToolbarBlockType';
|
|
6
6
|
var FloatingToolbarSettings = {
|
|
7
7
|
isSmall: true,
|
|
@@ -25,7 +25,7 @@ import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
25
25
|
import TextIcon from '@atlaskit/icon/core/text';
|
|
26
26
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
27
27
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
28
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
28
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
29
29
|
import { ThemeMutationObserver } from '@atlaskit/tokens/theme-mutation-observer';
|
|
30
30
|
import { NORMAL_TEXT } from '../../block-types';
|
|
31
31
|
import { BlockTypeButton } from './blocktype-button';
|
|
@@ -296,6 +296,6 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
296
296
|
);
|
|
297
297
|
}
|
|
298
298
|
}]);
|
|
299
|
-
}(React.PureComponent); // eslint-disable-next-line @typescript-eslint/
|
|
299
|
+
}(React.PureComponent); // eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
300
300
|
var _default_1 = injectIntl(ToolbarBlockType);
|
|
301
301
|
export default _default_1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.9",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/primitives": "^22.4.0",
|
|
44
44
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
45
45
|
"@atlaskit/prosemirror-input-rules": "^4.0.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^168.0.0",
|
|
47
47
|
"@atlaskit/tokens": "^16.9.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@compiled/react": "^1.0.2",
|