@atlaskit/editor-common 100.4.3 → 101.0.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.
Files changed (116) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/ai-messages/package.json +17 -0
  3. package/dist/cjs/ai-messages/ai-config-items.js +489 -0
  4. package/dist/cjs/ai-messages/ai-experience-application.js +131 -0
  5. package/dist/cjs/ai-messages/ai-failed-state.js +56 -0
  6. package/dist/cjs/ai-messages/ai-languages.js +368 -0
  7. package/dist/cjs/ai-messages/ai.js +122 -0
  8. package/dist/cjs/ai-messages/index.js +68 -0
  9. package/dist/cjs/card/index.js +13 -0
  10. package/dist/cjs/card/link-toolbar-button-group-options.js +2 -2
  11. package/dist/cjs/card/link-toolbar-dropdown-options.js +33 -0
  12. package/dist/cjs/element-browser/components/ElementList/EmptyState.js +1 -1
  13. package/dist/cjs/extensibility/Extension/Lozenge/EditToggle.js +1 -1
  14. package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +1 -1
  15. package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  16. package/dist/cjs/media/messages/altText.js +5 -0
  17. package/dist/cjs/messages/index.js +0 -28
  18. package/dist/cjs/monitoring/error.js +1 -1
  19. package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +35 -8
  20. package/dist/cjs/selection/gap-cursor/styles.js +1 -1
  21. package/dist/cjs/type-ahead/messages.js +10 -0
  22. package/dist/cjs/ui/DropList/index.js +1 -1
  23. package/dist/cjs/ui/FloatingToolbar/Button.js +5 -2
  24. package/dist/cjs/ui/FloatingToolbar/Separator.js +12 -6
  25. package/dist/cjs/ui-menu/ColorPickerButton/index.js +2 -1
  26. package/dist/es2019/ai-messages/ai-config-items.js +483 -0
  27. package/dist/es2019/ai-messages/ai-experience-application.js +124 -0
  28. package/dist/es2019/ai-messages/ai-failed-state.js +49 -0
  29. package/dist/es2019/ai-messages/ai-languages.js +361 -0
  30. package/dist/es2019/ai-messages/ai.js +116 -0
  31. package/dist/es2019/ai-messages/index.js +12 -0
  32. package/dist/es2019/card/index.js +2 -1
  33. package/dist/es2019/card/link-toolbar-button-group-options.js +1 -1
  34. package/dist/es2019/card/link-toolbar-dropdown-options.js +26 -0
  35. package/dist/es2019/element-browser/components/ElementList/EmptyState.js +1 -1
  36. package/dist/es2019/extensibility/Extension/Lozenge/EditToggle.js +1 -1
  37. package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +1 -1
  38. package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  39. package/dist/es2019/media/messages/altText.js +5 -0
  40. package/dist/es2019/messages/index.js +0 -4
  41. package/dist/es2019/monitoring/error.js +1 -1
  42. package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +34 -8
  43. package/dist/es2019/selection/gap-cursor/styles.js +1 -1
  44. package/dist/es2019/type-ahead/messages.js +10 -0
  45. package/dist/es2019/ui/DropList/index.js +1 -1
  46. package/dist/es2019/ui/FloatingToolbar/Button.js +5 -1
  47. package/dist/es2019/ui/FloatingToolbar/Separator.js +11 -4
  48. package/dist/es2019/ui-menu/ColorPickerButton/index.js +2 -1
  49. package/dist/esm/ai-messages/ai-config-items.js +483 -0
  50. package/dist/esm/ai-messages/ai-experience-application.js +124 -0
  51. package/dist/esm/ai-messages/ai-failed-state.js +49 -0
  52. package/dist/esm/ai-messages/ai-languages.js +361 -0
  53. package/dist/esm/ai-messages/ai.js +116 -0
  54. package/dist/esm/ai-messages/index.js +12 -0
  55. package/dist/esm/card/index.js +2 -1
  56. package/dist/esm/card/link-toolbar-button-group-options.js +1 -1
  57. package/dist/esm/card/link-toolbar-dropdown-options.js +26 -0
  58. package/dist/esm/element-browser/components/ElementList/EmptyState.js +1 -1
  59. package/dist/esm/extensibility/Extension/Lozenge/EditToggle.js +1 -1
  60. package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +1 -1
  61. package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  62. package/dist/esm/media/messages/altText.js +5 -0
  63. package/dist/esm/messages/index.js +0 -4
  64. package/dist/esm/monitoring/error.js +1 -1
  65. package/dist/esm/react-node-view/getInlineNodeViewProducer.js +35 -8
  66. package/dist/esm/selection/gap-cursor/styles.js +1 -1
  67. package/dist/esm/type-ahead/messages.js +10 -0
  68. package/dist/esm/ui/DropList/index.js +1 -1
  69. package/dist/esm/ui/FloatingToolbar/Button.js +5 -2
  70. package/dist/esm/ui/FloatingToolbar/Separator.js +12 -6
  71. package/dist/esm/ui-menu/ColorPickerButton/index.js +2 -1
  72. package/dist/types/ai-messages/ai-config-items.d.ts +462 -0
  73. package/dist/types/ai-messages/ai-experience-application.d.ts +122 -0
  74. package/dist/types/ai-messages/ai-failed-state.d.ts +47 -0
  75. package/dist/types/ai-messages/ai-languages.d.ts +357 -0
  76. package/dist/types/ai-messages/ai.d.ts +107 -0
  77. package/dist/types/ai-messages/index.d.ts +9 -0
  78. package/dist/types/card/index.d.ts +2 -1
  79. package/dist/types/card/link-toolbar-button-group-options.d.ts +51 -0
  80. package/dist/types/card/link-toolbar-dropdown-options.d.ts +4 -0
  81. package/dist/types/media/messages/altText.d.ts +5 -0
  82. package/dist/types/messages/index.d.ts +0 -4
  83. package/dist/types/type-ahead/messages.d.ts +10 -0
  84. package/dist/types-ts4.5/ai-messages/ai-config-items.d.ts +462 -0
  85. package/dist/types-ts4.5/ai-messages/ai-experience-application.d.ts +122 -0
  86. package/dist/types-ts4.5/ai-messages/ai-failed-state.d.ts +47 -0
  87. package/dist/types-ts4.5/ai-messages/ai-languages.d.ts +357 -0
  88. package/dist/types-ts4.5/ai-messages/ai.d.ts +107 -0
  89. package/dist/types-ts4.5/ai-messages/index.d.ts +9 -0
  90. package/dist/types-ts4.5/card/index.d.ts +2 -1
  91. package/dist/types-ts4.5/card/link-toolbar-button-group-options.d.ts +51 -0
  92. package/dist/types-ts4.5/card/link-toolbar-dropdown-options.d.ts +4 -0
  93. package/dist/types-ts4.5/media/messages/altText.d.ts +5 -0
  94. package/dist/types-ts4.5/messages/index.d.ts +0 -4
  95. package/dist/types-ts4.5/type-ahead/messages.d.ts +10 -0
  96. package/package.json +9 -11
  97. /package/dist/cjs/{messages → ai-messages}/ai-definitions.js +0 -0
  98. /package/dist/cjs/{messages → ai-messages}/ai-proactive-setting.js +0 -0
  99. /package/dist/cjs/{messages → ai-messages}/ai-proactive-transform.js +0 -0
  100. /package/dist/cjs/{messages → ai-messages}/ai-proactive.js +0 -0
  101. /package/dist/es2019/{messages → ai-messages}/ai-definitions.js +0 -0
  102. /package/dist/es2019/{messages → ai-messages}/ai-proactive-setting.js +0 -0
  103. /package/dist/es2019/{messages → ai-messages}/ai-proactive-transform.js +0 -0
  104. /package/dist/es2019/{messages → ai-messages}/ai-proactive.js +0 -0
  105. /package/dist/esm/{messages → ai-messages}/ai-definitions.js +0 -0
  106. /package/dist/esm/{messages → ai-messages}/ai-proactive-setting.js +0 -0
  107. /package/dist/esm/{messages → ai-messages}/ai-proactive-transform.js +0 -0
  108. /package/dist/esm/{messages → ai-messages}/ai-proactive.js +0 -0
  109. /package/dist/types/{messages → ai-messages}/ai-definitions.d.ts +0 -0
  110. /package/dist/types/{messages → ai-messages}/ai-proactive-setting.d.ts +0 -0
  111. /package/dist/types/{messages → ai-messages}/ai-proactive-transform.d.ts +0 -0
  112. /package/dist/types/{messages → ai-messages}/ai-proactive.d.ts +0 -0
  113. /package/dist/types-ts4.5/{messages → ai-messages}/ai-definitions.d.ts +0 -0
  114. /package/dist/types-ts4.5/{messages → ai-messages}/ai-proactive-setting.d.ts +0 -0
  115. /package/dist/types-ts4.5/{messages → ai-messages}/ai-proactive-transform.d.ts +0 -0
  116. /package/dist/types-ts4.5/{messages → ai-messages}/ai-proactive.d.ts +0 -0
