@atlaskit/editor-core 245.1.0 → 245.2.0

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,23 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 245.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`32e8522d67795`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/32e8522d67795) -
8
+ When `platform_editor_ui_control_registry` is enabled, editor-core initializes the UI control
9
+ registry through a core preset before product plugins. Product presets keep their previous
10
+ registry registrations only when this experiment is disabled. Core excludes legacy registry
11
+ plugins to preserve one registry through initialization, reconfiguration, and SSR.
12
+
13
+ Consumers upgrading `@atlaskit/editor-presets` or `@atlassian/proforma-form-builder` must also
14
+ upgrade editor-core to the release containing central registry ownership. The editor-core minor
15
+ release establishes the minimum compatible peer range.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 245.1.0
4
22
 
5
23
  ### Minor Changes
@@ -6,7 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = createPluginsList;
8
8
  exports.getDefaultPresetOptionsFromEditorProps = getDefaultPresetOptionsFromEditorProps;
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _builder = require("@atlaskit/editor-common/preset/builder");
12
+ var _uiControlRegistry = require("@atlaskit/editor-plugins/ui-control-registry");
13
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
10
14
  var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
11
15
  var _getScrollGutterOptions = require("./getScrollGutterOptions");
12
16
  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; }
@@ -90,6 +94,17 @@ preset, props, pluginInjectionAPI) {
90
94
  })) {
91
95
  excludes.add('codeBlock');
92
96
  }
97
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ui_control_registry')) {
98
+ var corePlugins = new _builder.EditorPresetBuilder().add(_uiControlRegistry.uiControlRegistryPlugin).build({
99
+ pluginInjectionAPI: pluginInjectionAPI
100
+ });
101
+ // Exclude older package copies by name so they cannot replace the core registry.
102
+ excludes.add('uiControlRegistry');
103
+ return [].concat((0, _toConsumableArray2.default)(corePlugins), (0, _toConsumableArray2.default)(preset.build({
104
+ pluginInjectionAPI: pluginInjectionAPI,
105
+ excludePlugins: excludes
106
+ })));
107
+ }
93
108
  return preset.build({
94
109
  pluginInjectionAPI: pluginInjectionAPI,
95
110
  excludePlugins: excludes
@@ -43,6 +43,7 @@ var _undoRedo = require("@atlaskit/editor-plugins/undo-redo");
43
43
  var _unsupportedContent = require("@atlaskit/editor-plugins/unsupported-content");
44
44
  var _userIntent = require("@atlaskit/editor-plugins/user-intent");
45
45
  var _width = require("@atlaskit/editor-plugins/width");
46
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
46
47
  var _isFullPage = require("../utils/is-full-page");
47
48
  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; }
48
49
  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; } // #region Imports
@@ -70,7 +71,7 @@ function createDefaultPreset(options) {
70
71
  contextIdentifierProvider: options.contextIdentifierProvider
71
72
  }]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).add(_userIntent.userIntentPlugin).maybeAdd([_toolbar.toolbarPlugin, options.toolbar || {}], Boolean((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience)).add([_primaryToolbar.primaryToolbarPlugin, {
72
73
  contextualFormattingEnabled: isFullPage
73
- }]).add(_uiControlRegistry.uiControlRegistryPlugin).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).maybeAdd([_blockMenu.blockMenuPlugin, {
74
+ }]).maybeAdd(_uiControlRegistry.uiControlRegistryPlugin, !(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ui_control_registry')).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).maybeAdd([_blockMenu.blockMenuPlugin, {
74
75
  useStandardNodeWidth: (_options$blockMenu$us = (_options$blockMenu = options.blockMenu) === null || _options$blockMenu === void 0 ? void 0 : _options$blockMenu.useStandardNodeWidth) !== null && _options$blockMenu$us !== void 0 ? _options$blockMenu$us : false,
75
76
  blockLinkHashPrefix: (_options$blockMenu2 = options.blockMenu) === null || _options$blockMenu2 === void 0 ? void 0 : _options$blockMenu2.blockLinkHashPrefix,
76
77
  getLinkPath: (_options$blockMenu3 = options.blockMenu) === null || _options$blockMenu3 === void 0 ? void 0 : _options$blockMenu3.getLinkPath,
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
8
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
9
- var version = exports.version = "245.0.3";
9
+ var version = exports.version = "245.1.0";
@@ -1,3 +1,6 @@
1
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset/builder';
2
+ import { uiControlRegistryPlugin } from '@atlaskit/editor-plugins/ui-control-registry';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
1
4
  import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
2
5
  import { getScrollGutterOptions } from './getScrollGutterOptions';
3
6
  const isCodeBlockAllowed = options => {
@@ -82,6 +85,17 @@ preset, props, pluginInjectionAPI) {
82
85
  })) {
83
86
  excludes.add('codeBlock');
84
87
  }
