@atlaskit/editor-common 96.6.0 → 96.7.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 +18 -0
- package/dist/cjs/extensibility/Extension/Extension/extension-utils.js +19 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +7 -1
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +6 -4
- package/dist/cjs/extensibility/Extension/Lozenge/LozengeComponent.js +2 -0
- package/dist/cjs/extensibility/Extension/Lozenge/index.js +2 -0
- package/dist/cjs/extensibility/Extension.js +2 -0
- package/dist/cjs/extensibility/ExtensionComponent.js +8 -16
- package/dist/cjs/extensibility/extensionNodeView.js +3 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/utils/table.js +33 -0
- package/dist/es2019/extensibility/Extension/Extension/extension-utils.js +13 -0
- package/dist/es2019/extensibility/Extension/Extension/index.js +7 -1
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +6 -4
- package/dist/es2019/extensibility/Extension/Lozenge/LozengeComponent.js +2 -0
- package/dist/es2019/extensibility/Extension/Lozenge/index.js +2 -0
- package/dist/es2019/extensibility/Extension.js +2 -0
- package/dist/es2019/extensibility/ExtensionComponent.js +6 -14
- package/dist/es2019/extensibility/extensionNodeView.js +3 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/table.js +34 -0
- package/dist/esm/extensibility/Extension/Extension/extension-utils.js +13 -0
- package/dist/esm/extensibility/Extension/Extension/index.js +7 -1
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +6 -4
- package/dist/esm/extensibility/Extension/Lozenge/LozengeComponent.js +2 -0
- package/dist/esm/extensibility/Extension/Lozenge/index.js +2 -0
- package/dist/esm/extensibility/Extension.js +2 -0
- package/dist/esm/extensibility/ExtensionComponent.js +6 -14
- package/dist/esm/extensibility/extensionNodeView.js +3 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/table.js +33 -0
- package/dist/types/extensibility/Extension/Extension/extension-utils.d.ts +2 -0
- package/dist/types/extensibility/Extension/Extension/index.d.ts +1 -0
- package/dist/types/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +3 -2
- package/dist/types/extensibility/Extension/Lozenge/LozengeComponent.d.ts +2 -1
- package/dist/types/extensibility/Extension/Lozenge/index.d.ts +1 -0
- 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 +2 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/table.d.ts +7 -0
- package/dist/types-ts4.5/extensibility/Extension/Extension/extension-utils.d.ts +2 -0
- package/dist/types-ts4.5/extensibility/Extension/Extension/index.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +3 -2
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/LozengeComponent.d.ts +2 -1
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/index.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/Extension.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/ExtensionComponent.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +2 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/table.d.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 96.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#181279](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/181279)
|
|
8
|
+
[`2b71646184e76`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2b71646184e76) -
|
|
9
|
+
[ux] Sends in new parameter from Confluence to editor to hide default border around 1P bodied
|
|
10
|
+
extensions in live pages if the parameter is true
|
|
11
|
+
|
|
12
|
+
## 96.6.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#181016](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/181016)
|
|
17
|
+
[`fb9a503ee55c3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb9a503ee55c3) -
|
|
18
|
+
Add new `getColumnWidths` function which will loop through each table row, looking for the max
|
|
19
|
+
number of table cells to use to render the table correctly when table resizing is enabled.
|
|
20
|
+
|
|
3
21
|
## 96.6.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isEmptyBodiedMacro = void 0;
|
|
7
|
+
var isEmptyBodiedMacro = exports.isEmptyBodiedMacro = function isEmptyBodiedMacro(node) {
|
|
8
|
+
var _node$content, _firstGrandChildNode$;
|
|
9
|
+
if (node.type.name !== 'bodiedExtension') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
var firstChildNode = node === null || node === void 0 || (_node$content = node.content) === null || _node$content === void 0 ? void 0 : _node$content.firstChild;
|
|
13
|
+
var firstGrandChildNode = firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.firstChild;
|
|
14
|
+
|
|
15
|
+
// If firstChildNode?.childCount > 1 means there is content along with the placeholder.
|
|
16
|
+
var isEmptyWithPlacholder = (firstGrandChildNode === null || firstGrandChildNode === void 0 || (_firstGrandChildNode$ = firstGrandChildNode.type) === null || _firstGrandChildNode$ === void 0 ? void 0 : _firstGrandChildNode$.name) === 'placeholder' && (firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.childCount) === 1;
|
|
17
|
+
var isEmptyWithNoContent = !firstGrandChildNode && node.childCount === 1;
|
|
18
|
+
return isEmptyWithPlacholder || isEmptyWithNoContent;
|
|
19
|
+
};
|
|
@@ -18,6 +18,7 @@ var _ui = require("../../../ui");
|
|
|
18
18
|
var _utils = require("../../../utils");
|
|
19
19
|
var _Lozenge = _interopRequireDefault(require("../Lozenge"));
|
|
20
20
|
var _styles = require("../styles");
|
|
21
|
+
var _extensionUtils = require("./extension-utils");
|
|
21
22
|
var _styles2 = require("./styles");
|
|
22
23
|
var _excluded = ["type"];
|
|
23
24
|
/**
|
|
@@ -47,6 +48,7 @@ function ExtensionWithPluginState(props) {
|
|
|
47
48
|
isNodeNested = props.isNodeNested,
|
|
48
49
|
setIsNodeHovered = props.setIsNodeHovered,
|
|
49
50
|
showLivePagesBodiedMacrosRendererView = props.showLivePagesBodiedMacrosRendererView,
|
|
51
|
+
showUpdatedLivePages1PBodiedExtensionUI = props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
50
52
|
showBodiedExtensionRendererView = props.showBodiedExtensionRendererView,
|
|
51
53
|
setShowBodiedExtensionRendererView = props.setShowBodiedExtensionRendererView;
|
|
52
54
|
var _ref = macroInteractionDesignFeatureFlags || {},
|
|
@@ -68,9 +70,12 @@ function ExtensionWithPluginState(props) {
|
|
|
68
70
|
isTopLevelNode &&
|
|
69
71
|
// Extension breakout state should not be respected when the editor appearance is full-width mode
|
|
70
72
|
editorAppearance !== 'full-width';
|
|
73
|
+
|
|
74
|
+
// We don't want to show border for non-empty 1p bodied extensions in live pages
|
|
75
|
+
var show1PBodiedExtensionBorder = showUpdatedLivePages1PBodiedExtensionUI ? (0, _extensionUtils.isEmptyBodiedMacro)(node) : true;
|
|
71
76
|
var classNames = (0, _classnames2.default)('extension-container', 'block', shadowClassNames, (0, _defineProperty2.default)({
|
|
72
77
|
'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
|
|
73
|
-
'with-bodied-border': showMacroInteractionDesignUpdates && hasBody && !showBodiedExtensionRendererView,
|
|
78
|
+
'with-bodied-border': showMacroInteractionDesignUpdates && hasBody && !showBodiedExtensionRendererView && show1PBodiedExtensionBorder,
|
|
74
79
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
|
|
75
80
|
'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
|
|
76
81
|
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
@@ -126,6 +131,7 @@ function ExtensionWithPluginState(props) {
|
|
|
126
131
|
setIsNodeHovered: setIsNodeHovered,
|
|
127
132
|
isBodiedMacro: hasBody,
|
|
128
133
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
134
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
129
135
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
130
136
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
131
137
|
}), (0, _react2.jsx)("div", {
|
|
@@ -124,10 +124,11 @@ var i18n = (0, _reactIntlNext.defineMessages)({
|
|
|
124
124
|
description: 'Text in tooltip that tells user they can configure the specific macro.'
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
|
-
var getShouldShowBodiedMacroLabel = exports.getShouldShowBodiedMacroLabel = function getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView) {
|
|
128
|
-
|
|
127
|
+
var getShouldShowBodiedMacroLabel = exports.getShouldShowBodiedMacroLabel = function getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI) {
|
|
128
|
+
// Bodied macros show the label by default except for the new live pages 1P bodied macro experience where we only show it on hover
|
|
129
|
+
if (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) {
|
|
129
130
|
return isNodeHovered;
|
|
130
|
-
}
|
|
131
|
+
}
|
|
131
132
|
if (!showLivePagesBodiedMacrosRendererView) {
|
|
132
133
|
return true;
|
|
133
134
|
} // Keep showing labels as usual for default experience for bodied macros
|
|
@@ -143,10 +144,11 @@ var ExtensionLabel = exports.ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
143
144
|
isBodiedMacro = _ref.isBodiedMacro,
|
|
144
145
|
showMacroButtonUpdates = _ref.showMacroButtonUpdates,
|
|
145
146
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
147
|
+
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
146
148
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView;
|
|
147
149
|
var isInlineExtension = extensionName === 'inlineExtension';
|
|
148
150
|
var showDefaultBodiedStyles = isBodiedMacro && !isNodeHovered;
|
|
149
|
-
var shouldShowBodiedMacroLabel = getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView);
|
|
151
|
+
var shouldShowBodiedMacroLabel = getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI);
|
|
150
152
|
var containerClassNames = (0, _classnames.default)({
|
|
151
153
|
bodied: isBodiedMacro
|
|
152
154
|
});
|
|
@@ -35,6 +35,7 @@ var LozengeComponent = exports.LozengeComponent = function LozengeComponent(_ref
|
|
|
35
35
|
setIsNodeHovered = _ref.setIsNodeHovered,
|
|
36
36
|
isBodiedMacro = _ref.isBodiedMacro,
|
|
37
37
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
38
|
+
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
38
39
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView,
|
|
39
40
|
setShowBodiedExtensionRendererView = _ref.setShowBodiedExtensionRendererView;
|
|
40
41
|
var capitalizedTitle = capitalizeFirstLetter(title);
|
|
@@ -49,6 +50,7 @@ var LozengeComponent = exports.LozengeComponent = function LozengeComponent(_ref
|
|
|
49
50
|
isBodiedMacro: isBodiedMacro,
|
|
50
51
|
showMacroButtonUpdates: showMacroButtonUpdates,
|
|
51
52
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
53
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
52
54
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView
|
|
53
55
|
}), showLivePagesBodiedMacrosRendererView && isBodiedMacro && (0, _react2.jsx)(_EditToggle.EditToggle, {
|
|
54
56
|
isNodeHovered: isNodeHovered,
|
|
@@ -55,6 +55,7 @@ var ExtensionLozenge = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
55
55
|
setIsNodeHovered = _this$props.setIsNodeHovered,
|
|
56
56
|
isBodiedMacro = _this$props.isBodiedMacro,
|
|
57
57
|
showLivePagesBodiedMacrosRendererView = _this$props.showLivePagesBodiedMacrosRendererView,
|
|
58
|
+
showUpdatedLivePages1PBodiedExtensionUI = _this$props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
58
59
|
showBodiedExtensionRendererView = _this$props.showBodiedExtensionRendererView,
|
|
59
60
|
setShowBodiedExtensionRendererView = _this$props.setShowBodiedExtensionRendererView;
|
|
60
61
|
var _this$props$node$attr = _this.props.node.attrs,
|
|
@@ -78,6 +79,7 @@ var ExtensionLozenge = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
setIsNodeHovered: setIsNodeHovered,
|
|
79
80
|
isBodiedMacro: isBodiedMacro,
|
|
80
81
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
82
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
81
83
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
82
84
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
83
85
|
});
|
|
@@ -38,6 +38,7 @@ var Extension = exports.Extension = /*#__PURE__*/function (_Component) {
|
|
|
38
38
|
eventDispatcher = _this$props.eventDispatcher,
|
|
39
39
|
macroInteractionDesignFeatureFlags = _this$props.macroInteractionDesignFeatureFlags,
|
|
40
40
|
showLivePagesBodiedMacrosRendererView = _this$props.showLivePagesBodiedMacrosRendererView,
|
|
41
|
+
showUpdatedLivePages1PBodiedExtensionUI = _this$props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
41
42
|
rendererExtensionHandlers = _this$props.rendererExtensionHandlers;
|
|
42
43
|
return /*#__PURE__*/_react.default.createElement(_ExtensionComponent.ExtensionComponent, {
|
|
43
44
|
editorView: editorView,
|
|
@@ -52,6 +53,7 @@ var Extension = exports.Extension = /*#__PURE__*/function (_Component) {
|
|
|
52
53
|
eventDispatcher: eventDispatcher,
|
|
53
54
|
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
54
55
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
56
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
55
57
|
rendererExtensionHandlers: rendererExtensionHandlers
|
|
56
58
|
});
|
|
57
59
|
});
|
|
@@ -24,6 +24,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
24
24
|
var _extensions = require("../extensions");
|
|
25
25
|
var _utils = require("../utils");
|
|
26
26
|
var _Extension = _interopRequireDefault(require("./Extension/Extension"));
|
|
27
|
+
var _extensionUtils = require("./Extension/Extension/extension-utils");
|
|
27
28
|
var _InlineExtension = _interopRequireDefault(require("./Extension/InlineExtension"));
|
|
28
29
|
var _MultiBodiedExtension = _interopRequireDefault(require("./MultiBodiedExtension"));
|
|
29
30
|
var _excluded = ["extensionProvider", "showLivePagesBodiedMacrosRendererView", "node"];
|
|
@@ -35,19 +36,6 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
35
36
|
|
|
36
37
|
/* temporary type until FG cleaned up */
|
|
37
38
|
|
|
38
|
-
var isEmptyBodiedMacro = function isEmptyBodiedMacro(node) {
|
|
39
|
-
var _node$content, _firstGrandChildNode$;
|
|
40
|
-
if (node.type.name !== 'bodiedExtension') {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
var firstChildNode = node === null || node === void 0 || (_node$content = node.content) === null || _node$content === void 0 ? void 0 : _node$content.firstChild;
|
|
44
|
-
var firstGrandChildNode = firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.firstChild;
|
|
45
|
-
|
|
46
|
-
// If firstChildNode?.childCount > 1 means there is content along with the placeholder.
|
|
47
|
-
var isEmptyWithPlacholder = (firstGrandChildNode === null || firstGrandChildNode === void 0 || (_firstGrandChildNode$ = firstGrandChildNode.type) === null || _firstGrandChildNode$ === void 0 ? void 0 : _firstGrandChildNode$.name) === 'placeholder' && (firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.childCount) === 1;
|
|
48
|
-
var isEmptyWithNoContent = !firstGrandChildNode && node.childCount === 1;
|
|
49
|
-
return isEmptyWithPlacholder || isEmptyWithNoContent;
|
|
50
|
-
};
|
|
51
39
|
var getBodiedExtensionContent = function getBodiedExtensionContent(node) {
|
|
52
40
|
var bodiedExtensionContent = [];
|
|
53
41
|
node.content.forEach(function (childNode) {
|
|
@@ -206,7 +194,7 @@ var ExtensionComponentOld = exports.ExtensionComponentOld = /*#__PURE__*/functio
|
|
|
206
194
|
node = _this$props2.node,
|
|
207
195
|
showLivePagesBodiedMacrosRendererView = _this$props2.showLivePagesBodiedMacrosRendererView;
|
|
208
196
|
// We only care about this empty state on first page load or insertion to determine the view
|
|
209
|
-
if (!!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView((0, _utils.nodeToJSON)(node))) && !isEmptyBodiedMacro(node)) {
|
|
197
|
+
if (!!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView((0, _utils.nodeToJSON)(node))) && !(0, _extensionUtils.isEmptyBodiedMacro)(node)) {
|
|
210
198
|
this.setState({
|
|
211
199
|
showBodiedExtensionRendererView: true
|
|
212
200
|
});
|
|
@@ -252,7 +240,8 @@ var ExtensionComponentOld = exports.ExtensionComponentOld = /*#__PURE__*/functio
|
|
|
252
240
|
getPos = _this$props3.getPos,
|
|
253
241
|
eventDispatcher = _this$props3.eventDispatcher,
|
|
254
242
|
macroInteractionDesignFeatureFlags = _this$props3.macroInteractionDesignFeatureFlags,
|
|
255
|
-
showLivePagesBodiedMacrosRendererView = _this$props3.showLivePagesBodiedMacrosRendererView
|
|
243
|
+
showLivePagesBodiedMacrosRendererView = _this$props3.showLivePagesBodiedMacrosRendererView,
|
|
244
|
+
showUpdatedLivePages1PBodiedExtensionUI = _this$props3.showUpdatedLivePages1PBodiedExtensionUI;
|
|
256
245
|
var selection = editorView.state.selection;
|
|
257
246
|
var selectedNode = selection instanceof _state.NodeSelection && selection.node;
|
|
258
247
|
var position = typeof getPos === 'function' && getPos();
|
|
@@ -295,6 +284,7 @@ var ExtensionComponentOld = exports.ExtensionComponentOld = /*#__PURE__*/functio
|
|
|
295
284
|
isNodeNested: isNodeNested,
|
|
296
285
|
setIsNodeHovered: this.setIsNodeHovered,
|
|
297
286
|
showLivePagesBodiedMacrosRendererView: !!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView((0, _utils.nodeToJSON)(node))),
|
|
287
|
+
showUpdatedLivePages1PBodiedExtensionUI: !!(showUpdatedLivePages1PBodiedExtensionUI !== null && showUpdatedLivePages1PBodiedExtensionUI !== void 0 && showUpdatedLivePages1PBodiedExtensionUI((0, _utils.nodeToJSON)(node))),
|
|
298
288
|
showBodiedExtensionRendererView: this.state.showBodiedExtensionRendererView,
|
|
299
289
|
setShowBodiedExtensionRendererView: this.setShowBodiedExtensionRendererView
|
|
300
290
|
}, extensionHandlerResult);
|
|
@@ -339,7 +329,7 @@ var ExtensionComponentNew = exports.ExtensionComponentNew = function ExtensionCo
|
|
|
339
329
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
340
330
|
extensionProvider = _useState2[0],
|
|
341
331
|
setExtensionProvider = _useState2[1];
|
|
342
|
-
var _useState3 = (0, _react.useState)(!!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView((0, _utils.nodeToJSON)(node))) && !isEmptyBodiedMacro(node)),
|
|
332
|
+
var _useState3 = (0, _react.useState)(!!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView((0, _utils.nodeToJSON)(node))) && !(0, _extensionUtils.isEmptyBodiedMacro)(node)),
|
|
343
333
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
344
334
|
showBodiedExtensionRendererView = _useState4[0],
|
|
345
335
|
setShowBodiedExtensionRendererView = _useState4[1];
|
|
@@ -515,6 +505,7 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component2) {
|
|
|
515
505
|
macroInteractionDesignFeatureFlags = _this$props4.macroInteractionDesignFeatureFlags,
|
|
516
506
|
extensionProvider = _this$props4.extensionProvider,
|
|
517
507
|
showLivePagesBodiedMacrosRendererView = _this$props4.showLivePagesBodiedMacrosRendererView,
|
|
508
|
+
showUpdatedLivePages1PBodiedExtensionUI = _this$props4.showUpdatedLivePages1PBodiedExtensionUI,
|
|
518
509
|
showBodiedExtensionRendererView = _this$props4.showBodiedExtensionRendererView,
|
|
519
510
|
setShowBodiedExtensionRendererView = _this$props4.setShowBodiedExtensionRendererView;
|
|
520
511
|
var selection = editorView.state.selection;
|
|
@@ -559,6 +550,7 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component2) {
|
|
|
559
550
|
isNodeNested: isNodeNested,
|
|
560
551
|
setIsNodeHovered: this.setIsNodeHovered,
|
|
561
552
|
showLivePagesBodiedMacrosRendererView: !!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView((0, _utils.nodeToJSON)(node))),
|
|
553
|
+
showUpdatedLivePages1PBodiedExtensionUI: !!(showUpdatedLivePages1PBodiedExtensionUI !== null && showUpdatedLivePages1PBodiedExtensionUI !== void 0 && showUpdatedLivePages1PBodiedExtensionUI((0, _utils.nodeToJSON)(node))),
|
|
562
554
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
563
555
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
564
556
|
}, extensionHandlerResult);
|
|
@@ -75,12 +75,13 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
75
75
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
76
76
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
77
77
|
showLivePagesBodiedMacrosRendererView: props.showLivePagesBodiedMacrosRendererView,
|
|
78
|
+
showUpdatedLivePages1PBodiedExtensionUI: props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
78
79
|
rendererExtensionHandlers: props.rendererExtensionHandlers
|
|
79
80
|
}));
|
|
80
81
|
}
|
|
81
82
|
}]);
|
|
82
83
|
}(_reactNodeView.default);
|
|
83
|
-
function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, rendererExtensionHandlers) {
|
|
84
|
+
function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers) {
|
|
84
85
|
return function (node, view, getPos) {
|
|
85
86
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
86
87
|
providerFactory: providerFactory,
|
|
@@ -89,6 +90,7 @@ function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory,
|
|
|
89
90
|
pluginInjectionApi: pluginInjectionApi,
|
|
90
91
|
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
91
92
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
93
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
92
94
|
rendererExtensionHandlers: rendererExtensionHandlers
|
|
93
95
|
}).init();
|
|
94
96
|
};
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "96.
|
|
20
|
+
var packageVersion = "96.7.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "96.
|
|
26
|
+
var packageVersion = "96.7.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -432,6 +432,12 @@ Object.defineProperty(exports, "getChildrenInfo", {
|
|
|
432
432
|
return _referentiality.getChildrenInfo;
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
|
+
Object.defineProperty(exports, "getColumnWidths", {
|
|
436
|
+
enumerable: true,
|
|
437
|
+
get: function get() {
|
|
438
|
+
return _table.getColumnWidths;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
435
441
|
Object.defineProperty(exports, "getDatasourceType", {
|
|
436
442
|
enumerable: true,
|
|
437
443
|
get: function get() {
|
package/dist/cjs/utils/table.js
CHANGED
|
@@ -6,11 +6,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.calcTableColumnWidths = calcTableColumnWidths;
|
|
8
8
|
exports.convertProsemirrorTableNodeToArrayOfRows = convertProsemirrorTableNodeToArrayOfRows;
|
|
9
|
+
exports.getColumnWidths = getColumnWidths;
|
|
9
10
|
exports.hasMergedCell = hasMergedCell;
|
|
10
11
|
exports.isPositionNearTableRow = isPositionNearTableRow;
|
|
11
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
/**
|
|
15
|
+
* Looks at every table row to find the correct number of columns for table, which
|
|
16
|
+
* accounts for tables with uneven rows.
|
|
17
|
+
*
|
|
18
|
+
* Returns an array of column widths if defined otherwise 0, positions respect table order.
|
|
19
|
+
*/
|
|
20
|
+
function getColumnWidths(node) {
|
|
21
|
+
var tableColumnWidths = [];
|
|
22
|
+
node.forEach(function (row) {
|
|
23
|
+
var currentTableWidth = [];
|
|
24
|
+
row.forEach(function (cell) {
|
|
25
|
+
var _ref = cell.attrs,
|
|
26
|
+
colspan = _ref.colspan,
|
|
27
|
+
colwidth = _ref.colwidth;
|
|
28
|
+
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
29
|
+
if (Array.isArray(colwidth)) {
|
|
30
|
+
currentTableWidth.push.apply(currentTableWidth, (0, _toConsumableArray2.default)(colwidth));
|
|
31
|
+
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
32
|
+
} else if (colspan !== undefined && colspan > 1) {
|
|
33
|
+
currentTableWidth.push.apply(currentTableWidth, (0, _toConsumableArray2.default)(Array(colspan).fill(0)));
|
|
34
|
+
// no merged cells, no column resized, default to 0
|
|
35
|
+
} else {
|
|
36
|
+
currentTableWidth.push(0);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (currentTableWidth.length > tableColumnWidths.length) {
|
|
40
|
+
tableColumnWidths = currentTableWidth;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return tableColumnWidths;
|
|
44
|
+
}
|
|
13
45
|
function calcTableColumnWidths(node) {
|
|
46
|
+
// TODO: replaced with getColumnWidths, which correctly scans entire table for column widths
|
|
14
47
|
if ((0, _platformFeatureFlags.fg)('platform_editor_table_row_span_fix')) {
|
|
15
48
|
var _firstRow = node.firstChild;
|
|
16
49
|
var _tableColumnWidths = [];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const isEmptyBodiedMacro = node => {
|
|
2
|
+
var _node$content, _firstGrandChildNode$;
|
|
3
|
+
if (node.type.name !== 'bodiedExtension') {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const firstChildNode = node === null || node === void 0 ? void 0 : (_node$content = node.content) === null || _node$content === void 0 ? void 0 : _node$content.firstChild;
|
|
7
|
+
const firstGrandChildNode = firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.firstChild;
|
|
8
|
+
|
|
9
|
+
// If firstChildNode?.childCount > 1 means there is content along with the placeholder.
|
|
10
|
+
const isEmptyWithPlacholder = (firstGrandChildNode === null || firstGrandChildNode === void 0 ? void 0 : (_firstGrandChildNode$ = firstGrandChildNode.type) === null || _firstGrandChildNode$ === void 0 ? void 0 : _firstGrandChildNode$.name) === 'placeholder' && (firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.childCount) === 1;
|
|
11
|
+
const isEmptyWithNoContent = !firstGrandChildNode && node.childCount === 1;
|
|
12
|
+
return isEmptyWithPlacholder || isEmptyWithNoContent;
|
|
13
|
+
};
|
|
@@ -15,6 +15,7 @@ import { overflowShadow } from '../../../ui';
|
|
|
15
15
|
import { calculateBreakoutStyles } from '../../../utils';
|
|
16
16
|
import ExtensionLozenge from '../Lozenge';
|
|
17
17
|
import { overlay } from '../styles';
|
|
18
|
+
import { isEmptyBodiedMacro } from './extension-utils';
|
|
18
19
|
import { content, contentWrapper, header, overflowWrapperStyles, widerLayoutClassName, wrapperStyle, wrapperStyleInheritedCursor } from './styles';
|
|
19
20
|
function ExtensionWithPluginState(props) {
|
|
20
21
|
const {
|
|
@@ -34,6 +35,7 @@ function ExtensionWithPluginState(props) {
|
|
|
34
35
|
isNodeNested,
|
|
35
36
|
setIsNodeHovered,
|
|
36
37
|
showLivePagesBodiedMacrosRendererView,
|
|
38
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
37
39
|
showBodiedExtensionRendererView,
|
|
38
40
|
setShowBodiedExtensionRendererView
|
|
39
41
|
} = props;
|
|
@@ -59,9 +61,12 @@ function ExtensionWithPluginState(props) {
|
|
|
59
61
|
isTopLevelNode &&
|
|
60
62
|
// Extension breakout state should not be respected when the editor appearance is full-width mode
|
|
61
63
|
editorAppearance !== 'full-width';
|
|
64
|
+
|
|
65
|
+
// We don't want to show border for non-empty 1p bodied extensions in live pages
|
|
66
|
+
const show1PBodiedExtensionBorder = showUpdatedLivePages1PBodiedExtensionUI ? isEmptyBodiedMacro(node) : true;
|
|
62
67
|
const classNames = classnames('extension-container', 'block', shadowClassNames, {
|
|
63
68
|
'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
|
|
64
|
-
'with-bodied-border': showMacroInteractionDesignUpdates && hasBody && !showBodiedExtensionRendererView,
|
|
69
|
+
'with-bodied-border': showMacroInteractionDesignUpdates && hasBody && !showBodiedExtensionRendererView && show1PBodiedExtensionBorder,
|
|
65
70
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
|
|
66
71
|
'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
|
|
67
72
|
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
@@ -124,6 +129,7 @@ function ExtensionWithPluginState(props) {
|
|
|
124
129
|
setIsNodeHovered: setIsNodeHovered,
|
|
125
130
|
isBodiedMacro: hasBody,
|
|
126
131
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
132
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
127
133
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
128
134
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
129
135
|
}), jsx("div", {
|
|
@@ -115,10 +115,11 @@ const i18n = defineMessages({
|
|
|
115
115
|
description: 'Text in tooltip that tells user they can configure the specific macro.'
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
export const getShouldShowBodiedMacroLabel = (isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView) => {
|
|
119
|
-
|
|
118
|
+
export const getShouldShowBodiedMacroLabel = (isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI) => {
|
|
119
|
+
// Bodied macros show the label by default except for the new live pages 1P bodied macro experience where we only show it on hover
|
|
120
|
+
if (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) {
|
|
120
121
|
return isNodeHovered;
|
|
121
|
-
}
|
|
122
|
+
}
|
|
122
123
|
if (!showLivePagesBodiedMacrosRendererView) {
|
|
123
124
|
return true;
|
|
124
125
|
} // Keep showing labels as usual for default experience for bodied macros
|
|
@@ -134,11 +135,12 @@ export const ExtensionLabel = ({
|
|
|
134
135
|
isBodiedMacro,
|
|
135
136
|
showMacroButtonUpdates,
|
|
136
137
|
showLivePagesBodiedMacrosRendererView,
|
|
138
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
137
139
|
showBodiedExtensionRendererView
|
|
138
140
|
}) => {
|
|
139
141
|
const isInlineExtension = extensionName === 'inlineExtension';
|
|
140
142
|
const showDefaultBodiedStyles = isBodiedMacro && !isNodeHovered;
|
|
141
|
-
const shouldShowBodiedMacroLabel = getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView);
|
|
143
|
+
const shouldShowBodiedMacroLabel = getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI);
|
|
142
144
|
const containerClassNames = classnames({
|
|
143
145
|
bodied: isBodiedMacro
|
|
144
146
|
});
|
|
@@ -27,6 +27,7 @@ export const LozengeComponent = ({
|
|
|
27
27
|
setIsNodeHovered,
|
|
28
28
|
isBodiedMacro,
|
|
29
29
|
showLivePagesBodiedMacrosRendererView,
|
|
30
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
30
31
|
showBodiedExtensionRendererView,
|
|
31
32
|
setShowBodiedExtensionRendererView
|
|
32
33
|
}) => {
|
|
@@ -42,6 +43,7 @@ export const LozengeComponent = ({
|
|
|
42
43
|
isBodiedMacro: isBodiedMacro,
|
|
43
44
|
showMacroButtonUpdates: showMacroButtonUpdates,
|
|
44
45
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
46
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
45
47
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView
|
|
46
48
|
}), showLivePagesBodiedMacrosRendererView && isBodiedMacro && jsx(EditToggle, {
|
|
47
49
|
isNodeHovered: isNodeHovered,
|
|
@@ -40,6 +40,7 @@ export default class ExtensionLozenge extends Component {
|
|
|
40
40
|
setIsNodeHovered,
|
|
41
41
|
isBodiedMacro,
|
|
42
42
|
showLivePagesBodiedMacrosRendererView,
|
|
43
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
43
44
|
showBodiedExtensionRendererView,
|
|
44
45
|
setShowBodiedExtensionRendererView
|
|
45
46
|
} = this.props;
|
|
@@ -67,6 +68,7 @@ export default class ExtensionLozenge extends Component {
|
|
|
67
68
|
setIsNodeHovered: setIsNodeHovered,
|
|
68
69
|
isBodiedMacro: isBodiedMacro,
|
|
69
70
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
71
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
70
72
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
71
73
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
72
74
|
});
|
|
@@ -20,6 +20,7 @@ export class Extension extends Component {
|
|
|
20
20
|
eventDispatcher,
|
|
21
21
|
macroInteractionDesignFeatureFlags,
|
|
22
22
|
showLivePagesBodiedMacrosRendererView,
|
|
23
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
23
24
|
rendererExtensionHandlers
|
|
24
25
|
} = this.props;
|
|
25
26
|
return /*#__PURE__*/React.createElement(ExtensionComponent, {
|
|
@@ -35,6 +36,7 @@ export class Extension extends Component {
|
|
|
35
36
|
eventDispatcher: eventDispatcher,
|
|
36
37
|
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
37
38
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
39
|
+
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
38
40
|
rendererExtensionHandlers: rendererExtensionHandlers
|
|
39
41
|
});
|
|
40
42
|
});
|
|
@@ -8,6 +8,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { getExtensionModuleNodePrivateProps, getNodeRenderer } from '../extensions';
|
|
9
9
|
import { getExtensionRenderer, nodeToJSON, toJSON } from '../utils';
|
|
10
10
|
import Extension from './Extension/Extension';
|
|
11
|
+
import { isEmptyBodiedMacro } from './Extension/Extension/extension-utils';
|
|
11
12
|
import InlineExtension from './Extension/InlineExtension';
|
|
12
13
|
import MultiBodiedExtension from './MultiBodiedExtension';
|
|
13
14
|
|
|
@@ -15,19 +16,6 @@ import MultiBodiedExtension from './MultiBodiedExtension';
|
|
|
15
16
|
|
|
16
17
|
/* temporary type until FG cleaned up */
|
|
17
18
|
|
|
18
|
-
const isEmptyBodiedMacro = node => {
|
|
19
|
-
var _node$content, _firstGrandChildNode$;
|
|
20
|
-
if (node.type.name !== 'bodiedExtension') {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
const firstChildNode = node === null || node === void 0 ? void 0 : (_node$content = node.content) === null || _node$content === void 0 ? void 0 : _node$content.firstChild;
|
|
24
|
-
const firstGrandChildNode = firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.firstChild;
|
|
25
|
-
|
|
26
|
-
// If firstChildNode?.childCount > 1 means there is content along with the placeholder.
|
|
27
|
-
const isEmptyWithPlacholder = (firstGrandChildNode === null || firstGrandChildNode === void 0 ? void 0 : (_firstGrandChildNode$ = firstGrandChildNode.type) === null || _firstGrandChildNode$ === void 0 ? void 0 : _firstGrandChildNode$.name) === 'placeholder' && (firstChildNode === null || firstChildNode === void 0 ? void 0 : firstChildNode.childCount) === 1;
|
|
28
|
-
const isEmptyWithNoContent = !firstGrandChildNode && node.childCount === 1;
|
|
29
|
-
return isEmptyWithPlacholder || isEmptyWithNoContent;
|
|
30
|
-
};
|
|
31
19
|
const getBodiedExtensionContent = node => {
|
|
32
20
|
const bodiedExtensionContent = [];
|
|
33
21
|
node.content.forEach(childNode => {
|
|
@@ -208,7 +196,8 @@ export class ExtensionComponentOld extends Component {
|
|
|
208
196
|
getPos,
|
|
209
197
|
eventDispatcher,
|
|
210
198
|
macroInteractionDesignFeatureFlags,
|
|
211
|
-
showLivePagesBodiedMacrosRendererView
|
|
199
|
+
showLivePagesBodiedMacrosRendererView,
|
|
200
|
+
showUpdatedLivePages1PBodiedExtensionUI
|
|
212
201
|
} = this.props;
|
|
213
202
|
const {
|
|
214
203
|
selection
|
|
@@ -254,6 +243,7 @@ export class ExtensionComponentOld extends Component {
|
|
|
254
243
|
isNodeNested: isNodeNested,
|
|
255
244
|
setIsNodeHovered: this.setIsNodeHovered,
|
|
256
245
|
showLivePagesBodiedMacrosRendererView: !!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView(nodeToJSON(node))),
|
|
246
|
+
showUpdatedLivePages1PBodiedExtensionUI: !!(showUpdatedLivePages1PBodiedExtensionUI !== null && showUpdatedLivePages1PBodiedExtensionUI !== void 0 && showUpdatedLivePages1PBodiedExtensionUI(nodeToJSON(node))),
|
|
257
247
|
showBodiedExtensionRendererView: this.state.showBodiedExtensionRendererView,
|
|
258
248
|
setShowBodiedExtensionRendererView: this.setShowBodiedExtensionRendererView
|
|
259
249
|
}, extensionHandlerResult);
|
|
@@ -444,6 +434,7 @@ class ExtensionComponentInner extends Component {
|
|
|
444
434
|
macroInteractionDesignFeatureFlags,
|
|
445
435
|
extensionProvider,
|
|
446
436
|
showLivePagesBodiedMacrosRendererView,
|
|
437
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
447
438
|
showBodiedExtensionRendererView,
|
|
448
439
|
setShowBodiedExtensionRendererView
|
|
449
440
|
} = this.props;
|
|
@@ -491,6 +482,7 @@ class ExtensionComponentInner extends Component {
|
|
|
491
482
|
isNodeNested: isNodeNested,
|
|
492
483
|
setIsNodeHovered: this.setIsNodeHovered,
|
|
493
484
|
showLivePagesBodiedMacrosRendererView: !!(showLivePagesBodiedMacrosRendererView !== null && showLivePagesBodiedMacrosRendererView !== void 0 && showLivePagesBodiedMacrosRendererView(nodeToJSON(node))),
|
|
485
|
+
showUpdatedLivePages1PBodiedExtensionUI: !!(showUpdatedLivePages1PBodiedExtensionUI !== null && showUpdatedLivePages1PBodiedExtensionUI !== void 0 && showUpdatedLivePages1PBodiedExtensionUI(nodeToJSON(node))),
|
|
494
486
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
495
487
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
496
488
|
}, extensionHandlerResult);
|
|
@@ -49,11 +49,12 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
49
49
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
50
50
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
51
51
|
showLivePagesBodiedMacrosRendererView: props.showLivePagesBodiedMacrosRendererView,
|
|
52
|
+
showUpdatedLivePages1PBodiedExtensionUI: props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
52
53
|
rendererExtensionHandlers: props.rendererExtensionHandlers
|
|
53
54
|
}));
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, rendererExtensionHandlers) {
|
|
57
|
+
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers) {
|
|
57
58
|
return (node, view, getPos) => {
|
|
58
59
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
59
60
|
providerFactory,
|
|
@@ -62,6 +63,7 @@ export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, pr
|
|
|
62
63
|
pluginInjectionApi,
|
|
63
64
|
macroInteractionDesignFeatureFlags,
|
|
64
65
|
showLivePagesBodiedMacrosRendererView,
|
|
66
|
+
showUpdatedLivePages1PBodiedExtensionUI,
|
|
65
67
|
rendererExtensionHandlers
|
|
66
68
|
}).init();
|
|
67
69
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "96.
|
|
4
|
+
const packageVersion = "96.7.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "96.
|
|
16
|
+
const packageVersion = "96.7.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
class DropList extends Component {
|
|
@@ -122,7 +122,7 @@ export { isPerformanceAPIAvailable, isPerformanceObserverAvailable } from './per
|
|
|
122
122
|
*/
|
|
123
123
|
export { getResponseEndTime } from './performance/navigation';
|
|
124
124
|
export { getExtensionRenderer } from './extension-handler';
|
|
125
|
-
export { hasMergedCell, calcTableColumnWidths, convertProsemirrorTableNodeToArrayOfRows, isPositionNearTableRow } from './table';
|
|
125
|
+
export { hasMergedCell, getColumnWidths, calcTableColumnWidths, convertProsemirrorTableNodeToArrayOfRows, isPositionNearTableRow } from './table';
|
|
126
126
|
export { createCompareNodes } from './compareNodes';
|
|
127
127
|
export { compose } from './compose';
|
|
128
128
|
export { isTextInput } from './is-text-input';
|