@atlaskit/editor-core 203.16.5 → 203.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/afm-cc/tsconfig.json +6 -0
- package/afm-jira/tsconfig.json +6 -0
- package/afm-post-office/tsconfig.json +6 -0
- package/dist/cjs/composable-editor/core-editor.js +5 -2
- package/dist/cjs/composable-editor/core-performance-metrics.js +109 -0
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/ui/Addon/ClickAreaBlock/contentComponentWrapper.js +22 -0
- package/dist/cjs/ui/Addon/click-area-helper.js +5 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +3 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +3 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +28 -4
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +11 -1
- package/dist/cjs/ui/ContentStyles/extension.js +1 -1
- package/dist/cjs/ui/Toolbar/ToolbarPortal.compiled.css +3 -0
- package/dist/cjs/ui/Toolbar/ToolbarPortal.js +48 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/core-editor.js +6 -3
- package/dist/es2019/composable-editor/core-performance-metrics.js +92 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/ui/Addon/ClickAreaBlock/contentComponentWrapper.js +15 -0
- package/dist/es2019/ui/Addon/click-area-helper.js +5 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +3 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +3 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +27 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +11 -1
- package/dist/es2019/ui/ContentStyles/extension.js +5 -0
- package/dist/es2019/ui/Toolbar/ToolbarPortal.compiled.css +3 -0
- package/dist/es2019/ui/Toolbar/ToolbarPortal.js +40 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/core-editor.js +6 -3
- package/dist/esm/composable-editor/core-performance-metrics.js +101 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/ui/Addon/ClickAreaBlock/contentComponentWrapper.js +15 -0
- package/dist/esm/ui/Addon/click-area-helper.js +5 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +28 -4
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +11 -1
- package/dist/esm/ui/ContentStyles/extension.js +1 -1
- package/dist/esm/ui/Toolbar/ToolbarPortal.compiled.css +3 -0
- package/dist/esm/ui/Toolbar/ToolbarPortal.js +41 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/core-performance-metrics.d.ts +4 -0
- package/dist/types/create-editor/create-universal-preset.d.ts +52 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/presets/universal.d.ts +52 -6
- package/dist/types/presets/useUniversalPreset.d.ts +52 -6
- package/dist/types/ui/Addon/ClickAreaBlock/contentComponentWrapper.d.ts +6 -0
- package/dist/types/ui/Addon/click-area-helper.d.ts +1 -0
- package/dist/types/ui/Toolbar/ToolbarPortal.d.ts +21 -0
- package/dist/types-ts4.5/composable-editor/core-performance-metrics.d.ts +4 -0
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +56 -6
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/presets/universal.d.ts +56 -6
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +56 -6
- package/dist/types-ts4.5/ui/Addon/ClickAreaBlock/contentComponentWrapper.d.ts +6 -0
- package/dist/types-ts4.5/ui/Addon/click-area-helper.d.ts +1 -0
- package/dist/types-ts4.5/ui/Toolbar/ToolbarPortal.d.ts +21 -0
- package/package.json +33 -11
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +0 -41
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +0 -105
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +0 -34
- package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +0 -85
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +0 -33
- package/dist/esm/ui/Addon/ClickAreaMobile/index.js +0 -103
- package/dist/types/ui/Addon/ClickAreaInline/index.d.ts +0 -13
- package/dist/types/ui/Addon/ClickAreaMobile/index.d.ts +0 -34
- package/dist/types-ts4.5/ui/Addon/ClickAreaInline/index.d.ts +0 -13
- package/dist/types-ts4.5/ui/Addon/ClickAreaMobile/index.d.ts +0 -34
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 203.17.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#115172](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115172)
|
|
8
|
+
[`5dc3799cf466f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5dc3799cf466f) -
|
|
9
|
+
[ED-26517] Fix LCM right rail alignment
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 203.17.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#112383](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112383)
|
|
17
|
+
[`51edd811330b1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/51edd811330b1) -
|
|
18
|
+
[AFO-3351] Introduce Editor PerformanceMetrics into editor-core
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 203.17.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [#108587](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108587)
|
|
26
|
+
[`441cefc11a2b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/441cefc11a2b9) -
|
|
27
|
+
[ux] [ED-26339] Add toolbar portal and mountpoint for rendering nested toolbars
|
|
28
|
+
|
|
3
29
|
## 203.16.5
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
{
|
|
37
37
|
"path": "../../editor-json-transformer/afm-cc/tsconfig.json"
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
"path": "../../editor-performance-metrics/afm-cc/tsconfig.json"
|
|
41
|
+
},
|
|
39
42
|
{
|
|
40
43
|
"path": "../../editor-plugin-quick-insert/afm-cc/tsconfig.json"
|
|
41
44
|
},
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
{
|
|
61
64
|
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
62
65
|
},
|
|
66
|
+
{
|
|
67
|
+
"path": "../../../react-ufo/atlaskit/afm-cc/tsconfig.json"
|
|
68
|
+
},
|
|
63
69
|
{
|
|
64
70
|
"path": "../../../elements/task-decision/afm-cc/tsconfig.json"
|
|
65
71
|
},
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
{
|
|
37
37
|
"path": "../../editor-json-transformer/afm-jira/tsconfig.json"
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
"path": "../../editor-performance-metrics/afm-jira/tsconfig.json"
|
|
41
|
+
},
|
|
39
42
|
{
|
|
40
43
|
"path": "../../editor-plugin-quick-insert/afm-jira/tsconfig.json"
|
|
41
44
|
},
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
{
|
|
61
64
|
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
62
65
|
},
|
|
66
|
+
{
|
|
67
|
+
"path": "../../../react-ufo/atlaskit/afm-jira/tsconfig.json"
|
|
68
|
+
},
|
|
63
69
|
{
|
|
64
70
|
"path": "../../../elements/task-decision/afm-jira/tsconfig.json"
|
|
65
71
|
},
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
{
|
|
37
37
|
"path": "../../editor-json-transformer/afm-post-office/tsconfig.json"
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
"path": "../../editor-performance-metrics/afm-post-office/tsconfig.json"
|
|
41
|
+
},
|
|
39
42
|
{
|
|
40
43
|
"path": "../../editor-plugin-quick-insert/afm-post-office/tsconfig.json"
|
|
41
44
|
},
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
{
|
|
61
64
|
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
62
65
|
},
|
|
66
|
+
{
|
|
67
|
+
"path": "../../../react-ufo/atlaskit/afm-post-office/tsconfig.json"
|
|
68
|
+
},
|
|
63
69
|
{
|
|
64
70
|
"path": "../../../elements/task-decision/afm-post-office/tsconfig.json"
|
|
65
71
|
},
|
|
@@ -17,11 +17,13 @@ var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents"
|
|
|
17
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
18
|
var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
|
|
19
19
|
var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _actions = _interopRequireDefault(require("../actions"));
|
|
21
22
|
var _EditorContext = require("../ui/EditorContext");
|
|
22
23
|
var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
|
|
23
24
|
var _measureEnum = _interopRequireDefault(require("../utils/performance/measure-enum"));
|
|
24
25
|
var _versionWrapper = require("../version-wrapper");
|
|
26
|
+
var _corePerformanceMetrics = require("./core-performance-metrics");
|
|
25
27
|
var _editorInternal = require("./editor-internal");
|
|
26
28
|
var _useMeasureEditorMountTime = _interopRequireDefault(require("./hooks/useMeasureEditorMountTime"));
|
|
27
29
|
var _useMemoEditorProps = _interopRequireDefault(require("./hooks/useMemoEditorProps"));
|
|
@@ -91,7 +93,8 @@ function Editor(passedProps) {
|
|
|
91
93
|
onSaveFromProps(view);
|
|
92
94
|
}
|
|
93
95
|
}, [onSaveFromProps]);
|
|
94
|
-
|
|
96
|
+
var isFullPageApperance = Boolean(props.appearance && ['full-page', 'full-width'].includes(props.appearance));
|
|
97
|
+
return (0, _react2.jsx)(_react.Fragment, null, isFullPageApperance && (0, _platformFeatureFlags.fg)('platform_editor_fe--ufo-bridge') ? (0, _react2.jsx)(_corePerformanceMetrics.EditorUFOBridge, null) : null, isFullPageApperance && (0, _platformFeatureFlags.fg)('platform_editor_fe--performance_metrics') ? (0, _react2.jsx)(_corePerformanceMetrics.EditorPerformanceMetrics, null) : null, (0, _react2.jsx)(_editorInternal.EditorInternal, {
|
|
95
98
|
props: props,
|
|
96
99
|
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
97
100
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
@@ -102,7 +105,7 @@ function Editor(passedProps) {
|
|
|
102
105
|
onEditorDestroyed: onEditorDestroyed,
|
|
103
106
|
providerFactory: providerFactory,
|
|
104
107
|
AppearanceComponent: props.AppearanceComponent
|
|
105
|
-
});
|
|
108
|
+
}));
|
|
106
109
|
}
|
|
107
110
|
var useMemoEditorFeatureFlags = function useMemoEditorFeatureFlags(featureFlags) {
|
|
108
111
|
var ffRef = (0, _react.useRef)(featureFlags);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.EditorUFOBridge = exports.EditorPerformanceMetrics = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
|
+
var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
+
var _react3 = require("@atlaskit/editor-performance-metrics/react");
|
|
14
|
+
var _loadHold = _interopRequireDefault(require("@atlaskit/react-ufo/load-hold"));
|
|
15
|
+
/**
|
|
16
|
+
* @jsxRuntime classic
|
|
17
|
+
* @jsx jsx
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
|
+
|
|
22
|
+
var EditorUFOBridge = exports.EditorUFOBridge = /*#__PURE__*/(0, _react.memo)(function () {
|
|
23
|
+
var _useState = (0, _react.useState)(true),
|
|
24
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
25
|
+
hold = _useState2[0],
|
|
26
|
+
setHold = _useState2[1];
|
|
27
|
+
var onTTAI = (0, _react.useCallback)(function () {
|
|
28
|
+
setHold(false);
|
|
29
|
+
}, []);
|
|
30
|
+
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_loadHold.default, {
|
|
31
|
+
name: "editor-core",
|
|
32
|
+
hold: hold
|
|
33
|
+
}), (0, _react2.jsx)(_react3.PerformanceMetrics, {
|
|
34
|
+
onTTAI: onTTAI
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
var EditorPerformanceMetrics = exports.EditorPerformanceMetrics = /*#__PURE__*/(0, _react.memo)(function () {
|
|
38
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
39
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
40
|
+
var _useState3 = (0, _react.useState)(null),
|
|
41
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
42
|
+
ttai = _useState4[0],
|
|
43
|
+
setTTAI = _useState4[1];
|
|
44
|
+
var _useState5 = (0, _react.useState)(null),
|
|
45
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
46
|
+
ttvc = _useState6[0],
|
|
47
|
+
setTTVC = _useState6[1];
|
|
48
|
+
var _useState7 = (0, _react.useState)(null),
|
|
49
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
50
|
+
latency = _useState8[0],
|
|
51
|
+
setUserLatency = _useState8[1];
|
|
52
|
+
var ttvcSentRef = (0, _react.useRef)(false);
|
|
53
|
+
var latencySentRef = (0, _react.useRef)(false);
|
|
54
|
+
var handleAnalyticsEvent = (0, _react.useCallback)(function (data) {
|
|
55
|
+
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)(data);
|
|
56
|
+
}, [createAnalyticsEvent]);
|
|
57
|
+
var onTTAI = (0, _react.useCallback)(function (_ref) {
|
|
58
|
+
var idleAt = _ref.idleAt;
|
|
59
|
+
setTTAI(idleAt);
|
|
60
|
+
}, []);
|
|
61
|
+
var onTTVC = (0, _react.useCallback)(function (_ref2) {
|
|
62
|
+
var ttvc = _ref2.ttvc;
|
|
63
|
+
setTTVC(ttvc);
|
|
64
|
+
}, []);
|
|
65
|
+
var onUserLatency = (0, _react.useCallback)(function (_ref3) {
|
|
66
|
+
var latency = _ref3.latency;
|
|
67
|
+
setUserLatency(latency);
|
|
68
|
+
}, []);
|
|
69
|
+
(0, _react.useEffect)(function () {
|
|
70
|
+
if (!ttai || !ttvc || ttvcSentRef.current) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
ttvcSentRef.current = true;
|
|
74
|
+
handleAnalyticsEvent({
|
|
75
|
+
payload: {
|
|
76
|
+
// @ts-expect-error Temporary data - let's not extend the public analytics enum
|
|
77
|
+
action: 'ttvc',
|
|
78
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
79
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
80
|
+
attributes: {
|
|
81
|
+
ttvc: ttvc,
|
|
82
|
+
ttai: ttai
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, [handleAnalyticsEvent, ttai, ttvc]);
|
|
87
|
+
(0, _react.useEffect)(function () {
|
|
88
|
+
if (!latency || latencySentRef.current) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
latencySentRef.current = true;
|
|
92
|
+
handleAnalyticsEvent({
|
|
93
|
+
payload: {
|
|
94
|
+
// @ts-expect-error Temporary data - let's not extend the public analytics enum
|
|
95
|
+
action: 'latency',
|
|
96
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
97
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
98
|
+
attributes: {
|
|
99
|
+
latency: latency
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}, [handleAnalyticsEvent, latency]);
|
|
104
|
+
return (0, _react2.jsx)(_react3.PerformanceMetrics, {
|
|
105
|
+
onTTAI: onTTAI,
|
|
106
|
+
onTTVC: onTTVC,
|
|
107
|
+
onUserLatency: onUserLatency
|
|
108
|
+
});
|
|
109
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -40,6 +40,12 @@ Object.defineProperty(exports, "ToolbarHelp", {
|
|
|
40
40
|
return _ToolbarHelp.default;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
+
Object.defineProperty(exports, "ToolbarPortalContextProvider", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _ToolbarPortal.ToolbarPortalContextProvider;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
43
49
|
Object.defineProperty(exports, "WithEditorActions", {
|
|
44
50
|
enumerable: true,
|
|
45
51
|
get: function get() {
|
|
@@ -82,6 +88,12 @@ Object.defineProperty(exports, "name", {
|
|
|
82
88
|
return _versionWrapper.name;
|
|
83
89
|
}
|
|
84
90
|
});
|
|
91
|
+
Object.defineProperty(exports, "useToolbarPortal", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function get() {
|
|
94
|
+
return _ToolbarPortal.useToolbarPortal;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
85
97
|
Object.defineProperty(exports, "version", {
|
|
86
98
|
enumerable: true,
|
|
87
99
|
get: function get() {
|
|
@@ -94,6 +106,7 @@ var _EditorContext = _interopRequireDefault(require("./ui/EditorContext"));
|
|
|
94
106
|
var _WithEditorActions = _interopRequireDefault(require("./ui/WithEditorActions"));
|
|
95
107
|
var _WithHelpTrigger = _interopRequireDefault(require("./ui/WithHelpTrigger"));
|
|
96
108
|
var _CollapsedEditor = _interopRequireDefault(require("./ui/CollapsedEditor"));
|
|
109
|
+
var _ToolbarPortal = require("./ui/Toolbar/ToolbarPortal");
|
|
97
110
|
var _ToolbarHelp = _interopRequireDefault(require("./ui/ToolbarHelp"));
|
|
98
111
|
var _ContextPanel = require("./ui/ContextPanel");
|
|
99
112
|
var _getNodesCount = require("./utils/getNodesCount");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ignoreAttribute = exports.contentComponentClickWrapper = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
var ignoreAttribute = exports.ignoreAttribute = 'data-editor-content-component';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Wraps content components in a data attribute to ignore
|
|
14
|
+
*/
|
|
15
|
+
var contentComponentClickWrapper = exports.contentComponentClickWrapper = function contentComponentClickWrapper(reactComponents) {
|
|
16
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_content_component_ignore_click')) {
|
|
17
|
+
return reactComponents;
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
"data-editor-content-component": 'true'
|
|
21
|
+
}, reactComponents);
|
|
22
|
+
};
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.clickAreaClickHandler = exports.checkForModal = void 0;
|
|
6
|
+
exports.outsideProsemirrorEditorClickHandler = exports.clickAreaClickHandler = exports.checkForModal = void 0;
|
|
7
7
|
var _collab = require("@atlaskit/editor-common/collab");
|
|
8
8
|
var _commands = require("@atlaskit/editor-common/commands");
|
|
9
9
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
+
var _contentComponentWrapper = require("./ClickAreaBlock/contentComponentWrapper");
|
|
11
12
|
// we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
|
|
12
13
|
var insideContentArea = function insideContentArea(ref) {
|
|
13
14
|
while (ref) {
|
|
@@ -78,6 +79,7 @@ var clickAreaClickHandler = exports.clickAreaClickHandler = function clickAreaCl
|
|
|
78
79
|
// Ignored via go/ees005
|
|
79
80
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
80
81
|
(0, _utils.closestElement)(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
|
|
82
|
+
var isContentComponent = !!(0, _utils.closestElement)(target, "[".concat(_contentComponentWrapper.ignoreAttribute, "]")) || (target === null || target === void 0 ? void 0 : target.getAttribute(_contentComponentWrapper.ignoreAttribute)) === 'true';
|
|
81
83
|
|
|
82
84
|
// This is a super workaround to find when events are coming from Confluence InlineComment modal
|
|
83
85
|
// We don't own those components, so we can't change them
|
|
@@ -93,14 +95,14 @@ var clickAreaClickHandler = exports.clickAreaClickHandler = function clickAreaCl
|
|
|
93
95
|
var edgeCaseScenario3 = isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
|
|
94
96
|
var edgeCaseScenario4 = isEventComingFromContentArea && !isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
|
|
95
97
|
var edgeCases = edgeCaseScenario1 || edgeCaseScenario2 || edgeCaseScenario3 || edgeCaseScenario4;
|
|
96
|
-
var isClickOutsideEditor = edgeCases && !isDatasourcePopupClicked && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
|
|
98
|
+
var isClickOutsideEditor = edgeCases && !isDatasourcePopupClicked && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && !isContentComponent && checkForModal(target);
|
|
97
99
|
|
|
98
100
|
// click was within editor container and focus should be brought to input
|
|
99
101
|
if (isClickOutsideEditor && view) {
|
|
100
102
|
outsideProsemirrorEditorClickHandler(view, event);
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
|
-
var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClickHandler(view, event) {
|
|
105
|
+
var outsideProsemirrorEditorClickHandler = exports.outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClickHandler(view, event) {
|
|
104
106
|
var _view$hasFocus2;
|
|
105
107
|
var dispatch = view.dispatch,
|
|
106
108
|
dom = view.dom,
|
|
@@ -21,6 +21,7 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
21
21
|
var _commonStyles = require("@atlaskit/editor-plugins/table/ui/common-styles");
|
|
22
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
23
23
|
var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
|
|
24
|
+
var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
|
|
24
25
|
var _ContentStyles = require("../../ContentStyles");
|
|
25
26
|
var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
|
|
26
27
|
var _ToolbarWithSizeDetector = require("../../Toolbar/ToolbarWithSizeDetector");
|
|
@@ -239,7 +240,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
239
240
|
}),
|
|
240
241
|
featureFlags: featureFlags,
|
|
241
242
|
viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
242
|
-
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
243
|
+
}, customContentComponents && 'before' in customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(customContentComponents.before) : (0, _contentComponentWrapper.contentComponentClickWrapper)(customContentComponents), (0, _react2.jsx)(_PluginSlot.default, {
|
|
243
244
|
editorView: editorView,
|
|
244
245
|
editorActions: editorActions,
|
|
245
246
|
eventDispatcher: eventDispatcher,
|
|
@@ -254,7 +255,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
254
255
|
disabled: !!disabled,
|
|
255
256
|
wrapperElement: wrapperElementRef.current,
|
|
256
257
|
pluginHooks: pluginHooks
|
|
257
|
-
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
|
|
258
|
+
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(customContentComponents.after) : null);
|
|
258
259
|
}))), showSecondaryToolbar && (0, _react2.jsx)("div", {
|
|
259
260
|
css: secondaryToolbarStyles,
|
|
260
261
|
"data-testid": "ak-editor-secondary-toolbar"
|
|
@@ -12,6 +12,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
14
|
var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
|
|
15
|
+
var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
|
|
15
16
|
var _ContextPanel = require("../../ContextPanel");
|
|
16
17
|
var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
|
|
17
18
|
var _StyledComponents = require("./StyledComponents");
|
|
@@ -95,7 +96,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
95
96
|
,
|
|
96
97
|
className: ['ak-editor-content-area', 'appearance-full-page', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
|
|
97
98
|
ref: contentAreaRef
|
|
98
|
-
}, !!props.customContentComponents && 'before' in props.customContentComponents ? props.customContentComponents.before : props.customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
99
|
+
}, !!props.customContentComponents && 'before' in props.customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents.before) : (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents), (0, _react2.jsx)(_PluginSlot.default, {
|
|
99
100
|
editorView: props.editorView,
|
|
100
101
|
editorActions: props.editorActions,
|
|
101
102
|
eventDispatcher: props.eventDispatcher,
|
|
@@ -111,7 +112,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
111
112
|
containerElement: scrollContainerRef.current,
|
|
112
113
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
113
114
|
wrapperElement: props.wrapperElement
|
|
114
|
-
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? props.customContentComponents.after : null))))), (0, _react2.jsx)("div", {
|
|
115
|
+
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents.after) : null))))), (0, _react2.jsx)("div", {
|
|
115
116
|
css: _StyledComponents.sidebarArea
|
|
116
117
|
}, props.contextPanel || (0, _react2.jsx)(_ContextPanel.ContextPanel, {
|
|
117
118
|
editorAPI: props.editorAPI,
|
|
@@ -13,6 +13,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
+
var _ToolbarPortal = require("../../Toolbar/ToolbarPortal");
|
|
16
18
|
var _ToolbarWithSizeDetector = require("../../Toolbar/ToolbarWithSizeDetector");
|
|
17
19
|
var _BeforeWrapper = require("./BeforeWrapper");
|
|
18
20
|
var _MainToolbar = require("./MainToolbar");
|
|
@@ -26,7 +28,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
26
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
27
29
|
|
|
28
30
|
var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
|
|
29
|
-
var _props$customPrimaryT;
|
|
31
|
+
var _props$customPrimaryT, _useToolbarPortal;
|
|
30
32
|
var _useState = (0, _react.useState)(false),
|
|
31
33
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
34
|
shouldSplitToolbar = _useState2[0],
|
|
@@ -100,15 +102,37 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
100
102
|
event.preventDefault();
|
|
101
103
|
event.stopPropagation();
|
|
102
104
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
|
|
106
|
+
// When a toolbar portal context is provided, render the toolbar inside a portal.
|
|
107
|
+
// Otherwise fall back to a fragment just to avoid forking rendering logic.
|
|
108
|
+
var _ref = (_useToolbarPortal = (0, _ToolbarPortal.useToolbarPortal)()) !== null && _useToolbarPortal !== void 0 ? _useToolbarPortal : {
|
|
109
|
+
Portal: _react.default.Fragment
|
|
110
|
+
},
|
|
111
|
+
ToolbarPortal = _ref.Portal;
|
|
112
|
+
return (0, _react2.jsx)(_ui.ContextPanelConsumer, null, function (_ref2) {
|
|
113
|
+
var contextPanelWidth = _ref2.width;
|
|
105
114
|
return (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
106
115
|
editorView: props.editorView,
|
|
107
116
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
108
117
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
109
118
|
handleEscape: handleEscape,
|
|
110
119
|
intl: props.intl
|
|
120
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_lcm_toolbar_portals') ? (0, _react2.jsx)(ToolbarPortal, null, (0, _react2.jsx)("div", {
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
122
|
+
css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, twoLineEditorToolbar),
|
|
123
|
+
"data-testid": "ak-editor-main-toolbar"
|
|
111
124
|
}, (0, _react2.jsx)("div", {
|
|
125
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
126
|
+
css: (0, _MainToolbar.mainToolbarFirstChildStyle)(twoLineEditorToolbar),
|
|
127
|
+
role: "toolbar",
|
|
128
|
+
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.toolbarLabel)
|
|
129
|
+
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), (0, _react2.jsx)("div", {
|
|
130
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
131
|
+
css: (0, _MainToolbar.mainToolbarSecondChildStyle)(twoLineEditorToolbar),
|
|
132
|
+
"data-testid": "avatar-group-outside-plugin",
|
|
133
|
+
role: "region",
|
|
134
|
+
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.pageActionsLabel)
|
|
135
|
+
}, shouldSplitToolbar ? nonCustomToolbar : customToolbar), (0, _react2.jsx)(_ToolbarPortal.ToolbarPortalMountPoint, null))) : (0, _react2.jsx)("div", {
|
|
112
136
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
113
137
|
css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, twoLineEditorToolbar),
|
|
114
138
|
"data-testid": "ak-editor-main-toolbar"
|
|
@@ -120,7 +144,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
120
144
|
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), (0, _react2.jsx)("div", {
|
|
121
145
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
122
146
|
css: (0, _MainToolbar.mainToolbarSecondChildStyle)(twoLineEditorToolbar),
|
|
123
|
-
"data-testid":
|
|
147
|
+
"data-testid": "avatar-group-outside-plugin",
|
|
124
148
|
role: "region",
|
|
125
149
|
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.pageActionsLabel)
|
|
126
150
|
}, shouldSplitToolbar ? nonCustomToolbar : customToolbar)));
|
|
@@ -90,7 +90,17 @@ var contentAreaHeightNoToolbar = exports.contentAreaHeightNoToolbar = (0, _react
|
|
|
90
90
|
var sidebarArea = exports.sidebarArea = (0, _react.css)({
|
|
91
91
|
height: '100%',
|
|
92
92
|
boxSizing: 'border-box',
|
|
93
|
-
alignSelf: 'flex-end'
|
|
93
|
+
alignSelf: 'flex-end',
|
|
94
|
+
// Make the sidebar sticky within the legacy content macro
|
|
95
|
+
// to prevent it from aligning to the bottom with large content.
|
|
96
|
+
// This style is only applied when opening inside the legacy content macro.
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-nested-selectors
|
|
98
|
+
'.extension-editable-area &': {
|
|
99
|
+
height: 'auto',
|
|
100
|
+
position: 'sticky',
|
|
101
|
+
top: 0,
|
|
102
|
+
alignSelf: 'flex-start'
|
|
103
|
+
}
|
|
94
104
|
});
|
|
95
105
|
|
|
96
106
|
// initially hide until we have a containerWidth and can properly size them,
|
|
@@ -18,4 +18,4 @@ var dangerOverlayStyles = (0, _react.css)({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
21
|
-
var extensionStyles = exports.extensionStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t.multiBodiedExtensionView-content-wrap {\n\t\t&.danger > span > .multiBodiedExtension--container {\n\t\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t\t", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\n\t\t", "\n\n\t\t&.danger > span > .with-danger-overlay {\n\t\t\tbackground-color: transparent;\n\t\t\t.multiBodiedExtension--overlay {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&:not(.danger).", " {\n\t\t\t& > span > .multiBodiedExtension--container {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t\t.multiBodiedExtension--container {\n\t\t\twidth: 100%;\n\t\t\tmax-width: 100%; // ensure width can't go over 100%;\n\t\t}\n\t}\n\n\t.inlineExtensionView-content-wrap {\n\t\t&.danger > span > .extension-container {\n\t\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t\t", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\n\t\t&.danger > span > .with-danger-overlay {\n\t\t\t// If the macro turned used to turn red before, not setting the background to be transparent will cause the\n\t\t\t// danger state to have two layers of red which we don't want.\n\t\t\tbackground-color: transparent;\n\t\t\t.extension-overlay {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&:not(.danger).", " {\n\t\t\t& > span > .extension-container {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t}\n\n\t// This is referenced in the toDOM of a bodied extension and is used to put\n\t// label content into the bodied extension.\n\t// We do this so that we don't serialise the label (which causes the label to be\n\t// be copied to the clipboard causing copy-paste issues).\n\t.bodied-extension-to-dom-label::after {\n\t\tcontent: attr(data-bodied-extension-label);\n\t}\n\n\t.extensionView-content-wrap,\n\t.multiBodiedExtensionView-content-wrap,\n\t.bodiedExtensionView-content-wrap {\n\t\tmargin: ", " 0;\n\n\t\t&:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t&:last-of-type {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\t&:not(.danger).", " {\n\t\t\t& > span > .extension-container {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&.danger > span > .extension-container {\n\t\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t\t", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\n\t\t", "\n\n\t\t&.danger > span > .with-danger-overlay {\n\t\t\tbackground-color: transparent;\n\t\t\t.extension-overlay {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&.inline {\n\t\t\tword-wrap: break-all;\n\t\t}\n\t}\n\n\t.extensionView-content-wrap .extension-container {\n\t\toverflow: hidden;\n\t}\n\n\t.bodiedExtensionView-content-wrap .extensionView-content-wrap .extension-container {\n\t\twidth: 100%;\n\t\tmax-width: 100%; // ensure width can't go over 100%;\n\t}\n\n\t[data-mark-type='fragment'] {\n\t\t& > .extensionView-content-wrap,\n\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t& > [data-mark-type='dataConsumer'] {\n\t\t\t& > .extensionView-content-wrap,\n\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\tmargin: ", " 0;\n\t\t\t}\n\t\t}\n\n\t\t&:first-child {\n\t\t\t& > .extensionView-content-wrap,\n\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t& > [data-mark-type='dataConsumer'] {\n\t\t\t\t& > .extensionView-content-wrap,\n\t\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&:nth-last-of-type(-n + 2):not(:first-of-type) {\n\t\t\t& > .extensionView-content-wrap,\n\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\n\t\t\t& > [data-mark-type='dataConsumer'] {\n\t\t\t\t& > .extensionView-content-wrap,\n\t\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), extensionLabelStyles, dangerOverlayStyles, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), dangerOverlayStyles, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), extensionLabelStyles, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), extensionLabelStyles, dangerOverlayStyles, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin);
|
|
21
|
+
var extensionStyles = exports.extensionStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t.multiBodiedExtensionView-content-wrap {\n\t\t&.danger > span > .multiBodiedExtension--container {\n\t\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t\t", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\n\t\t", "\n\n\t\t&.danger > span > .with-danger-overlay {\n\t\t\tbackground-color: transparent;\n\t\t\t.multiBodiedExtension--overlay {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&:not(.danger).", " {\n\t\t\t& > span > .multiBodiedExtension--container {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t\t.multiBodiedExtension--container {\n\t\t\twidth: 100%;\n\t\t\tmax-width: 100%; // ensure width can't go over 100%;\n\t\t}\n\t}\n\n\t.inlineExtensionView-content-wrap {\n\t\t&.danger > span > .extension-container {\n\t\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t\t", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\n\t\t&.danger > span > .with-danger-overlay {\n\t\t\t// If the macro turned used to turn red before, not setting the background to be transparent will cause the\n\t\t\t// danger state to have two layers of red which we don't want.\n\t\t\tbackground-color: transparent;\n\t\t\t.extension-overlay {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&:not(.danger).", " {\n\t\t\t& > span > .extension-container {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t}\n\n\t// This is referenced in the toDOM of a bodied extension and is used to put\n\t// label content into the bodied extension.\n\t// We do this so that we don't serialise the label (which causes the label to be\n\t// be copied to the clipboard causing copy-paste issues).\n\t.bodied-extension-to-dom-label::after {\n\t\tcontent: attr(data-bodied-extension-label);\n\t}\n\n\t.extensionView-content-wrap,\n\t.multiBodiedExtensionView-content-wrap,\n\t.bodiedExtensionView-content-wrap {\n\t\tmargin: ", " 0;\n\n\t\t&:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t&:last-of-type {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\t&:not(.danger).", " {\n\t\t\t& > span > .extension-container {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&.danger > span > .extension-container {\n\t\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t\t", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\n\t\t", "\n\n\t\t&.danger > span > .with-danger-overlay {\n\t\t\tbackground-color: transparent;\n\t\t\t.extension-overlay {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t&.inline {\n\t\t\tword-wrap: break-all;\n\t\t}\n\t}\n\n\t.extensionView-content-wrap .extension-container {\n\t\toverflow: hidden;\n\n\t\t/* Don't hide overflow for editors inside extensions */\n\t\t&:has(.extension-editable-area) {\n\t\t\toverflow: visible;\n\t\t}\n\t}\n\n\t.bodiedExtensionView-content-wrap .extensionView-content-wrap .extension-container {\n\t\twidth: 100%;\n\t\tmax-width: 100%; // ensure width can't go over 100%;\n\t}\n\n\t[data-mark-type='fragment'] {\n\t\t& > .extensionView-content-wrap,\n\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t& > [data-mark-type='dataConsumer'] {\n\t\t\t& > .extensionView-content-wrap,\n\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\tmargin: ", " 0;\n\t\t\t}\n\t\t}\n\n\t\t&:first-child {\n\t\t\t& > .extensionView-content-wrap,\n\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t& > [data-mark-type='dataConsumer'] {\n\t\t\t\t& > .extensionView-content-wrap,\n\t\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&:nth-last-of-type(-n + 2):not(:first-of-type) {\n\t\t\t& > .extensionView-content-wrap,\n\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\n\t\t\t& > [data-mark-type='dataConsumer'] {\n\t\t\t\t& > .extensionView-content-wrap,\n\t\t\t\t& > .bodiedExtensionView-content-wrap {\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), extensionLabelStyles, dangerOverlayStyles, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), dangerOverlayStyles, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), extensionLabelStyles, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), extensionLabelStyles, dangerOverlayStyles, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* ToolbarPortal.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useToolbarPortal = exports.ToolbarPortalMountPoint = exports.ToolbarPortalContextProvider = void 0;
|
|
9
|
+
require("./ToolbarPortal.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var ToolbarPortalContext = /*#__PURE__*/_react.default.createContext(undefined);
|
|
13
|
+
var ToolbarPortalContextProvider = exports.ToolbarPortalContextProvider = function ToolbarPortalContextProvider(_ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
portal = _ref.portal,
|
|
16
|
+
isActive = _ref.isActive;
|
|
17
|
+
var value = _react.default.useMemo(function () {
|
|
18
|
+
return {
|
|
19
|
+
Portal: portal,
|
|
20
|
+
isActive: isActive
|
|
21
|
+
};
|
|
22
|
+
}, [portal, isActive]);
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(ToolbarPortalContext.Provider, {
|
|
24
|
+
value: value
|
|
25
|
+
}, children);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// NOTE: This doesn't throw on undefined context on purpose, as it is likely that
|
|
29
|
+
// the outer toolbar _won't_ have a context provider as it is unlikely to portal
|
|
30
|
+
// anywhere
|
|
31
|
+
var useToolbarPortal = exports.useToolbarPortal = function useToolbarPortal() {
|
|
32
|
+
return _react.default.useContext(ToolbarPortalContext);
|
|
33
|
+
};
|
|
34
|
+
var toolbarPortalStyles = {
|
|
35
|
+
portal: "_1r04ze3t _kqswstnw _fiawglyw"
|
|
36
|
+
};
|
|
37
|
+
var ToolbarPortalMountPoint = exports.ToolbarPortalMountPoint = function ToolbarPortalMountPoint() {
|
|
38
|
+
var portal = useToolbarPortal();
|
|
39
|
+
|
|
40
|
+
// Don't render a mountpoint when we're already inside a portal
|
|
41
|
+
if (portal) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
className: (0, _runtime.ax)([toolbarPortalStyles.portal, "ak-editor-toolbar-portal"])
|
|
47
|
+
});
|
|
48
|
+
};
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import { useCallback, useMemo, useRef } from 'react';
|
|
6
|
+
import { useCallback, useMemo, useRef, Fragment } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
@@ -14,11 +14,13 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents'
|
|
|
14
14
|
import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
16
16
|
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils/analytics';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import EditorActions from '../actions';
|
|
18
19
|
import { useEditorContext } from '../ui/EditorContext';
|
|
19
20
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
20
21
|
import measurements from '../utils/performance/measure-enum';
|
|
21
22
|
import { name, version } from '../version-wrapper';
|
|
23
|
+
import { EditorUFOBridge, EditorPerformanceMetrics } from './core-performance-metrics';
|
|
22
24
|
import { EditorInternal } from './editor-internal';
|
|
23
25
|
import useMeasureEditorMountTime from './hooks/useMeasureEditorMountTime';
|
|
24
26
|
// Ignored via go/ees005
|
|
@@ -89,7 +91,8 @@ function Editor(passedProps) {
|
|
|
89
91
|
onSaveFromProps(view);
|
|
90
92
|
}
|
|
91
93
|
}, [onSaveFromProps]);
|
|
92
|
-
|
|
94
|
+
const isFullPageApperance = Boolean(props.appearance && ['full-page', 'full-width'].includes(props.appearance));
|
|
95
|
+
return jsx(Fragment, null, isFullPageApperance && fg('platform_editor_fe--ufo-bridge') ? jsx(EditorUFOBridge, null) : null, isFullPageApperance && fg('platform_editor_fe--performance_metrics') ? jsx(EditorPerformanceMetrics, null) : null, jsx(EditorInternal, {
|
|
93
96
|
props: props,
|
|
94
97
|
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
95
98
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
@@ -100,7 +103,7 @@ function Editor(passedProps) {
|
|
|
100
103
|
onEditorDestroyed: onEditorDestroyed,
|
|
101
104
|
providerFactory: providerFactory,
|
|
102
105
|
AppearanceComponent: props.AppearanceComponent
|
|
103
|
-
});
|
|
106
|
+
}));
|
|
104
107
|
}
|
|
105
108
|
const useMemoEditorFeatureFlags = featureFlags => {
|
|
106
109
|
const ffRef = useRef(featureFlags);
|