88
+ if (isExperimentEnabled('platform_editor_ui_control_registry')) {
89
+ const corePlugins = new EditorPresetBuilder().add(uiControlRegistryPlugin).build({
90
+ pluginInjectionAPI
91
+ });
92
+ // Exclude older package copies by name so they cannot replace the core registry.
93
+ excludes.add('uiControlRegistry');
94
+ return [...corePlugins, ...preset.build({
95
+ pluginInjectionAPI,
96
+ excludePlugins: excludes
97
+ })];
98
+ }
85
99
  return preset.build({
86
100
  pluginInjectionAPI,
87
101
  excludePlugins: excludes
@@ -36,6 +36,7 @@ import { undoRedoPlugin } from '@atlaskit/editor-plugins/undo-redo';
36
36
  import { unsupportedContentPlugin } from '@atlaskit/editor-plugins/unsupported-content';
37
37
  import { userIntentPlugin } from '@atlaskit/editor-plugins/user-intent';
38
38
  import { widthPlugin } from '@atlaskit/editor-plugins/width';
39
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
39
40
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
40
41
 
41
42
  // #endregion
@@ -63,7 +64,7 @@ export function createDefaultPreset(options) {
63
64
  contextIdentifierProvider: options.contextIdentifierProvider
64
65
  }]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(userIntentPlugin).maybeAdd([toolbarPlugin, options.toolbar || {}], Boolean((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience)).add([primaryToolbarPlugin, {
65
66
  contextualFormattingEnabled: isFullPage
66
- }]).add(uiControlRegistryPlugin).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).maybeAdd([blockMenuPlugin, {
67
+ }]).maybeAdd(uiControlRegistryPlugin, !isExperimentEnabled('platform_editor_ui_control_registry')).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).maybeAdd([blockMenuPlugin, {
67
68
  useStandardNodeWidth: (_options$blockMenu$us = (_options$blockMenu = options.blockMenu) === null || _options$blockMenu === void 0 ? void 0 : _options$blockMenu.useStandardNodeWidth) !== null && _options$blockMenu$us !== void 0 ? _options$blockMenu$us : false,
68
69
  blockLinkHashPrefix: (_options$blockMenu2 = options.blockMenu) === null || _options$blockMenu2 === void 0 ? void 0 : _options$blockMenu2.blockLinkHashPrefix,
69
70
  getLinkPath: (_options$blockMenu3 = options.blockMenu) === null || _options$blockMenu3 === void 0 ? void 0 : _options$blockMenu3.getLinkPath,
@@ -1,3 +1,3 @@
1
1
  export const name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export const version = "245.0.3";
3
+ export const version = "245.1.0";
@@ -1,6 +1,10 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  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; }
3
4
  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; }
5
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset/builder';
6
+ import { uiControlRegistryPlugin } from '@atlaskit/editor-plugins/ui-control-registry';
7
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
8
  import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
5
9
  import { getScrollGutterOptions } from './getScrollGutterOptions';
6
10
  var isCodeBlockAllowed = function isCodeBlockAllowed(options) {
@@ -82,6 +86,17 @@ preset, props, pluginInjectionAPI) {
82
86
  })) {
83
87
  excludes.add('codeBlock');
84
88
  }
