@atlaskit/editor-plugin-text-formatting 21.0.2 → 21.0.4
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 +17 -0
- package/dist/cjs/pm-plugins/main.js +3 -2
- package/dist/cjs/ui/Toolbar/hooks/responsive-toolbar-buttons.js +5 -5
- package/dist/es2019/pm-plugins/main.js +3 -2
- package/dist/es2019/ui/Toolbar/hooks/responsive-toolbar-buttons.js +5 -5
- package/dist/esm/pm-plugins/main.js +3 -2
- package/dist/esm/ui/Toolbar/hooks/responsive-toolbar-buttons.js +5 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-formatting
|
|
2
2
|
|
|
3
|
+
## 21.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e339b127f827a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e339b127f827a) -
|
|
8
|
+
Route `platform_editor_controls` checks that used `expValEquals` / `expValEqualsNoExposure`
|
|
9
|
+
through `editorExperiment`, so they respect the per-product experiment key (Confluence
|
|
10
|
+
`platform_editor_controls`, Jira `platform_editor_controls_jira`). Previously these checks always
|
|
11
|
+
read the Confluence experiment, which evaluated to control in Jira.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 21.0.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 21.0.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -15,7 +15,6 @@ var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
|
15
15
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
16
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
17
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
18
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
18
|
var _textFormatting = _interopRequireWildcard(require("../editor-commands/text-formatting"));
|
|
20
19
|
var commands = _textFormatting;
|
|
21
20
|
var _pluginKey = require("./plugin-key");
|
|
@@ -52,7 +51,9 @@ var getTextFormattingState = function getTextFormattingState(editorState, _edito
|
|
|
52
51
|
var state = {
|
|
53
52
|
isInitialised: true
|
|
54
53
|
};
|
|
55
|
-
var showOnlyCommonMarks = (0,
|
|
54
|
+
var showOnlyCommonMarks = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
55
|
+
exposure: true
|
|
56
|
+
});
|
|
56
57
|
if (showOnlyCommonMarks) {
|
|
57
58
|
// Code marks will disable all other formatting options when they are included in a
|
|
58
59
|
// selection but (for now) we do not want to make it behave differently in regards to which
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useResponsiveToolbarButtons = exports.useResponsiveIconTypeMenu = exports.useResponsiveIconTypeButtons = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
9
9
|
var _constants = require("../constants");
|
|
10
10
|
var _useIconList = require("./use-icon-list");
|
|
11
11
|
var useResponsiveIconTypeButtons = exports.useResponsiveIconTypeButtons = function useResponsiveIconTypeButtons(_ref) {
|
|
12
12
|
var toolbarSize = _ref.toolbarSize,
|
|
13
13
|
responsivenessEnabled = _ref.responsivenessEnabled;
|
|
14
14
|
var ResponsiveCustomButtonToolbar = _constants.ResponsiveCustomButtonToolbarCompact;
|
|
15
|
-
if ((0,
|
|
15
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
16
16
|
ResponsiveCustomButtonToolbar = _constants.ResponsiveCustomButtonToolbarMinimal;
|
|
17
17
|
}
|
|
18
18
|
var iconTypeList = (0, _react.useMemo)(function () {
|
|
@@ -21,7 +21,7 @@ var useResponsiveIconTypeButtons = exports.useResponsiveIconTypeButtons = functi
|
|
|
21
21
|
if (responsivenessEnabled) {
|
|
22
22
|
return iconTypeList;
|
|
23
23
|
}
|
|
24
|
-
if ((0,
|
|
24
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
25
25
|
return _constants.ToolbarButtonsStrong;
|
|
26
26
|
} else {
|
|
27
27
|
return _constants.ToolbarButtonsStrongItalic;
|
|
@@ -31,7 +31,7 @@ var useResponsiveIconTypeMenu = exports.useResponsiveIconTypeMenu = function use
|
|
|
31
31
|
var toolbarSize = _ref2.toolbarSize,
|
|
32
32
|
responsivenessEnabled = _ref2.responsivenessEnabled;
|
|
33
33
|
var ResponsiveCustomMenu = _constants.ResponsiveCustomMenuCompact;
|
|
34
|
-
if ((0,
|
|
34
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
35
35
|
ResponsiveCustomMenu = _constants.ResponsiveCustomMenuMinimal;
|
|
36
36
|
}
|
|
37
37
|
var iconTypeList = (0, _react.useMemo)(function () {
|
|
@@ -40,7 +40,7 @@ var useResponsiveIconTypeMenu = exports.useResponsiveIconTypeMenu = function use
|
|
|
40
40
|
if (responsivenessEnabled) {
|
|
41
41
|
return iconTypeList;
|
|
42
42
|
}
|
|
43
|
-
if ((0,
|
|
43
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
44
44
|
return _constants.ButtonsMenuMinimal;
|
|
45
45
|
} else {
|
|
46
46
|
return _constants.ToolbarButtonsStrongItalic;
|
|
@@ -9,7 +9,6 @@ import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
|
9
9
|
import { MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
12
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
12
|
import { createInlineCodeFromTextInputWithAnalytics } from '../editor-commands/text-formatting';
|
|
14
13
|
// Ignored via go/ees005
|
|
15
14
|
// eslint-disable-next-line import/no-namespace
|
|
@@ -42,7 +41,9 @@ const getTextFormattingState = (editorState, _editorAnalyticsAPI) => {
|
|
|
42
41
|
const state = {
|
|
43
42
|
isInitialised: true
|
|
44
43
|
};
|
|
45
|
-
const showOnlyCommonMarks =
|
|
44
|
+
const showOnlyCommonMarks = editorExperiment('platform_editor_controls', 'variant1', {
|
|
45
|
+
exposure: true
|
|
46
|
+
});
|
|
46
47
|
if (showOnlyCommonMarks) {
|
|
47
48
|
// Code marks will disable all other formatting options when they are included in a
|
|
48
49
|
// selection but (for now) we do not want to make it behave differently in regards to which
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
3
3
|
import { ButtonsMenuMinimal, ToolbarButtonsStrong, ToolbarButtonsStrongItalic, ResponsiveCustomButtonToolbarMinimal, ResponsiveCustomButtonToolbarCompact, ResponsiveCustomMenuMinimal, ResponsiveCustomMenuCompact } from '../constants';
|
|
4
4
|
import { useIconList } from './use-icon-list';
|
|
5
5
|
export const useResponsiveIconTypeButtons = ({
|
|
@@ -7,14 +7,14 @@ export const useResponsiveIconTypeButtons = ({
|
|
|
7
7
|
responsivenessEnabled
|
|
8
8
|
}) => {
|
|
9
9
|
let ResponsiveCustomButtonToolbar = ResponsiveCustomButtonToolbarCompact;
|
|
10
|
-
if (
|
|
10
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
11
11
|
ResponsiveCustomButtonToolbar = ResponsiveCustomButtonToolbarMinimal;
|
|
12
12
|
}
|
|
13
13
|
const iconTypeList = useMemo(() => ResponsiveCustomButtonToolbar[toolbarSize], [toolbarSize, ResponsiveCustomButtonToolbar]);
|
|
14
14
|
if (responsivenessEnabled) {
|
|
15
15
|
return iconTypeList;
|
|
16
16
|
}
|
|
17
|
-
if (
|
|
17
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
18
18
|
return ToolbarButtonsStrong;
|
|
19
19
|
} else {
|
|
20
20
|
return ToolbarButtonsStrongItalic;
|
|
@@ -25,14 +25,14 @@ export const useResponsiveIconTypeMenu = ({
|
|
|
25
25
|
responsivenessEnabled
|
|
26
26
|
}) => {
|
|
27
27
|
let ResponsiveCustomMenu = ResponsiveCustomMenuCompact;
|
|
28
|
-
if (
|
|
28
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
29
29
|
ResponsiveCustomMenu = ResponsiveCustomMenuMinimal;
|
|
30
30
|
}
|
|
31
31
|
const iconTypeList = useMemo(() => ResponsiveCustomMenu[toolbarSize], [toolbarSize, ResponsiveCustomMenu]);
|
|
32
32
|
if (responsivenessEnabled) {
|
|
33
33
|
return iconTypeList;
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
35
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
36
36
|
return ButtonsMenuMinimal;
|
|
37
37
|
} else {
|
|
38
38
|
return ToolbarButtonsStrongItalic;
|
|
@@ -13,7 +13,6 @@ import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
|
13
13
|
import { MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
14
14
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
15
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
16
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
16
|
import { createInlineCodeFromTextInputWithAnalytics } from '../editor-commands/text-formatting';
|
|
18
17
|
// Ignored via go/ees005
|
|
19
18
|
// eslint-disable-next-line import/no-namespace
|
|
@@ -45,7 +44,9 @@ var getTextFormattingState = function getTextFormattingState(editorState, _edito
|
|
|
45
44
|
var state = {
|
|
46
45
|
isInitialised: true
|
|
47
46
|
};
|
|
48
|
-
var showOnlyCommonMarks =
|
|
47
|
+
var showOnlyCommonMarks = editorExperiment('platform_editor_controls', 'variant1', {
|
|
48
|
+
exposure: true
|
|
49
|
+
});
|
|
49
50
|
if (showOnlyCommonMarks) {
|
|
50
51
|
// Code marks will disable all other formatting options when they are included in a
|
|
51
52
|
// selection but (for now) we do not want to make it behave differently in regards to which
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
3
3
|
import { ButtonsMenuMinimal, ToolbarButtonsStrong, ToolbarButtonsStrongItalic, ResponsiveCustomButtonToolbarMinimal, ResponsiveCustomButtonToolbarCompact, ResponsiveCustomMenuMinimal, ResponsiveCustomMenuCompact } from '../constants';
|
|
4
4
|
import { useIconList } from './use-icon-list';
|
|
5
5
|
export var useResponsiveIconTypeButtons = function useResponsiveIconTypeButtons(_ref) {
|
|
6
6
|
var toolbarSize = _ref.toolbarSize,
|
|
7
7
|
responsivenessEnabled = _ref.responsivenessEnabled;
|
|
8
8
|
var ResponsiveCustomButtonToolbar = ResponsiveCustomButtonToolbarCompact;
|
|
9
|
-
if (
|
|
9
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
10
10
|
ResponsiveCustomButtonToolbar = ResponsiveCustomButtonToolbarMinimal;
|
|
11
11
|
}
|
|
12
12
|
var iconTypeList = useMemo(function () {
|
|
@@ -15,7 +15,7 @@ export var useResponsiveIconTypeButtons = function useResponsiveIconTypeButtons(
|
|
|
15
15
|
if (responsivenessEnabled) {
|
|
16
16
|
return iconTypeList;
|
|
17
17
|
}
|
|
18
|
-
if (
|
|
18
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
19
19
|
return ToolbarButtonsStrong;
|
|
20
20
|
} else {
|
|
21
21
|
return ToolbarButtonsStrongItalic;
|
|
@@ -25,7 +25,7 @@ export var useResponsiveIconTypeMenu = function useResponsiveIconTypeMenu(_ref2)
|
|
|
25
25
|
var toolbarSize = _ref2.toolbarSize,
|
|
26
26
|
responsivenessEnabled = _ref2.responsivenessEnabled;
|
|
27
27
|
var ResponsiveCustomMenu = ResponsiveCustomMenuCompact;
|
|
28
|
-
if (
|
|
28
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
29
29
|
ResponsiveCustomMenu = ResponsiveCustomMenuMinimal;
|
|
30
30
|
}
|
|
31
31
|
var iconTypeList = useMemo(function () {
|
|
@@ -34,7 +34,7 @@ export var useResponsiveIconTypeMenu = function useResponsiveIconTypeMenu(_ref2)
|
|
|
34
34
|
if (responsivenessEnabled) {
|
|
35
35
|
return iconTypeList;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
38
38
|
return ButtonsMenuMinimal;
|
|
39
39
|
} else {
|
|
40
40
|
return ToolbarButtonsStrongItalic;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-formatting",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.4",
|
|
4
4
|
"description": "Text-formatting plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
34
34
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
35
35
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
36
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
36
|
+
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
37
37
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
38
38
|
"@atlaskit/icon": "^38.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
40
40
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^208.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^20.0.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^125.
|
|
47
|
+
"@atlaskit/editor-common": "^125.3.0",
|
|
48
48
|
"react": "^18.2.0 || ^19.2.0",
|
|
49
49
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
50
50
|
},
|