@atlaskit/editor-common 123.1.0 → 123.1.2

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.
Files changed (130) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/block-menu/key-deprecated.js +1 -0
  3. package/dist/cjs/block-menu/key.js +1 -0
  4. package/dist/cjs/element-browser/constants.js +1 -0
  5. package/dist/cjs/extensibility/Extension/InlineExtension/index.js +1 -1
  6. package/dist/cjs/extensibility/Extension/styles.js +1 -0
  7. package/dist/cjs/keymaps/consts.js +1 -0
  8. package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  9. package/dist/cjs/media-inline/media-inline-image-card.js +1 -1
  10. package/dist/cjs/monitoring/error.js +1 -1
  11. package/dist/cjs/quick-insert/QuickInsertMenuItem.js +1 -1
  12. package/dist/cjs/quick-insert/build-quick-insert-menu-model.js +1 -1
  13. package/dist/cjs/quick-insert/get-matching-quick-insert-components.js +1 -1
  14. package/dist/cjs/quick-insert/getQuickInsertMenuItemParents.js +1 -1
  15. package/dist/cjs/quick-insert/keys.js +1 -0
  16. package/dist/cjs/resizer/Resizer.js +1 -1
  17. package/dist/cjs/styles/shared/resizer.js +1 -0
  18. package/dist/cjs/toolbar/keys.js +1 -0
  19. package/dist/cjs/ui/DropList/index.js +1 -1
  20. package/dist/cjs/ui/Emoji/index.js +1 -1
  21. package/dist/cjs/ui/Popup/index.js +1 -1
  22. package/dist/cjs/ui-color/ColorPalette/utils.js +2 -2
  23. package/dist/cjs/ui-menu/DropdownMenu/index.js +1 -1
  24. package/dist/cjs/utils/areDocsEqualByBlockStructureAndText.js +1 -1
  25. package/dist/cjs/utils/validator.js +1 -1
  26. package/dist/cjs/vanilla-tooltip/index.js +22 -0
  27. package/dist/es2019/block-menu/index.js +1 -0
  28. package/dist/es2019/block-menu/key-deprecated.js +1 -0
  29. package/dist/es2019/block-menu/key.js +1 -0
  30. package/dist/es2019/block-menu/rank.js +1 -0
  31. package/dist/es2019/code-block/index.js +1 -0
  32. package/dist/es2019/doc-utils/editor-use-only.js +1 -0
  33. package/dist/es2019/element-browser/components/ElementList/ElementList.js +1 -0
  34. package/dist/es2019/element-browser/constants.js +1 -0
  35. package/dist/es2019/extensibility/Extension/InlineExtension/index.js +1 -1
  36. package/dist/es2019/extensibility/Extension/styles.js +1 -0
  37. package/dist/es2019/extensibility/ExtensionComponent.js +1 -0
  38. package/dist/es2019/icons/shared/table.js +1 -0
  39. package/dist/es2019/keymaps/consts.js +1 -0
  40. package/dist/es2019/keymaps/index.js +1 -0
  41. package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  42. package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +1 -0
  43. package/dist/es2019/media-inline/media-inline-image-card.js +1 -1
  44. package/dist/es2019/monitoring/error.js +1 -1
  45. package/dist/es2019/portal/usePortalProvider.js +1 -0
  46. package/dist/es2019/provider-factory/with-providers.js +1 -0
  47. package/dist/es2019/quick-insert/QuickInsertMenuItem.js +1 -1
  48. package/dist/es2019/quick-insert/assets/datasource-confluence-search.js +1 -0
  49. package/dist/es2019/quick-insert/assets/date.js +1 -0
  50. package/dist/es2019/quick-insert/assets/fallback.js +1 -0
  51. package/dist/es2019/quick-insert/assets/index.js +1 -0
  52. package/dist/es2019/quick-insert/assets/list-number.js +1 -0
  53. package/dist/es2019/quick-insert/build-quick-insert-menu-model.js +1 -1
  54. package/dist/es2019/quick-insert/get-matching-quick-insert-components.js +1 -1
  55. package/dist/es2019/quick-insert/getQuickInsertMenuItemParents.js +1 -1
  56. package/dist/es2019/quick-insert/keys.js +1 -0
  57. package/dist/es2019/quick-insert/rank.js +1 -0
  58. package/dist/es2019/quick-insert/registered-menu-model.js +1 -0
  59. package/dist/es2019/resizer/Resizer.js +1 -1
  60. package/dist/es2019/styles/shared/resizer.js +1 -0
  61. package/dist/es2019/toolbar/keys.js +1 -0
  62. package/dist/es2019/toolbar/rank.js +1 -0
  63. package/dist/es2019/ugc-tokens/index.js +1 -0
  64. package/dist/es2019/ui/DropList/index.js +1 -1
  65. package/dist/es2019/ui/Emoji/index.js +1 -1
  66. package/dist/es2019/ui/HoverLinkOverlay/index.js +1 -0
  67. package/dist/es2019/ui/Mention/index.js +1 -0
  68. package/dist/es2019/ui/Popup/index.js +1 -1
  69. package/dist/es2019/ui-color/ColorPalette/utils.js +2 -2
  70. package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -1
  71. package/dist/es2019/utils/annotation/index.js +1 -0
  72. package/dist/es2019/utils/areDocsEqualByBlockStructureAndText.js +1 -1
  73. package/dist/es2019/utils/validator.js +1 -1
  74. package/dist/es2019/vanilla-tooltip/index.js +22 -0
  75. package/dist/esm/block-menu/index.js +1 -0
  76. package/dist/esm/block-menu/key-deprecated.js +1 -0
  77. package/dist/esm/block-menu/key.js +1 -0
  78. package/dist/esm/block-menu/rank.js +1 -0
  79. package/dist/esm/code-block/index.js +1 -0
  80. package/dist/esm/doc-utils/editor-use-only.js +1 -0
  81. package/dist/esm/element-browser/components/ElementList/ElementList.js +1 -0
  82. package/dist/esm/element-browser/constants.js +1 -0
  83. package/dist/esm/extensibility/Extension/InlineExtension/index.js +1 -1
  84. package/dist/esm/extensibility/Extension/styles.js +1 -0
  85. package/dist/esm/extensibility/ExtensionComponent.js +1 -0
  86. package/dist/esm/icons/shared/table.js +1 -0
  87. package/dist/esm/keymaps/consts.js +1 -0
  88. package/dist/esm/keymaps/index.js +1 -0
  89. package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  90. package/dist/esm/link/LinkSearch/LinkSearchListItem.js +1 -0
  91. package/dist/esm/media-inline/media-inline-image-card.js +1 -1
  92. package/dist/esm/monitoring/error.js +1 -1
  93. package/dist/esm/portal/usePortalProvider.js +1 -0
  94. package/dist/esm/provider-factory/with-providers.js +1 -0
  95. package/dist/esm/quick-insert/QuickInsertMenuItem.js +1 -1
  96. package/dist/esm/quick-insert/assets/datasource-confluence-search.js +1 -0
  97. package/dist/esm/quick-insert/assets/date.js +1 -0
  98. package/dist/esm/quick-insert/assets/fallback.js +1 -0
  99. package/dist/esm/quick-insert/assets/index.js +1 -0
  100. package/dist/esm/quick-insert/assets/list-number.js +1 -0
  101. package/dist/esm/quick-insert/build-quick-insert-menu-model.js +1 -1
  102. package/dist/esm/quick-insert/get-matching-quick-insert-components.js +1 -1
  103. package/dist/esm/quick-insert/getQuickInsertMenuItemParents.js +1 -1
  104. package/dist/esm/quick-insert/keys.js +1 -0
  105. package/dist/esm/quick-insert/rank.js +1 -0
  106. package/dist/esm/quick-insert/registered-menu-model.js +1 -0
  107. package/dist/esm/resizer/Resizer.js +1 -1
  108. package/dist/esm/styles/shared/resizer.js +1 -0
  109. package/dist/esm/toolbar/keys.js +1 -0
  110. package/dist/esm/toolbar/rank.js +1 -0
  111. package/dist/esm/ugc-tokens/index.js +1 -0
  112. package/dist/esm/ui/DropList/index.js +1 -1
  113. package/dist/esm/ui/Emoji/index.js +1 -1
  114. package/dist/esm/ui/HoverLinkOverlay/index.js +1 -0
  115. package/dist/esm/ui/Mention/index.js +1 -0
  116. package/dist/esm/ui/Popup/index.js +1 -1
  117. package/dist/esm/ui-color/ColorPalette/utils.js +2 -2
  118. package/dist/esm/ui-menu/DropdownMenu/index.js +1 -1
  119. package/dist/esm/utils/annotation/index.js +1 -0
  120. package/dist/esm/utils/areDocsEqualByBlockStructureAndText.js +1 -1
  121. package/dist/esm/utils/validator.js +1 -1
  122. package/dist/esm/vanilla-tooltip/index.js +22 -0
  123. package/dist/types/element-browser/components/CategoryList.d.ts +1 -1
  124. package/dist/types/element-browser/components/ElementList/ElementList.d.ts +1 -1
  125. package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +4 -0
  126. package/dist/types/provider-factory/profile-card-provider.d.ts +1 -1
  127. package/dist/types/ui/Expand/index.d.ts +4 -0
  128. package/dist/types/ui-menu/DropdownMenu/index.d.ts +4 -0
  129. package/dist/types/utils/nodes.d.ts +1 -1
  130. package/package.json +5 -5