89
+ if (isExperimentEnabled('platform_editor_ui_control_registry')) {
90
+ var corePlugins = new EditorPresetBuilder().add(uiControlRegistryPlugin).build({
91
+ pluginInjectionAPI: pluginInjectionAPI
92
+ });
93
+ // Exclude older package copies by name so they cannot replace the core registry.
94
+ excludes.add('uiControlRegistry');
95
+ return [].concat(_toConsumableArray(corePlugins), _toConsumableArray(preset.build({
96
+ pluginInjectionAPI: pluginInjectionAPI,
97
+ excludePlugins: excludes
98
+ })));
99
+ }
85
100
  return preset.build({
86
101
  pluginInjectionAPI: pluginInjectionAPI,
87
102
  excludePlugins: excludes
@@ -39,6 +39,7 @@ import { undoRedoPlugin } from '@atlaskit/editor-plugins/undo-redo';
39
39
  import { unsupportedContentPlugin } from '@atlaskit/editor-plugins/unsupported-content';
40
40
  import { userIntentPlugin } from '@atlaskit/editor-plugins/user-intent';
41
41
  import { widthPlugin } from '@atlaskit/editor-plugins/width';
42
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
42
43
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
43
44
 
44
45
  // #endregion
@@ -65,7 +66,7 @@ export function createDefaultPreset(options) {
65
66
  contextIdentifierProvider: options.contextIdentifierProvider
66
67
  }]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(userIntentPlugin).maybeAdd([toolbarPlugin, options.toolbar || {}], Boolean((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience)).add([primaryToolbarPlugin, {
67
68
  contextualFormattingEnabled: isFullPage
68
- }]).add(uiControlRegistryPlugin).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).maybeAdd([blockMenuPlugin, {
69
+ }]).maybeAdd(uiControlRegistryPlugin, !isExperimentEnabled('platform_editor_ui_control_registry')).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).maybeAdd([blockMenuPlugin, {
69
70
  useStandardNodeWidth: (_options$blockMenu$us = (_options$blockMenu = options.blockMenu) === null || _options$blockMenu === void 0 ? void 0 : _options$blockMenu.useStandardNodeWidth) !== null && _options$blockMenu$us !== void 0 ? _options$blockMenu$us : false,
70
71
  blockLinkHashPrefix: (_options$blockMenu2 = options.blockMenu) === null || _options$blockMenu2 === void 0 ? void 0 : _options$blockMenu2.blockLinkHashPrefix,
71
72
  getLinkPath: (_options$blockMenu3 = options.blockMenu) === null || _options$blockMenu3 === void 0 ? void 0 : _options$blockMenu3.getLinkPath,
@@ -1,3 +1,3 @@
1
1
  export var name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export var version = "245.0.3";
3
+ export var version = "245.1.0";
@@ -1,5 +1,5 @@
1
1
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
2
- import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset/builder';
2
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset/builder';
3
3
  import type { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset/plugin-injection-api';
4
4
  import type { EditorPlugin } from '@atlaskit/editor-common/types/editor-plugin';
5
5
  import type { DefaultPresetPluginOptions } from '../../src/presets/default';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "245.1.0",
3
+ "version": "245.2.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -145,7 +145,7 @@
145
145
  "@atlaskit/editor-plugin-selection-marker": "^33.0.0",
146
146
  "@atlaskit/editor-plugin-show-diff": "^33.1.0",
147
147
  "@atlaskit/editor-plugin-synced-block": "^31.0.0",
148
- "@atlaskit/editor-plugin-table": "^45.1.0",
148
+ "@atlaskit/editor-plugin-table": "^45.2.0",
149
149
  "@atlaskit/editor-plugin-tasks-and-decisions": "^36.0.0",
150
150
  "@atlaskit/editor-plugin-text-color": "^33.0.0",
151
151
  "@atlaskit/editor-plugin-text-formatting": "^34.0.0",