@atlaskit/editor-plugin-status 19.0.11 → 20.0.1

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,30 @@
1
1
  # @atlaskit/editor-plugin-status
2
2
 
3
+ ## 20.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
8
+ Clean up shipped experiment `platform_editor_block_menu`
9
+ - Updated dependencies
10
+
11
+ ## 20.0.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 19.0.12
18
+
19
+ ### Patch Changes
20
+
21
+ - [`01c0f8f495971`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/01c0f8f495971) -
22
+ Fix status suggestion popup showing duplicate entries when a legacy named color and its
23
+ equivalent-hue hex value (introduced by platform_editor_update_status_colors, e.g. green/#D3F1A7
24
+ or yellow/#FCE4A6) both appear in the document; suggestions now dedupe by resolved lozenge
25
+ appearance instead of the raw color attribute.
26
+ - Updated dependencies
27
+
3
28
  ## 19.0.11
4
29
 
5
30
  ### Patch Changes
@@ -17,7 +17,6 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
17
17
  var _utils = require("@atlaskit/editor-common/utils");
18
18
  var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
19
19
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
20
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
20
  var _actions = require("./pm-plugins/actions");
22
21
  var _turnInto = require("./utils/turnInto");
23
22
  var _keymap = require("./pm-plugins/keymap");
@@ -32,7 +31,7 @@ var statusPlugin = exports.statusPlugin = function statusPlugin(_ref) {
32
31
  var _api$analytics, _api$analytics2;
33
32
  var options = _ref.config,
34
33
  api = _ref.api;
35
- if ((0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_turn_into_status')) {
34
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_turn_into_status')) {
36
35
  var _api$blockMenu;
37
36
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
38
37
  type: 'block-menu-item',
@@ -7,16 +7,21 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getSuggestedStatuses = exports.MAX_SUGGESTED_STATUSES_OLD = exports.MAX_SUGGESTED_STATUSES = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _statusColors = require("@atlaskit/status/status-colors");
10
11
  var _excluded = ["distance"];
11
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
14
  var MAX_SUGGESTED_STATUSES = exports.MAX_SUGGESTED_STATUSES = 20;
14
15
  // Remove when cleaning up `platform_editor_status_popup_suggestions_patch_1`.
15
16
  var MAX_SUGGESTED_STATUSES_OLD = exports.MAX_SUGGESTED_STATUSES_OLD = 7;
17
+
18
+ // `color` may be a legacy name or a hex value that render the same hue (e.g. `green` and
19
+ // `#D3F1A7` both resolve to `accent-lime`), so the key is built from the resolved appearance
20
+ // rather than the raw attribute value — otherwise both variants would surface as suggestions.
16
21
  var getStatusKey = function getStatusKey(_ref) {
17
22
  var color = _ref.color,
18
23
  text = _ref.text;
19
- return "".concat(color, ":").concat(text.trim().toLowerCase());
24
+ return "".concat((0, _statusColors.getLozengeAppearance)(color), ":").concat(text.trim().toLowerCase());
20
25
  };
21
26
  var getDisplayText = function getDisplayText(status, shouldUppercaseText) {
22
27
  return shouldUppercaseText && status.style !== 'mixedCase' ? status.text.toUpperCase() : status.text;
@@ -9,7 +9,6 @@ import { IconStatus } from '@atlaskit/editor-common/quick-insert';
9
9
  import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils';
10
10
  import CommentIcon from '@atlaskit/icon/core/comment';
11
11
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
12
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
12
  import { commitStatusPicker, insertStatus, removeStatus, updateStatusWithAnalytics } from './pm-plugins/actions';
14
13
  import { isStatusTurnIntoHidden } from './utils/turnInto';
15
14
  import { keymapPlugin } from './pm-plugins/keymap';
@@ -23,7 +22,7 @@ export const statusPlugin = ({
23
22
  api
24
23
  }) => {
25
24
  var _api$analytics, _api$analytics2;
26
- if (expValEquals('platform_editor_block_menu', 'isEnabled', true) && isExperimentEnabled('platform_editor_turn_into_status')) {
25
+ if (isExperimentEnabled('platform_editor_turn_into_status')) {
27
26
  var _api$blockMenu;
28
27
  api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents([{
29
28
  type: 'block-menu-item',
@@ -1,10 +1,15 @@
1
+ import { getLozengeAppearance } from '@atlaskit/status/status-colors';
1
2
  export const MAX_SUGGESTED_STATUSES = 20;
2
3
  // Remove when cleaning up `platform_editor_status_popup_suggestions_patch_1`.
3
4
  export const MAX_SUGGESTED_STATUSES_OLD = 7;
5
+
6
+ // `color` may be a legacy name or a hex value that render the same hue (e.g. `green` and
7
+ // `#D3F1A7` both resolve to `accent-lime`), so the key is built from the resolved appearance
8
+ // rather than the raw attribute value — otherwise both variants would surface as suggestions.
4
9
  const getStatusKey = ({
5
10
  color,
6
11
  text
7
- }) => `${color}:${text.trim().toLowerCase()}`;
12
+ }) => `${getLozengeAppearance(color)}:${text.trim().toLowerCase()}`;
8
13
  const getDisplayText = (status, shouldUppercaseText) => shouldUppercaseText && status.style !== 'mixedCase' ? status.text.toUpperCase() : status.text;
9
14
  export const getSuggestedStatuses = ({
10
15
  currentPos,
@@ -12,7 +12,6 @@ import { IconStatus } from '@atlaskit/editor-common/quick-insert';
12
12
  import { calculateToolbarPositionAboveSelection } from '@atlaskit/editor-common/utils';
13
13
  import CommentIcon from '@atlaskit/icon/core/comment';
14
14
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
15
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
15
  import { commitStatusPicker, insertStatus, removeStatus, updateStatusWithAnalytics } from './pm-plugins/actions';
17
16
  import { isStatusTurnIntoHidden } from './utils/turnInto';
18
17
  import { keymapPlugin } from './pm-plugins/keymap';
@@ -25,7 +24,7 @@ export var statusPlugin = function statusPlugin(_ref) {
25
24
  var _api$analytics, _api$analytics2;
26
25
  var options = _ref.config,
27
26
  api = _ref.api;
28
- if (expValEquals('platform_editor_block_menu', 'isEnabled', true) && isExperimentEnabled('platform_editor_turn_into_status')) {
27
+ if (isExperimentEnabled('platform_editor_turn_into_status')) {
29
28
  var _api$blockMenu;
30
29
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
31
30
  type: 'block-menu-item',
@@ -3,13 +3,18 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  var _excluded = ["distance"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { getLozengeAppearance } from '@atlaskit/status/status-colors';
6
7
  export var MAX_SUGGESTED_STATUSES = 20;
7
8
  // Remove when cleaning up `platform_editor_status_popup_suggestions_patch_1`.
8
9
  export var MAX_SUGGESTED_STATUSES_OLD = 7;
10
+
11
+ // `color` may be a legacy name or a hex value that render the same hue (e.g. `green` and
12
+ // `#D3F1A7` both resolve to `accent-lime`), so the key is built from the resolved appearance
13
+ // rather than the raw attribute value — otherwise both variants would surface as suggestions.
9
14
  var getStatusKey = function getStatusKey(_ref) {
10
15
  var color = _ref.color,
11
16
  text = _ref.text;
12
- return "".concat(color, ":").concat(text.trim().toLowerCase());
17
+ return "".concat(getLozengeAppearance(color), ":").concat(text.trim().toLowerCase());
13
18
  };
14
19
  var getDisplayText = function getDisplayText(status, shouldUppercaseText) {
15
20
  return shouldUppercaseText && status.style !== 'mixedCase' ? status.text.toUpperCase() : status.text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-status",
3
- "version": "19.0.11",
3
+ "version": "20.0.1",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,12 +24,12 @@
24
24
  "@atlaskit/adf-schema": "^57.5.0",
25
25
  "@atlaskit/analytics-next": "^12.5.0",
26
26
  "@atlaskit/browser-apis": "^1.2.0",
27
- "@atlaskit/editor-plugin-analytics": "^18.0.0",
28
- "@atlaskit/editor-plugin-block-controls": "^19.0.0",
29
- "@atlaskit/editor-plugin-block-menu": "^17.0.0",
30
- "@atlaskit/editor-plugin-selection": "^18.0.0",
31
- "@atlaskit/editor-plugin-ui-control-registry": "^12.0.0",
32
- "@atlaskit/editor-prosemirror": "^8.0.0",
27
+ "@atlaskit/editor-plugin-analytics": "^19.0.0",
28
+ "@atlaskit/editor-plugin-block-controls": "^20.0.0",
29
+ "@atlaskit/editor-plugin-block-menu": "^18.0.0",
30
+ "@atlaskit/editor-plugin-selection": "^19.0.0",
31
+ "@atlaskit/editor-plugin-ui-control-registry": "^13.0.0",
32
+ "@atlaskit/editor-prosemirror": "^9.0.0",
33
33
  "@atlaskit/editor-shared-styles": "^4.3.0",
34
34
  "@atlaskit/editor-toolbar": "^2.6.0",
35
35
  "@atlaskit/editor-ui-control-model": "^2.9.0",
@@ -37,15 +37,15 @@
37
37
  "@atlaskit/icon-lab": "^7.9.0",
38
38
  "@atlaskit/platform-feature-experiments": "^0.3.0",
39
39
  "@atlaskit/platform-feature-flags": "^2.2.0",
40
- "@atlaskit/status": "^5.11.0",
41
- "@atlaskit/tmp-editor-statsig": "^199.0.0",
42
- "@atlaskit/tokens": "^18.0.0",
40
+ "@atlaskit/status": "^5.12.0",
41
+ "@atlaskit/tmp-editor-statsig": "^200.0.0",
42
+ "@atlaskit/tokens": "^18.2.0",
43
43
  "@atlaskit/visually-hidden": "^4.4.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^122.11.0",
48
+ "@atlaskit/editor-common": "^123.0.0",
49
49
  "react": "^18.2.0 || ^19.2.0",
50
50
  "react-dom": "^18.2.0 || ^19.2.0",
51
51
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"