@@ -5,6 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
5
  * @jsxRuntime classic
6
6
  * @jsx jsx
7
7
  */
8
+
8
9
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
9
10
 
10
11
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports -- jsx required at runtime for @jsxRuntime classic
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  /* eslint-disable @repo/internal/react/no-class-components */
10
+
10
11
  import React, { PureComponent } from 'react';
11
12
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
12
13
  import { ProviderFactory, WithProviders } from '../../provider-factory';
@@ -9,10 +9,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
9
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  import React from 'react';
12
+ import { createPortal, flushSync } from 'react-dom';
12
13
  import { bind } from 'bind-event-listener';
13
14
  import createFocusTrap from 'focus-trap';
14
15
  import rafSchedule from 'raf-schd';
15
- import { createPortal, flushSync } from 'react-dom';
16
16
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
17
17
  import { calculatePlacement, calculatePosition as _calculatePosition, findOverflowScrollParent } from './utils';
18
18
  import { validatePosition } from './validatePosition';
@@ -1,8 +1,8 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import paletteRaw from '@atlaskit/tokens/palette';
3
- import tokenNames from '@atlaskit/tokens/token-names';
4
2
  import darkTokensRaw from '@atlaskit/tokens/atlassian-dark';
5
3
  import lightTokensRaw from '@atlaskit/tokens/atlassian-light';
