@atlaskit/editor-core 203.2.1 → 203.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/composable-editor/core-editor.js +2 -0
- package/dist/cjs/composable-editor/editor-internal.js +2 -3
- package/dist/cjs/composable-editor/temp_useTrackDangerousPlugins.js +35 -0
- package/dist/cjs/create-editor/ReactEditorViewNext.js +1 -1
- package/dist/cjs/ui/ContentStyles/layout.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/core-editor.js +2 -0
- package/dist/es2019/composable-editor/editor-internal.js +2 -3
- package/dist/es2019/composable-editor/temp_useTrackDangerousPlugins.js +27 -0
- package/dist/es2019/create-editor/ReactEditorViewNext.js +1 -1
- package/dist/es2019/ui/ContentStyles/layout.js +1 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/core-editor.js +2 -0
- package/dist/esm/composable-editor/editor-internal.js +2 -3
- package/dist/esm/composable-editor/temp_useTrackDangerousPlugins.js +29 -0
- package/dist/esm/create-editor/ReactEditorViewNext.js +1 -1
- package/dist/esm/ui/ContentStyles/layout.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/temp_useTrackDangerousPlugins.d.ts +3 -0
- package/dist/types/create-editor/create-universal-preset.d.ts +244 -19
- package/dist/types/presets/default.d.ts +174 -14
- package/dist/types/presets/universal.d.ts +244 -19
- package/dist/types/presets/useUniversalPreset.d.ts +244 -19
- package/dist/types-ts4.5/composable-editor/temp_useTrackDangerousPlugins.d.ts +3 -0
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +276 -18
- package/dist/types-ts4.5/presets/default.d.ts +198 -14
- package/dist/types-ts4.5/presets/universal.d.ts +276 -18
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +276 -18
- package/package.json +20 -9
- package/dist/cjs/nodeviews/context-adapter.js +0 -78
- package/dist/es2019/nodeviews/context-adapter.js +0 -48
- package/dist/esm/nodeviews/context-adapter.js +0 -71
- package/dist/types/nodeviews/context-adapter.d.ts +0 -2
- package/dist/types-ts4.5/nodeviews/context-adapter.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 203.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#176132](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/176132)
|
|
8
|
+
[`738d9aeecf5e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/738d9aeecf5e1) -
|
|
9
|
+
[ED-24119] Replace Legacy React Context with proper React Context
|
|
10
|
+
|
|
11
|
+
## 203.2.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#174774](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/174774)
|
|
16
|
+
[`8e4f117f6abde`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8e4f117f6abde) -
|
|
17
|
+
[ux] ED-25744 Resolve styling issues with column sort and background color for nested tables
|
|
18
|
+
- [#174970](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/174970)
|
|
19
|
+
[`43ca94d0ef378`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/43ca94d0ef378) -
|
|
20
|
+
[ux] Apply border radius on layout column selection
|
|
21
|
+
- [#175621](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/175621)
|
|
22
|
+
[`a29cb9d714dd5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a29cb9d714dd5) -
|
|
23
|
+
ED-25918 Add skipValidation for ReactEditorViewNext
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 203.2.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -26,6 +26,7 @@ var _editorInternal = require("./editor-internal");
|
|
|
26
26
|
var _useMeasureEditorMountTime = _interopRequireDefault(require("./hooks/useMeasureEditorMountTime"));
|
|
27
27
|
var _useMemoEditorProps = _interopRequireDefault(require("./hooks/useMemoEditorProps"));
|
|
28
28
|
var _useProviderFactory = _interopRequireDefault(require("./hooks/useProviderFactory"));
|
|
29
|
+
var _temp_useTrackDangerousPlugins = require("./temp_useTrackDangerousPlugins");
|
|
29
30
|
var _sendDurationAnalytics = _interopRequireDefault(require("./utils/sendDurationAnalytics"));
|
|
30
31
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
@@ -51,6 +52,7 @@ function Editor(passedProps) {
|
|
|
51
52
|
var handleAnalyticsEvent = (0, _react.useCallback)(function (data) {
|
|
52
53
|
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)(data);
|
|
53
54
|
}, [createAnalyticsEvent]);
|
|
55
|
+
(0, _temp_useTrackDangerousPlugins.useTrackDangerouslyAppendPlugins)(passedProps, handleAnalyticsEvent);
|
|
54
56
|
var getFeatureFlagsFromRef = (0, _react.useCallback)(function () {
|
|
55
57
|
var _propsRef$current$col, _propsRef$current$col2;
|
|
56
58
|
return _objectSpread(_objectSpread({}, (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(propsRef.current.featureFlags)), {}, {
|
|
@@ -17,7 +17,6 @@ var _ErrorBoundary = _interopRequireDefault(require("../create-editor/ErrorBound
|
|
|
17
17
|
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
18
18
|
var _ReactEditorView = _interopRequireDefault(require("../create-editor/ReactEditorView"));
|
|
19
19
|
var _ReactEditorViewNext = _interopRequireDefault(require("../create-editor/ReactEditorViewNext"));
|
|
20
|
-
var _contextAdapter = require("../nodeviews/context-adapter");
|
|
21
20
|
var _EditorContext = _interopRequireDefault(require("../ui/EditorContext"));
|
|
22
21
|
var _IntlProviderIfMissingWrapper = require("../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper");
|
|
23
22
|
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
@@ -84,7 +83,7 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
84
83
|
css: editorContainerStyles
|
|
85
84
|
}, (0, _react2.jsx)(_EditorContext.default, {
|
|
86
85
|
editorActions: editorActions
|
|
87
|
-
}, (0, _react2.jsx)(
|
|
86
|
+
}, (0, _react2.jsx)(_IntlProviderIfMissingWrapper.IntlProviderIfMissingWrapper, null, (0, _react2.jsx)(_react.Fragment, null, (0, _platformFeatureFlags.fg)('platform_editor_react_editor_view_react_18') ? (0, _react2.jsx)(_ReactEditorViewNext.default, {
|
|
88
87
|
editorProps: overriddenEditorProps,
|
|
89
88
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
90
89
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -194,7 +193,7 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
194
193
|
pluginHooks: config.pluginHooks
|
|
195
194
|
}));
|
|
196
195
|
}
|
|
197
|
-
}), (0, _react2.jsx)(PortalRenderer, null), (0, _react2.jsx)(NodeViewPortalRenderer, null)))))))
|
|
196
|
+
}), (0, _react2.jsx)(PortalRenderer, null), (0, _react2.jsx)(NodeViewPortalRenderer, null)))))));
|
|
198
197
|
});
|
|
199
198
|
function ReactEditorViewContextWrapper(props) {
|
|
200
199
|
var _media, _linking;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTrackDangerouslyAppendPlugins = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
// Temporary - track the usage of `dangerouslyAppendPlugins` which is deprecated
|
|
11
|
+
// Once `platform_editor_jira_base_composable` and `platform_editor_jira_polaris_composable` have
|
|
12
|
+
// fully rolled out in Jira this should trend to 0 and we can delete the deprecated prop.
|
|
13
|
+
var useTrackDangerouslyAppendPlugins = exports.useTrackDangerouslyAppendPlugins = function useTrackDangerouslyAppendPlugins(passedProps, handleAnalyticsEvent) {
|
|
14
|
+
var _passedProps$dangerou5;
|
|
15
|
+
(0, _react.useEffect)(function () {
|
|
16
|
+
var _passedProps$dangerou, _passedProps$dangerou2;
|
|
17
|
+
if (((_passedProps$dangerou = passedProps === null || passedProps === void 0 || (_passedProps$dangerou2 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou2 === void 0 ? void 0 : _passedProps$dangerou2.__plugins) !== null && _passedProps$dangerou !== void 0 ? _passedProps$dangerou : []).length > 0 && (0, _platformFeatureFlags.fg)('platform_editor_track_dangerous_append_plugins')) {
|
|
18
|
+
var _passedProps$dangerou3, _passedProps$dangerou4;
|
|
19
|
+
handleAnalyticsEvent({
|
|
20
|
+
payload: {
|
|
21
|
+
// @ts-expect-error Temporary action - let's not extend the public analytics enum
|
|
22
|
+
action: 'dangerousPluginAppended',
|
|
23
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
24
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
25
|
+
attributes: {
|
|
26
|
+
count: passedProps === null || passedProps === void 0 || (_passedProps$dangerou3 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou3 === void 0 ? void 0 : _passedProps$dangerou3.__plugins.length,
|
|
27
|
+
names: passedProps === null || passedProps === void 0 || (_passedProps$dangerou4 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou4 === void 0 ? void 0 : _passedProps$dangerou4.__plugins.map(function (plugin) {
|
|
28
|
+
return plugin.name;
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, [handleAnalyticsEvent, passedProps === null || passedProps === void 0 || (_passedProps$dangerou5 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou5 === void 0 ? void 0 : _passedProps$dangerou5.__plugins]);
|
|
35
|
+
};
|
|
@@ -164,7 +164,7 @@ function ReactEditorView(props) {
|
|
|
164
164
|
if (options.doc) {
|
|
165
165
|
// if the collabEdit API is set, skip this validation due to potential pm validation errors
|
|
166
166
|
// from docs that end up with invalid marks after processing (See #hot-111702 for more details)
|
|
167
|
-
if ((api === null || api === void 0 ? void 0 : api.collabEdit) !== undefined && (0, _platformFeatureFlags.fg)('editor_load_conf_collab_docs_without_checks')) {
|
|
167
|
+
if ((api === null || api === void 0 ? void 0 : api.collabEdit) !== undefined && (0, _platformFeatureFlags.fg)('editor_load_conf_collab_docs_without_checks') || options.props.editorProps.skipValidation) {
|
|
168
168
|
doc = (0, _processRawValue.processRawValueWithoutValidation)(schema, options.doc, dispatchAnalyticsEvent);
|
|
169
169
|
} else {
|
|
170
170
|
doc = (0, _processRawValue.processRawValue)(schema, options.doc, options.props.providerFactory, options.props.editorProps.sanitizePrivateContent, contentTransformer.current, dispatchAnalyticsEvent);
|
|
@@ -23,7 +23,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
23
23
|
// TODO handle responsive
|
|
24
24
|
var layoutColumnStyles = function layoutColumnStyles() {
|
|
25
25
|
return (0, _experiments.editorExperiment)('advanced_layouts', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
26
|
-
(0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN / 2, _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket])) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
26
|
+
(0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN / 2, _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), "var(--ds-border-radius, 3px)") : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
27
27
|
(0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: ", "px;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth);
|
|
28
28
|
};
|
|
29
29
|
var layoutSectionStyles = function layoutSectionStyles() {
|
|
@@ -23,6 +23,7 @@ import { EditorInternal } from './editor-internal';
|
|
|
23
23
|
import useMeasureEditorMountTime from './hooks/useMeasureEditorMountTime';
|
|
24
24
|
import useMemoEditorProps from './hooks/useMemoEditorProps';
|
|
25
25
|
import useProviderFactory from './hooks/useProviderFactory';
|
|
26
|
+
import { useTrackDangerouslyAppendPlugins } from './temp_useTrackDangerousPlugins';
|
|
26
27
|
import sendDurationAnalytics from './utils/sendDurationAnalytics';
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -43,6 +44,7 @@ function Editor(passedProps) {
|
|
|
43
44
|
const handleAnalyticsEvent = useCallback(data => {
|
|
44
45
|
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
45
46
|
}, [createAnalyticsEvent]);
|
|
47
|
+
useTrackDangerouslyAppendPlugins(passedProps, handleAnalyticsEvent);
|
|
46
48
|
const getFeatureFlagsFromRef = useCallback(() => {
|
|
47
49
|
var _propsRef$current$col, _propsRef$current$col2;
|
|
48
50
|
return {
|
|
@@ -14,7 +14,6 @@ import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
|
14
14
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
15
15
|
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
16
16
|
import ReactEditorViewNext from '../create-editor/ReactEditorViewNext';
|
|
17
|
-
import { ContextAdapter } from '../nodeviews/context-adapter';
|
|
18
17
|
import EditorContext from '../ui/EditorContext';
|
|
19
18
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
20
19
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
@@ -72,7 +71,7 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
72
71
|
css: editorContainerStyles
|
|
73
72
|
}, jsx(EditorContext, {
|
|
74
73
|
editorActions: editorActions
|
|
75
|
-
}, jsx(
|
|
74
|
+
}, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, fg('platform_editor_react_editor_view_react_18') ? jsx(ReactEditorViewNext, {
|
|
76
75
|
editorProps: overriddenEditorProps,
|
|
77
76
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
78
77
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -184,7 +183,7 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
184
183
|
pluginHooks: config.pluginHooks
|
|
185
184
|
}));
|
|
186
185
|
}
|
|
187
|
-
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))))
|
|
186
|
+
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
|
|
188
187
|
});
|
|
189
188
|
function ReactEditorViewContextWrapper(props) {
|
|
190
189
|
var _media, _linking, _linking$smartLinks;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
// Temporary - track the usage of `dangerouslyAppendPlugins` which is deprecated
|
|
5
|
+
// Once `platform_editor_jira_base_composable` and `platform_editor_jira_polaris_composable` have
|
|
6
|
+
// fully rolled out in Jira this should trend to 0 and we can delete the deprecated prop.
|
|
7
|
+
export const useTrackDangerouslyAppendPlugins = (passedProps, handleAnalyticsEvent) => {
|
|
8
|
+
var _passedProps$dangerou5;
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
var _passedProps$dangerou, _passedProps$dangerou2;
|
|
11
|
+
if (((_passedProps$dangerou = passedProps === null || passedProps === void 0 ? void 0 : (_passedProps$dangerou2 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou2 === void 0 ? void 0 : _passedProps$dangerou2.__plugins) !== null && _passedProps$dangerou !== void 0 ? _passedProps$dangerou : []).length > 0 && fg('platform_editor_track_dangerous_append_plugins')) {
|
|
12
|
+
var _passedProps$dangerou3, _passedProps$dangerou4;
|
|
13
|
+
handleAnalyticsEvent({
|
|
14
|
+
payload: {
|
|
15
|
+
// @ts-expect-error Temporary action - let's not extend the public analytics enum
|
|
16
|
+
action: 'dangerousPluginAppended',
|
|
17
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
18
|
+
eventType: EVENT_TYPE.TRACK,
|
|
19
|
+
attributes: {
|
|
20
|
+
count: passedProps === null || passedProps === void 0 ? void 0 : (_passedProps$dangerou3 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou3 === void 0 ? void 0 : _passedProps$dangerou3.__plugins.length,
|
|
21
|
+
names: passedProps === null || passedProps === void 0 ? void 0 : (_passedProps$dangerou4 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou4 === void 0 ? void 0 : _passedProps$dangerou4.__plugins.map(plugin => plugin.name)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}, [handleAnalyticsEvent, passedProps === null || passedProps === void 0 ? void 0 : (_passedProps$dangerou5 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou5 === void 0 ? void 0 : _passedProps$dangerou5.__plugins]);
|
|
27
|
+
};
|
|
@@ -140,7 +140,7 @@ function ReactEditorView(props) {
|
|
|
140
140
|
if (options.doc) {
|
|
141
141
|
// if the collabEdit API is set, skip this validation due to potential pm validation errors
|
|
142
142
|
// from docs that end up with invalid marks after processing (See #hot-111702 for more details)
|
|
143
|
-
if ((api === null || api === void 0 ? void 0 : api.collabEdit) !== undefined && fg('editor_load_conf_collab_docs_without_checks')) {
|
|
143
|
+
if ((api === null || api === void 0 ? void 0 : api.collabEdit) !== undefined && fg('editor_load_conf_collab_docs_without_checks') || options.props.editorProps.skipValidation) {
|
|
144
144
|
doc = processRawValueWithoutValidation(schema, options.doc, dispatchAnalyticsEvent);
|
|
145
145
|
} else {
|
|
146
146
|
doc = processRawValue(schema, options.doc, options.props.providerFactory, options.props.editorProps.sanitizePrivateContent, contentTransformer.current, dispatchAnalyticsEvent);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "203.2.
|
|
2
|
+
export const version = "203.2.3";
|
|
@@ -26,6 +26,7 @@ import { EditorInternal } from './editor-internal';
|
|
|
26
26
|
import useMeasureEditorMountTime from './hooks/useMeasureEditorMountTime';
|
|
27
27
|
import useMemoEditorProps from './hooks/useMemoEditorProps';
|
|
28
28
|
import useProviderFactory from './hooks/useProviderFactory';
|
|
29
|
+
import { useTrackDangerouslyAppendPlugins } from './temp_useTrackDangerousPlugins';
|
|
29
30
|
import sendDurationAnalytics from './utils/sendDurationAnalytics';
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -47,6 +48,7 @@ function Editor(passedProps) {
|
|
|
47
48
|
var handleAnalyticsEvent = useCallback(function (data) {
|
|
48
49
|
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
49
50
|
}, [createAnalyticsEvent]);
|
|
51
|
+
useTrackDangerouslyAppendPlugins(passedProps, handleAnalyticsEvent);
|
|
50
52
|
var getFeatureFlagsFromRef = useCallback(function () {
|
|
51
53
|
var _propsRef$current$col, _propsRef$current$col2;
|
|
52
54
|
return _objectSpread(_objectSpread({}, createFeatureFlagsFromProps(propsRef.current.featureFlags)), {}, {
|
|
@@ -18,7 +18,6 @@ import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
|
18
18
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
19
19
|
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
20
20
|
import ReactEditorViewNext from '../create-editor/ReactEditorViewNext';
|
|
21
|
-
import { ContextAdapter } from '../nodeviews/context-adapter';
|
|
22
21
|
import EditorContext from '../ui/EditorContext';
|
|
23
22
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
24
23
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
@@ -80,7 +79,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
80
79
|
css: editorContainerStyles
|
|
81
80
|
}, jsx(EditorContext, {
|
|
82
81
|
editorActions: editorActions
|
|
83
|
-
}, jsx(
|
|
82
|
+
}, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, fg('platform_editor_react_editor_view_react_18') ? jsx(ReactEditorViewNext, {
|
|
84
83
|
editorProps: overriddenEditorProps,
|
|
85
84
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
86
85
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -190,7 +189,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
190
189
|
pluginHooks: config.pluginHooks
|
|
191
190
|
}));
|
|
192
191
|
}
|
|
193
|
-
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))))
|
|
192
|
+
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
|
|
194
193
|
});
|
|
195
194
|
function ReactEditorViewContextWrapper(props) {
|
|
196
195
|
var _media, _linking;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
// Temporary - track the usage of `dangerouslyAppendPlugins` which is deprecated
|
|
5
|
+
// Once `platform_editor_jira_base_composable` and `platform_editor_jira_polaris_composable` have
|
|
6
|
+
// fully rolled out in Jira this should trend to 0 and we can delete the deprecated prop.
|
|
7
|
+
export var useTrackDangerouslyAppendPlugins = function useTrackDangerouslyAppendPlugins(passedProps, handleAnalyticsEvent) {
|
|
8
|
+
var _passedProps$dangerou5;
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
var _passedProps$dangerou, _passedProps$dangerou2;
|
|
11
|
+
if (((_passedProps$dangerou = passedProps === null || passedProps === void 0 || (_passedProps$dangerou2 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou2 === void 0 ? void 0 : _passedProps$dangerou2.__plugins) !== null && _passedProps$dangerou !== void 0 ? _passedProps$dangerou : []).length > 0 && fg('platform_editor_track_dangerous_append_plugins')) {
|
|
12
|
+
var _passedProps$dangerou3, _passedProps$dangerou4;
|
|
13
|
+
handleAnalyticsEvent({
|
|
14
|
+
payload: {
|
|
15
|
+
// @ts-expect-error Temporary action - let's not extend the public analytics enum
|
|
16
|
+
action: 'dangerousPluginAppended',
|
|
17
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
18
|
+
eventType: EVENT_TYPE.TRACK,
|
|
19
|
+
attributes: {
|
|
20
|
+
count: passedProps === null || passedProps === void 0 || (_passedProps$dangerou3 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou3 === void 0 ? void 0 : _passedProps$dangerou3.__plugins.length,
|
|
21
|
+
names: passedProps === null || passedProps === void 0 || (_passedProps$dangerou4 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou4 === void 0 ? void 0 : _passedProps$dangerou4.__plugins.map(function (plugin) {
|
|
22
|
+
return plugin.name;
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, [handleAnalyticsEvent, passedProps === null || passedProps === void 0 || (_passedProps$dangerou5 = passedProps.dangerouslyAppendPlugins) === null || _passedProps$dangerou5 === void 0 ? void 0 : _passedProps$dangerou5.__plugins]);
|
|
29
|
+
};
|
|
@@ -154,7 +154,7 @@ function ReactEditorView(props) {
|
|
|
154
154
|
if (options.doc) {
|
|
155
155
|
// if the collabEdit API is set, skip this validation due to potential pm validation errors
|
|
156
156
|
// from docs that end up with invalid marks after processing (See #hot-111702 for more details)
|
|
157
|
-
if ((api === null || api === void 0 ? void 0 : api.collabEdit) !== undefined && fg('editor_load_conf_collab_docs_without_checks')) {
|
|
157
|
+
if ((api === null || api === void 0 ? void 0 : api.collabEdit) !== undefined && fg('editor_load_conf_collab_docs_without_checks') || options.props.editorProps.skipValidation) {
|
|
158
158
|
doc = processRawValueWithoutValidation(schema, options.doc, dispatchAnalyticsEvent);
|
|
159
159
|
} else {
|
|
160
160
|
doc = processRawValue(schema, options.doc, options.props.providerFactory, options.props.editorProps.sanitizePrivateContent, contentTransformer.current, dispatchAnalyticsEvent);
|
|
@@ -17,7 +17,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
17
17
|
// TODO handle responsive
|
|
18
18
|
var layoutColumnStyles = function layoutColumnStyles() {
|
|
19
19
|
return editorExperiment('advanced_layouts', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
20
|
-
css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), LAYOUT_SECTION_MARGIN / 2, gridMediumMaxWidth, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Blanket])) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
20
|
+
css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), LAYOUT_SECTION_MARGIN / 2, gridMediumMaxWidth, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Blanket]), "var(--ds-border-radius, 3px)") : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
21
21
|
css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: ", "px;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), LAYOUT_SECTION_MARGIN, gridMediumMaxWidth);
|
|
22
22
|
};
|
|
23
23
|
var layoutSectionStyles = function layoutSectionStyles() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "203.2.
|
|
2
|
+
export var version = "203.2.3";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorProps } from '../types/editor-props';
|
|
3
|
+
export declare const useTrackDangerouslyAppendPlugins: (passedProps: EditorProps, handleAnalyticsEvent: FireAnalyticsCallback) => void;
|