@atlaskit/editor-common 111.8.0 → 111.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f0124a523d8f1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f0124a523d8f1) -
8
+ [ux] [EDITOR-2845] Implement synced location for source and reference sync block
9
+
10
+ ## 111.8.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`1f4c761b661e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f4c761b661e1) -
15
+ [ux] EDITOR-4174 wrap synced block and bodied sync block with sentry error boundaries
16
+ - Updated dependencies
17
+
3
18
  ## 111.8.0
4
19
 
5
20
  ### Minor Changes
@@ -537,6 +537,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
537
537
  ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
538
538
  ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
539
539
  ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
540
+ ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
540
541
  ACTION_SUBJECT_ID["TABLE_STICKY_HEADER"] = "tableStickyHeader";
541
542
  return ACTION_SUBJECT_ID;
542
543
  }({});
@@ -205,5 +205,50 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
205
205
  id: 'fabric.editor.syncBlockCopiedAction',
206
206
  defaultMessage: 'Learn more',
207
207
  description: 'Action in flag which appears when a sync block is copied to learn more'
208
+ },
209
+ syncedLocationDropdownTitle: {
210
+ id: 'fabric.editor.syncedLocationDropdownTitle',
211
+ defaultMessage: 'Synced locations',
212
+ description: 'Title for the dropdown menu that shows the synced (referenced) locations of the source sync block'
213
+ },
214
+ syncedLocationDropdownHeading: {
215
+ id: 'fabric.editor.syncedLocationDropdownHeading',
216
+ defaultMessage: '{count} locations:',
217
+ description: 'Heading for the dropdown menu that shows the synced (referenced) locations of the source sync block'
218
+ },
219
+ syncedLocationDropdownError: {
220
+ id: 'fabric.editor.syncedLocationDropdownError',
221
+ defaultMessage: "We can't load locations right now. Please wait a few minutes and refresh your browser.",
222
+ description: 'Error message shown in the synced location dropdown menu when fail to fetch the synced (referenced) locations of the source sync block'
223
+ },
224
+ syncedLocationDropdownNoResults: {
225
+ id: 'fabric.editor.syncedLocationDropdownNoResults',
226
+ defaultMessage: 'Copy and paste synced blocks to reuse in other locations.',
227
+ description: 'Message shown in the synced location dropdown menu when no shared locations are found'
228
+ },
229
+ syncedLocationDropdownLearnMoreLink: {
230
+ id: 'fabric.editor.syncedLocationDropdownLearnMoreLink',
231
+ defaultMessage: 'Learn more about synced blocks',
232
+ description: 'Link shown in the synced location dropdown menu to learn more about synced blocks'
233
+ },
234
+ syncedLocationDropdownSamePage: {
235
+ id: 'fabric.editor.syncedLocationDropdownSamePage',
236
+ defaultMessage: 'This page',
237
+ description: 'Message shown in the synced location dropdown option when the reference sync block is on the same page'
238
+ },
239
+ syncedLocationDropdownTitleBlockIndex: {
240
+ id: 'fabric.editor.syncedLocationDropdownTitleNote',
241
+ defaultMessage: 'block {index}',
242
+ description: 'Suffix for page title shown in synced location dropdown option when there are multiple references to the same page'
243
+ },
244
+ syncedLocationDropdownTitleNote: {
245
+ id: 'fabric.editor.syncedLocationDropdownTitleNote',
246
+ defaultMessage: 'This page',
247
+ description: 'Note shown next to the page title in the synced location dropdown option when the sync block is on the current page'
248
+ },
249
+ syncedLocationDropdownSourceLozenge: {
250
+ id: 'fabric.editor.syncedLocationDropdownSourceLozenge',
251
+ defaultMessage: 'Source',
252
+ description: 'Lozenge label shown in the synced location dropdown option when the sync block is source'
208
253
  }