@@ -8,7 +8,7 @@ import React from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { jsx } from '@emotion/react';
10
10
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
11
- import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
12
  import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
13
13
  import { ErrorBoundary } from '../ui/ErrorBoundary';
14
14
  import { analyticsEventKey, browser, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
@@ -16,9 +16,30 @@ import { ZERO_WIDTH_SPACE } from '../whitespace';
16
16
  import { generateUniqueNodeKey } from './generateUniqueNodeKey';
17
17
  import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
18
18
  export const inlineNodeViewClassname = 'inlineNodeView';
19
+
20
+ // number of initial nodes to allow React to render before switching to fallback
21
+ let initialReactRenderedNodeCount = 0;
19
22
  const canRenderFallback = node => {
20
23
  return node.type.isInline && node.type.isAtom && node.type.isLeaf;
21
24
  };
25
+ const virtualisationConfiguration = () => {
26
+ let enableVirtualization = false;
27
+ let reactRenderedDocumentPositionThreshold = 0;
28
+ if (editorExperiment('platform_editor_inline_node_virtualization', 'off')) {
29
+ enableVirtualization = false;
30
+ } else if (editorExperiment('platform_editor_inline_node_virtualization', 'fallbackall')) {
31
+ enableVirtualization = true;
32
+ reactRenderedDocumentPositionThreshold = 0;
33
+ } else if (editorExperiment('platform_editor_inline_node_virtualization', 'fallbackoffscreen')) {
34
+ enableVirtualization = true;
35
+ reactRenderedDocumentPositionThreshold = 100;
36
+ }
37
+ return {
38
+ enableVirtualization,
39
+ reactRenderedDocumentPositionThreshold,
40
+ virtualizeCurrentNode: () => enableVirtualization && !(initialReactRenderedNodeCount < reactRenderedDocumentPositionThreshold)
41
+ };
42
+ };
22
43
  function createNodeView({
23
44
  nodeViewParams,
24
45
  pmPluginFactoryParams,
@@ -26,7 +47,11 @@ function createNodeView({
26
47
  extraComponentProps,
27
48
  extraNodeViewProps
28
49
  }) {
29
- const shouldVirtualize = fg('platform_editor_lego__inline_node_virtualization');
50
+ const {
51
+ enableVirtualization,
52
+ virtualizeCurrentNode
53
+ } = virtualisationConfiguration();
54
+ const virtualizeNode = virtualizeCurrentNode();
30
55
  // We set a variable for the current node which is
31
56
  // used for comparisions when doing updates, before being
32
57
  // overwritten to the updated node.
@@ -92,7 +117,7 @@ function createNodeView({
92
117
  });
93
118
  }
94
119
  }
95
- if (shouldVirtualize) {
120
+ if (virtualizeNode) {
96
121
  renderFallback();
97
122
  // allow the fallback to render first before attaching the observer.
98
123
  // Will tweak this in a follow up PR to optimise rendering of visible
@@ -101,6 +126,7 @@ function createNodeView({
101
126
  attachNodeViewObserver();
102
127
  }, 0);
103
128
  } else {
129
+ initialReactRenderedNodeCount = initialReactRenderedNodeCount + 1;
104
130
  const {
105
131
  samplingRate,
106
132
  slowThreshold,
@@ -121,9 +147,9 @@ function createNodeView({
121
147
  }
122
148
  const extraNodeViewPropsWithStopEvent = {
123
149
  ...extraNodeViewProps,
124
- ...(fg('platform_editor_lego__inline_node_virtualization') ? {
150
+ ...(enableVirtualization ? {
125
151
  // This is not related to virtualization, but it's something we should fix/handle
126
- // Remove this comment when `platform_editor_lego__inline_node_virtualization` FF is cleaned up
152
+ // Remove this comment when virtualization experiment is cleaned up
127
153
  stopEvent(event) {
128
154
  const maybeStopEvent = extraNodeViewProps === null || extraNodeViewProps === void 0 ? void 0 : extraNodeViewProps.stopEvent;
129
155
  if (typeof maybeStopEvent === 'function') {
@@ -164,7 +190,7 @@ function createNodeView({
164
190
  setDomAttrs(nextNode, domRef);
165
191
  }
166
192
  currentNode = nextNode;
167
- if (shouldVirtualize) {
193
+ if (virtualizeNode) {
168
194
  if (didRenderComponentWithIntersectionObserver) {
169
195
  renderComponent();
170
196
  }
@@ -174,7 +200,7 @@ function createNodeView({
174
200
  return true;
175
201
  },
176
202
  destroy() {
177
- if (shouldVirtualize) {
203
+ if (virtualizeNode) {
178
204
  removeIntersectionObserver();
179
205
  }
180
206
 
@@ -186,7 +212,7 @@ function createNodeView({
186
212
  // of HTMLSpanElement type however once the node view has
187
213
  // been destroyed no other consumers should still be using it.
188
214
  domRef = undefined;
189
- if (shouldVirtualize) {
215
+ if (virtualizeNode) {
190
216
  destroyed = true;
191
217
  }
192
218
  },
@@ -10,7 +10,7 @@ const gapCursorBlink = keyframes({
10
10
  });
11
11
  export const hideCaretModifier = 'ProseMirror-hide-gapcursor';
12
12
  const gapCursor = '.ProseMirror-gapcursor';
13
- const prosemirrorwidgetNotBlock = '.ProseMirror-widget:not([data-blocks-decoration-container="true"]):not([data-blocks-drag-handle-container="true"])';
13
+ const prosemirrorwidgetNotBlock = '.ProseMirror-widget:not([data-blocks-decoration-container="true"]):not([data-blocks-drag-handle-container="true"]):not([data-blocks-quick-insert-container="true"])';
14
14
  const wrapLeft = '[layout="wrap-left"]';
15
15
  const wrapRight = '[layout="wrap-right"]';
16
16
 
@@ -89,5 +89,15 @@ export const typeAheadListMessages = defineMessages({
89
89
  id: 'fablric.editor.viewAllInserts',
90
90
  defaultMessage: 'View all inserts',
91
91
  description: 'a text on a button that opens a side panel with a list of all insertable editor elements'
92
+ },
93
+ emptySearchResults: {
94
+ id: 'fabric.editor.emptySearchResults',
95
+ defaultMessage: "We couldn't find any results.",
96
+ description: 'a message displayed when there are no search results'
97
+ },
98
+ emptySearchResultsSuggestion: {
99
+ id: 'fabric.editor.emptySearchResultsSuggestion',
100
+ defaultMessage: 'Select {buttonName} to browse inserts.',
101
+ description: 'a prompt to suggest user to click a button to browse inserts when there are no search results'
92
102
  }
93
103
  });
@@ -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 = "100.4.3";
16
+ const packageVersion = "101.0.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -6,6 +6,9 @@ import Tooltip from '@atlaskit/tooltip';
6
6
  import { Pulse } from '../Pulse/Pulse';
7
7
  import { ButtonSpotlightCard } from './ButtonSpotlightCard';
8
8
  import { getButtonStyles, iconOnlySpacing } from './styles';
9
+ const minWidthStyle = {
10
+ minWidth: "var(--ds-space-400, 32px)"
11
+ };
9
12
  export default (({
10
13
  title,
11
14
  icon,
@@ -87,7 +90,8 @@ export default (({
87
90
  appearance,
88
91
  state: themeProps.state,
89
92
  mode: themeProps.mode
90
- }))
93
+ })),
94
+ ...(editorExperiment('platform_editor_controls', 'variant1') ? minWidthStyle : {})
91
95
  },
92
96
  ...rest
93
97
  };
@@ -4,6 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, jsx } from '@emotion/react';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  const separator = css({
8
9
  background: "var(--ds-border, #091E4224)",
9
10
  width: '1px',
@@ -11,14 +12,20 @@ const separator = css({
11
12
  margin: `0 ${"var(--ds-space-050, 4px)"}`,
12
13
  alignSelf: 'center'
13
14
  });
15
+ const separatorNew = css({
16
+ background: "var(--ds-border, #091E4224)",
17
+ width: '1px',
18
+ height: '20px',
19
+ alignSelf: 'center'
20
+ });
14
21
  const separatorFullHeight = css({
15
22
  height: '40px'
16
23
  });
17
24
  export default (({
18
25
  fullHeight
19
- }) =>
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
21
- jsx("div", {
22
- css: [separator, fullHeight && separatorFullHeight],
26
+ }) => jsx("div", {
27
+ css: [editorExperiment('platform_editor_controls', 'variant1') ? separatorNew : separator, fullHeight && separatorFullHeight]
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
29
+ ,
23
30
  className: "separator"
24
31
  }));
@@ -14,6 +14,7 @@ import LegacyExpandIcon from '@atlaskit/icon/glyph/chevron-down';
14
14
  import ChevronDownIcon from '@atlaskit/icon/utility/chevron-down';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
16
  import { Box, xcss, Inline } from '@atlaskit/primitives';
17
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
18
  import Tooltip from '@atlaskit/tooltip';
18
19
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, editorAnalyticsChannel, EVENT_TYPE } from '../../analytics';
19
20
  import { ColorPalette, DEFAULT_BORDER_COLOR, getSelectedRowAndColumnFromPalette } from '../../ui-color';
@@ -248,7 +249,7 @@ const ColorPickerButton = props => {
248
249
  ref: buttonRef,
249
250
  "aria-label": title,
250
251
  "aria-expanded": props.isAriaExpanded ? isPopupOpen : undefined,
251
- spacing: "compact",
252
+ spacing: editorExperiment('platform_editor_controls', 'variant1') ? 'default' : 'compact',
252
253
  onClick: togglePopup,
253
254
  onKeyDown: event => {
254
255
  if (event.key === 'Enter' || event.key === ' ') {