@atlaskit/editor-common 102.13.2 → 102.13.4

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 (30) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/analytics/types/enums.js +1 -0
  3. package/dist/cjs/extensibility/Extension/Extension/index.js +0 -25
  4. package/dist/cjs/messages/link-toolbar.js +5 -0
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +185 -106
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/utils/referentiality.js +2 -2
  9. package/dist/es2019/analytics/types/enums.js +1 -0
  10. package/dist/es2019/extensibility/Extension/Extension/index.js +1 -26
  11. package/dist/es2019/messages/link-toolbar.js +5 -0
  12. package/dist/es2019/monitoring/error.js +1 -1
  13. package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +181 -97
  14. package/dist/es2019/ui/DropList/index.js +1 -1
  15. package/dist/esm/analytics/types/enums.js +1 -0
  16. package/dist/esm/extensibility/Extension/Extension/index.js +1 -26
  17. package/dist/esm/messages/link-toolbar.js +5 -0
  18. package/dist/esm/monitoring/error.js +1 -1
  19. package/dist/esm/react-node-view/getInlineNodeViewProducer.js +185 -106
  20. package/dist/esm/ui/DropList/index.js +1 -1
  21. package/dist/esm/utils/referentiality.js +2 -2
  22. package/dist/types/analytics/types/enums.d.ts +2 -1
  23. package/dist/types/analytics/types/find-replace-events.d.ts +1 -1
  24. package/dist/types/messages/link-toolbar.d.ts +5 -0
  25. package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +13 -0
  26. package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -1
  27. package/dist/types-ts4.5/analytics/types/find-replace-events.d.ts +1 -1
  28. package/dist/types-ts4.5/messages/link-toolbar.d.ts +5 -0
  29. package/dist/types-ts4.5/react-node-view/getInlineNodeViewProducer.d.ts +13 -0
  30. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 102.13.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#130856](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130856)