4
+ import paletteRaw from '@atlaskit/tokens/palette';
5
+ import tokenNames from '@atlaskit/tokens/token-names';
6
6
  import { getSelectedRowAndColumn } from './getSelectedRowAndColumn';
7
7
  export var DEFAULT_COLOR_PICKER_COLUMNS = 7;
8
8
  // Ignored via go/ees005
@@ -30,8 +30,8 @@ import CustomItem from '@atlaskit/menu/custom-item';
30
30
  import MenuGroup from '@atlaskit/menu/menu-group';
31
31
  import Section from '@atlaskit/menu/section';
32
32
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
33
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
34
33
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
34
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
35
35
  import Tooltip from '@atlaskit/tooltip/Tooltip';
36
36
  import { DropdownMenuSharedCssClassName } from '../../styles';
37
37
  import { KeyDownHandlerContext } from '../../ui-menu/ToolbarArrowKeyNavigationProvider';
@@ -1,5 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports */
3
+
3
4
  import { AnnotationTypes } from '@atlaskit/adf-schema/annotation';
4
5
  import { fg } from '@atlaskit/platform-feature-flags/fg';
5
6
  export var canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelection, doc, schema) {
@@ -1,6 +1,6 @@
1
1
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
2
  import { Transform } from '@atlaskit/editor-prosemirror/transform';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
4
4
 
5
5
  /**
6
6
  * Returns true when documents have the same text and block structure, while ignoring marks and
@@ -5,8 +5,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { inlineNodes } from '@atlaskit/adf-schema/inline-nodes';
6
6
  import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
7
7
  import { PanelType } from '@atlaskit/adf-schema/panel';
8
- import { generateUuid as uuid } from '@atlaskit/adf-schema/uuid';
9
8
  import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
9
+ import { generateUuid as uuid } from '@atlaskit/adf-schema/uuid';
10
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
11
11
  import { isSubSupType } from './isSubSupType';
12
12
  import { markOrder } from './markOrder';
@@ -188,6 +188,28 @@ export var VanillaTooltip = /*#__PURE__*/function () {
188
188
  }));
189
189
  }
190
190
 
