@atlaskit/editor-common 116.24.3 → 116.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +11 -17
- package/dist/cjs/extensibility/Extension/Lozenge/LozengeComponent.js +6 -2
- package/dist/cjs/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +75 -9
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +10 -16
- package/dist/es2019/extensibility/Extension/Lozenge/LozengeComponent.js +6 -2
- package/dist/es2019/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +66 -5
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +10 -16
- package/dist/esm/extensibility/Extension/Lozenge/LozengeComponent.js +6 -2
- package/dist/esm/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +76 -10
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- 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/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 116.24.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f813190f05f57`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f813190f05f57) -
|
|
8
|
+
Update multi bodied extension chrome to match extension presentation.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 116.24.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -4,13 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.ExtensionLabel = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _reactIntl = require("react-intl");
|
|
13
13
|
var _customize = _interopRequireDefault(require("@atlaskit/icon/core/customize"));
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _primitives = require("@atlaskit/primitives");
|
|
15
16
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
17
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
@@ -117,32 +118,25 @@ var i18n = (0, _reactIntl.defineMessages)({
|
|
|
117
118
|
description: 'Text in tooltip that tells user they can configure the specific macro.'
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
|
-
var getShouldShowBodiedMacroLabel = exports.getShouldShowBodiedMacroLabel = function getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI) {
|
|
121
|
-
// Bodied macros show the label by default except for the new live pages 1P bodied macro experience where we only show it on hover
|
|
122
|
-
if (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) {
|
|
123
|
-
return isNodeHovered;
|
|
124
|
-
}
|
|
125
|
-
if (!showLivePagesBodiedMacrosRendererView) {
|
|
126
|
-
return true;
|
|
127
|
-
} // Keep showing labels as usual for default experience for bodied macros
|
|
128
|
-
return !!(isNodeHovered && !showBodiedExtensionRendererView); // For the new live pages bodied macro experience, we only show the label on hover in the "edit" view
|
|
129
|
-
};
|
|
130
121
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
131
122
|
var ExtensionLabel = exports.ExtensionLabel = function ExtensionLabel(_ref) {
|
|
132
123
|
var text = _ref.text,
|
|
133
124
|
extensionName = _ref.extensionName,
|
|
134
125
|
customContainerStyles = _ref.customContainerStyles,
|
|
135
126
|
isNodeNested = _ref.isNodeNested,
|
|
127
|
+
isNodeSelected = _ref.isNodeSelected,
|
|
136
128
|
setIsNodeHovered = _ref.setIsNodeHovered,
|
|
137
129
|
isBodiedMacro = _ref.isBodiedMacro,
|
|
138
130
|
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
139
131
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
140
132
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView,
|
|
141
|
-
_pluginInjectionApi = _ref.pluginInjectionApi
|
|
133
|
+
_pluginInjectionApi = _ref.pluginInjectionApi,
|
|
134
|
+
isMultiBodiedMacro = _ref.isMultiBodiedMacro;
|
|
142
135
|
var isInlineExtension = extensionName === 'inlineExtension';
|
|
143
136
|
var showDefaultBodiedStyles = isBodiedMacro;
|
|
137
|
+
var shouldUseMultiBodiedMacroPresentation = isMultiBodiedMacro && (0, _platformFeatureFlags.fg)('confluence_frontend_native_tabs_extension');
|
|
144
138
|
var containerClassNames = (0, _classnames.default)({
|
|
145
|
-
bodied: isBodiedMacro
|
|
139
|
+
bodied: isBodiedMacro && !shouldUseMultiBodiedMacroPresentation
|
|
146
140
|
});
|
|
147
141
|
var labelClassNames = (0, _classnames.default)('extension-label', {
|
|
148
142
|
nested: isNodeNested,
|
|
@@ -153,8 +147,8 @@ var ExtensionLabel = exports.ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
153
147
|
'with-bodied-macro-live-page-styles': isBodiedMacro && showLivePagesBodiedMacrosRendererView,
|
|
154
148
|
'always-hide-label': isBodiedMacro && showBodiedExtensionRendererView,
|
|
155
149
|
// Need this separate class since we don't ever want to show the label during view mode
|
|
156
|
-
'remove-left-margin': !isBodiedMacro && !isInlineExtension && !isNodeNested,
|
|
157
|
-
'remove-nested-left-margin': isNodeNested && !isBodiedMacro && !isInlineExtension
|
|
150
|
+
'remove-left-margin': (!isBodiedMacro || shouldUseMultiBodiedMacroPresentation) && !isInlineExtension && !isNodeNested,
|
|
151
|
+
'remove-nested-left-margin': isNodeNested && (!isBodiedMacro || shouldUseMultiBodiedMacroPresentation) && !isInlineExtension
|
|
158
152
|
});
|
|
159
153
|
var iconClassNames = (0, _classnames.default)({
|
|
160
154
|
'extension-icon': true
|
|
@@ -206,12 +200,12 @@ var ExtensionLabel = exports.ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
206
200
|
// Ignored via go/ees005
|
|
207
201
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
208
202
|
}, tooltipProps, {
|
|
209
|
-
css: [labelStyles, !showLivePagesBodiedMacrosRendererView && showLabelStyles, (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) && hideLabelStyles]
|
|
203
|
+
css: [labelStyles, !showLivePagesBodiedMacrosRendererView && showLabelStyles, (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI || shouldUseMultiBodiedMacroPresentation && !isNodeSelected) && hideLabelStyles]
|
|
210
204
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
211
205
|
,
|
|
212
206
|
className: labelClassNames
|
|
213
207
|
}), text, (0, _react2.jsx)("span", {
|
|
214
|
-
css: [iconStyles, isBodiedMacro && bodiedMacroIconStyles]
|
|
208
|
+
css: [iconStyles, isBodiedMacro && !shouldUseMultiBodiedMacroPresentation && bodiedMacroIconStyles]
|
|
215
209
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
216
210
|
,
|
|
217
211
|
className: iconClassNames,
|
|
@@ -32,13 +32,15 @@ var LozengeComponent = exports.LozengeComponent = function LozengeComponent(_ref
|
|
|
32
32
|
customContainerStyles = _ref.customContainerStyles,
|
|
33
33
|
isNodeHovered = _ref.isNodeHovered,
|
|
34
34
|
isNodeNested = _ref.isNodeNested,
|
|
35
|
+
isNodeSelected = _ref.isNodeSelected,
|
|
35
36
|
setIsNodeHovered = _ref.setIsNodeHovered,
|
|
36
37
|
isBodiedMacro = _ref.isBodiedMacro,
|
|
37
38
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
38
39
|
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
39
40
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView,
|
|
40
41
|
setShowBodiedExtensionRendererView = _ref.setShowBodiedExtensionRendererView,
|
|
41
|
-
pluginInjectionApi = _ref.pluginInjectionApi
|
|
42
|
+
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
43
|
+
isMultiBodiedMacro = _ref.isMultiBodiedMacro;
|
|
42
44
|
var capitalizedTitle = capitalizeFirstLetter(title);
|
|
43
45
|
if (showMacroInteractionDesignUpdates) {
|
|
44
46
|
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ExtensionLabel.ExtensionLabel, {
|
|
@@ -46,13 +48,15 @@ var LozengeComponent = exports.LozengeComponent = function LozengeComponent(_ref
|
|
|
46
48
|
extensionName: extensionName,
|
|
47
49
|
isNodeHovered: isNodeHovered,
|
|
48
50
|
isNodeNested: isNodeNested,
|
|
51
|
+
isNodeSelected: isNodeSelected,
|
|
49
52
|
customContainerStyles: customContainerStyles,
|
|
50
53
|
setIsNodeHovered: setIsNodeHovered,
|
|
51
54
|
isBodiedMacro: isBodiedMacro,
|
|
52
55
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
53
56
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
54
57
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
55
|
-
pluginInjectionApi: pluginInjectionApi
|
|
58
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
59
|
+
isMultiBodiedMacro: isMultiBodiedMacro
|
|
56
60
|
}), showLivePagesBodiedMacrosRendererView && isBodiedMacro && (0, _react2.jsx)(_EditToggle.EditToggle, {
|
|
57
61
|
isNodeHovered: isNodeHovered,
|
|
58
62
|
setIsNodeHovered: setIsNodeHovered,
|
|
@@ -59,7 +59,8 @@ var ExtensionLozenge = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
59
59
|
showUpdatedLivePages1PBodiedExtensionUI = _this$props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
60
60
|
showBodiedExtensionRendererView = _this$props.showBodiedExtensionRendererView,
|
|
61
61
|
setShowBodiedExtensionRendererView = _this$props.setShowBodiedExtensionRendererView,
|
|
62
|
-
pluginInjectionApi = _this$props.pluginInjectionApi
|
|
62
|
+
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
63
|
+
isMultiBodiedMacro = _this$props.isMultiBodiedMacro;
|
|
63
64
|
var _this$props$node$attr = _this.props.node.attrs,
|
|
64
65
|
parameters = _this$props$node$attr.parameters,
|
|
65
66
|
extensionKey = _this$props$node$attr.extensionKey;
|
|
@@ -83,7 +84,8 @@ var ExtensionLozenge = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
83
84
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
84
85
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
85
86
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView,
|
|
86
|
-
pluginInjectionApi: pluginInjectionApi
|
|
87
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
88
|
+
isMultiBodiedMacro: isMultiBodiedMacro
|
|
87
89
|
});
|
|
88
90
|
});
|
|
89
91
|
return _this;
|
|
@@ -7,12 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
+
var _bindEventListener = require("bind-event-listener");
|
|
16
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
18
|
var _file = _interopRequireDefault(require("@atlaskit/icon/core/file"));
|
|
18
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -63,6 +64,67 @@ var MultiBodiedExtensionFrames = function MultiBodiedExtensionFrames(_ref) {
|
|
|
63
64
|
ref: articleRef
|
|
64
65
|
});
|
|
65
66
|
};
|
|
67
|
+
var isSelectionInsideNode = function isSelectionInsideNode(selection, node, getPos) {
|
|
68
|
+
var nodeStartPosition = getPos();
|
|
69
|
+
if (typeof nodeStartPosition !== 'number' || !selection) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
var nodeEndPosition = nodeStartPosition + node.nodeSize;
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
selection starts within MBE ||
|
|
76
|
+
selection ends within MBE ||
|
|
77
|
+
selection includes MBE
|
|
78
|
+
*/
|
|
79
|
+
return nodeStartPosition < selection.from && selection.from < nodeEndPosition || nodeStartPosition < selection.to && selection.to < nodeEndPosition || nodeStartPosition >= selection.from && selection.to >= nodeEndPosition;
|
|
80
|
+
};
|
|
81
|
+
var useIsSelectionInsideNode = function useIsSelectionInsideNode(editorView, node, getPos, enabled) {
|
|
82
|
+
var nodeRef = (0, _react.useRef)(node);
|
|
83
|
+
var _useState = (0, _react.useState)(function () {
|
|
84
|
+
return enabled && isSelectionInsideNode(editorView.state.selection, node, getPos);
|
|
85
|
+
}),
|
|
86
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
87
|
+
isSelectionInside = _useState2[0],
|
|
88
|
+
setIsSelectionInside = _useState2[1];
|
|
89
|
+
nodeRef.current = node;
|
|
90
|
+
(0, _react.useEffect)(function () {
|
|
91
|
+
if (!enabled) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
var animationFrameId;
|
|
95
|
+
var updateSelectionInsideNode = function updateSelectionInsideNode() {
|
|
96
|
+
setIsSelectionInside(isSelectionInsideNode(editorView.state.selection, nodeRef.current, getPos));
|
|
97
|
+
};
|
|
98
|
+
var scheduleUpdateSelectionInsideNode = function scheduleUpdateSelectionInsideNode() {
|
|
99
|
+
if (animationFrameId !== undefined) {
|
|
100
|
+
cancelAnimationFrame(animationFrameId);
|
|
101
|
+
}
|
|
102
|
+
animationFrameId = requestAnimationFrame(updateSelectionInsideNode);
|
|
103
|
+
};
|
|
104
|
+
var ownerDocument = editorView.dom.ownerDocument;
|
|
105
|
+
var unbindSelectionChange = (0, _bindEventListener.bind)(ownerDocument, {
|
|
106
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
107
|
+
type: 'selectionchange'
|
|
108
|
+
});
|
|
109
|
+
var unbindKeyUp = (0, _bindEventListener.bind)(editorView.dom, {
|
|
110
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
111
|
+
type: 'keyup'
|
|
112
|
+
});
|
|
113
|
+
var unbindMouseUp = (0, _bindEventListener.bind)(editorView.dom, {
|
|
114
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
115
|
+
type: 'mouseup'
|
|
116
|
+
});
|
|
117
|
+
return function () {
|
|
118
|
+
if (animationFrameId !== undefined) {
|
|
119
|
+
cancelAnimationFrame(animationFrameId);
|
|
120
|
+
}
|
|
121
|
+
unbindSelectionChange();
|
|
122
|
+
unbindKeyUp();
|
|
123
|
+
unbindMouseUp();
|
|
124
|
+
};
|
|
125
|
+
}, [editorView, getPos, enabled]);
|
|
126
|
+
return enabled && isSelectionInside;
|
|
127
|
+
};
|
|
66
128
|
|
|
67
129
|
// Similar to the one in platform/packages/editor/editor-common/src/extensibility/Extension/Lozenge.tsx
|
|
68
130
|
var getWrapperTitleContent = function getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates) {
|
|
@@ -122,10 +184,10 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
122
184
|
node: node,
|
|
123
185
|
type: 'image'
|
|
124
186
|
});
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
activeChildIndex =
|
|
128
|
-
setActiveChildIndex =
|
|
187
|
+
var _useState3 = (0, _react.useState)(0),
|
|
188
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
189
|
+
activeChildIndex = _useState4[0],
|
|
190
|
+
setActiveChildIndex = _useState4[1];
|
|
129
191
|
// Adding to avoid aliasing `this` for the callbacks
|
|
130
192
|
var updateActiveChild = _react.default.useCallback(function (index) {
|
|
131
193
|
if (typeof index !== 'number') {
|
|
@@ -175,8 +237,11 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
175
237
|
breakoutStyles = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_calculateBreakoutSty), _calculateBreakoutSty));
|
|
176
238
|
mbeWrapperStyles = breakoutStyles;
|
|
177
239
|
}
|
|
240
|
+
var shouldUseNativeTabsPresentation = (0, _platformFeatureFlags.fg)('confluence_frontend_native_tabs_extension');
|
|
241
|
+
var isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseNativeTabsPresentation);
|
|
242
|
+
var isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
|
|
178
243
|
var wrapperClassNames = (0, _classnames.default)('multiBodiedExtension--wrapper', 'extension-container', 'block', {
|
|
179
|
-
'with-border': showMacroInteractionDesignUpdates,
|
|
244
|
+
'with-border': showMacroInteractionDesignUpdates && (shouldUseNativeTabsPresentation ? isMultiBodiedExtensionActive : true),
|
|
180
245
|
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
181
246
|
'with-padding-background-styles': showMacroInteractionDesignUpdates,
|
|
182
247
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested
|
|
@@ -198,7 +263,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
198
263
|
}
|
|
199
264
|
};
|
|
200
265
|
return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && (0, _react2.jsx)(_Lozenge.default, {
|
|
201
|
-
isNodeSelected: isNodeSelected,
|
|
266
|
+
isNodeSelected: shouldUseNativeTabsPresentation ? isMultiBodiedExtensionActive : isNodeSelected,
|
|
202
267
|
node: node,
|
|
203
268
|
showMacroInteractionDesignUpdates: true,
|
|
204
269
|
customContainerStyles: mbeWrapperStyles,
|
|
@@ -206,12 +271,13 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
206
271
|
isNodeNested: isNodeNested,
|
|
207
272
|
setIsNodeHovered: setIsNodeHovered,
|
|
208
273
|
isBodiedMacro: true,
|
|
274
|
+
isMultiBodiedMacro: shouldUseNativeTabsPresentation,
|
|
209
275
|
pluginInjectionApi: pluginInjectionApi
|
|
210
276
|
}), (0, _react2.jsx)("div", {
|
|
211
277
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
212
278
|
className: wrapperClassNames,
|
|
213
279
|
css: [/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
214
|
-
|
|
280
|
+
shouldUseNativeTabsPresentation ? _styles.mbeExtensionWrapperCSSStyles : _styles.mbeExtensionWrapperCSSStylesOld, /* eslint-enable @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage */
|
|
215
281
|
showMacroInteractionDesignUpdates && !isLivePageViewMode && hoverStyles],
|
|
216
282
|
"data-testid": "multiBodiedExtension--wrapper-editor",
|
|
217
283
|
"data-layout": node.attrs.layout
|
|
@@ -231,7 +297,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
231
297
|
onBlur: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? function () {} : undefined
|
|
232
298
|
}, (0, _react2.jsx)("div", {
|
|
233
299
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
234
|
-
css:
|
|
300
|
+
css: shouldUseNativeTabsPresentation ? _styles.overlayStyles : _styles.overlayStylesOld
|
|
235
301
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
236
302
|
,
|
|
237
303
|
className: overlayClassNames,
|
|
@@ -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.3";
|
|
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.3";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -10,6 +10,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import classnames from 'classnames';
|
|
11
11
|
import { FormattedMessage, defineMessages } from 'react-intl';
|
|
12
12
|
import CustomizeIcon from '@atlaskit/icon/core/customize';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
14
15
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
15
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -108,33 +109,26 @@ const i18n = defineMessages({
|
|
|
108
109
|
description: 'Text in tooltip that tells user they can configure the specific macro.'
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
|
-
export const getShouldShowBodiedMacroLabel = (isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI) => {
|
|
112
|
-
// Bodied macros show the label by default except for the new live pages 1P bodied macro experience where we only show it on hover
|
|
113
|
-
if (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) {
|
|
114
|
-
return isNodeHovered;
|
|
115
|
-
}
|
|
116
|
-
if (!showLivePagesBodiedMacrosRendererView) {
|
|
117
|
-
return true;
|
|
118
|
-
} // Keep showing labels as usual for default experience for bodied macros
|
|
119
|
-
return !!(isNodeHovered && !showBodiedExtensionRendererView); // For the new live pages bodied macro experience, we only show the label on hover in the "edit" view
|
|
120
|
-
};
|
|
121
112
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
122
113
|
export const ExtensionLabel = ({
|
|
123
114
|
text,
|
|
124
115
|
extensionName,
|
|
125
116
|
customContainerStyles,
|
|
126
117
|
isNodeNested,
|
|
118
|
+
isNodeSelected,
|
|
127
119
|
setIsNodeHovered,
|
|
128
120
|
isBodiedMacro,
|
|
129
121
|
showUpdatedLivePages1PBodiedExtensionUI,
|
|
130
122
|
showLivePagesBodiedMacrosRendererView,
|
|
131
123
|
showBodiedExtensionRendererView,
|
|
132
|
-
pluginInjectionApi: _pluginInjectionApi
|
|
124
|
+
pluginInjectionApi: _pluginInjectionApi,
|
|
125
|
+
isMultiBodiedMacro
|
|
133
126
|
}) => {
|
|
134
127
|
const isInlineExtension = extensionName === 'inlineExtension';
|
|
135
128
|
const showDefaultBodiedStyles = isBodiedMacro;
|
|
129
|
+
const shouldUseMultiBodiedMacroPresentation = isMultiBodiedMacro && fg('confluence_frontend_native_tabs_extension');
|
|
136
130
|
const containerClassNames = classnames({
|
|
137
|
-
bodied: isBodiedMacro
|
|
131
|
+
bodied: isBodiedMacro && !shouldUseMultiBodiedMacroPresentation
|
|
138
132
|
});
|
|
139
133
|
const labelClassNames = classnames('extension-label', {
|
|
140
134
|
nested: isNodeNested,
|
|
@@ -145,8 +139,8 @@ export const ExtensionLabel = ({
|
|
|
145
139
|
'with-bodied-macro-live-page-styles': isBodiedMacro && showLivePagesBodiedMacrosRendererView,
|
|
146
140
|
'always-hide-label': isBodiedMacro && showBodiedExtensionRendererView,
|
|
147
141
|
// Need this separate class since we don't ever want to show the label during view mode
|
|
148
|
-
'remove-left-margin': !isBodiedMacro && !isInlineExtension && !isNodeNested,
|
|
149
|
-
'remove-nested-left-margin': isNodeNested && !isBodiedMacro && !isInlineExtension
|
|
142
|
+
'remove-left-margin': (!isBodiedMacro || shouldUseMultiBodiedMacroPresentation) && !isInlineExtension && !isNodeNested,
|
|
143
|
+
'remove-nested-left-margin': isNodeNested && (!isBodiedMacro || shouldUseMultiBodiedMacroPresentation) && !isInlineExtension
|
|
150
144
|
});
|
|
151
145
|
const iconClassNames = classnames({
|
|
152
146
|
'extension-icon': true
|
|
@@ -195,12 +189,12 @@ export const ExtensionLabel = ({
|
|
|
195
189
|
// Ignored via go/ees005
|
|
196
190
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
197
191
|
}, tooltipProps, {
|
|
198
|
-
css: [labelStyles, !showLivePagesBodiedMacrosRendererView && showLabelStyles, (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) && hideLabelStyles]
|
|
192
|
+
css: [labelStyles, !showLivePagesBodiedMacrosRendererView && showLabelStyles, (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI || shouldUseMultiBodiedMacroPresentation && !isNodeSelected) && hideLabelStyles]
|
|
199
193
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
200
194
|
,
|
|
201
195
|
className: labelClassNames
|
|
202
196
|
}), text, jsx("span", {
|
|
203
|
-
css: [iconStyles, isBodiedMacro && bodiedMacroIconStyles]
|
|
197
|
+
css: [iconStyles, isBodiedMacro && !shouldUseMultiBodiedMacroPresentation && bodiedMacroIconStyles]
|
|
204
198
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
205
199
|
,
|
|
206
200
|
className: iconClassNames,
|
|
@@ -26,13 +26,15 @@ export const LozengeComponent = ({
|
|
|
26
26
|
customContainerStyles,
|
|
27
27
|
isNodeHovered,
|
|
28
28
|
isNodeNested,
|
|
29
|
+
isNodeSelected,
|
|
29
30
|
setIsNodeHovered,
|
|
30
31
|
isBodiedMacro,
|
|
31
32
|
showLivePagesBodiedMacrosRendererView,
|
|
32
33
|
showUpdatedLivePages1PBodiedExtensionUI,
|
|
33
34
|
showBodiedExtensionRendererView,
|
|
34
35
|
setShowBodiedExtensionRendererView,
|
|
35
|
-
pluginInjectionApi
|
|
36
|
+
pluginInjectionApi,
|
|
37
|
+
isMultiBodiedMacro
|
|
36
38
|
}) => {
|
|
37
39
|
const capitalizedTitle = capitalizeFirstLetter(title);
|
|
38
40
|
if (showMacroInteractionDesignUpdates) {
|
|
@@ -41,13 +43,15 @@ export const LozengeComponent = ({
|
|
|
41
43
|
extensionName: extensionName,
|
|
42
44
|
isNodeHovered: isNodeHovered,
|
|
43
45
|
isNodeNested: isNodeNested,
|
|
46
|
+
isNodeSelected: isNodeSelected,
|
|
44
47
|
customContainerStyles: customContainerStyles,
|
|
45
48
|
setIsNodeHovered: setIsNodeHovered,
|
|
46
49
|
isBodiedMacro: isBodiedMacro,
|
|
47
50
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
48
51
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
49
52
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
50
|
-
pluginInjectionApi: pluginInjectionApi
|
|
53
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
54
|
+
isMultiBodiedMacro: isMultiBodiedMacro
|
|
51
55
|
}), showLivePagesBodiedMacrosRendererView && isBodiedMacro && jsx(EditToggle, {
|
|
52
56
|
isNodeHovered: isNodeHovered,
|
|
53
57
|
setIsNodeHovered: setIsNodeHovered,
|
|
@@ -44,7 +44,8 @@ export default class ExtensionLozenge extends Component {
|
|
|
44
44
|
showUpdatedLivePages1PBodiedExtensionUI,
|
|
45
45
|
showBodiedExtensionRendererView,
|
|
46
46
|
setShowBodiedExtensionRendererView,
|
|
47
|
-
pluginInjectionApi
|
|
47
|
+
pluginInjectionApi,
|
|
48
|
+
isMultiBodiedMacro
|
|
48
49
|
} = this.props;
|
|
49
50
|
const {
|
|
50
51
|
parameters,
|
|
@@ -72,7 +73,8 @@ export default class ExtensionLozenge extends Component {
|
|
|
72
73
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
73
74
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
74
75
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView,
|
|
75
|
-
pluginInjectionApi: pluginInjectionApi
|
|
76
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
77
|
+
isMultiBodiedMacro: isMultiBodiedMacro
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
80
|
}
|
|
@@ -5,10 +5,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, { Fragment, useState } from 'react';
|
|
8
|
+
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
|
+
import { bind } from 'bind-event-listener';
|
|
12
13
|
import classnames from 'classnames';
|
|
13
14
|
import EditorFileIcon from '@atlaskit/icon/core/file';
|
|
14
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -52,6 +53,62 @@ const MultiBodiedExtensionFrames = ({
|
|
|
52
53
|
ref: articleRef
|
|
53
54
|
});
|
|
54
55
|
};
|
|
56
|
+
const isSelectionInsideNode = (selection, node, getPos) => {
|
|
57
|
+
const nodeStartPosition = getPos();
|
|
58
|
+
if (typeof nodeStartPosition !== 'number' || !selection) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const nodeEndPosition = nodeStartPosition + node.nodeSize;
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
selection starts within MBE ||
|
|
65
|
+
selection ends within MBE ||
|
|
66
|
+
selection includes MBE
|
|
67
|
+
*/
|
|
68
|
+
return nodeStartPosition < selection.from && selection.from < nodeEndPosition || nodeStartPosition < selection.to && selection.to < nodeEndPosition || nodeStartPosition >= selection.from && selection.to >= nodeEndPosition;
|
|
69
|
+
};
|
|
70
|
+
const useIsSelectionInsideNode = (editorView, node, getPos, enabled) => {
|
|
71
|
+
const nodeRef = useRef(node);
|
|
72
|
+
const [isSelectionInside, setIsSelectionInside] = useState(() => enabled && isSelectionInsideNode(editorView.state.selection, node, getPos));
|
|
73
|
+
nodeRef.current = node;
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!enabled) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
let animationFrameId;
|
|
79
|
+
const updateSelectionInsideNode = () => {
|
|
80
|
+
setIsSelectionInside(isSelectionInsideNode(editorView.state.selection, nodeRef.current, getPos));
|
|
81
|
+
};
|
|
82
|
+
const scheduleUpdateSelectionInsideNode = () => {
|
|
83
|
+
if (animationFrameId !== undefined) {
|
|
84
|
+
cancelAnimationFrame(animationFrameId);
|
|
85
|
+
}
|
|
86
|
+
animationFrameId = requestAnimationFrame(updateSelectionInsideNode);
|
|
87
|
+
};
|
|
88
|
+
const ownerDocument = editorView.dom.ownerDocument;
|
|
89
|
+
const unbindSelectionChange = bind(ownerDocument, {
|
|
90
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
91
|
+
type: 'selectionchange'
|
|
92
|
+
});
|
|
93
|
+
const unbindKeyUp = bind(editorView.dom, {
|
|
94
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
95
|
+
type: 'keyup'
|
|
96
|
+
});
|
|
97
|
+
const unbindMouseUp = bind(editorView.dom, {
|
|
98
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
99
|
+
type: 'mouseup'
|
|
100
|
+
});
|
|
101
|
+
return () => {
|
|
102
|
+
if (animationFrameId !== undefined) {
|
|
103
|
+
cancelAnimationFrame(animationFrameId);
|
|
104
|
+
}
|
|
105
|
+
unbindSelectionChange();
|
|
106
|
+
unbindKeyUp();
|
|
107
|
+
unbindMouseUp();
|
|
108
|
+
};
|
|
109
|
+
}, [editorView, getPos, enabled]);
|
|
110
|
+
return enabled && isSelectionInside;
|
|
111
|
+
};
|
|
55
112
|
|
|
56
113
|
// Similar to the one in platform/packages/editor/editor-common/src/extensibility/Extension/Lozenge.tsx
|
|
57
114
|
const getWrapperTitleContent = (imageData, title, showMacroInteractionDesignUpdates) => {
|
|
@@ -166,8 +223,11 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
166
223
|
});
|
|
167
224
|
mbeWrapperStyles = breakoutStyles;
|
|
168
225
|
}
|
|
226
|
+
const shouldUseNativeTabsPresentation = fg('confluence_frontend_native_tabs_extension');
|
|
227
|
+
const isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseNativeTabsPresentation);
|
|
228
|
+
const isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
|
|
169
229
|
const wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block', {
|
|
170
|
-
'with-border': showMacroInteractionDesignUpdates,
|
|
230
|
+
'with-border': showMacroInteractionDesignUpdates && (shouldUseNativeTabsPresentation ? isMultiBodiedExtensionActive : true),
|
|
171
231
|
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
172
232
|
'with-padding-background-styles': showMacroInteractionDesignUpdates,
|
|
173
233
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested
|
|
@@ -189,7 +249,7 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
189
249
|
}
|
|
190
250
|
};
|
|
191
251
|
return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
|
|
192
|
-
isNodeSelected: isNodeSelected,
|
|
252
|
+
isNodeSelected: shouldUseNativeTabsPresentation ? isMultiBodiedExtensionActive : isNodeSelected,
|
|
193
253
|
node: node,
|
|
194
254
|
showMacroInteractionDesignUpdates: true,
|
|
195
255
|
customContainerStyles: mbeWrapperStyles,
|
|
@@ -197,12 +257,13 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
197
257
|
isNodeNested: isNodeNested,
|
|
198
258
|
setIsNodeHovered: setIsNodeHovered,
|
|
199
259
|
isBodiedMacro: true,
|
|
260
|
+
isMultiBodiedMacro: shouldUseNativeTabsPresentation,
|
|
200
261
|
pluginInjectionApi: pluginInjectionApi
|
|
201
262
|
}), jsx("div", {
|
|
202
263
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
203
264
|
className: wrapperClassNames,
|
|
204
265
|
css: [/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
205
|
-
|
|
266
|
+
shouldUseNativeTabsPresentation ? mbeExtensionWrapperCSSStyles : mbeExtensionWrapperCSSStylesOld, /* eslint-enable @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage */
|
|
206
267
|
showMacroInteractionDesignUpdates && !isLivePageViewMode && hoverStyles],
|
|
207
268
|
"data-testid": "multiBodiedExtension--wrapper-editor",
|
|
208
269
|
"data-layout": node.attrs.layout
|
|
@@ -218,7 +279,7 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
218
279
|
onBlur: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? () => {} : undefined
|
|
219
280
|
}, jsx("div", {
|
|
220
281
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
221
|
-
css:
|
|
282
|
+
css: shouldUseNativeTabsPresentation ? overlayStyles : overlayStylesOld
|
|
222
283
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
223
284
|
,
|
|
224
285
|
className: overlayClassNames,
|
|
@@ -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.3";
|
|
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.3";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -10,6 +10,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import classnames from 'classnames';
|
|
11
11
|
import { FormattedMessage, defineMessages } from 'react-intl';
|
|
12
12
|
import CustomizeIcon from '@atlaskit/icon/core/customize';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
14
15
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
15
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -108,32 +109,25 @@ var i18n = defineMessages({
|
|
|
108
109
|
description: 'Text in tooltip that tells user they can configure the specific macro.'
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
|
-
export var getShouldShowBodiedMacroLabel = function getShouldShowBodiedMacroLabel(isBodiedMacro, isNodeHovered, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, showUpdatedLivePages1PBodiedExtensionUI) {
|
|
112
|
-
// Bodied macros show the label by default except for the new live pages 1P bodied macro experience where we only show it on hover
|
|
113
|
-
if (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) {
|
|
114
|
-
return isNodeHovered;
|
|
115
|
-
}
|
|
116
|
-
if (!showLivePagesBodiedMacrosRendererView) {
|
|
117
|
-
return true;
|
|
118
|
-
} // Keep showing labels as usual for default experience for bodied macros
|
|
119
|
-
return !!(isNodeHovered && !showBodiedExtensionRendererView); // For the new live pages bodied macro experience, we only show the label on hover in the "edit" view
|
|
120
|
-
};
|
|
121
112
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
122
113
|
export var ExtensionLabel = function ExtensionLabel(_ref) {
|
|
123
114
|
var text = _ref.text,
|
|
124
115
|
extensionName = _ref.extensionName,
|
|
125
116
|
customContainerStyles = _ref.customContainerStyles,
|
|
126
117
|
isNodeNested = _ref.isNodeNested,
|
|
118
|
+
isNodeSelected = _ref.isNodeSelected,
|
|
127
119
|
setIsNodeHovered = _ref.setIsNodeHovered,
|
|
128
120
|
isBodiedMacro = _ref.isBodiedMacro,
|
|
129
121
|
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
130
122
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
131
123
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView,
|
|
132
|
-
_pluginInjectionApi = _ref.pluginInjectionApi
|
|
124
|
+
_pluginInjectionApi = _ref.pluginInjectionApi,
|
|
125
|
+
isMultiBodiedMacro = _ref.isMultiBodiedMacro;
|
|
133
126
|
var isInlineExtension = extensionName === 'inlineExtension';
|
|
134
127
|
var showDefaultBodiedStyles = isBodiedMacro;
|
|
128
|
+
var shouldUseMultiBodiedMacroPresentation = isMultiBodiedMacro && fg('confluence_frontend_native_tabs_extension');
|
|
135
129
|
var containerClassNames = classnames({
|
|
136
|
-
bodied: isBodiedMacro
|
|
130
|
+
bodied: isBodiedMacro && !shouldUseMultiBodiedMacroPresentation
|
|
137
131
|
});
|
|
138
132
|
var labelClassNames = classnames('extension-label', {
|
|
139
133
|
nested: isNodeNested,
|
|
@@ -144,8 +138,8 @@ export var ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
144
138
|
'with-bodied-macro-live-page-styles': isBodiedMacro && showLivePagesBodiedMacrosRendererView,
|
|
145
139
|
'always-hide-label': isBodiedMacro && showBodiedExtensionRendererView,
|
|
146
140
|
// Need this separate class since we don't ever want to show the label during view mode
|
|
147
|
-
'remove-left-margin': !isBodiedMacro && !isInlineExtension && !isNodeNested,
|
|
148
|
-
'remove-nested-left-margin': isNodeNested && !isBodiedMacro && !isInlineExtension
|
|
141
|
+
'remove-left-margin': (!isBodiedMacro || shouldUseMultiBodiedMacroPresentation) && !isInlineExtension && !isNodeNested,
|
|
142
|
+
'remove-nested-left-margin': isNodeNested && (!isBodiedMacro || shouldUseMultiBodiedMacroPresentation) && !isInlineExtension
|
|
149
143
|
});
|
|
150
144
|
var iconClassNames = classnames({
|
|
151
145
|
'extension-icon': true
|
|
@@ -197,12 +191,12 @@ export var ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
197
191
|
// Ignored via go/ees005
|
|
198
192
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
199
193
|
}, tooltipProps, {
|
|
200
|
-
css: [labelStyles, !showLivePagesBodiedMacrosRendererView && showLabelStyles, (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI) && hideLabelStyles]
|
|
194
|
+
css: [labelStyles, !showLivePagesBodiedMacrosRendererView && showLabelStyles, (!isBodiedMacro || showUpdatedLivePages1PBodiedExtensionUI || shouldUseMultiBodiedMacroPresentation && !isNodeSelected) && hideLabelStyles]
|
|
201
195
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
202
196
|
,
|
|
203
197
|
className: labelClassNames
|
|
204
198
|
}), text, jsx("span", {
|
|
205
|
-
css: [iconStyles, isBodiedMacro && bodiedMacroIconStyles]
|
|
199
|
+
css: [iconStyles, isBodiedMacro && !shouldUseMultiBodiedMacroPresentation && bodiedMacroIconStyles]
|
|
206
200
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
207
201
|
,
|
|
208
202
|
className: iconClassNames,
|
|
@@ -29,13 +29,15 @@ export var LozengeComponent = function LozengeComponent(_ref) {
|
|
|
29
29
|
customContainerStyles = _ref.customContainerStyles,
|
|
30
30
|
isNodeHovered = _ref.isNodeHovered,
|
|
31
31
|
isNodeNested = _ref.isNodeNested,
|
|
32
|
+
isNodeSelected = _ref.isNodeSelected,
|
|
32
33
|
setIsNodeHovered = _ref.setIsNodeHovered,
|
|
33
34
|
isBodiedMacro = _ref.isBodiedMacro,
|
|
34
35
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
35
36
|
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
36
37
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView,
|
|
37
38
|
setShowBodiedExtensionRendererView = _ref.setShowBodiedExtensionRendererView,
|
|
38
|
-
pluginInjectionApi = _ref.pluginInjectionApi
|
|
39
|
+
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
40
|
+
isMultiBodiedMacro = _ref.isMultiBodiedMacro;
|
|
39
41
|
var capitalizedTitle = capitalizeFirstLetter(title);
|
|
40
42
|
if (showMacroInteractionDesignUpdates) {
|
|
41
43
|
return jsx(Fragment, null, jsx(ExtensionLabel, {
|
|
@@ -43,13 +45,15 @@ export var LozengeComponent = function LozengeComponent(_ref) {
|
|
|
43
45
|
extensionName: extensionName,
|
|
44
46
|
isNodeHovered: isNodeHovered,
|
|
45
47
|
isNodeNested: isNodeNested,
|
|
48
|
+
isNodeSelected: isNodeSelected,
|
|
46
49
|
customContainerStyles: customContainerStyles,
|
|
47
50
|
setIsNodeHovered: setIsNodeHovered,
|
|
48
51
|
isBodiedMacro: isBodiedMacro,
|
|
49
52
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
50
53
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
51
54
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
52
|
-
pluginInjectionApi: pluginInjectionApi
|
|
55
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
56
|
+
isMultiBodiedMacro: isMultiBodiedMacro
|
|
53
57
|
}), showLivePagesBodiedMacrosRendererView && isBodiedMacro && jsx(EditToggle, {
|
|
54
58
|
isNodeHovered: isNodeHovered,
|
|
55
59
|
setIsNodeHovered: setIsNodeHovered,
|
|
@@ -54,7 +54,8 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
|
|
|
54
54
|
showUpdatedLivePages1PBodiedExtensionUI = _this$props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
55
55
|
showBodiedExtensionRendererView = _this$props.showBodiedExtensionRendererView,
|
|
56
56
|
setShowBodiedExtensionRendererView = _this$props.setShowBodiedExtensionRendererView,
|
|
57
|
-
pluginInjectionApi = _this$props.pluginInjectionApi
|
|
57
|
+
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
58
|
+
isMultiBodiedMacro = _this$props.isMultiBodiedMacro;
|
|
58
59
|
var _this$props$node$attr = _this.props.node.attrs,
|
|
59
60
|
parameters = _this$props$node$attr.parameters,
|
|
60
61
|
extensionKey = _this$props$node$attr.extensionKey;
|
|
@@ -78,7 +79,8 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
79
80
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
80
81
|
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView,
|
|
81
|
-
pluginInjectionApi: pluginInjectionApi
|
|
82
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
83
|
+
isMultiBodiedMacro: isMultiBodiedMacro
|
|
82
84
|
});
|
|
83
85
|
});
|
|
84
86
|
return _this;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
6
|
var _excluded = ["url"];
|
|
7
7
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
@@ -10,10 +10,11 @@ var _excluded = ["url"];
|
|
|
10
10
|
* @jsx jsx
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React, { Fragment, useState } from 'react';
|
|
13
|
+
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
16
16
|
import { css, jsx } from '@emotion/react';
|
|
17
|
+
import { bind } from 'bind-event-listener';
|
|
17
18
|
import classnames from 'classnames';
|
|
18
19
|
import EditorFileIcon from '@atlaskit/icon/core/file';
|
|
19
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -56,6 +57,67 @@ var MultiBodiedExtensionFrames = function MultiBodiedExtensionFrames(_ref) {
|
|
|
56
57
|
ref: articleRef
|
|
57
58
|
});
|
|
58
59
|
};
|
|
60
|
+
var isSelectionInsideNode = function isSelectionInsideNode(selection, node, getPos) {
|
|
61
|
+
var nodeStartPosition = getPos();
|
|
62
|
+
if (typeof nodeStartPosition !== 'number' || !selection) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
var nodeEndPosition = nodeStartPosition + node.nodeSize;
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
selection starts within MBE ||
|
|
69
|
+
selection ends within MBE ||
|
|
70
|
+
selection includes MBE
|
|
71
|
+
*/
|
|
72
|
+
return nodeStartPosition < selection.from && selection.from < nodeEndPosition || nodeStartPosition < selection.to && selection.to < nodeEndPosition || nodeStartPosition >= selection.from && selection.to >= nodeEndPosition;
|
|
73
|
+
};
|
|
74
|
+
var useIsSelectionInsideNode = function useIsSelectionInsideNode(editorView, node, getPos, enabled) {
|
|
75
|
+
var nodeRef = useRef(node);
|
|
76
|
+
var _useState = useState(function () {
|
|
77
|
+
return enabled && isSelectionInsideNode(editorView.state.selection, node, getPos);
|
|
78
|
+
}),
|
|
79
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
80
|
+
isSelectionInside = _useState2[0],
|
|
81
|
+
setIsSelectionInside = _useState2[1];
|
|
82
|
+
nodeRef.current = node;
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
if (!enabled) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
var animationFrameId;
|
|
88
|
+
var updateSelectionInsideNode = function updateSelectionInsideNode() {
|
|
89
|
+
setIsSelectionInside(isSelectionInsideNode(editorView.state.selection, nodeRef.current, getPos));
|
|
90
|
+
};
|
|
91
|
+
var scheduleUpdateSelectionInsideNode = function scheduleUpdateSelectionInsideNode() {
|
|
92
|
+
if (animationFrameId !== undefined) {
|
|
93
|
+
cancelAnimationFrame(animationFrameId);
|
|
94
|
+
}
|
|
95
|
+
animationFrameId = requestAnimationFrame(updateSelectionInsideNode);
|
|
96
|
+
};
|
|
97
|
+
var ownerDocument = editorView.dom.ownerDocument;
|
|
98
|
+
var unbindSelectionChange = bind(ownerDocument, {
|
|
99
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
100
|
+
type: 'selectionchange'
|
|
101
|
+
});
|
|
102
|
+
var unbindKeyUp = bind(editorView.dom, {
|
|
103
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
104
|
+
type: 'keyup'
|
|
105
|
+
});
|
|
106
|
+
var unbindMouseUp = bind(editorView.dom, {
|
|
107
|
+
listener: scheduleUpdateSelectionInsideNode,
|
|
108
|
+
type: 'mouseup'
|
|
109
|
+
});
|
|
110
|
+
return function () {
|
|
111
|
+
if (animationFrameId !== undefined) {
|
|
112
|
+
cancelAnimationFrame(animationFrameId);
|
|
113
|
+
}
|
|
114
|
+
unbindSelectionChange();
|
|
115
|
+
unbindKeyUp();
|
|
116
|
+
unbindMouseUp();
|
|
117
|
+
};
|
|
118
|
+
}, [editorView, getPos, enabled]);
|
|
119
|
+
return enabled && isSelectionInside;
|
|
120
|
+
};
|
|
59
121
|
|
|
60
122
|
// Similar to the one in platform/packages/editor/editor-common/src/extensibility/Extension/Lozenge.tsx
|
|
61
123
|
var getWrapperTitleContent = function getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates) {
|
|
@@ -115,10 +177,10 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
115
177
|
node: node,
|
|
116
178
|
type: 'image'
|
|
117
179
|
});
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
activeChildIndex =
|
|
121
|
-
setActiveChildIndex =
|
|
180
|
+
var _useState3 = useState(0),
|
|
181
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
182
|
+
activeChildIndex = _useState4[0],
|
|
183
|
+
setActiveChildIndex = _useState4[1];
|
|
122
184
|
// Adding to avoid aliasing `this` for the callbacks
|
|
123
185
|
var updateActiveChild = React.useCallback(function (index) {
|
|
124
186
|
if (typeof index !== 'number') {
|
|
@@ -168,8 +230,11 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
168
230
|
breakoutStyles = _extends({}, (_objectDestructuringEmpty(_calculateBreakoutSty), _calculateBreakoutSty));
|
|
169
231
|
mbeWrapperStyles = breakoutStyles;
|
|
170
232
|
}
|
|
233
|
+
var shouldUseNativeTabsPresentation = fg('confluence_frontend_native_tabs_extension');
|
|
234
|
+
var isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseNativeTabsPresentation);
|
|
235
|
+
var isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
|
|
171
236
|
var wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block', {
|
|
172
|
-
'with-border': showMacroInteractionDesignUpdates,
|
|
237
|
+
'with-border': showMacroInteractionDesignUpdates && (shouldUseNativeTabsPresentation ? isMultiBodiedExtensionActive : true),
|
|
173
238
|
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
174
239
|
'with-padding-background-styles': showMacroInteractionDesignUpdates,
|
|
175
240
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested
|
|
@@ -191,7 +256,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
191
256
|
}
|
|
192
257
|
};
|
|
193
258
|
return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
|
|
194
|
-
isNodeSelected: isNodeSelected,
|
|
259
|
+
isNodeSelected: shouldUseNativeTabsPresentation ? isMultiBodiedExtensionActive : isNodeSelected,
|
|
195
260
|
node: node,
|
|
196
261
|
showMacroInteractionDesignUpdates: true,
|
|
197
262
|
customContainerStyles: mbeWrapperStyles,
|
|
@@ -199,12 +264,13 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
199
264
|
isNodeNested: isNodeNested,
|
|
200
265
|
setIsNodeHovered: setIsNodeHovered,
|
|
201
266
|
isBodiedMacro: true,
|
|
267
|
+
isMultiBodiedMacro: shouldUseNativeTabsPresentation,
|
|
202
268
|
pluginInjectionApi: pluginInjectionApi
|
|
203
269
|
}), jsx("div", {
|
|
204
270
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
205
271
|
className: wrapperClassNames,
|
|
206
272
|
css: [/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
207
|
-
|
|
273
|
+
shouldUseNativeTabsPresentation ? mbeExtensionWrapperCSSStyles : mbeExtensionWrapperCSSStylesOld, /* eslint-enable @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage */
|
|
208
274
|
showMacroInteractionDesignUpdates && !isLivePageViewMode && hoverStyles],
|
|
209
275
|
"data-testid": "multiBodiedExtension--wrapper-editor",
|
|
210
276
|
"data-layout": node.attrs.layout
|
|
@@ -224,7 +290,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
224
290
|
onBlur: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? function () {} : undefined
|
|
225
291
|
}, jsx("div", {
|
|
226
292
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
227
|
-
css:
|
|
293
|
+
css: shouldUseNativeTabsPresentation ? overlayStyles : overlayStylesOld
|
|
228
294
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
229
295
|
,
|
|
230
296
|
className: overlayClassNames,
|
|
@@ -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.3";
|
|
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.3";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { type CSSProperties } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
8
|
-
export declare const getShouldShowBodiedMacroLabel: (isBodiedMacro: boolean | undefined, isNodeHovered: boolean | undefined, showLivePagesBodiedMacrosRendererView: boolean | undefined, showBodiedExtensionRendererView: boolean | undefined, showUpdatedLivePages1PBodiedExtensionUI: boolean | undefined) => boolean | undefined;
|
|
9
8
|
type ExtensionLabelProps = {
|
|
10
9
|
customContainerStyles?: CSSProperties;
|
|
11
10
|
extensionName: string;
|
|
12
11
|
isBodiedMacro?: boolean;
|
|
12
|
+
isMultiBodiedMacro?: boolean;
|
|
13
13
|
isNodeHovered?: boolean;
|
|
14
14
|
isNodeNested?: boolean;
|
|
15
|
+
isNodeSelected?: boolean;
|
|
15
16
|
pluginInjectionApi?: ExtensionsPluginInjectionAPI;
|
|
16
17
|
setIsNodeHovered?: (isHovered: boolean) => void;
|
|
17
18
|
showBodiedExtensionRendererView?: boolean;
|
|
@@ -19,5 +20,5 @@ type ExtensionLabelProps = {
|
|
|
19
20
|
showUpdatedLivePages1PBodiedExtensionUI?: boolean;
|
|
20
21
|
text: string;
|
|
21
22
|
};
|
|
22
|
-
export declare const ExtensionLabel: ({ text, extensionName, customContainerStyles, isNodeNested, setIsNodeHovered, isBodiedMacro, showUpdatedLivePages1PBodiedExtensionUI, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, pluginInjectionApi: _pluginInjectionApi, }: ExtensionLabelProps) => jsx.JSX.Element;
|
|
23
|
+
export declare const ExtensionLabel: ({ text, extensionName, customContainerStyles, isNodeNested, isNodeSelected, setIsNodeHovered, isBodiedMacro, showUpdatedLivePages1PBodiedExtensionUI, showLivePagesBodiedMacrosRendererView, showBodiedExtensionRendererView, pluginInjectionApi: _pluginInjectionApi, isMultiBodiedMacro, }: ExtensionLabelProps) => jsx.JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -11,6 +11,7 @@ type LozengeComponentProps = {
|
|
|
11
11
|
customContainerStyles?: CSSProperties;
|
|
12
12
|
extensionName: string;
|
|
13
13
|
isBodiedMacro?: boolean;
|
|
14
|
+
isMultiBodiedMacro?: boolean;
|
|
14
15
|
isNodeHovered?: boolean;
|
|
15
16
|
isNodeNested?: boolean;
|
|
16
17
|
isNodeSelected?: boolean;
|
|
@@ -26,5 +27,5 @@ type LozengeComponentProps = {
|
|
|
26
27
|
showUpdatedLivePages1PBodiedExtensionUI?: boolean;
|
|
27
28
|
title: string;
|
|
28
29
|
};
|
|
29
|
-
export declare const LozengeComponent: ({ lozengeData, extensionName, title, params, renderImage, showMacroInteractionDesignUpdates, customContainerStyles, isNodeHovered, isNodeNested, setIsNodeHovered, isBodiedMacro, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, showBodiedExtensionRendererView, setShowBodiedExtensionRendererView, pluginInjectionApi, }: LozengeComponentProps) => jsx.JSX.Element;
|
|
30
|
+
export declare const LozengeComponent: ({ lozengeData, extensionName, title, params, renderImage, showMacroInteractionDesignUpdates, customContainerStyles, isNodeHovered, isNodeNested, isNodeSelected, setIsNodeHovered, isBodiedMacro, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, showBodiedExtensionRendererView, setShowBodiedExtensionRendererView, pluginInjectionApi, isMultiBodiedMacro, }: LozengeComponentProps) => jsx.JSX.Element;
|
|
30
31
|
export {};
|
|
@@ -10,6 +10,7 @@ import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
|
10
10
|
export interface Props {
|
|
11
11
|
customContainerStyles?: CSSProperties;
|
|
12
12
|
isBodiedMacro?: boolean;
|
|
13
|
+
isMultiBodiedMacro?: boolean;
|
|
13
14
|
isNodeHovered?: boolean;
|
|
14
15
|
isNodeNested?: boolean;
|
|
15
16
|
isNodeSelected?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "116.24.
|
|
3
|
+
"version": "116.24.4",
|
|
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/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
50
50
|
"@atlaskit/editor-toolbar": "^2.1.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^1.1.0",
|
|
52
|
-
"@atlaskit/emoji": "^71.
|
|
52
|
+
"@atlaskit/emoji": "^71.8.0",
|
|
53
53
|
"@atlaskit/icon": "^36.2.0",
|
|
54
54
|
"@atlaskit/link": "^4.1.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^6.1.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@atlaskit/task-decision": "^21.4.0",
|
|
81
81
|
"@atlaskit/teams-app-config": "^2.1.0",
|
|
82
82
|
"@atlaskit/textfield": "^9.1.0",
|
|
83
|
-
"@atlaskit/tmp-editor-statsig": "^124.
|
|
83
|
+
"@atlaskit/tmp-editor-statsig": "^124.1.0",
|
|
84
84
|
"@atlaskit/tokens": "^15.5.0",
|
|
85
85
|
"@atlaskit/tooltip": "^23.1.0",
|
|
86
86
|
"@atlaskit/width-detector": "^6.2.0",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@atlaskit/media-core": "^38.0.0",
|
|
124
124
|
"@atlassian/a11y-jest-testing": "^0.13.0",
|
|
125
125
|
"@atlassian/feature-flags-test-utils": "^1.1.0",
|
|
126
|
-
"@atlassian/testing-library": "^0.
|
|
126
|
+
"@atlassian/testing-library": "^0.11.0",
|
|
127
127
|
"@testing-library/dom": "^10.1.0",
|
|
128
128
|
"@testing-library/jest-dom": "^6.4.5",
|
|
129
129
|
"@testing-library/react": "^16.3.0",
|