209
254
  });
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "111.7.4";
22
+ var packageVersion = "111.8.1";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "111.7.4";
27
+ var packageVersion = "111.8.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
4
+ var _typeof3 = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
@@ -9,23 +9,26 @@ exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
12
13
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
14
  var _react = _interopRequireWildcard(require("react"));
14
15
  var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
15
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
+ var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
18
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
19
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
17
20
  var _Pulse = require("../Pulse/Pulse");
18
21
  var _ButtonSpotlightCard = require("./ButtonSpotlightCard");
19
22
  var _styles = require("./styles");
20
23
  var _excluded = ["buttonStyles"];
21
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
27
  var customSizeAndPadding = {
25
28
  minWidth: "var(--ds-space-400, 32px)",
26
29
  padding: "0px ".concat("var(--ds-space-050, 4px)")
27
30
  };
28
- var _default = exports.default = function _default(_ref) {
31
+ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
29
32
  var title = _ref.title,
30
33
  icon = _ref.icon,
31
34
  iconAfter = _ref.iconAfter,
@@ -103,7 +106,14 @@ var _default = exports.default = function _default(_ref) {
103
106
  , {
104
107
  className: className,
105
108
  ref: function ref(buttonElement) {
106
- return setSpotlightReferenceElement(buttonElement);
109
+ setSpotlightReferenceElement(buttonElement);
110
+ if (forwardedRef && (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
111
+ if (typeof forwardedRef === 'function') {
112
+ forwardedRef(buttonElement);
113
+ } else if ((0, _typeof2.default)(forwardedRef) === 'object') {
114
+ forwardedRef.current = buttonElement;
115
+ }
116
+ }
107
117
  }
108
118
  // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
109
119
  ,
@@ -151,4 +161,7 @@ var _default = exports.default = function _default(_ref) {
151
161
  // Ignored via go/ees005
152
162
  // eslint-disable-next-line react/jsx-props-no-spreading
153
163
  }, spotlightConfig.spotlightCardOptions)));
154
- };
164
+ };
165
+ var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
166
+ return (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding');
167
+ }, /*#__PURE__*/(0, _react.forwardRef)(FloatingToolbarButton), FloatingToolbarButton);
@@ -531,6 +531,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
531
531
  ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
532
532
  ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
533
533
  ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
534
+ ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
534
535
  ACTION_SUBJECT_ID["TABLE_STICKY_HEADER"] = "tableStickyHeader";
535
536
  return ACTION_SUBJECT_ID;
536
537
  }({});
