@atlaskit/editor-common 99.14.1 → 99.15.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,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 99.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#113466](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113466)
8
+ [`756bb7e35a24d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/756bb7e35a24d) -
9
+ Add new FloatingToolbarOverflowDropdown item to floating toolbar config to support new editor
10
+ controls, add config in selection-toolbar plugin to add new button to text selection
11
+
12
+ ### Patch Changes
13
+
14
+ - [#113299](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113299)
15
+ [`329821ba1c893`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/329821ba1c893) -
16
+ [ED-26503] Mark the extension label as non-editable
17
+
3
18
  ## 99.14.1
4
19
 
5
20
  ### Patch Changes
@@ -10,6 +10,7 @@ var _react = require("@emotion/react");
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _reactIntlNext = require("react-intl-next");
12
12
  var _customize = _interopRequireDefault(require("@atlaskit/icon/core/customize"));
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _primitives = require("@atlaskit/primitives");
14
15
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
16
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
@@ -179,7 +180,8 @@ var ExtensionLabel = exports.ExtensionLabel = function ExtensionLabel(_ref) {
179
180
  }));
180
181
  }
181
182
  },
182
- "data-testid": "new-lozenge-container"
183
+ "data-testid": "new-lozenge-container",
184
+ contentEditable: (0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro') ? false : undefined
183
185
  }, (0, _react.jsx)(_tooltip.default, {
184
186
  content: (0, _react.jsx)(_reactIntlNext.FormattedMessage
185
187
  // Ignored via go/ees005
@@ -96,6 +96,7 @@ var isSameItem = exports.isSameItem = function isSameItem(leftItem, rightItem) {
96
96
  return false;
97
97
  }
98
98
  return compareItemWithKeys(leftItem, rightItem, ['type', 'onChange', 'options']);
99
+ case 'overflow-dropdown':
99
100
  case 'dropdown':
100
101
  if (makeSameType(leftItem, rightItem) && Array.isArray(leftItem.options) && Array.isArray(rightItem.options) &&
101
102
  // @ts-expect-error TS2345: Argument of type 'DropdownOptionT<Function>[]' is not assignable to parameter of type 'any[][]'
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "99.14.1";
20
+ var packageVersion = "99.15.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "99.14.1";
26
+ var packageVersion = "99.15.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -9,6 +9,7 @@ import { css, jsx } from '@emotion/react';
9
9
  import classnames from 'classnames';
10
10
  import { defineMessages, FormattedMessage } from 'react-intl-next';
11
11
  import CustomizeIcon from '@atlaskit/icon/core/customize';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { Box, xcss } from '@atlaskit/primitives';
13
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
15
  import Tooltip from '@atlaskit/tooltip';
@@ -172,7 +173,8 @@ export const ExtensionLabel = ({
172
173
  }));
173
174
  }
174
175
  },
175
- "data-testid": "new-lozenge-container"
176
+ "data-testid": "new-lozenge-container",
177
+ contentEditable: fg('platform_editor_legacy_content_macro') ? false : undefined
176
178
  }, jsx(Tooltip, {
177
179
  content: jsx(FormattedMessage
178
180
  // Ignored via go/ees005
@@ -71,6 +71,7 @@ export const isSameItem = (leftItem, rightItem) => {
71
71
  return false;
72
72
  }
73
73
  return compareItemWithKeys(leftItem, rightItem, ['type', 'onChange', 'options']);
74
+ case 'overflow-dropdown':
74
75
  case 'dropdown':
75
76
  if (makeSameType(leftItem, rightItem) && Array.isArray(leftItem.options) && Array.isArray(rightItem.options) &&
76
77
  // @ts-expect-error TS2345: Argument of type 'DropdownOptionT<Function>[]' is not assignable to parameter of type 'any[][]'
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "99.14.1";
4
+ const packageVersion = "99.15.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "99.14.1";
16
+ const packageVersion = "99.15.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -9,6 +9,7 @@ import { css, jsx } from '@emotion/react';
9
9
  import classnames from 'classnames';
10
10
  import { defineMessages, FormattedMessage } from 'react-intl-next';
11
11
  import CustomizeIcon from '@atlaskit/icon/core/customize';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { Box, xcss } from '@atlaskit/primitives';
13
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
15
  import Tooltip from '@atlaskit/tooltip';
@@ -171,7 +172,8 @@ export var ExtensionLabel = function ExtensionLabel(_ref) {
171
172
  }));
172
173
  }
173
174
  },
174
- "data-testid": "new-lozenge-container"
175
+ "data-testid": "new-lozenge-container",
176
+ contentEditable: fg('platform_editor_legacy_content_macro') ? false : undefined
175
177
  }, jsx(Tooltip, {
176
178
  content: jsx(FormattedMessage
177
179
  // Ignored via go/ees005
@@ -81,6 +81,7 @@ export var isSameItem = function isSameItem(leftItem, rightItem) {
81
81
  return false;
82
82
  }
83
83
  return compareItemWithKeys(leftItem, rightItem, ['type', 'onChange', 'options']);
84
+ case 'overflow-dropdown':
84
85
  case 'dropdown':
85
86
  if (makeSameType(leftItem, rightItem) && Array.isArray(leftItem.options) && Array.isArray(rightItem.options) &&
86
87
  // @ts-expect-error TS2345: Argument of type 'DropdownOptionT<Function>[]' is not assignable to parameter of type 'any[][]'
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "99.14.1";
10
+ var packageVersion = "99.15.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "99.14.1";
23
+ var packageVersion = "99.15.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -12,6 +12,32 @@ import type { ProviderFactory } from '../provider-factory';
12
12
  import type { PaletteColor } from '../ui-color/ColorPalette/Palettes/type';
13
13
  import type { Command, CommandDispatch } from './command';
14
14
  import type { MarkOptions, NodeOptions } from './copy-button';
15
+ /**
16
+ * New dropdown types to support editor controls
17
+ */
18
+ type OverflowDropdownHeading = {
19
+ type: 'overflow-dropdown-heading';
20
+ title: string;
21
+ };
22
+ export type FloatingToolbarOverflowDropdownOptions<T extends Object> = Array<DropdownOptionT<T> | FloatingToolbarSeparator | OverflowDropdownHeading>;
23
+ type FloatingToolbarOverflowDropdown<T extends Object> = {
24
+ type: 'overflow-dropdown';
25
+ options: FloatingToolbarOverflowDropdownOptions<T>;
26
+ testId?: string;
27
+ id?: string;
28
+ hidden?: boolean;
29
+ disabled?: boolean;
30
+ tooltip?: string;
31
+ dropdownWidth?: number;
32
+ showSelected?: boolean;
33
+ alignDropdownWithToolbar?: boolean;
34
+ onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
35
+ footer?: React.ReactNode;
36
+ /** If true, the component will have pulse onboarding effect around it. */
37
+ pulse?: boolean;
38
+ onMount?: () => void;
39
+ onClick?: () => void;
40
+ };
15
41
  export interface RenderOptionsPropsT<T extends Object> {
16
42
  hide: () => void;
17
43
  dispatchCommand: (command: T) => void;
@@ -253,7 +279,7 @@ type FloatingToolbarExtensionsPlaceholder = {
253
279
  * Make sure that this type is not a FloatingToolbarCustom type.
254
280
  */
255
281
  export type FloatingToolbarFallbackItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
256
- export type FloatingToolbarItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
282
+ export type FloatingToolbarItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder | FloatingToolbarOverflowDropdown<T>;
257
283
  export interface FloatingToolbarConfig {
258
284
  /** Used for the ariaLabel on the <Popup /> component */
259
285
  title: string;
@@ -13,7 +13,7 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags } from './feat
13
13
  export type { Browsers, Range, DisableSpellcheckByBrowser } from './supported-browsers';
14
14
  export type { EditorContainerWidth, GetEditorContainerWidth } from './editor-container-width';
15
15
  export type { EmptyStateHandler, EmptyStateHandlerParams } from './empty-state-handler';
16
- export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, } from './floating-toolbar';
16
+ export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, FloatingToolbarOverflowDropdownOptions, } from './floating-toolbar';
17
17
  export type { MarkOptions, NodeOptions } from './copy-button';
18
18
  export type { ContextPanelHandler } from './context-panel';
19
19
  export type { EditorAppearance } from './editor-appearance';
@@ -12,6 +12,32 @@ import type { ProviderFactory } from '../provider-factory';
12
12
  import type { PaletteColor } from '../ui-color/ColorPalette/Palettes/type';
13
13
  import type { Command, CommandDispatch } from './command';
14
14
  import type { MarkOptions, NodeOptions } from './copy-button';
15
+ /**
16
+ * New dropdown types to support editor controls
17
+ */
18
+ type OverflowDropdownHeading = {
19
+ type: 'overflow-dropdown-heading';
20
+ title: string;
21
+ };
22
+ export type FloatingToolbarOverflowDropdownOptions<T extends Object> = Array<DropdownOptionT<T> | FloatingToolbarSeparator | OverflowDropdownHeading>;
23
+ type FloatingToolbarOverflowDropdown<T extends Object> = {
24
+ type: 'overflow-dropdown';
25
+ options: FloatingToolbarOverflowDropdownOptions<T>;
26
+ testId?: string;
27
+ id?: string;
28
+ hidden?: boolean;
29
+ disabled?: boolean;
30
+ tooltip?: string;
31
+ dropdownWidth?: number;
32
+ showSelected?: boolean;
33
+ alignDropdownWithToolbar?: boolean;
34
+ onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
35
+ footer?: React.ReactNode;
36
+ /** If true, the component will have pulse onboarding effect around it. */
37
+ pulse?: boolean;
38
+ onMount?: () => void;
39
+ onClick?: () => void;
40
+ };
15
41
  export interface RenderOptionsPropsT<T extends Object> {
16
42
  hide: () => void;
17
43
  dispatchCommand: (command: T) => void;
@@ -253,7 +279,7 @@ type FloatingToolbarExtensionsPlaceholder = {
253
279
  * Make sure that this type is not a FloatingToolbarCustom type.
254
280
  */
255
281
  export type FloatingToolbarFallbackItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
256
- export type FloatingToolbarItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
282
+ export type FloatingToolbarItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder | FloatingToolbarOverflowDropdown<T>;
257
283
  export interface FloatingToolbarConfig {
258
284
  /** Used for the ariaLabel on the <Popup /> component */
259
285
  title: string;
@@ -13,7 +13,7 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags } from './feat
13
13
  export type { Browsers, Range, DisableSpellcheckByBrowser } from './supported-browsers';
14
14
  export type { EditorContainerWidth, GetEditorContainerWidth } from './editor-container-width';
15
15
  export type { EmptyStateHandler, EmptyStateHandlerParams } from './empty-state-handler';
16
- export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, } from './floating-toolbar';
16
+ export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, FloatingToolbarOverflowDropdownOptions, } from './floating-toolbar';
17
17
  export type { MarkOptions, NodeOptions } from './copy-button';
18
18
  export type { ContextPanelHandler } from './context-panel';
19
19
  export type { EditorAppearance } from './editor-appearance';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "99.14.1",
3
+ "version": "99.15.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"