8
+ [`0591d853bb6c0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0591d853bb6c0) -
9
+ NOISSUE: fixes editor virtualization experiment variants
10
+ - [#130809](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130809)
11
+ [`8d1dd6da98a94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d1dd6da98a94) -
12
+ ED-26834 Remove faulty manual exposure event for nested non bodied macros
13
+ - Updated dependencies
14
+
15
+ ## 102.13.3
16
+
17
+ ### Patch Changes
18
+
19
+ - [#130882](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130882)
20
+ [`df1c29f476539`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/df1c29f476539) -
21
+ [ux] Adds a new i18n message and updates icons and tooltips on links, media and extensions.
22
+ - Updated dependencies
23
+
3
24
  ## 102.13.2
4
25
 
5
26
  ### Patch Changes
@@ -222,6 +222,7 @@ var TRIGGER_METHOD = exports.TRIGGER_METHOD = /*#__PURE__*/function (TRIGGER_MET
222
222
  TRIGGER_METHOD["KEYBOARD"] = "keyboard";
223
223
  TRIGGER_METHOD["SHORTCUT"] = "shortcut";
224
224
  TRIGGER_METHOD["TOOLBAR"] = "toolbar";
225
+ TRIGGER_METHOD["EXTERNAL"] = "external";
225
226
  return TRIGGER_METHOD;
226
227
  }({});
227
228
  var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
@@ -13,7 +13,6 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  var _react2 = require("@emotion/react");
14
14
  var _classnames2 = _interopRequireDefault(require("classnames"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
17
16
  var _hooks = require("../../../hooks");
18
17
  var _ui = require("../../../ui");
19
18
  var _utils = require("../../../utils");
@@ -126,30 +125,6 @@ function ExtensionWithPluginState(props) {
126
125
  setIsNodeHovered(didHover);
127
126
  }
128
127
  };
129
- var shouldFireNbmExperimentExposure = _react.default.useMemo(function () {
130
- if (node.type.name === 'extension' && typeof getPos === 'function') {
131
- var pos = getPos();
132
- if (!isNaN(pos)) {
133
- var _view$state$doc$resol;
134
- var parentNameType = (_view$state$doc$resol = view.state.doc.resolve(pos).parent) === null || _view$state$doc$resol === void 0 || (_view$state$doc$resol = _view$state$doc$resol.type) === null || _view$state$doc$resol === void 0 ? void 0 : _view$state$doc$resol.name;
135
- if (['listItem', 'nestedExpand', 'blockquote', 'panel'].includes(parentNameType)) {
136
- return true;
137
- }
138
- }
139
- }
140
- return false;
141
- }, [node, getPos, view]);
142
- (0, _react.useEffect)(function () {
143
- if (shouldFireNbmExperimentExposure) {
144
- // No-op editorExperiment evaluation to track usage of nested non-bodied macros
145
- // these can't be tracked at the point of diversion of the experience because that is a toggle of the
146
- // ProseMirror schema nodes for listItems, nestedExpand, blockquote, and panel. At that point the customer
147
- // has not yet been exposed
148
- (0, _experiments.editorExperiment)('platform_editor_nested_non_bodied_macros', 'test', {
149
- exposure: true
150
- });
151
- }
152
- }, [shouldFireNbmExperimentExposure]);
153
128
  return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && (0, _react2.jsx)(_Lozenge.default, {
154
129
  isNodeSelected: isNodeSelected,
155
130
  isNodeHovered: isNodeHovered,
@@ -66,6 +66,11 @@ var linkToolbarMessages = exports.linkToolbarMessages = (0, _reactIntlNext.defin
66
66
  defaultMessage: 'Go to Link Preferences',
67
67
  description: 'Go to Link Preferences'
68
68
  },
69
+ preferencesLink: {
70
+ id: 'fabric.editor.preferencesLink',
71
+ defaultMessage: 'Link preferences',
72
+ description: 'Go to link preferences'
73
+ },
69
74
  editDatasource: {
70
75
  id: 'fabric.editor.edit.datasource',
71
76
  defaultMessage: 'Edit search query',
@@ -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 = "102.13.2";
20
+ var packageVersion = "102.13.4";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // Ignored via go/ees007
@@ -26,67 +26,149 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
26
26
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
27
27
  var isSSR = Boolean(process.env.REACT_SSR);
28
28
  var inlineNodeViewClassname = exports.inlineNodeViewClassname = 'inlineNodeView';
29
-
30
- // number of initial nodes to allow React to render before switching to fallback
31
- var initialReactRenderedNodeCount = 0;
32
29
  var canRenderFallback = function canRenderFallback(node) {
33
30
  return node.type.isInline && node.type.isAtom && node.type.isLeaf;
34
31
  };
35
32
 
36
33
  // list of inline nodes with toDOM fallback implementations that can be virtualized. As
37
34
  // additional nodes are converted they should be added here
38
- var virtualizedNodeWhitelist = ['status', 'mention', 'emoji', 'date', 'inlineCard'];
39
- var virtualisationConfiguration = function virtualisationConfiguration() {
40
- var enableVirtualization = false;
41
- var reactRenderedDocumentPositionThreshold = 0;
42
- if (isSSR) {
43
- return {
44
- enableVirtualization: enableVirtualization,
45
- reactRenderedDocumentPositionThreshold: reactRenderedDocumentPositionThreshold,
46
- virtualizeCurrentNode: function virtualizeCurrentNode() {
47
- return false;
48
- }
49
- };
50
- }
35
+ var virtualizedNodeAllowlist = ['status', 'mention', 'emoji', 'date', 'inlineCard'];
36
+ function checkExperimentExposure() {
51
37
  if ((0, _experiments.editorExperiment)('platform_editor_inline_node_virtualization', 'off', {
52
38
  exposure: true
53
39
  })) {
54
- enableVirtualization = false;
55
- } else if ((0, _experiments.editorExperiment)('platform_editor_inline_node_virtualization', 'fallback-small', {
56
- exposure: true
57
- })) {
58
- enableVirtualization = true;
59
- reactRenderedDocumentPositionThreshold = 100;
60
- } else if ((0, _experiments.editorExperiment)('platform_editor_inline_node_virtualization', 'fallback-large', {
40
+ return false;
41
+ }
42
+ if ((0, _experiments.editorExperiment)('platform_editor_inline_node_virtualization', 'fallback-small', {
61
43
  exposure: true
62
44
  })) {
63
- enableVirtualization = true;
64
- reactRenderedDocumentPositionThreshold = 400;
45
+ return true;
65
46
  }
66
-
67
- // we need to be able to override the threshold to 0
68
- // for specific situation, primarily testing
69
- if (reactRenderedDocumentPositionThreshold !== 0 && (0, _platformFeatureFlags.fg)('platform_editor_inline_node_virt_threshold_override')) {
70
- reactRenderedDocumentPositionThreshold = 0;
71
- }
72
- return {
73
- enableVirtualization: enableVirtualization,
74
- reactRenderedDocumentPositionThreshold: reactRenderedDocumentPositionThreshold,
75
- virtualizeCurrentNode: function virtualizeCurrentNode(nodeType) {
76
- return enableVirtualization && virtualizedNodeWhitelist.includes(nodeType) && !(initialReactRenderedNodeCount < reactRenderedDocumentPositionThreshold);
77
- }
78
- };
79
- };
47
+ return false;
48
+ }
80
49
  function createNodeView(_ref) {
81
50
  var nodeViewParams = _ref.nodeViewParams,
82
51
  pmPluginFactoryParams = _ref.pmPluginFactoryParams,
83
52
  Component = _ref.Component,
84
53
  extraComponentProps = _ref.extraComponentProps,
85
54
  extraNodeViewProps = _ref.extraNodeViewProps;
86
- var _virtualisationConfig = virtualisationConfiguration(),
87
- enableVirtualization = _virtualisationConfig.enableVirtualization,
88
- virtualizeCurrentNode = _virtualisationConfig.virtualizeCurrentNode;
89
- var virtualizeNode = virtualizeCurrentNode(nodeViewParams.node.type.name);
55
+ // We set a variable for the current node which is
56
+ // used for comparisions when doing updates, before being
57
+ // overwritten to the updated node.
58
+ var currentNode = nodeViewParams.node;
59
+ var key = (0, _generateUniqueNodeKey.generateUniqueNodeKey)();
60
+
61
+ // First we setup the dom element which will be rendered and "tracked" by prosemirror
62
+ // and also used as a "editor portal" (not react portal) target by the editor
63
+ // portal provider api, for rendering the Component passed.
64
+
65
+ var domRef = document.createElement('span');
66
+ domRef.contentEditable = 'false';
67
+ setDomAttrs(nodeViewParams.node, domRef);
68
+ var fallbackRef = {
69
+ current: null
70
+ };
71
+
72
+ // @see ED-3790
73
+ // something gets messed up during mutation processing inside of a
74
+ // nodeView if DOM structure has nested plain "div"s, it doesn't see the
75
+ // difference between them and it kills the nodeView
76
+ domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "".concat(inlineNodeViewClassname));
77
+
78
+ // This util is shared for tracking rendering, and the ErrorBoundary that
79
+ // is setup to wrap the Component when rendering
80
+ // NOTE: This is not a prosemirror dispatch
81
+ function dispatchAnalyticsEvent(payload) {
82
+ pmPluginFactoryParams.eventDispatcher.emit(_utils.analyticsEventKey, {
83
+ payload: payload
84
+ });
85
+ }
86
+
87
+ // This is called to render the Component into domRef which is inside the
88
+ // prosemirror View.
89
+ // Internally it uses the unstable_renderSubtreeIntoContainer api to render,
90
+ // to the passed dom element (domRef) which means it is automatically
91
+ // "cleaned up" when you do a "re render".
92
+ function renderComponent() {
93
+ pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
94
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
95
+ currentNode: currentNode,
96
+ nodeViewParams: nodeViewParams,
97
+ Component: Component,
98
+ extraComponentProps: extraComponentProps
99
+ }), domRef, key);
100
+ }
101
+ var _getPerformanceOption = (0, _utils.getPerformanceOptions)(nodeViewParams.view),
102
+ samplingRate = _getPerformanceOption.samplingRate,
103
+ slowThreshold = _getPerformanceOption.slowThreshold,
104
+ trackingEnabled = _getPerformanceOption.trackingEnabled;
105
+ trackingEnabled && (0, _utils.startMeasureReactNodeViewRendered)({
106
+ nodeTypeName: currentNode.type.name
107
+ });
108
+
109
+ // We render the component while creating the node view
110
+ renderComponent();
111
+ trackingEnabled && (0, _utils.stopMeasureReactNodeViewRendered)({
112
+ nodeTypeName: currentNode.type.name,
113
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
114
+ samplingRate: samplingRate,
115
+ slowThreshold: slowThreshold
116
+ });
117
+ var extraNodeViewPropsWithStopEvent = _objectSpread({}, extraNodeViewProps);
118
+
119
+ // https://prosemirror.net/docs/ref/#view.NodeView
120
+ var nodeView = _objectSpread({
121
+ get dom() {
122
+ return domRef;
123
+ },
124
+ update: function update(nextNode, _decorations) {
125
+ // Let ProseMirror handle the update if node types are different.
126
+ // This prevents an issue where it was not possible to select the
127
+ // inline node view then replace it by entering text - the node
128
+ // view contents would be deleted but the node view itself would
129
+ // stay in the view and become uneditable.
130
+ if (currentNode.type !== nextNode.type) {
131
+ return false;
132
+ }
133
+ // On updates, we only set the new attributes if the type, attributes, and marks
134
+ // have changed on the node.
135
+
136
+ // NOTE: this could mean attrs changes aren't reflected in the dom,
137
+ // when an attribute key which was previously present is no longer
138
+ // present.
139
+ // ie.
140
+ // -> Original attributes { text: "hello world", color: "red" }
141
+ // -> Updated attributes { color: "blue" }
142
+ // in this case, the dom text attribute will not be cleared.
143
+ //
144
+ // This may not be an issue with any of our current node schemas.
145
+ if (!currentNode.sameMarkup(nextNode)) {
146
+ setDomAttrs(nextNode, domRef);
147
+ }
148
+ currentNode = nextNode;
149
+ renderComponent();
150
+ return true;
151
+ },
152
+ destroy: function destroy() {
153
+ // When prosemirror destroys the node view, we need to clean up
154
+ // what we have previously rendered using the editor portal
155
+ // provider api.
156
+ pmPluginFactoryParams.portalProviderAPI.remove(key);
157
+ // @ts-expect-error Expect an error as domRef is expected to be
158
+ // of HTMLSpanElement type however once the node view has
159
+ // been destroyed no other consumers should still be using it.
160
+ domRef = undefined;
161
+ fallbackRef.current = null;
162
+ }
163
+ }, extraNodeViewPropsWithStopEvent);
164
+ return nodeView;
165
+ }
166
+ function createNodeViewVirtualized(_ref2) {
167
+ var nodeViewParams = _ref2.nodeViewParams,
168
+ pmPluginFactoryParams = _ref2.pmPluginFactoryParams,
169
+ Component = _ref2.Component,
170
+ extraComponentProps = _ref2.extraComponentProps,
171
+ extraNodeViewProps = _ref2.extraNodeViewProps;
90
172
  // We set a variable for the current node which is
91
173
  // used for comparisions when doing updates, before being
92
174
  // overwritten to the updated node.
@@ -138,18 +220,20 @@ function createNodeView(_ref) {
138
220
  nodeViewParams: nodeViewParams,
139
221
  Component: Component,
140
222
  extraComponentProps: extraComponentProps
141
- }), domRef, key, enableVirtualization ? onBeforeReactDomRender : undefined);
223
+ }), domRef, key, onBeforeReactDomRender);
142
224
  }
