@atlaskit/editor-plugin-extension 1.15.8 → 1.16.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,26 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 1.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#159018](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159018)
8
+ [`14d5e189df870`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14d5e189df870) -
9
+ [ux] ED-25367-remove-copy-button-from-view-mode-when-its-the-only-item
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.15.9
16
+
17
+ ### Patch Changes
18
+
19
+ - [#160771](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/160771)
20
+ [`52c92c480a7df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52c92c480a7df) -
21
+ Passes bodied macro feature gate and live page info from Confluence to extension nodes
22
+ - Updated dependencies
23
+
3
24
  ## 1.15.8
4
25
 
5
26
  ### Patch Changes
@@ -70,7 +70,7 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
70
70
  var extensionHandlers = options.extensionHandlers || {};
71
71
  return (0, _main.createPlugin)(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, _api, options.useLongPressSelection, {
72
72
  appearance: options.appearance
73
- }, featureFlags);
73
+ }, featureFlags, options === null || options === void 0 ? void 0 : options.__livePage);
74
74
  }
75
75
  }, {
76
76
  name: 'extensionKeymap',
@@ -190,6 +190,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
190
190
  var useLongPressSelection = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
191
191
  var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
192
192
  var featureFlags = arguments.length > 8 ? arguments[8] : undefined;
193
+ var __livePage = arguments.length > 9 ? arguments[9] : undefined;
193
194
  var state = (0, _pluginFactory.createPluginState)(dispatch, {
194
195
  showEditButton: false,
195
196
  showContextPanel: false
@@ -201,6 +202,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
201
202
  showMacroInteractionDesignUpdates: (_featureFlags$macroIn = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionUpdates) !== null && _featureFlags$macroIn !== void 0 ? _featureFlags$macroIn : false,
202
203
  showMacroButtonUpdates: (_featureFlags$macroIn2 = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionButtonUpdates) !== null && _featureFlags$macroIn2 !== void 0 ? _featureFlags$macroIn2 : false
203
204
  };
205
+ var showLivePagesBodiedMacrosRendererView = !!(__livePage && featureFlags !== null && featureFlags !== void 0 && featureFlags.livePagesBodiedMacrosRendererView);
204
206
  return new _safePlugin.SafePlugin({
205
207
  state: state,
206
208
  view: function view(editorView) {
@@ -299,7 +301,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
299
301
  // WARNING: referentiality-plugin also creates these nodeviews
300
302
  extension: (0, _lazyExtension.lazyExtensionNodeView)('extension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
301
303
  // WARNING: referentiality-plugin also creates these nodeviews
302
- bodiedExtension: (0, _lazyExtension.lazyExtensionNodeView)('bodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
304
+ bodiedExtension: (0, _lazyExtension.lazyExtensionNodeView)('bodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView),
303
305
  // WARNING: referentiality-plugin also creates these nodeviews
304
306
  inlineExtension: (0, _lazyExtension.lazyExtensionNodeView)('inlineExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
305
307
  multiBodiedExtension: (0, _lazyExtension.lazyExtensionNodeView)('multiBodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags)
@@ -21,6 +21,7 @@ var _mediaCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/m
21
21
  var _mediaFullWidth = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-full-width"));
22
22
  var _mediaWide = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wide"));
23
23
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
24
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
25
  var _actions = require("./actions");
25
26
  var _commands = require("./commands");
26
27
  var _pluginKey = require("./pm-plugins/macro/plugin-key");
@@ -176,7 +177,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
176
177
  separator: 'end'
177
178
  }, {
178
179
  type: 'copy-button',
179
- supportsViewMode: true,
180
+ supportsViewMode: !(0, _platformFeatureFlags.fg)('platform_editor_remove_copy_button_from_view_mode'),
180
181
  items: [{
181
182
  state: state,
182
183
  formatMessage: intl.formatMessage,
@@ -64,7 +64,7 @@ export const extensionPlugin = ({
64
64
  const extensionHandlers = options.extensionHandlers || {};
65
65
  return createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, api, options.useLongPressSelection, {
66
66
  appearance: options.appearance
67
- }, featureFlags);
67
+ }, featureFlags, options === null || options === void 0 ? void 0 : options.__livePage);
68
68
  }
69
69
  }, {
70
70
  name: 'extensionKeymap',
@@ -114,7 +114,7 @@ export const handleUpdate = ({
114
114
  }
115
115
  return true;
116
116
  };
117
- const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi, useLongPressSelection = false, options = {}, featureFlags) => {
117
+ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi, useLongPressSelection = false, options = {}, featureFlags, __livePage) => {
118
118
  var _featureFlags$macroIn, _featureFlags$macroIn2;
119
119
  const state = createPluginState(dispatch, {
120
120
  showEditButton: false,
@@ -127,6 +127,7 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
127
127
  showMacroInteractionDesignUpdates: (_featureFlags$macroIn = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionUpdates) !== null && _featureFlags$macroIn !== void 0 ? _featureFlags$macroIn : false,
128
128
  showMacroButtonUpdates: (_featureFlags$macroIn2 = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionButtonUpdates) !== null && _featureFlags$macroIn2 !== void 0 ? _featureFlags$macroIn2 : false
129
129
  };
130
+ const showLivePagesBodiedMacrosRendererView = !!(__livePage && featureFlags !== null && featureFlags !== void 0 && featureFlags.livePagesBodiedMacrosRendererView);
130
131
  return new SafePlugin({
131
132
  state,
132
133
  view: editorView => {
@@ -234,7 +235,7 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
234
235
  // WARNING: referentiality-plugin also creates these nodeviews
235
236
  extension: lazyExtensionNodeView('extension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
236
237
  // WARNING: referentiality-plugin also creates these nodeviews
237
- bodiedExtension: lazyExtensionNodeView('bodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
238
+ bodiedExtension: lazyExtensionNodeView('bodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView),
238
239
  // WARNING: referentiality-plugin also creates these nodeviews
239
240
  inlineExtension: lazyExtensionNodeView('inlineExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
240
241
  multiBodiedExtension: lazyExtensionNodeView('multiBodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags)
@@ -13,6 +13,7 @@ import CenterIcon from '@atlaskit/icon/glyph/editor/media-center';
13
13
  import FullWidthIcon from '@atlaskit/icon/glyph/editor/media-full-width';
14
14
  import WideIcon from '@atlaskit/icon/glyph/editor/media-wide';
15
15
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import { editExtension } from './actions';
17
18
  import { removeDescendantNodes, removeExtension, updateExtensionLayout } from './commands';
18
19
  import { pluginKey as macroPluginKey } from './pm-plugins/macro/plugin-key';
@@ -173,7 +174,7 @@ export const getToolbarConfig = ({
173
174
  separator: 'end'
174
175
  }, {
175
176
  type: 'copy-button',
176
- supportsViewMode: true,
177
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
177
178
  items: [{
178
179
  state,
179
180
  formatMessage: intl.formatMessage,
@@ -63,7 +63,7 @@ export var extensionPlugin = function extensionPlugin(_ref) {
63
63
  var extensionHandlers = options.extensionHandlers || {};
64
64
  return createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, _api, options.useLongPressSelection, {
65
65
  appearance: options.appearance
66
- }, featureFlags);
66
+ }, featureFlags, options === null || options === void 0 ? void 0 : options.__livePage);
67
67
  }
68
68
  }, {
69
69
  name: 'extensionKeymap',
@@ -164,6 +164,7 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
164
164
  var useLongPressSelection = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
165
165
  var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
166
166
  var featureFlags = arguments.length > 8 ? arguments[8] : undefined;
167
+ var __livePage = arguments.length > 9 ? arguments[9] : undefined;
167
168
  var state = createPluginState(dispatch, {
168
169
  showEditButton: false,
169
170
  showContextPanel: false
@@ -175,6 +176,7 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
175
176
  showMacroInteractionDesignUpdates: (_featureFlags$macroIn = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionUpdates) !== null && _featureFlags$macroIn !== void 0 ? _featureFlags$macroIn : false,
176
177
  showMacroButtonUpdates: (_featureFlags$macroIn2 = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionButtonUpdates) !== null && _featureFlags$macroIn2 !== void 0 ? _featureFlags$macroIn2 : false
177
178
  };
179
+ var showLivePagesBodiedMacrosRendererView = !!(__livePage && featureFlags !== null && featureFlags !== void 0 && featureFlags.livePagesBodiedMacrosRendererView);
178
180
  return new SafePlugin({
179
181
  state: state,
180
182
  view: function view(editorView) {
@@ -273,7 +275,7 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
273
275
  // WARNING: referentiality-plugin also creates these nodeviews
274
276
  extension: lazyExtensionNodeView('extension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
275
277
  // WARNING: referentiality-plugin also creates these nodeviews
276
- bodiedExtension: lazyExtensionNodeView('bodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
278
+ bodiedExtension: lazyExtensionNodeView('bodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView),
277
279
  // WARNING: referentiality-plugin also creates these nodeviews
278
280
  inlineExtension: lazyExtensionNodeView('inlineExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
279
281
  multiBodiedExtension: lazyExtensionNodeView('multiBodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags)
@@ -14,6 +14,7 @@ import CenterIcon from '@atlaskit/icon/glyph/editor/media-center';
14
14
  import FullWidthIcon from '@atlaskit/icon/glyph/editor/media-full-width';
15
15
  import WideIcon from '@atlaskit/icon/glyph/editor/media-wide';
16
16
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { editExtension } from './actions';
18
19
  import { removeDescendantNodes, removeExtension, updateExtensionLayout } from './commands';
19
20
  import { pluginKey as macroPluginKey } from './pm-plugins/macro/plugin-key';
@@ -169,7 +170,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
169
170
  separator: 'end'
170
171
  }, {
171
172
  type: 'copy-button',
172
- supportsViewMode: true,
173
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
173
174
  items: [{
174
175
  state: state,
175
176
  formatMessage: intl.formatMessage,
@@ -20,5 +20,5 @@ export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandle
20
20
  }) => true | undefined;
21
21
  declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<ExtensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
22
22
  appearance?: EditorAppearance;
23
- }, featureFlags?: FeatureFlags) => SafePlugin<import("../types").ExtensionState>;
23
+ }, featureFlags?: FeatureFlags, __livePage?: boolean) => SafePlugin<import("../types").ExtensionState>;
24
24
  export { pluginKey, createPlugin, createCommand, getPluginState };
@@ -41,6 +41,7 @@ export interface ExtensionPluginOptions extends LongPressSelectionPluginOptions
41
41
  breakoutEnabled?: boolean;
42
42
  extensionHandlers?: ExtensionHandlers;
43
43
  appearance?: EditorAppearance;
44
+ __livePage?: boolean;
44
45
  }
45
46
  type InsertMacroFromMacroBrowser = (macroProvider: MacroProvider, macroNode?: PmNode, isEditing?: boolean) => (view: EditorView) => Promise<boolean>;
46
47
  export type RunMacroAutoConvert = (state: EditorState, text: string) => PmNode | null;
@@ -20,5 +20,5 @@ export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandle
20
20
  }) => true | undefined;
21
21
  declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<ExtensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
22
22
  appearance?: EditorAppearance;
23
- }, featureFlags?: FeatureFlags) => SafePlugin<import("../types").ExtensionState>;
23
+ }, featureFlags?: FeatureFlags, __livePage?: boolean) => SafePlugin<import("../types").ExtensionState>;
24
24
  export { pluginKey, createPlugin, createCommand, getPluginState };
@@ -41,6 +41,7 @@ export interface ExtensionPluginOptions extends LongPressSelectionPluginOptions
41
41
  breakoutEnabled?: boolean;
42
42
  extensionHandlers?: ExtensionHandlers;
43
43
  appearance?: EditorAppearance;
44
+ __livePage?: boolean;
44
45
  }
45
46
  type InsertMacroFromMacroBrowser = (macroProvider: MacroProvider, macroNode?: PmNode, isEditing?: boolean) => (view: EditorView) => Promise<boolean>;
46
47
  export type RunMacroAutoConvert = (state: EditorState, text: string) => PmNode | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "1.15.8",
3
+ "version": "1.16.0",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "@atlaskit/button": "^20.3.0",
31
31
  "@atlaskit/checkbox": "^15.1.0",
32
32
  "@atlaskit/datetime-picker": "^15.7.0",
33
- "@atlaskit/editor-common": "^94.10.0",
33
+ "@atlaskit/editor-common": "^94.13.0",
34
34
  "@atlaskit/editor-json-transformer": "^8.20.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
36
36
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
40
40
  "@atlaskit/editor-plugin-width": "^1.3.0",
41
41
  "@atlaskit/editor-prosemirror": "6.0.0",
42
- "@atlaskit/editor-shared-styles": "^3.1.0",
42
+ "@atlaskit/editor-shared-styles": "^3.2.0",
43
43
  "@atlaskit/editor-tables": "^2.8.0",
44
44
  "@atlaskit/empty-state": "^7.12.0",
45
45
  "@atlaskit/form": "^10.5.0",
@@ -49,16 +49,16 @@
49
49
  "@atlaskit/primitives": "^13.0.0",
50
50
  "@atlaskit/radio": "^6.5.0",
51
51
  "@atlaskit/section-message": "^6.6.0",
52
- "@atlaskit/select": "^18.4.0",
52
+ "@atlaskit/select": "^18.5.0",
53
53
  "@atlaskit/smart-user-picker": "^6.11.0",
54
54
  "@atlaskit/spinner": "^16.3.0",
55
55
  "@atlaskit/tabs": "^16.5.0",
56
56
  "@atlaskit/textarea": "^5.6.0",
57
57
  "@atlaskit/textfield": "^6.5.0",
58
58
  "@atlaskit/theme": "^14.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^2.11.0",
59
+ "@atlaskit/tmp-editor-statsig": "^2.12.0",
60
60
  "@atlaskit/toggle": "^13.4.0",
61
- "@atlaskit/tokens": "^2.0.0",
61
+ "@atlaskit/tokens": "^2.2.0",
62
62
  "@atlaskit/tooltip": "^18.8.0",
63
63
  "@babel/runtime": "^7.0.0",
64
64
  "@emotion/react": "^11.7.1",
@@ -106,6 +106,11 @@
106
106
  ]
107
107
  }
108
108
  },
109
+ "platform-feature-flags": {
110
+ "platform_editor_remove_copy_button_from_view_mode": {
111
+ "type": "boolean"
112
+ }
113
+ },
109
114
  "stricter": {
110
115
  "no-unused-dependencies": {
111
116
  "checkDevDependencies": true