@atlaskit/editor-plugin-media 12.2.6 → 12.3.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,17 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 12.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e8a04d9738c5a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8a04d9738c5a) -
8
+ Add a rainbow `AIGeneratingOverlay` shown over media nodes during AI inline edits, gated by
9
+ `fg('cc-maui-phase-2-loading')` layered on top of the existing MAUI gates and killswitch.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 12.2.6
4
16
 
5
17
  ### Patch Changes
@@ -14,6 +14,8 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _view = require("@atlaskit/editor-prosemirror/view");
16
16
  var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
19
  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; }
18
20
  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; }
19
21
  /**
@@ -113,9 +115,10 @@ function createAIGeneratingDecorationPlugin() {
113
115
  };
114
116
  },
115
117
  apply: function apply(tr, pluginState, _oldState, newState) {
116
- // Killswitch if active, clear any existing decorations and stop
118
+ // Disabled when killswitch is on or gate/experiment off drop decorations.
119
+ if (
117
120
  // eslint-disable-next-line @atlaskit/platform/use-recommended-utils -- dynamic config killswitch, not a standard feature gate
118
- if (_featureGateJsClient.default.getExperimentValue('maui_ai_border_killswitch', 'value', false)) {
121
+ _featureGateJsClient.default.getExperimentValue('maui_ai_border_killswitch', 'value', false) || !(0, _platformFeatureFlags.fg)('cc-maui-phase-2-loading') || !(0, _expValEquals.expValEquals)('cc-maui-experiment', 'isEnabled', true)) {
119
122
  if (pluginState.generatingMediaIds.size > 0) {
120
123
  return {
121
124
  generatingMediaIds: new Set(),
@@ -2,6 +2,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import FeatureGates from '@atlaskit/feature-gate-js-client';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
7
 
6
8
  /**
7
9
  * ProseMirror plugin that manages AI-generating decorations on media nodes.
@@ -98,9 +100,10 @@ export function createAIGeneratingDecorationPlugin() {
98
100
  };
99
101
  },
100
102
  apply(tr, pluginState, _oldState, newState) {
101
- // Killswitch if active, clear any existing decorations and stop
103
+ // Disabled when killswitch is on or gate/experiment off drop decorations.
104
+ if (
102
105
  // eslint-disable-next-line @atlaskit/platform/use-recommended-utils -- dynamic config killswitch, not a standard feature gate
103
- if (FeatureGates.getExperimentValue('maui_ai_border_killswitch', 'value', false)) {
106
+ FeatureGates.getExperimentValue('maui_ai_border_killswitch', 'value', false) || !fg('cc-maui-phase-2-loading') || !expValEquals('cc-maui-experiment', 'isEnabled', true)) {
104
107
  if (pluginState.generatingMediaIds.size > 0) {
105
108
  return {
106
109
  generatingMediaIds: new Set(),
@@ -5,6 +5,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import FeatureGates from '@atlaskit/feature-gate-js-client';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
10
 
9
11
  /**
10
12
  * ProseMirror plugin that manages AI-generating decorations on media nodes.
@@ -103,9 +105,10 @@ export function createAIGeneratingDecorationPlugin() {
103
105
  };
104
106
  },
105
107
  apply: function apply(tr, pluginState, _oldState, newState) {
106
- // Killswitch if active, clear any existing decorations and stop
108
+ // Disabled when killswitch is on or gate/experiment off drop decorations.
109
+ if (
107
110
  // eslint-disable-next-line @atlaskit/platform/use-recommended-utils -- dynamic config killswitch, not a standard feature gate
108
- if (FeatureGates.getExperimentValue('maui_ai_border_killswitch', 'value', false)) {
111
+ FeatureGates.getExperimentValue('maui_ai_border_killswitch', 'value', false) || !fg('cc-maui-phase-2-loading') || !expValEquals('cc-maui-experiment', 'isEnabled', true)) {
109
112
  if (pluginState.generatingMediaIds.size > 0) {
110
113
  return {
111
114
  generatingMediaIds: new Set(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "12.2.6",
3
+ "version": "12.3.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -78,7 +78,7 @@
78
78
  "uuid": "^3.1.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^114.15.0",
81
+ "@atlaskit/editor-common": "^114.16.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",
@@ -162,6 +162,9 @@
162
162
  },
163
163
  "platform_editor_media_disable_save_during_upload": {
164
164
  "type": "boolean"
165
+ },
166
+ "cc-maui-phase-2-loading": {
167
+ "type": "boolean"
165
168
  }
166
169
  },
167
170
  "stricter": {