@atlaskit/editor-common 111.8.1 → 111.8.3
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 +16 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +61 -18
- package/dist/cjs/messages/syncBlock.js +45 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +18 -5
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +31 -6
- package/dist/es2019/messages/syncBlock.js +45 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +17 -5
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +62 -19
- package/dist/esm/messages/syncBlock.js +45 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +17 -4
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/sync-block-events.d.ts +2 -1
- package/dist/types/messages/syncBlock.d.ts +45 -0
- package/dist/types/ui/FloatingToolbar/Button.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/sync-block-events.d.ts +2 -1
- package/dist/types-ts4.5/messages/syncBlock.d.ts +45 -0
- package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ef0c088fb17f6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef0c088fb17f6) -
|
|
8
|
+
[ux] Fix the flickering extensions icon issue in the table's floating toolbar `View more` dropdown
|
|
9
|
+
options.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 111.8.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`f0124a523d8f1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f0124a523d8f1) -
|
|
17
|
+
[ux] [EDITOR-2845] Implement synced location for source and reference sync block
|
|
18
|
+
|
|
3
19
|
## 111.8.1
|
|
4
20
|
|
|
5
21
|
### Patch 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
|
}({});
|
|
@@ -8,14 +8,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.DropdownMenuExtensionItems = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
16
|
var _extensions = require("../extensions");
|
|
15
17
|
var _utils = require("../utils");
|
|
16
18
|
var _DropdownMenuItem = require("./DropdownMenuItem");
|
|
17
19
|
var _DropdownSeparator = require("./DropdownSeparator");
|
|
18
20
|
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
19
23
|
var noop = function noop() {
|
|
20
24
|
return null;
|
|
21
25
|
};
|
|
@@ -53,7 +57,8 @@ var convertExtensionToDropdownMenuItem = function convertExtensionToDropdownMenu
|
|
|
53
57
|
var item = _ref2.item,
|
|
54
58
|
disabled = _ref2.disabled,
|
|
55
59
|
node = _ref2.node,
|
|
56
|
-
extension = _ref2.extension
|
|
60
|
+
extension = _ref2.extension,
|
|
61
|
+
IconComponent = _ref2.IconComponent;
|
|
57
62
|
var ButtonIcon = item.icon ? (0, _reactLoadable.default)({
|
|
58
63
|
// Ignored via go/ees005
|
|
59
64
|
// eslint-disable-next-line require-await
|
|
@@ -85,11 +90,20 @@ var convertExtensionToDropdownMenuItem = function convertExtensionToDropdownMenu
|
|
|
85
90
|
title = item.ariaLabel;
|
|
86
91
|
}
|
|
87
92
|
item.disabled = (disabled === null || disabled === void 0 ? void 0 : disabled(item.key)) || false;
|
|
93
|
+
var getIcon = function getIcon() {
|
|
94
|
+
var label = item.label || '';
|
|
95
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true)) {
|
|
96
|
+
return IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
97
|
+
label: label
|
|
98
|
+
}) : undefined;
|
|
99
|
+
}
|
|
100
|
+
return ButtonIcon ? /*#__PURE__*/_react.default.createElement(ButtonIcon, {
|
|
101
|
+
label: label
|
|
102
|
+
}) : undefined;
|
|
103
|
+
};
|
|
88
104
|
return {
|
|
89
105
|
title: title,
|
|
90
|
-
icon:
|
|
91
|
-
label: item.label || ''
|
|
92
|
-
}) : undefined,
|
|
106
|
+
icon: getIcon(),
|
|
93
107
|
disabled: item.disabled,
|
|
94
108
|
onClick: function onClick() {
|
|
95
109
|
if (typeof item.action !== 'function') {
|
|
@@ -102,18 +116,47 @@ var convertExtensionToDropdownMenuItem = function convertExtensionToDropdownMenu
|
|
|
102
116
|
};
|
|
103
117
|
};
|
|
104
118
|
var DropdownMenuExtensionItem = function DropdownMenuExtensionItem(_ref3) {
|
|
119
|
+
var _iconRef$current;
|
|
105
120
|
var item = _ref3.item,
|
|
106
121
|
editorView = _ref3.editorView,
|
|
107
122
|
disabled = _ref3.disabled,
|
|
108
123
|
node = _ref3.node,
|
|
109
124
|
extension = _ref3.extension,
|
|
110
125
|
dropdownOptions = _ref3.dropdownOptions;
|
|
111
|
-
|
|
126
|
+
// Use ref to keep icon component stable across renders
|
|
127
|
+
var iconRef = (0, _react.useRef)(null);
|
|
128
|
+
if (!iconRef.current && item.icon && (0, _expValEquals.expValEquals)('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true)) {
|
|
129
|
+
iconRef.current = (0, _reactLoadable.default)({
|
|
130
|
+
// Ignored via go/ees005
|
|
131
|
+
// eslint-disable-next-line require-await
|
|
132
|
+
loader: function () {
|
|
133
|
+
var _loader2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
134
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
135
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
136
|
+
case 0:
|
|
137
|
+
return _context3.abrupt("return", resolveExtensionIcon(item.icon));
|
|
138
|
+
case 1:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context3.stop();
|
|
141
|
+
}
|
|
142
|
+
}, _callee3);
|
|
143
|
+
}));
|
|
144
|
+
function loader() {
|
|
145
|
+
return _loader2.apply(this, arguments);
|
|
146
|
+
}
|
|
147
|
+
return loader;
|
|
148
|
+
}(),
|
|
149
|
+
loading: noop
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
var dropdownItem = convertExtensionToDropdownMenuItem(_objectSpread({
|
|
112
153
|
item: item,
|
|
113
154
|
disabled: disabled,
|
|
114
155
|
node: node,
|
|
115
156
|
extension: extension
|
|
116
|
-
})
|
|
157
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true) ? {
|
|
158
|
+
IconComponent: (_iconRef$current = iconRef.current) !== null && _iconRef$current !== void 0 ? _iconRef$current : undefined
|
|
159
|
+
} : {}));
|
|
117
160
|
if (!dropdownItem) {
|
|
118
161
|
return null;
|
|
119
162
|
}
|
|
@@ -147,30 +190,30 @@ var DropdownMenuExtensionItems = exports.DropdownMenuExtensionItems = function D
|
|
|
147
190
|
return _getExtensions.apply(this, arguments);
|
|
148
191
|
}
|
|
149
192
|
function _getExtensions() {
|
|
150
|
-
_getExtensions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
193
|
+
_getExtensions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
151
194
|
var provider;
|
|
152
|
-
return _regenerator.default.wrap(function
|
|
153
|
-
while (1) switch (
|
|
195
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
196
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
154
197
|
case 0:
|
|
155
|
-
|
|
198
|
+
_context4.next = 2;
|
|
156
199
|
return extension.extensionProvider;
|
|
157
200
|
case 2:
|
|
158
|
-
provider =
|
|
201
|
+
provider = _context4.sent;
|
|
159
202
|
if (!provider) {
|
|
160
|
-
|
|
203
|
+
_context4.next = 9;
|
|
161
204
|
break;
|
|
162
205
|
}
|
|
163
|
-
|
|
164
|
-
|
|
206
|
+
_context4.t0 = setExtensions;
|
|
207
|
+
_context4.next = 7;
|
|
165
208
|
return provider.getExtensions();
|
|
166
209
|
case 7:
|
|
167
|
-
|
|
168
|
-
(0,
|
|
210
|
+
_context4.t1 = _context4.sent;
|
|
211
|
+
(0, _context4.t0)(_context4.t1);
|
|
169
212
|
case 9:
|
|
170
213
|
case "end":
|
|
171
|
-
return
|
|
214
|
+
return _context4.stop();
|
|
172
215
|
}
|
|
173
|
-
},
|
|
216
|
+
}, _callee4);
|
|
174
217
|
}));
|
|
175
218
|
return _getExtensions.apply(this, arguments);
|
|
176
219
|
}
|
|
@@ -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 = "
|
|
22
|
+
var packageVersion = "0.0.0-development";
|
|
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 = "
|
|
27
|
+
var packageVersion = "0.0.0-development";
|
|
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
|
|
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" !=
|
|
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
|
|
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
|
-
|
|
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
|
}({});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { getContextualToolbarItemsFromModule } from '../extensions';
|
|
4
5
|
import { nodeToJSON } from '../utils';
|
|
5
6
|
import { DropdownMenuItem } from './DropdownMenuItem';
|
|
@@ -19,7 +20,8 @@ const convertExtensionToDropdownMenuItem = ({
|
|
|
19
20
|
item,
|
|
20
21
|
disabled,
|
|
21
22
|
node,
|
|
22
|
-
extension
|
|
23
|
+
extension,
|
|
24
|
+
IconComponent
|
|
23
25
|
}) => {
|
|
24
26
|
const ButtonIcon = item.icon ? Loadable({
|
|
25
27
|
// Ignored via go/ees005
|
|
@@ -36,11 +38,20 @@ const convertExtensionToDropdownMenuItem = ({
|
|
|
36
38
|
title = item.ariaLabel;
|
|
37
39
|
}
|
|
38
40
|
item.disabled = (disabled === null || disabled === void 0 ? void 0 : disabled(item.key)) || false;
|
|
41
|
+
const getIcon = () => {
|
|
42
|
+
const label = item.label || '';
|
|
43
|
+
if (expValEquals('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true)) {
|
|
44
|
+
return IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
45
|
+
label: label
|
|
46
|
+
}) : undefined;
|
|
47
|
+
}
|
|
48
|
+
return ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
49
|
+
label: label
|
|
50
|
+
}) : undefined;
|
|
51
|
+
};
|
|
39
52
|
return {
|
|
40
53
|
title,
|
|
41
|
-
icon:
|
|
42
|
-
label: item.label || ''
|
|
43
|
-
}) : undefined,
|
|
54
|
+
icon: getIcon(),
|
|
44
55
|
disabled: item.disabled,
|
|
45
56
|
onClick: () => {
|
|
46
57
|
if (typeof item.action !== 'function') {
|
|
@@ -60,11 +71,25 @@ const DropdownMenuExtensionItem = ({
|
|
|
60
71
|
extension,
|
|
61
72
|
dropdownOptions
|
|
62
73
|
}) => {
|
|
74
|
+
var _iconRef$current;
|
|
75
|
+
// Use ref to keep icon component stable across renders
|
|
76
|
+
const iconRef = useRef(null);
|
|
77
|
+
if (!iconRef.current && item.icon && expValEquals('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true)) {
|
|
78
|
+
iconRef.current = Loadable({
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line require-await
|
|
81
|
+
loader: async () => resolveExtensionIcon(item.icon),
|
|
82
|
+
loading: noop
|
|
83
|
+
});
|
|
84
|
+
}
|
|
63
85
|
const dropdownItem = convertExtensionToDropdownMenuItem({
|
|
64
86
|
item,
|
|
65
87
|
disabled,
|
|
66
88
|
node,
|
|
67
|
-
extension
|
|
89
|
+
extension,
|
|
90
|
+
...(expValEquals('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true) ? {
|
|
91
|
+
IconComponent: (_iconRef$current = iconRef.current) !== null && _iconRef$current !== void 0 ? _iconRef$current : undefined
|
|
92
|
+
} : {})
|
|
68
93
|
});
|
|
69
94
|
if (!dropdownItem) {
|
|
70
95
|
return null;
|
|
@@ -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 = "
|
|
7
|
+
const packageVersion = "0.0.0-development";
|
|
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 = "
|
|
17
|
+
const packageVersion = "0.0.0-development";
|
|
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
|
-
|
|
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 =>
|
|
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
|
}({});
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
3
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import React, { useEffect, useState } from 'react';
|
|
7
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
5
8
|
import Loadable from 'react-loadable';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
10
|
import { getContextualToolbarItemsFromModule } from '../extensions';
|
|
7
11
|
import { nodeToJSON } from '../utils';
|
|
8
12
|
import { DropdownMenuItem } from './DropdownMenuItem';
|
|
@@ -44,7 +48,8 @@ var convertExtensionToDropdownMenuItem = function convertExtensionToDropdownMenu
|
|
|
44
48
|
var item = _ref2.item,
|
|
45
49
|
disabled = _ref2.disabled,
|
|
46
50
|
node = _ref2.node,
|
|
47
|
-
extension = _ref2.extension
|
|
51
|
+
extension = _ref2.extension,
|
|
52
|
+
IconComponent = _ref2.IconComponent;
|
|
48
53
|
var ButtonIcon = item.icon ? Loadable({
|
|
49
54
|
// Ignored via go/ees005
|
|
50
55
|
// eslint-disable-next-line require-await
|
|
@@ -76,11 +81,20 @@ var convertExtensionToDropdownMenuItem = function convertExtensionToDropdownMenu
|
|
|
76
81
|
title = item.ariaLabel;
|
|
77
82
|
}
|
|
78
83
|
item.disabled = (disabled === null || disabled === void 0 ? void 0 : disabled(item.key)) || false;
|
|
84
|
+
var getIcon = function getIcon() {
|
|
85
|
+
var label = item.label || '';
|
|
86
|
+
if (expValEquals('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true)) {
|
|
87
|
+
return IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
88
|
+
label: label
|
|
89
|
+
}) : undefined;
|
|
90
|
+
}
|
|
91
|
+
return ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
92
|
+
label: label
|
|
93
|
+
}) : undefined;
|
|
94
|
+
};
|
|
79
95
|
return {
|
|
80
96
|
title: title,
|
|
81
|
-
icon:
|
|
82
|
-
label: item.label || ''
|
|
83
|
-
}) : undefined,
|
|
97
|
+
icon: getIcon(),
|
|
84
98
|
disabled: item.disabled,
|
|
85
99
|
onClick: function onClick() {
|
|
86
100
|
if (typeof item.action !== 'function') {
|
|
@@ -93,18 +107,47 @@ var convertExtensionToDropdownMenuItem = function convertExtensionToDropdownMenu
|
|
|
93
107
|
};
|
|
94
108
|
};
|
|
95
109
|
var DropdownMenuExtensionItem = function DropdownMenuExtensionItem(_ref3) {
|
|
110
|
+
var _iconRef$current;
|
|
96
111
|
var item = _ref3.item,
|
|
97
112
|
editorView = _ref3.editorView,
|
|
98
113
|
disabled = _ref3.disabled,
|
|
99
114
|
node = _ref3.node,
|
|
100
115
|
extension = _ref3.extension,
|
|
101
116
|
dropdownOptions = _ref3.dropdownOptions;
|
|
102
|
-
|
|
117
|
+
// Use ref to keep icon component stable across renders
|
|
118
|
+
var iconRef = useRef(null);
|
|
119
|
+
if (!iconRef.current && item.icon && expValEquals('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true)) {
|
|
120
|
+
iconRef.current = Loadable({
|
|
121
|
+
// Ignored via go/ees005
|
|
122
|
+
// eslint-disable-next-line require-await
|
|
123
|
+
loader: function () {
|
|
124
|
+
var _loader2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
125
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
126
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
return _context3.abrupt("return", resolveExtensionIcon(item.icon));
|
|
129
|
+
case 1:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context3.stop();
|
|
132
|
+
}
|
|
133
|
+
}, _callee3);
|
|
134
|
+
}));
|
|
135
|
+
function loader() {
|
|
136
|
+
return _loader2.apply(this, arguments);
|
|
137
|
+
}
|
|
138
|
+
return loader;
|
|
139
|
+
}(),
|
|
140
|
+
loading: noop
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
var dropdownItem = convertExtensionToDropdownMenuItem(_objectSpread({
|
|
103
144
|
item: item,
|
|
104
145
|
disabled: disabled,
|
|
105
146
|
node: node,
|
|
106
147
|
extension: extension
|
|
107
|
-
})
|
|
148
|
+
}, expValEquals('platform_editor_table_toolbar_icon_ext_fix_exp', 'isEnabled', true) ? {
|
|
149
|
+
IconComponent: (_iconRef$current = iconRef.current) !== null && _iconRef$current !== void 0 ? _iconRef$current : undefined
|
|
150
|
+
} : {}));
|
|
108
151
|
if (!dropdownItem) {
|
|
109
152
|
return null;
|
|
110
153
|
}
|
|
@@ -138,30 +181,30 @@ export var DropdownMenuExtensionItems = function DropdownMenuExtensionItems(prop
|
|
|
138
181
|
return _getExtensions.apply(this, arguments);
|
|
139
182
|
}
|
|
140
183
|
function _getExtensions() {
|
|
141
|
-
_getExtensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
184
|
+
_getExtensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
142
185
|
var provider;
|
|
143
|
-
return _regeneratorRuntime.wrap(function
|
|
144
|
-
while (1) switch (
|
|
186
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
187
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
145
188
|
case 0:
|
|
146
|
-
|
|
189
|
+
_context4.next = 2;
|
|
147
190
|
return extension.extensionProvider;
|
|
148
191
|
case 2:
|
|
149
|
-
provider =
|
|
192
|
+
provider = _context4.sent;
|
|
150
193
|
if (!provider) {
|
|
151
|
-
|
|
194
|
+
_context4.next = 9;
|
|
152
195
|
break;
|
|
153
196
|
}
|
|
154
|
-
|
|
155
|
-
|
|
197
|
+
_context4.t0 = setExtensions;
|
|
198
|
+
_context4.next = 7;
|
|
156
199
|
return provider.getExtensions();
|
|
157
200
|
case 7:
|
|
158
|
-
|
|
159
|
-
(0,
|
|
201
|
+
_context4.t1 = _context4.sent;
|
|
202
|
+
(0, _context4.t0)(_context4.t1);
|
|
160
203
|
case 9:
|
|
161
204
|
case "end":
|
|
162
|
-
return
|
|
205
|
+
return _context4.stop();
|
|
163
206
|
}
|
|
164
|
-
},
|
|
207
|
+
}, _callee4);
|
|
165
208
|
}));
|
|
166
209
|
return _getExtensions.apply(this, arguments);
|
|
167
210
|
}
|
|
@@ -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 = "
|
|
13
|
+
var packageVersion = "0.0.0-development";
|
|
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 = "
|
|
24
|
+
var packageVersion = "0.0.0-development";
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
@@ -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
|
|
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:
|
|
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 {
|
|
@@ -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
|
|
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:
|
|
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.
|
|
3
|
+
"version": "111.8.3",
|
|
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.
|
|
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.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^16.23.0",
|
|
85
85
|
"@atlaskit/tokens": "^9.1.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.14.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|