@atlaskit/editor-common 116.24.4 → 116.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/extensibility/Extension.js +2 -0
- package/dist/cjs/extensibility/ExtensionComponent.js +6 -2
- package/dist/cjs/extensibility/extensionNodeView.js +3 -1
- package/dist/cjs/extensions/extension-handlers.js +3 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/extensibility/Extension.js +2 -0
- package/dist/es2019/extensibility/ExtensionComponent.js +7 -3
- package/dist/es2019/extensibility/extensionNodeView.js +3 -1
- package/dist/es2019/extensions/extension-handlers.js +3 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/extensibility/Extension.js +2 -0
- package/dist/esm/extensibility/ExtensionComponent.js +6 -2
- package/dist/esm/extensibility/extensionNodeView.js +3 -1
- package/dist/esm/extensions/extension-handlers.js +3 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/sync-block-events.d.ts +19 -2
- package/dist/types/extensibility/Extension.d.ts +1 -0
- package/dist/types/extensibility/ExtensionComponent.d.ts +1 -0
- package/dist/types/extensibility/extensionNodeView.d.ts +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 116.25.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`c0b0b98789f7a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0b0b98789f7a) -
|
|
8
|
+
Add analytics for synced block source creation: record the creation input method and whether the
|
|
9
|
+
block was created empty, and emit a one-off event the first time an empty source block gains
|
|
10
|
+
content.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 116.24.5
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`07226ab3fad50`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/07226ab3fad50) -
|
|
21
|
+
[ux] Reserve native embed first-paint layout
|
|
22
|
+
|
|
3
23
|
## 116.24.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -597,6 +597,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
|
|
|
597
597
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
598
598
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
599
599
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
600
|
+
ACTION_SUBJECT_ID["SYNCED_BLOCK_ADD_CONTENT"] = "syncedBlockAddContent";
|
|
600
601
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
|
|
601
602
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
602
603
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
|
|
@@ -34,6 +34,7 @@ var Extension = exports.Extension = /*#__PURE__*/function (_Component) {
|
|
|
34
34
|
editorView = _this$props.editorView,
|
|
35
35
|
handleContentDOMRef = _this$props.handleContentDOMRef,
|
|
36
36
|
extensionHandlers = _this$props.extensionHandlers,
|
|
37
|
+
extensionLoadingHandlers = _this$props.extensionLoadingHandlers,
|
|
37
38
|
references = _this$props.references,
|
|
38
39
|
editorAppearance = _this$props.editorAppearance,
|
|
39
40
|
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
@@ -59,6 +60,7 @@ var Extension = exports.Extension = /*#__PURE__*/function (_Component) {
|
|
|
59
60
|
extensionProvider: extensionProvider,
|
|
60
61
|
handleContentDOMRef: handleContentDOMRef,
|
|
61
62
|
extensionHandlers: extensionHandlers,
|
|
63
|
+
extensionLoadingHandlers: extensionLoadingHandlers,
|
|
62
64
|
editorAppearance: editorAppearance,
|
|
63
65
|
pluginInjectionApi: pluginInjectionApi,
|
|
64
66
|
eventDispatcher: eventDispatcher,
|
|
@@ -149,6 +149,7 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
149
149
|
var _pmNode$marks;
|
|
150
150
|
var _this$props = _this.props,
|
|
151
151
|
extensionHandlers = _this$props.extensionHandlers,
|
|
152
|
+
extensionLoadingHandlers = _this$props.extensionLoadingHandlers,
|
|
152
153
|
editorView = _this$props.editorView,
|
|
153
154
|
showBodiedExtensionRendererView = _this$props.showBodiedExtensionRendererView,
|
|
154
155
|
rendererExtensionHandlers = _this$props.rendererExtensionHandlers;
|
|
@@ -184,6 +185,7 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
var result;
|
|
188
|
+
var loadingFallback = extensionLoadingHandlers !== null && extensionLoadingHandlers !== void 0 && extensionLoadingHandlers[extensionType] ? (0, _utils.getExtensionRenderer)(extensionLoadingHandlers[extensionType])(node, editorView.state.doc, actions) : undefined;
|
|
187
189
|
if (extensionHandlers && extensionHandlers[extensionType]) {
|
|
188
190
|
var render = (0, _utils.getExtensionRenderer)(extensionHandlers[extensionType]);
|
|
189
191
|
result = render(node, editorView.state.doc, actions);
|
|
@@ -196,18 +198,20 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
196
198
|
return /*#__PURE__*/_react.default.createElement(NodeRenderer, {
|
|
197
199
|
node: node,
|
|
198
200
|
references: _this.props.references,
|
|
199
|
-
actions: actions
|
|
201
|
+
actions: actions,
|
|
202
|
+
loadingFallback: loadingFallback
|
|
200
203
|
});
|
|
201
204
|
}
|
|
202
205
|
return /*#__PURE__*/_react.default.createElement(NodeRenderer, {
|
|
203
206
|
node: node,
|
|
204
207
|
references: _this.props.references,
|
|
205
208
|
isSelected: isSelected,
|
|
209
|
+
loadingFallback: loadingFallback,
|
|
206
210
|
showUnknownMacroPlaceholder: (0, _platformFeatureFlags.fg)('tinymce_display_unknown_macro_body_content')
|
|
207
211
|
});
|
|
208
212
|
}
|
|
209
213
|
}
|
|
210
|
-
return result;
|
|
214
|
+
return result !== null && result !== void 0 ? result : loadingFallback;
|
|
211
215
|
});
|
|
212
216
|
return _this;
|
|
213
217
|
}
|
|
@@ -321,6 +321,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
321
321
|
providerFactory: props.providerFactory,
|
|
322
322
|
handleContentDOMRef: forwardRef,
|
|
323
323
|
extensionHandlers: props.extensionHandlers,
|
|
324
|
+
extensionLoadingHandlers: props.extensionLoadingHandlers,
|
|
324
325
|
editorAppearance: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.appearance,
|
|
325
326
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
326
327
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
@@ -331,11 +332,12 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
331
332
|
}
|
|
332
333
|
}]);
|
|
333
334
|
}(_reactNodeView.default); // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
334
|
-
function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
335
|
+
function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionLoadingHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
335
336
|
return function (node, view, getPos) {
|
|
336
337
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
337
338
|
providerFactory: providerFactory,
|
|
338
339
|
extensionHandlers: extensionHandlers,
|
|
340
|
+
extensionLoadingHandlers: extensionLoadingHandlers,
|
|
339
341
|
extensionNodeViewOptions: extensionNodeViewOptions,
|
|
340
342
|
pluginInjectionApi: pluginInjectionApi,
|
|
341
343
|
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
@@ -124,6 +124,9 @@ function isUnknownConfluenceMacroWithBody(extensionNode) {
|
|
|
124
124
|
function ExtensionLoading(props) {
|
|
125
125
|
var intl = (0, _reactIntl.useIntl)();
|
|
126
126
|
var extensionNode = props.node;
|
|
127
|
+
if (!props.error && !props.timedOut && props.loadingFallback) {
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.loadingFallback);
|
|
129
|
+
}
|
|
127
130
|
if (props.error || props.timedOut) {
|
|
128
131
|
// eslint-disable-next-line no-console
|
|
129
132
|
console.error('Error rendering extension', props.error);
|
|
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
28
28
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
29
29
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
30
30
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
31
|
-
var packageVersion = "116.24.
|
|
31
|
+
var packageVersion = "116.24.5";
|
|
32
32
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
33
33
|
// Remove URL as it has UGC
|
|
34
34
|
// 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 = "116.24.
|
|
27
|
+
var packageVersion = "116.24.5";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -605,6 +605,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
605
605
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
606
606
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
607
607
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
608
|
+
ACTION_SUBJECT_ID["SYNCED_BLOCK_ADD_CONTENT"] = "syncedBlockAddContent";
|
|
608
609
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
|
|
609
610
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
610
611
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
|
|
@@ -17,6 +17,7 @@ export class Extension extends Component {
|
|
|
17
17
|
editorView,
|
|
18
18
|
handleContentDOMRef,
|
|
19
19
|
extensionHandlers,
|
|
20
|
+
extensionLoadingHandlers,
|
|
20
21
|
references,
|
|
21
22
|
editorAppearance,
|
|
22
23
|
pluginInjectionApi,
|
|
@@ -44,6 +45,7 @@ export class Extension extends Component {
|
|
|
44
45
|
extensionProvider: extensionProvider,
|
|
45
46
|
handleContentDOMRef: handleContentDOMRef,
|
|
46
47
|
extensionHandlers: extensionHandlers,
|
|
48
|
+
extensionLoadingHandlers: extensionLoadingHandlers,
|
|
47
49
|
editorAppearance: editorAppearance,
|
|
48
50
|
pluginInjectionApi: pluginInjectionApi,
|
|
49
51
|
eventDispatcher: eventDispatcher,
|
|
@@ -102,9 +102,10 @@ class ExtensionComponentInner extends Component {
|
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
_defineProperty(this, "handleExtension", (pmNode, actions) => {
|
|
105
|
-
var _pmNode$marks, _pmNode$marks$find, _pmNode$marks$find$at;
|
|
105
|
+
var _pmNode$marks, _pmNode$marks$find, _pmNode$marks$find$at, _result;
|
|
106
106
|
const {
|
|
107
107
|
extensionHandlers,
|
|
108
|
+
extensionLoadingHandlers,
|
|
108
109
|
editorView,
|
|
109
110
|
showBodiedExtensionRendererView,
|
|
110
111
|
rendererExtensionHandlers
|
|
@@ -142,6 +143,7 @@ class ExtensionComponentInner extends Component {
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
let result;
|
|
146
|
+
const loadingFallback = extensionLoadingHandlers !== null && extensionLoadingHandlers !== void 0 && extensionLoadingHandlers[extensionType] ? getExtensionRenderer(extensionLoadingHandlers[extensionType])(node, editorView.state.doc, actions) : undefined;
|
|
145
147
|
if (extensionHandlers && extensionHandlers[extensionType]) {
|
|
146
148
|
const render = getExtensionRenderer(extensionHandlers[extensionType]);
|
|
147
149
|
result = render(node, editorView.state.doc, actions);
|
|
@@ -154,18 +156,20 @@ class ExtensionComponentInner extends Component {
|
|
|
154
156
|
return /*#__PURE__*/React.createElement(NodeRenderer, {
|
|
155
157
|
node: node,
|
|
156
158
|
references: this.props.references,
|
|
157
|
-
actions: actions
|
|
159
|
+
actions: actions,
|
|
160
|
+
loadingFallback: loadingFallback
|
|
158
161
|
});
|
|
159
162
|
}
|
|
160
163
|
return /*#__PURE__*/React.createElement(NodeRenderer, {
|
|
161
164
|
node: node,
|
|
162
165
|
references: this.props.references,
|
|
163
166
|
isSelected: isSelected,
|
|
167
|
+
loadingFallback: loadingFallback,
|
|
164
168
|
showUnknownMacroPlaceholder: fg('tinymce_display_unknown_macro_body_content')
|
|
165
169
|
});
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
|
-
return result;
|
|
172
|
+
return (_result = result) !== null && _result !== void 0 ? _result : loadingFallback;
|
|
169
173
|
});
|
|
170
174
|
}
|
|
171
175
|
componentDidUpdate() {
|
|
@@ -275,6 +275,7 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
275
275
|
providerFactory: props.providerFactory,
|
|
276
276
|
handleContentDOMRef: forwardRef,
|
|
277
277
|
extensionHandlers: props.extensionHandlers,
|
|
278
|
+
extensionLoadingHandlers: props.extensionLoadingHandlers,
|
|
278
279
|
editorAppearance: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.appearance,
|
|
279
280
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
280
281
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
@@ -286,11 +287,12 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
286
287
|
}
|
|
287
288
|
|
|
288
289
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
289
|
-
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
290
|
+
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionLoadingHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
290
291
|
return (node, view, getPos) => {
|
|
291
292
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
292
293
|
providerFactory,
|
|
293
294
|
extensionHandlers,
|
|
295
|
+
extensionLoadingHandlers,
|
|
294
296
|
extensionNodeViewOptions,
|
|
295
297
|
pluginInjectionApi,
|
|
296
298
|
macroInteractionDesignFeatureFlags,
|
|
@@ -63,6 +63,9 @@ function isUnknownConfluenceMacroWithBody(extensionNode) {
|
|
|
63
63
|
function ExtensionLoading(props) {
|
|
64
64
|
const intl = useIntl();
|
|
65
65
|
const extensionNode = props.node;
|
|
66
|
+
if (!props.error && !props.timedOut && props.loadingFallback) {
|
|
67
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.loadingFallback);
|
|
68
|
+
}
|
|
66
69
|
if (props.error || props.timedOut) {
|
|
67
70
|
// eslint-disable-next-line no-console
|
|
68
71
|
console.error('Error rendering extension', props.error);
|
|
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
14
14
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
15
15
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
16
16
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
17
|
-
const packageVersion = "116.24.
|
|
17
|
+
const packageVersion = "116.24.5";
|
|
18
18
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
19
19
|
// Remove URL as it has UGC
|
|
20
20
|
// 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 = "116.24.
|
|
17
|
+
const packageVersion = "116.24.5";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -605,6 +605,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
605
605
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
606
606
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
607
607
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
608
|
+
ACTION_SUBJECT_ID["SYNCED_BLOCK_ADD_CONTENT"] = "syncedBlockAddContent";
|
|
608
609
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
|
|
609
610
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
610
611
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
|
|
@@ -25,6 +25,7 @@ export var Extension = /*#__PURE__*/function (_Component) {
|
|
|
25
25
|
editorView = _this$props.editorView,
|
|
26
26
|
handleContentDOMRef = _this$props.handleContentDOMRef,
|
|
27
27
|
extensionHandlers = _this$props.extensionHandlers,
|
|
28
|
+
extensionLoadingHandlers = _this$props.extensionLoadingHandlers,
|
|
28
29
|
references = _this$props.references,
|
|
29
30
|
editorAppearance = _this$props.editorAppearance,
|
|
30
31
|
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
@@ -50,6 +51,7 @@ export var Extension = /*#__PURE__*/function (_Component) {
|
|
|
50
51
|
extensionProvider: extensionProvider,
|
|
51
52
|
handleContentDOMRef: handleContentDOMRef,
|
|
52
53
|
extensionHandlers: extensionHandlers,
|
|
54
|
+
extensionLoadingHandlers: extensionLoadingHandlers,
|
|
53
55
|
editorAppearance: editorAppearance,
|
|
54
56
|
pluginInjectionApi: pluginInjectionApi,
|
|
55
57
|
eventDispatcher: eventDispatcher,
|
|
@@ -140,6 +140,7 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
140
140
|
var _pmNode$marks;
|
|
141
141
|
var _this$props = _this.props,
|
|
142
142
|
extensionHandlers = _this$props.extensionHandlers,
|
|
143
|
+
extensionLoadingHandlers = _this$props.extensionLoadingHandlers,
|
|
143
144
|
editorView = _this$props.editorView,
|
|
144
145
|
showBodiedExtensionRendererView = _this$props.showBodiedExtensionRendererView,
|
|
145
146
|
rendererExtensionHandlers = _this$props.rendererExtensionHandlers;
|
|
@@ -175,6 +176,7 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
var result;
|
|
179
|
+
var loadingFallback = extensionLoadingHandlers !== null && extensionLoadingHandlers !== void 0 && extensionLoadingHandlers[extensionType] ? getExtensionRenderer(extensionLoadingHandlers[extensionType])(node, editorView.state.doc, actions) : undefined;
|
|
178
180
|
if (extensionHandlers && extensionHandlers[extensionType]) {
|
|
179
181
|
var render = getExtensionRenderer(extensionHandlers[extensionType]);
|
|
180
182
|
result = render(node, editorView.state.doc, actions);
|
|
@@ -187,18 +189,20 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
187
189
|
return /*#__PURE__*/React.createElement(NodeRenderer, {
|
|
188
190
|
node: node,
|
|
189
191
|
references: _this.props.references,
|
|
190
|
-
actions: actions
|
|
192
|
+
actions: actions,
|
|
193
|
+
loadingFallback: loadingFallback
|
|
191
194
|
});
|
|
192
195
|
}
|
|
193
196
|
return /*#__PURE__*/React.createElement(NodeRenderer, {
|
|
194
197
|
node: node,
|
|
195
198
|
references: _this.props.references,
|
|
196
199
|
isSelected: isSelected,
|
|
200
|
+
loadingFallback: loadingFallback,
|
|
197
201
|
showUnknownMacroPlaceholder: fg('tinymce_display_unknown_macro_body_content')
|
|
198
202
|
});
|
|
199
203
|
}
|
|
200
204
|
}
|
|
201
|
-
return result;
|
|
205
|
+
return result !== null && result !== void 0 ? result : loadingFallback;
|
|
202
206
|
});
|
|
203
207
|
return _this;
|
|
204
208
|
}
|
|
@@ -313,6 +313,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
313
313
|
providerFactory: props.providerFactory,
|
|
314
314
|
handleContentDOMRef: forwardRef,
|
|
315
315
|
extensionHandlers: props.extensionHandlers,
|
|
316
|
+
extensionLoadingHandlers: props.extensionLoadingHandlers,
|
|
316
317
|
editorAppearance: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.appearance,
|
|
317
318
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
318
319
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
@@ -325,11 +326,12 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
325
326
|
}(ReactNodeView);
|
|
326
327
|
|
|
327
328
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
328
|
-
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
329
|
+
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionLoadingHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers, intl) {
|
|
329
330
|
return function (node, view, getPos) {
|
|
330
331
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
331
332
|
providerFactory: providerFactory,
|
|
332
333
|
extensionHandlers: extensionHandlers,
|
|
334
|
+
extensionLoadingHandlers: extensionLoadingHandlers,
|
|
333
335
|
extensionNodeViewOptions: extensionNodeViewOptions,
|
|
334
336
|
pluginInjectionApi: pluginInjectionApi,
|
|
335
337
|
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
@@ -109,6 +109,9 @@ function isUnknownConfluenceMacroWithBody(extensionNode) {
|
|
|
109
109
|
function ExtensionLoading(props) {
|
|
110
110
|
var intl = useIntl();
|
|
111
111
|
var extensionNode = props.node;
|
|
112
|
+
if (!props.error && !props.timedOut && props.loadingFallback) {
|
|
113
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.loadingFallback);
|
|
114
|
+
}
|
|
112
115
|
if (props.error || props.timedOut) {
|
|
113
116
|
// eslint-disable-next-line no-console
|
|
114
117
|
console.error('Error rendering extension', props.error);
|
|
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
20
20
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
21
21
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
22
22
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
23
|
-
var packageVersion = "116.24.
|
|
23
|
+
var packageVersion = "116.24.5";
|
|
24
24
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
25
25
|
// Remove URL as it has UGC
|
|
26
26
|
// 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 = "116.24.
|
|
24
|
+
var packageVersion = "116.24.5";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -579,6 +579,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
579
579
|
SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
|
|
580
580
|
REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
|
|
581
581
|
SYNCED_BLOCK_CREATE = "syncedBlockCreate",
|
|
582
|
+
SYNCED_BLOCK_ADD_CONTENT = "syncedBlockAddContent",
|
|
582
583
|
REFERENCE_SYNCED_BLOCK_CREATE = "referenceSyncedBlockCreate",
|
|
583
584
|
SYNCED_BLOCK_DELETE = "syncedBlockDelete",
|
|
584
585
|
REFERENCE_SYNCED_BLOCK_DELETE = "referenceSyncedBlockDelete",
|
|
@@ -74,6 +74,18 @@ type SyncedBlockCopyErrorAttributes = SyncedBlockErrorAttributes & {
|
|
|
74
74
|
type SyncedBlockEditSourceAttributes = SyncedBlockSuccessAttributes & {
|
|
75
75
|
sameDocument?: boolean;
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Source `syncedBlockCreate` success attrs. Both optional so gate-off/legacy
|
|
79
|
+
* payloads are unchanged. `inputMethod`: creating surface (enum, PII-safe).
|
|
80
|
+
* `createdEmpty`: true when created from an empty selection, false when content
|
|
81
|
+
* was converted into the block.
|
|
82
|
+
*/
|
|
83
|
+
type SyncedBlockCreateSuccessAttributes = SyncedBlockSuccessAttributes & {
|
|
84
|
+
createdEmpty?: boolean;
|
|
85
|
+
inputMethod?: INPUT_METHOD;
|
|
86
|
+
};
|
|
87
|
+
/** First-content-added attrs: join keys only (no user content, PII-safe). */
|
|
88
|
+
type SyncedBlockAddContentAttributes = SyncedBlockSuccessAttributes;
|
|
77
89
|
export type SyncedBlockSourceURLErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_SOURCE_URL, SyncedBlockErrorAttributes>;
|
|
78
90
|
export type SyncedBlockUpdateCacheErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_UPDATE_CACHE, SyncedBlockErrorAttributes>;
|
|
79
91
|
export type SyncedBlockUpdateErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_UPDATE, SyncedBlockErrorAttributes>;
|
|
@@ -84,7 +96,12 @@ export type SyncedBlockGetSourceInfoErrorAEP = OperationalAEP<ACTION.ERROR, ACTI
|
|
|
84
96
|
export type SyncedBlockFetchErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH, SyncedBlockErrorAttributes>;
|
|
85
97
|
export type SyncedBlockFetchReferencesErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH_REFERENCES, SyncedBlockErrorAttributes>;
|
|
86
98
|
export type SyncedBlockFetchSuccessAEP = OperationalAEP<ACTION.FETCHED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_FETCH, FetchSyncedBlockSuccessAttributes>;
|
|
87
|
-
export type SyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
|
|
99
|
+
export type SyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE, SyncedBlockCreateSuccessAttributes>;
|
|
100
|
+
/**
|
|
101
|
+
* First-content-added event: fired once per source block when it first gains
|
|
102
|
+
* user content, keyed by `resourceId` + `blockInstanceId` to join the funnel.
|
|
103
|
+
*/
|
|
104
|
+
export type SyncedBlockAddContentAEP = OperationalAEP<ACTION.ADDED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_ADD_CONTENT, SyncedBlockAddContentAttributes>;
|
|
88
105
|
export type SyncedBlockUpdateSuccessAEP = OperationalAEP<ACTION.UPDATED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_UPDATE, SyncedBlockSuccessAttributes>;
|
|
89
106
|
export type SyncedBlockDeleteSuccessAEP = OperationalAEP<ACTION.DELETED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_DELETE, SyncedBlockDeleteSuccessAttributes>;
|
|
90
107
|
export type ReferenceSyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_CREATE, SyncedBlockSuccessAttributes>;
|
|
@@ -151,6 +168,6 @@ type SyncedBlockInsertAttemptedUnsupportedSurfaceAttributes = {
|
|
|
151
168
|
* EDITOR-7749.
|
|
152
169
|
*/
|
|
153
170
|
export type SyncedBlockInsertAttemptedUnsupportedSurfaceAEP = TrackAEP<ACTION.INSERT_ATTEMPTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE, SyncedBlockInsertAttemptedUnsupportedSurfaceAttributes, undefined>;
|
|
154
|
-
export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockUpdateSuccessAEP | SyncedBlockCreateErrorAEP | SyncedBlockCreateSuccessAEP | SyncedBlockDeleteErrorAEP | SyncedBlockDeleteSuccessAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockFetchReferencesErrorAEP | ExperienceEventPayload | ReferenceSyncedBlockCreateSuccessAEP | ReferenceSyncedBlockDeleteSuccessAEP | SyncedBlockEditSourceAEP | SyncedBlockCopyAEP | SyncedBlockCopyErrorAEP | SyncedLocationClickAEP | SyncedBlockSSRErrorAEP | SyncedBlockSourceInfoOrphanedAEP | SyncedBlockCacheDeletionForcedAEP | SyncedBlockInsertAttemptedUnsupportedSurfaceAEP | InsertSourceSyncedBlockPayload;
|
|
171
|
+
export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockUpdateSuccessAEP | SyncedBlockCreateErrorAEP | SyncedBlockCreateSuccessAEP | SyncedBlockAddContentAEP | SyncedBlockDeleteErrorAEP | SyncedBlockDeleteSuccessAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockFetchReferencesErrorAEP | ExperienceEventPayload | ReferenceSyncedBlockCreateSuccessAEP | ReferenceSyncedBlockDeleteSuccessAEP | SyncedBlockEditSourceAEP | SyncedBlockCopyAEP | SyncedBlockCopyErrorAEP | SyncedLocationClickAEP | SyncedBlockSSRErrorAEP | SyncedBlockSourceInfoOrphanedAEP | SyncedBlockCacheDeletionForcedAEP | SyncedBlockInsertAttemptedUnsupportedSurfaceAEP | InsertSourceSyncedBlockPayload;
|
|
155
172
|
export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockSourceInfoOrphanedAEP | SyncedBlockCacheDeletionForcedAEP | ExperienceEventPayload;
|
|
156
173
|
export {};
|
|
@@ -13,6 +13,7 @@ export interface Props {
|
|
|
13
13
|
editorView: EditorView;
|
|
14
14
|
eventDispatcher?: EventDispatcher;
|
|
15
15
|
extensionHandlers: ExtensionHandlers;
|
|
16
|
+
extensionLoadingHandlers?: ExtensionHandlers;
|
|
16
17
|
getPos: ProsemirrorGetPosHandler;
|
|
17
18
|
handleContentDOMRef: (node: HTMLElement | null) => void;
|
|
18
19
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
@@ -12,6 +12,7 @@ export interface Props {
|
|
|
12
12
|
editorView: EditorView;
|
|
13
13
|
eventDispatcher?: EventDispatcher;
|
|
14
14
|
extensionHandlers: ExtensionHandlers;
|
|
15
|
+
extensionLoadingHandlers?: ExtensionHandlers;
|
|
15
16
|
extensionProvider?: Promise<ExtensionProvider>;
|
|
16
17
|
getPos: ProsemirrorGetPosHandler;
|
|
17
18
|
handleContentDOMRef: (node: HTMLElement | null) => void;
|
|
@@ -17,6 +17,7 @@ interface ExtensionNodeViewOptions {
|
|
|
17
17
|
}
|
|
18
18
|
interface ReactExtensionNodeProps {
|
|
19
19
|
extensionHandlers: ExtensionHandlers;
|
|
20
|
+
extensionLoadingHandlers?: ExtensionHandlers;
|
|
20
21
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
21
22
|
intl?: IntlShape;
|
|
22
23
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
@@ -75,6 +76,7 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
75
76
|
} | undefined;
|
|
76
77
|
render(props: {
|
|
77
78
|
extensionHandlers: ExtensionHandlers;
|
|
79
|
+
extensionLoadingHandlers?: ExtensionHandlers;
|
|
78
80
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
79
81
|
intl?: IntlShape;
|
|
80
82
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
@@ -85,5 +87,5 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
85
87
|
showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean;
|
|
86
88
|
}, forwardRef: ForwardRef): React.JSX.Element;
|
|
87
89
|
}
|
|
88
|
-
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers, intl?: IntlShape): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
90
|
+
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionLoadingHandlers: ExtensionHandlers | undefined, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers, intl?: IntlShape): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
89
91
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "116.
|
|
3
|
+
"version": "116.25.0",
|
|
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/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/link": "^4.1.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^6.1.0",
|
|
56
56
|
"@atlaskit/link-picker": "^6.2.0",
|
|
57
|
-
"@atlaskit/media-card": "^81.
|
|
57
|
+
"@atlaskit/media-card": "^81.4.0",
|
|
58
58
|
"@atlaskit/media-client": "^37.2.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^6.1.0",
|
|
60
60
|
"@atlaskit/media-common": "^14.3.0",
|