@@ -199,5 +199,50 @@ export const syncBlockMessages = defineMessages({
199
199
  id: 'fabric.editor.syncBlockCopiedAction',
200
200
  defaultMessage: 'Learn more',
201
201
  description: 'Action in flag which appears when a sync block is copied to learn more'
202
+ },
203
+ syncedLocationDropdownTitle: {
204
+ id: 'fabric.editor.syncedLocationDropdownTitle',
205
+ defaultMessage: 'Synced locations',
206
+ description: 'Title for the dropdown menu that shows the synced (referenced) locations of the source sync block'
207
+ },
208
+ syncedLocationDropdownHeading: {
209
+ id: 'fabric.editor.syncedLocationDropdownHeading',
210
+ defaultMessage: '{count} locations:',
211
+ description: 'Heading for the dropdown menu that shows the synced (referenced) locations of the source sync block'
212
+ },
213
+ syncedLocationDropdownError: {
214
+ id: 'fabric.editor.syncedLocationDropdownError',
215
+ defaultMessage: "We can't load locations right now. Please wait a few minutes and refresh your browser.",
216
+ description: 'Error message shown in the synced location dropdown menu when fail to fetch the synced (referenced) locations of the source sync block'
217
+ },
218
+ syncedLocationDropdownNoResults: {
219
+ id: 'fabric.editor.syncedLocationDropdownNoResults',
220
+ defaultMessage: 'Copy and paste synced blocks to reuse in other locations.',
221
+ description: 'Message shown in the synced location dropdown menu when no shared locations are found'
222
+ },
223
+ syncedLocationDropdownLearnMoreLink: {
224
+ id: 'fabric.editor.syncedLocationDropdownLearnMoreLink',
225
+ defaultMessage: 'Learn more about synced blocks',
226
+ description: 'Link shown in the synced location dropdown menu to learn more about synced blocks'
227
+ },
228
+ syncedLocationDropdownSamePage: {
229
+ id: 'fabric.editor.syncedLocationDropdownSamePage',
230
+ defaultMessage: 'This page',
231
+ description: 'Message shown in the synced location dropdown option when the reference sync block is on the same page'
232
+ },
233
+ syncedLocationDropdownTitleBlockIndex: {
234
+ id: 'fabric.editor.syncedLocationDropdownTitleNote',
235
+ defaultMessage: 'block {index}',
236
+ description: 'Suffix for page title shown in synced location dropdown option when there are multiple references to the same page'
237
+ },
238
+ syncedLocationDropdownTitleNote: {
239
+ id: 'fabric.editor.syncedLocationDropdownTitleNote',
240
+ defaultMessage: 'This page',
241
+ description: 'Note shown next to the page title in the synced location dropdown option when the sync block is on the current page'
242
+ },
243
+ syncedLocationDropdownSourceLozenge: {
244
+ id: 'fabric.editor.syncedLocationDropdownSourceLozenge',
245
+ defaultMessage: 'Source',
246
+ description: 'Lozenge label shown in the synced location dropdown option when the sync block is source'
202
247
  }
203
248
  });
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "111.7.4";
7
+ const packageVersion = "111.8.1";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "111.7.4";
17
+ const packageVersion = "111.8.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,7 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useCallback, useEffect, useState } from 'react';
2
+ import React, { forwardRef, useCallback, useEffect, useState } from 'react';
3
3
  import Button from '@atlaskit/button/custom-theme-button';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
6
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
7
  import Tooltip from '@atlaskit/tooltip';
6
8
  import { Pulse } from '../Pulse/Pulse';
7
9
  import { ButtonSpotlightCard } from './ButtonSpotlightCard';
@@ -10,7 +12,7 @@ const customSizeAndPadding = {
10
12
  minWidth: "var(--ds-space-400, 32px)",
11
13
  padding: `0px ${"var(--ds-space-050, 4px)"}`
12
14
  };