191
+ // Resets `isDisplayed` when the browser closes the popover without going through `hide()`
192
+ // (e.g. light-dismissal). Prevents the guard in `show()` from becoming stale.
193
+ if (isExperimentEnabled('platform_editor_use_vanilla_components') && fg('platform_editor_use_vanilla_components_patch_2')) {
194
+ this.listeners.push(bind(tooltip, {
195
+ type: 'toggle',
196
+ listener: function listener(event) {
197
+ if (event.newState === 'closed') {
198
+ _this.isDisplayed = false;
199
+ // Cancel a pending show, which would otherwise mark a closed popover as
200
+ // displayed and announce a tooltip the user never saw.
201
+ //
202
+ // `shouldHidePopover` is set by `hide()` and cleared by `show()`, so it
203
+ // is false exactly when the pending timeout is a show. A pending hide
204
+ // must survive: it still has the positioning instance to release.
205
+ if (!_this.shouldHidePopover && _this.currentTimeoutId !== undefined) {
206
+ clearTimeout(_this.currentTimeoutId);
207
+ }
208
+ }
209
+ }
210
+ }));
211
+ }
212
+
191
213
  // Hide the tooltip if the hide transition has completed.
192
214
  //
193
215
  // Only reachable in the control arm: no consumer declares a transition on the tooltip, so
@@ -3,8 +3,8 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import React from 'react';
6
- import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
7
6
  import { type WithContextProps } from '@atlaskit/analytics-next/withAnalyticsContext';
7
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
8
8
  import type { Category } from '../types';
9
9
  interface Props {
10
10
  categories?: Category[];
@@ -6,8 +6,8 @@ import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import type { SerializedStyles } from '@emotion/react';
8
8
  import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
9
- import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
10
9
  import { type WithContextProps } from '@atlaskit/analytics-next/withAnalyticsContext';
10
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
11
11
  import type { QuickInsertItem } from '../../../provider-factory';
12
12
  import type { EmptyStateHandler } from '../../../types';
13
13
  import type { SelectedItemProps } from '../../types';
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
1
5
  import React, { PureComponent } from 'react';
2
6
  import { jsx } from '@emotion/react';
3
7
  import type { SerializedStyles } from '@emotion/react';
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { Placement } from '@atlaskit/popper/main';
3
- import type { ProfileCardAction } from '@atlaskit/profilecard/types';
4
3
  import type ProfileClient from '@atlaskit/profilecard/profile-card-client';
4
+ import type { ProfileCardAction } from '@atlaskit/profilecard/types';
5
5
  /**
6
6
  * Render-prop signature for injecting a custom user profile card around a mention. When the
7
7
  * `people-teams_migrate-user-profile-card` feature gate is on and the consumer supplies this
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
1
5
  import React from 'react';
2
6
  import { jsx } from '@emotion/react';
3
7
  import type { SerializedStyles } from '@emotion/react';
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
1
5
  import React, { PureComponent } from 'react';
2
6
  import { jsx } from '@emotion/react';
3
7
  import type { MenuItem, Props, State } from './types';
@@ -1,5 +1,5 @@
1
- import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer/types';
2
1
  import type { SanitizeNodeOptions } from '@atlaskit/editor-json-transformer/sanitize/sanitize-node';
2
+ import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer/types';
3
3
  import type { MarkType, NodeType, Mark as PMMark, Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import { SelectedState } from './SelectedState';
5
5
  /** Validates prosemirror nodes, and returns true only if all nodes are valid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "123.1.0",
3
+ "version": "123.1.2",
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/"
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/editor-prosemirror": "^9.0.0",
48
48
  "@atlaskit/editor-shared-styles": "^4.3.0",
49
49
  "@atlaskit/editor-tables": "^3.2.0",
50
- "@atlaskit/editor-toolbar": "^2.6.0",
50
+ "@atlaskit/editor-toolbar": "^2.7.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.2.0",
52
52
  "@atlaskit/editor-ui-control-model": "^2.9.0",
53
53
  "@atlaskit/emoji": "^72.4.0",
@@ -193,9 +193,6 @@
193
193
  "platform_editor_inline_node_virt_threshold_override": {
194
194
  "type": "boolean"
195
195
  },
196
- "platform_editor_fix_limited_mode_leaking": {
197
- "type": "boolean"
198
- },
199
196
  "confluence-issue-terminology-refresh": {
200
197
  "type": "boolean"
201
198
  },
@@ -252,6 +249,9 @@
252
249
  },
253
250
  "platform_editor_custom_emoji_unicode_fallback": {
254
251
  "type": "boolean"
252
+ },
253
+ "platform_editor_use_vanilla_components_patch_2": {
254
+ "type": "boolean"
255
255
  }
256
256
  },
257
257
  "platform-experiments": {