143
225
  var didRenderComponentWithIntersectionObserver = false;
144
226
  var destroyed = false;
145
227
  var removeIntersectionObserver = function removeIntersectionObserver() {};
146
228
  function renderFallback() {
147
229
  var _currentNode$type;
148
- if (canRenderFallback(currentNode) && typeof ((_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 || (_currentNode$type = _currentNode$type.spec) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.toDOM) === 'function') {
149
- var fallback = _model.DOMSerializer.renderSpec(document, currentNode.type.spec.toDOM(currentNode));
150
- fallbackRef.current = fallback.dom;
151
- domRef.replaceChildren(fallback.dom);
230
+ if (!canRenderFallback(currentNode) || typeof ((_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 || (_currentNode$type = _currentNode$type.spec) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.toDOM) !== 'function') {
231
+ return;
152
232
  }
233
+ var fallback = _model.DOMSerializer.renderSpec(document, currentNode.type.spec.toDOM(currentNode));
234
+ var dom = fallback.dom;
235
+ fallbackRef.current = dom;
236
+ domRef.replaceChildren(dom);
153
237
  }
154
238
  function attachNodeViewObserver() {
155
239
  var observer = (0, _onVisibleObserverFactory.getOrCreateOnVisibleObserver)(nodeViewParams.view);
@@ -162,36 +246,14 @@ function createNodeView(_ref) {
162
246
  });
163
247
  }
164
248
  }
165
- if (virtualizeNode) {
166
- renderFallback();
167
- // allow the fallback to render first before attaching the observer.
168
- // Will tweak this in a follow up PR to optimise rendering of visible
169
- // nodes without fallback rendering.
170
- setTimeout(function () {
171
- attachNodeViewObserver();
172
- }, 0);
173
- } else {
174
- initialReactRenderedNodeCount = initialReactRenderedNodeCount + 1;
175
- var _getPerformanceOption = (0, _utils.getPerformanceOptions)(nodeViewParams.view),
176
- samplingRate = _getPerformanceOption.samplingRate,
177
- slowThreshold = _getPerformanceOption.slowThreshold,
178
- trackingEnabled = _getPerformanceOption.trackingEnabled;
179
- trackingEnabled && (0, _utils.startMeasureReactNodeViewRendered)({
180
- nodeTypeName: currentNode.type.name
181
- });
182
-
183
- // We render the component while creating the node view
184
- renderComponent();
185
- trackingEnabled && (0, _utils.stopMeasureReactNodeViewRendered)({
186
- nodeTypeName: currentNode.type.name,
187
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
188
- samplingRate: samplingRate,
189
- slowThreshold: slowThreshold
190
- });
191
- }
192
- var extraNodeViewPropsWithStopEvent = _objectSpread(_objectSpread({}, extraNodeViewProps), enableVirtualization ? {
193
- // This is not related to virtualization, but it's something we should fix/handle
194
- // Remove this comment when virtualization experiment is cleaned up
249
+ renderFallback();
250
+ // allow the fallback to render first before attaching the observer.
251
+ // Will tweak this in a follow up PR to optimise rendering of visible
252
+ // nodes without fallback rendering.
253
+ setTimeout(function () {
254
+ attachNodeViewObserver();
255
+ }, 0);
256
+ var extraNodeViewPropsWithStopEvent = _objectSpread(_objectSpread({}, extraNodeViewProps), {}, {
195
257
  stopEvent: function stopEvent(event) {
196
258
  var maybeStopEvent = extraNodeViewProps === null || extraNodeViewProps === void 0 ? void 0 : extraNodeViewProps.stopEvent;
197
259
  if (typeof maybeStopEvent === 'function') {
@@ -199,7 +261,7 @@ function createNodeView(_ref) {
199
261
  }
200
262
  return false;
201
263
  }
202
- } : {});
264
+ });
203
265
 
204
266
  // https://prosemirror.net/docs/ref/#view.NodeView
205
267
  var nodeView = _objectSpread({
@@ -231,19 +293,14 @@ function createNodeView(_ref) {
231
293
  setDomAttrs(nextNode, domRef);
232
294
  }
233
295
  currentNode = nextNode;
234
- if (virtualizeNode) {
235
- if (didRenderComponentWithIntersectionObserver) {
236
- renderComponent();
237
- }
238
- } else {
296
+ if (didRenderComponentWithIntersectionObserver) {
239
297
  renderComponent();
240
298
  }
241
299
  return true;
242
300
  },
243
301
  destroy: function destroy() {
244
- if (virtualizeNode) {
245
- removeIntersectionObserver();
246
- }
302
+ removeIntersectionObserver();
303
+ destroyed = true;
247
304
 
248
305
  // When prosemirror destroys the node view, we need to clean up
249
306
  // what we have previously rendered using the editor portal
@@ -254,9 +311,6 @@ function createNodeView(_ref) {
254
311
  // been destroyed no other consumers should still be using it.
255
312
  domRef = undefined;
256
313
  fallbackRef.current = null;
257
- if (virtualizeNode) {
258
- destroyed = true;
259
- }
260
314
  }
261
315
  }, extraNodeViewPropsWithStopEvent);
262
316
  return nodeView;
@@ -271,12 +325,12 @@ function setDomAttrs(node, element) {
271
325
  element.setAttribute(attr, node.attrs[attr]);
272
326
  });
273
327
  }
274
- function getPortalChildren(_ref2) {
275
- var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
276
- currentNode = _ref2.currentNode,
277
- nodeViewParams = _ref2.nodeViewParams,
278
- Component = _ref2.Component,
279
- extraComponentProps = _ref2.extraComponentProps;
328
+ function getPortalChildren(_ref3) {
329
+ var dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
330
+ currentNode = _ref3.currentNode,
331
+ nodeViewParams = _ref3.nodeViewParams,
332
+ Component = _ref3.Component,
333
+ extraComponentProps = _ref3.extraComponentProps;
280
334
  return function portalChildren() {
281
335
  var _currentNode$type$nam, _currentNode$type2;
282
336
  // All inline nodes use `display: inline` to allow for multi-line
@@ -347,18 +401,22 @@ function getPortalChildren(_ref2) {
347
401
  // [nodeViewName: string]: NodeViewProducer
348
402
  // }
349
403
 
404
+ var counterPerEditorViewMap = new WeakMap();
350
405
  // This return of this function is intended to be the value of a key
351
406
  // in a ProseMirror nodeViews object.
352
- function getInlineNodeViewProducer(_ref3) {
353
- var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
354
- Component = _ref3.Component,
355
- extraComponentProps = _ref3.extraComponentProps,
356
- extraNodeViewProps = _ref3.extraNodeViewProps;
407
+ function getInlineNodeViewProducer(_ref4) {
408
+ var pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
409
+ Component = _ref4.Component,
410
+ extraComponentProps = _ref4.extraComponentProps,
411
+ extraNodeViewProps = _ref4.extraNodeViewProps;
357
412
  function nodeViewProducer() {
358
- var nodeView = createNodeView({
413
+ var _node$type;
414
+ var view = arguments.length <= 1 ? undefined : arguments[1];
415
+ var node = arguments.length <= 0 ? undefined : arguments[0];
416
+ var parameters = {
359
417
  nodeViewParams: {
360
- node: arguments.length <= 0 ? undefined : arguments[0],
361
- view: arguments.length <= 1 ? undefined : arguments[1],
418
+ node: node,
419
+ view: view,
362
420
  getPos: arguments.length <= 2 ? undefined : arguments[2],
363
421
  decorations: arguments.length <= 3 ? undefined : arguments[3]
364
422
  },
@@ -366,8 +424,29 @@ function getInlineNodeViewProducer(_ref3) {
366
424
  Component: Component,
367
425
  extraComponentProps: extraComponentProps,
368
426
  extraNodeViewProps: extraNodeViewProps
369
- });
370
- return nodeView;
427
+ };
428
+ var isNodeTypeAllowedToBeVirtualized = virtualizedNodeAllowlist.includes((node === null || node === void 0 || (_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) || '');
429
+ if (!isNodeTypeAllowedToBeVirtualized || isSSR) {
430
+ return createNodeView(parameters);
431
+ }
432
+ if ((0, _platformFeatureFlags.fg)('platform_editor_inline_node_virt_threshold_override')) {
433
+ return createNodeViewVirtualized(parameters);
434
+ }
435
+ var inlineNodeViewsVirtualizationCounter = counterPerEditorViewMap.get(view) || 0;
436
+ inlineNodeViewsVirtualizationCounter += 1;
437
+ counterPerEditorViewMap.set(view, inlineNodeViewsVirtualizationCounter);
438
+
439
+ // We never virtualize the 100th first elements
440
+ if (inlineNodeViewsVirtualizationCounter <= 100) {
441
+ return createNodeView(parameters);
442
+ }
443
+ if (
444
+ // Due to the experiment, we need to check experiment exposure
445
+ // when a document has more than 100 (virtulizables) nodes.
446
+ checkExperimentExposure()) {
447
+ return createNodeViewVirtualized(parameters);
448
+ }
449
+ return createNodeView(parameters);
371
450
  }
372
451
  return nodeViewProducer;
373
452
  }
@@ -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 = "102.13.2";
26
+ var packageVersion = "102.13.4";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -256,8 +256,8 @@ var getNodeNameById = function getNodeNameById(id, allNodes) {
256
256
  if ((0, _typeof2.default)(id) === 'object') {
257
257
  var name;
258
258
  id.forEach(function (localId) {
259
- var _name, _allNodes$localId;
260
- name = (_name = name) !== null && _name !== void 0 ? _name : (_allNodes$localId = allNodes[localId]) === null || _allNodes$localId === void 0 ? void 0 : _allNodes$localId.name;
259
+ var _allNodes$localId;
260
+ name = name !== null && name !== void 0 ? name : (_allNodes$localId = allNodes[localId]) === null || _allNodes$localId === void 0 ? void 0 : _allNodes$localId.name;
261
261
  });
262
262
  return name || null;
263
263
  }
@@ -216,6 +216,7 @@ export let TRIGGER_METHOD = /*#__PURE__*/function (TRIGGER_METHOD) {
216
216
  TRIGGER_METHOD["KEYBOARD"] = "keyboard";
217
217
  TRIGGER_METHOD["SHORTCUT"] = "shortcut";
218
218
  TRIGGER_METHOD["TOOLBAR"] = "toolbar";
219
+ TRIGGER_METHOD["EXTERNAL"] = "external";
219
220
  return TRIGGER_METHOD;
220
221
  }({});
221
222
  export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
@@ -4,13 +4,12 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
 
7
- import React, { Fragment, useEffect } from 'react';
7
+ import React, { Fragment } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { jsx } from '@emotion/react';
11
11
  import classnames from 'classnames';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
13
  import { useSharedPluginState } from '../../../hooks';
15
14
  import { overflowShadow } from '../../../ui';
16
15
  import { calculateBreakoutStyles } from '../../../utils';
@@ -124,30 +123,6 @@ function ExtensionWithPluginState(props) {
124
123
  setIsNodeHovered(didHover);
125
124
  }
126
125
  };
127
- const shouldFireNbmExperimentExposure = React.useMemo(() => {
128
- if (node.type.name === 'extension' && typeof getPos === 'function') {
129
- const pos = getPos();
130
- if (!isNaN(pos)) {
131
- var _view$state$doc$resol, _view$state$doc$resol2;
132
- const parentNameType = (_view$state$doc$resol = view.state.doc.resolve(pos).parent) === null || _view$state$doc$resol === void 0 ? void 0 : (_view$state$doc$resol2 = _view$state$doc$resol.type) === null || _view$state$doc$resol2 === void 0 ? void 0 : _view$state$doc$resol2.name;
133
- if (['listItem', 'nestedExpand', 'blockquote', 'panel'].includes(parentNameType)) {
134
- return true;
135
- }
136
- }
137
- }
138
- return false;
139
- }, [node, getPos, view]);
140
- useEffect(() => {
141
- if (shouldFireNbmExperimentExposure) {
142
- // No-op editorExperiment evaluation to track usage of nested non-bodied macros
143
- // these can't be tracked at the point of diversion of the experience because that is a toggle of the
144
- // ProseMirror schema nodes for listItems, nestedExpand, blockquote, and panel. At that point the customer
145
- // has not yet been exposed
146
- editorExperiment('platform_editor_nested_non_bodied_macros', 'test', {
147
- exposure: true
148
- });
149
- }
150
- }, [shouldFireNbmExperimentExposure]);
151
126
  return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
152
127
  isNodeSelected: isNodeSelected,
153
128
  isNodeHovered: isNodeHovered,
@@ -60,6 +60,11 @@ export const linkToolbarMessages = defineMessages({
60
60
  defaultMessage: 'Go to Link Preferences',
61
61
  description: 'Go to Link Preferences'
62
62
  },
63
+ preferencesLink: {
64
+ id: 'fabric.editor.preferencesLink',
65
+ defaultMessage: 'Link preferences',
66
+ description: 'Go to link preferences'
67
+ },
63
68
  editDatasource: {
64
69
  id: 'fabric.editor.edit.datasource',
65
70
  defaultMessage: 'Edit search query',
@@ -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 = "102.13.2";
4
+ const packageVersion = "102.13.4";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007