13
- export default (({
15
+ const FloatingToolbarButton = ({
14
16
  title,
15
17
  icon,
16
18
  iconAfter,
@@ -42,7 +44,7 @@ export default (({
42
44
  pulse,
43
45
  spotlightConfig,
44
46
  areAnyNewToolbarFlagsEnabled
45
- }) => {
47
+ }, forwardedRef) => {
46
48
  // Check if there's only an icon and add additional styles
47
49
  const iconOnly = (icon || iconAfter) && !children;
48
50
  const customSpacing = iconOnly ? iconOnlySpacing : {};
@@ -81,7 +83,16 @@ export default (({
81
83
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
82
84
  , {
83
85
  className: className,
84
- ref: buttonElement => setSpotlightReferenceElement(buttonElement)
86
+ ref: buttonElement => {
87
+ setSpotlightReferenceElement(buttonElement);
88
+ if (forwardedRef && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding')) {
89
+ if (typeof forwardedRef === 'function') {
90
+ forwardedRef(buttonElement);
91
+ } else if (typeof forwardedRef === 'object') {
92
+ forwardedRef.current = buttonElement;
93
+ }
94
+ }
95
+ }
85
96
  // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
86
97
  ,
87
98
  theme: (adgTheme, themeProps) => {
@@ -135,4 +146,5 @@ export default (({
135
146
  // Ignored via go/ees005
136
147
  // eslint-disable-next-line react/jsx-props-no-spreading
137
148
  }, spotlightConfig.spotlightCardOptions)));
138
- });
149
+ };
150
+ export default componentWithCondition(() => editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding'), /*#__PURE__*/forwardRef(FloatingToolbarButton), FloatingToolbarButton);
@@ -531,6 +531,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
531
531
  ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
532
532
  ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
533
533
  ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
534
+ ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
534
535
  ACTION_SUBJECT_ID["TABLE_STICKY_HEADER"] = "tableStickyHeader";
535
536
  return ACTION_SUBJECT_ID;
536
537
  }({});
@@ -199,5 +199,50 @@ export var syncBlockMessages = defineMessages({
199
199
  id: 'fabric.editor.syncBlockCopiedAction',
200
200
  defaultMessage: 'Learn more',
201
201
  description: 'Action in flag which appears when a sync block is copied to learn more'
202
+ },
203
+ syncedLocationDropdownTitle: {
204
+ id: 'fabric.editor.syncedLocationDropdownTitle',
205
+ defaultMessage: 'Synced locations',
206
+ description: 'Title for the dropdown menu that shows the synced (referenced) locations of the source sync block'
207
+ },
208
+ syncedLocationDropdownHeading: {
209
+ id: 'fabric.editor.syncedLocationDropdownHeading',
210
+ defaultMessage: '{count} locations:',
211
+ description: 'Heading for the dropdown menu that shows the synced (referenced) locations of the source sync block'
212
+ },
213
+ syncedLocationDropdownError: {
214
+ id: 'fabric.editor.syncedLocationDropdownError',
215
+ defaultMessage: "We can't load locations right now. Please wait a few minutes and refresh your browser.",
216
+ description: 'Error message shown in the synced location dropdown menu when fail to fetch the synced (referenced) locations of the source sync block'
217
+ },
218
+ syncedLocationDropdownNoResults: {
219
+ id: 'fabric.editor.syncedLocationDropdownNoResults',
220
+ defaultMessage: 'Copy and paste synced blocks to reuse in other locations.',
221
+ description: 'Message shown in the synced location dropdown menu when no shared locations are found'
222
+ },
223
+ syncedLocationDropdownLearnMoreLink: {
224
+ id: 'fabric.editor.syncedLocationDropdownLearnMoreLink',
225
+ defaultMessage: 'Learn more about synced blocks',
226
+ description: 'Link shown in the synced location dropdown menu to learn more about synced blocks'
227
+ },
228
+ syncedLocationDropdownSamePage: {
229
+ id: 'fabric.editor.syncedLocationDropdownSamePage',
230
+ defaultMessage: 'This page',
231
+ description: 'Message shown in the synced location dropdown option when the reference sync block is on the same page'
232
+ },
233
+ syncedLocationDropdownTitleBlockIndex: {
234
+ id: 'fabric.editor.syncedLocationDropdownTitleNote',
235
+ defaultMessage: 'block {index}',
236
+ description: 'Suffix for page title shown in synced location dropdown option when there are multiple references to the same page'
237
+ },
238
+ syncedLocationDropdownTitleNote: {
239
+ id: 'fabric.editor.syncedLocationDropdownTitleNote',
240
+ defaultMessage: 'This page',
241
+ description: 'Note shown next to the page title in the synced location dropdown option when the sync block is on the current page'
242
+ },
243
+ syncedLocationDropdownSourceLozenge: {
244
+ id: 'fabric.editor.syncedLocationDropdownSourceLozenge',
245
+ defaultMessage: 'Source',
246
+ description: 'Lozenge label shown in the synced location dropdown option when the sync block is source'
202
247
  }
203
248
  });
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "111.7.4";
13
+ var packageVersion = "111.8.1";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "111.7.4";
24
+ var packageVersion = "111.8.1";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,13 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ import _typeof from "@babel/runtime/helpers/typeof";
4
5
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
6
  var _excluded = ["buttonStyles"];
6
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- import React, { useCallback, useEffect, useState } from 'react';
9
+ import React, { forwardRef, useCallback, useEffect, useState } from 'react';
9
10
  import Button from '@atlaskit/button/custom-theme-button';
10
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
13
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
14
  import Tooltip from '@atlaskit/tooltip';
12
15
  import { Pulse } from '../Pulse/Pulse';
13
16
  import { ButtonSpotlightCard } from './ButtonSpotlightCard';
@@ -16,7 +19,7 @@ var customSizeAndPadding = {
16
19
  minWidth: "var(--ds-space-400, 32px)",
17
20
  padding: "0px ".concat("var(--ds-space-050, 4px)")
18
21
  };
19
- export default (function (_ref) {
22
+ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
20
23
  var title = _ref.title,
21
24
  icon = _ref.icon,
22
25
  iconAfter = _ref.iconAfter,
@@ -94,7 +97,14 @@ export default (function (_ref) {
94
97
  , {
95
98
  className: className,
96
99
  ref: function ref(buttonElement) {
97
- return setSpotlightReferenceElement(buttonElement);
100
+ setSpotlightReferenceElement(buttonElement);
101
+ if (forwardedRef && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding')) {
102
+ if (typeof forwardedRef === 'function') {
103
+ forwardedRef(buttonElement);
104
+ } else if (_typeof(forwardedRef) === 'object') {
105
+ forwardedRef.current = buttonElement;
106
+ }
107
+ }
98
108
  }
99
109
  // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
100
110
  ,
@@ -142,4 +152,7 @@ export default (function (_ref) {
142
152
  // Ignored via go/ees005
143
153
  // eslint-disable-next-line react/jsx-props-no-spreading
144
154
  }, spotlightConfig.spotlightCardOptions)));
145
- });
155
+ };
156
+ export default componentWithCondition(function () {
157
+ return editorExperiment('platform_synced_block', true) && fg('platform_synced_block_dogfooding');
158
+ }, /*#__PURE__*/forwardRef(FloatingToolbarButton), FloatingToolbarButton);
@@ -523,6 +523,7 @@ export declare enum ACTION_SUBJECT_ID {
523
523
  REFERENCE_SYNCED_BLOCK_DELETE = "referenceSyncedBlockDelete",
524
524
  SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
525
525
  SYNCED_BLOCK_FETCH = "syncedBlockFetch",
526
+ SYNCED_BLOCK_FETCH_REFERENCES = "syncedBlockFetchReferences",
526
527
  TABLE_STICKY_HEADER = "tableStickyHeader"
527
528
  }
528
529
  export declare enum FLOATING_CONTROLS_TITLE {
@@ -159,7 +159,7 @@ export type ErrorEventAttributes = {
159
159
  outdatedBrowser?: boolean;
160
160
  product?: string;
161
161
  };
162
- type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.BLOCK_MENU | ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes>;
162
+ type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.BLOCK_MENU | ACTION_SUBJECT.SYNCED_BLOCK | ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes>;
163
163
  type ComponentCrashAdditionalInfoErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED_ADDITIONAL_INFORMATION, ACTION_SUBJECT.EDITOR, undefined, {
164
164
  errorId: string;
165
165
  }>;
@@ -12,6 +12,7 @@ export type SyncedBlockCreateErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJ
12
12
  export type SyncedBlockDeleteErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_DELETE, SyncedBlockErrorAttributes>;
13
13
  export type SyncedBlockGetSourceInfoErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_GET_SOURCE_INFO, SyncedBlockErrorAttributes>;
14
14
  export type SyncedBlockFetchErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH, SyncedBlockErrorAttributes>;
15
- export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockCreateErrorAEP | SyncedBlockDeleteErrorAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
15
+ export type SyncedBlockFetchReferencesErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH_REFERENCES, SyncedBlockErrorAttributes>;
16
+ export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockCreateErrorAEP | SyncedBlockDeleteErrorAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload | SyncedBlockFetchReferencesErrorAEP;
16
17
  export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
17
18
  export {};
@@ -199,4 +199,49 @@ export declare const syncBlockMessages: {
199
199
  defaultMessage: string;
200
200
  description: string;
201
201
  };
202
+ syncedLocationDropdownTitle: {
203
+ id: string;
204
+ defaultMessage: string;
205
+ description: string;
206
+ };
207
+ syncedLocationDropdownHeading: {
208
+ id: string;
209
+ defaultMessage: string;
210
+ description: string;
211
+ };
212
+ syncedLocationDropdownError: {
213
+ id: string;
214
+ defaultMessage: string;
215
+ description: string;
216
+ };
217
+ syncedLocationDropdownNoResults: {
218
+ id: string;
219
+ defaultMessage: string;
220
+ description: string;
221
+ };
222
+ syncedLocationDropdownLearnMoreLink: {
223
+ id: string;
224
+ defaultMessage: string;
225
+ description: string;
226
+ };
227
+ syncedLocationDropdownSamePage: {
228
+ id: string;
229
+ defaultMessage: string;
230
+ description: string;
231
+ };
232
+ syncedLocationDropdownTitleBlockIndex: {
233
+ id: string;
234
+ defaultMessage: string;
235
+ description: string;
236
+ };
237
+ syncedLocationDropdownTitleNote: {
238
+ id: string;
239
+ defaultMessage: string;
240
+ description: string;
241
+ };
242
+ syncedLocationDropdownSourceLozenge: {
243
+ id: string;
244
+ defaultMessage: string;
245
+ description: string;
246
+ };
202
247
  };
@@ -36,5 +36,5 @@ export interface Props {
36
36
  tooltipContent?: TooltipProps['content'];
37
37
  tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
38
38
  }
39
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onMount, onUnmount, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, interactionName, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, pulse, spotlightConfig, areAnyNewToolbarFlagsEnabled, }: Props) => React.JSX.Element;
39
+ declare const _default: React.FC<Omit<Props & React.RefAttributes<HTMLElement>, "ref"> & Props & React.RefAttributes<HTMLElement>>;
40
40
  export default _default;
@@ -523,6 +523,7 @@ export declare enum ACTION_SUBJECT_ID {
523
523
  REFERENCE_SYNCED_BLOCK_DELETE = "referenceSyncedBlockDelete",
524
524
  SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
525
525
  SYNCED_BLOCK_FETCH = "syncedBlockFetch",
526
+ SYNCED_BLOCK_FETCH_REFERENCES = "syncedBlockFetchReferences",
526
527
  TABLE_STICKY_HEADER = "tableStickyHeader"
527
528
  }
528
529
  export declare enum FLOATING_CONTROLS_TITLE {
@@ -159,7 +159,7 @@ export type ErrorEventAttributes = {
159
159
  outdatedBrowser?: boolean;
160
160
  product?: string;
161
161
  };
162
- type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.BLOCK_MENU | ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes>;
162
+ type ComponentCrashErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED, ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON | ACTION_SUBJECT.PLUGIN_SLOT | ACTION_SUBJECT.REACT_NODE_VIEW | ACTION_SUBJECT.TABLES_PLUGIN | ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN | ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.BLOCK_MENU | ACTION_SUBJECT.SYNCED_BLOCK | ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID | FLOATING_CONTROLS_TITLE, ErrorEventAttributes>;
163
163
  type ComponentCrashAdditionalInfoErrorAEP = OperationalAEP<ACTION.EDITOR_CRASHED_ADDITIONAL_INFORMATION, ACTION_SUBJECT.EDITOR, undefined, {
164
164
  errorId: string;
165
165
  }>;
@@ -12,6 +12,7 @@ export type SyncedBlockCreateErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJ
12
12
  export type SyncedBlockDeleteErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_DELETE, SyncedBlockErrorAttributes>;
13
13
  export type SyncedBlockGetSourceInfoErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_GET_SOURCE_INFO, SyncedBlockErrorAttributes>;
14
14
  export type SyncedBlockFetchErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH, SyncedBlockErrorAttributes>;
15
- export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockCreateErrorAEP | SyncedBlockDeleteErrorAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
15
+ export type SyncedBlockFetchReferencesErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH_REFERENCES, SyncedBlockErrorAttributes>;
16
+ export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockCreateErrorAEP | SyncedBlockDeleteErrorAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload | SyncedBlockFetchReferencesErrorAEP;
16
17
  export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
17
18
  export {};
@@ -199,4 +199,49 @@ export declare const syncBlockMessages: {
199
199
  defaultMessage: string;
200
200
  description: string;
201
201
  };
202
+ syncedLocationDropdownTitle: {
203
+ id: string;
204
+ defaultMessage: string;
205
+ description: string;
206
+ };
207
+ syncedLocationDropdownHeading: {
208
+ id: string;
209
+ defaultMessage: string;
210
+ description: string;
211
+ };
212
+ syncedLocationDropdownError: {
213
+ id: string;
214
+ defaultMessage: string;
215
+ description: string;
216
+ };
217
+ syncedLocationDropdownNoResults: {
218
+ id: string;
219
+ defaultMessage: string;
220
+ description: string;
221
+ };
222
+ syncedLocationDropdownLearnMoreLink: {
223
+ id: string;
224
+ defaultMessage: string;
225
+ description: string;
226
+ };
227
+ syncedLocationDropdownSamePage: {
228
+ id: string;
229
+ defaultMessage: string;
230
+ description: string;
231
+ };
232
+ syncedLocationDropdownTitleBlockIndex: {
233
+ id: string;
234
+ defaultMessage: string;
235
+ description: string;
236
+ };
237
+ syncedLocationDropdownTitleNote: {
238
+ id: string;
239
+ defaultMessage: string;
240
+ description: string;
241
+ };
242
+ syncedLocationDropdownSourceLozenge: {
243
+ id: string;
244
+ defaultMessage: string;
245
+ description: string;
246
+ };
202
247
  };
@@ -36,5 +36,5 @@ export interface Props {
36
36
  tooltipContent?: TooltipProps['content'];
37
37
  tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
38
38
  }
39
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onMount, onUnmount, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, interactionName, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, pulse, spotlightConfig, areAnyNewToolbarFlagsEnabled, }: Props) => React.JSX.Element;
39
+ declare const _default: React.FC<Omit<Props & React.RefAttributes<HTMLElement>, "ref"> & Props & React.RefAttributes<HTMLElement>>;
40
40
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.8.0",
3
+ "version": "111.8.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/"
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/platform-feature-flags": "^1.1.0",
70
70
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
71
71
  "@atlaskit/popper": "^7.1.0",
72
- "@atlaskit/primitives": "^17.0.0",
72
+ "@atlaskit/primitives": "^17.1.0",
73
73
  "@atlaskit/profilecard": "^24.30.0",
74
74
  "@atlaskit/prosemirror-history": "^0.2.0",
75
75
  "@atlaskit/react-ufo": "^4.17.0",
@@ -81,7 +81,7 @@
81
81
  "@atlaskit/task-decision": "^19.2.0",
82
82
  "@atlaskit/textfield": "^8.2.0",
83
83
  "@atlaskit/theme": "^21.0.0",
84
- "@atlaskit/tmp-editor-statsig": "^16.19.0",
84
+ "@atlaskit/tmp-editor-statsig": "^16.22.0",
85
85
  "@atlaskit/tokens": "^9.1.0",
86
86
  "@atlaskit/tooltip": "^20.14.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",