@atlaskit/editor-core 197.1.4 → 197.2.1
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 +32 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/dist/cjs/composable-editor/core-editor.js +2 -2
- package/dist/cjs/composable-editor/hooks/useMemoEditorProps.js +2 -1
- package/dist/cjs/create-editor/ReactEditorView.js +15 -12
- package/dist/cjs/create-editor/create-schema.js +2 -2
- package/dist/cjs/presets/universal.js +0 -1
- package/dist/cjs/presets/useUniversalPreset.js +4 -2
- package/dist/cjs/ui/ContentStyles/layout.js +2 -2
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/core-editor.js +1 -1
- package/dist/es2019/composable-editor/hooks/useMemoEditorProps.js +2 -1
- package/dist/es2019/create-editor/ReactEditorView.js +11 -8
- package/dist/es2019/create-editor/create-schema.js +1 -1
- package/dist/es2019/presets/universal.js +0 -1
- package/dist/es2019/presets/useUniversalPreset.js +4 -2
- package/dist/es2019/ui/ContentStyles/layout.js +3 -3
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/core-editor.js +1 -1
- package/dist/esm/composable-editor/hooks/useMemoEditorProps.js +2 -1
- package/dist/esm/create-editor/ReactEditorView.js +15 -12
- package/dist/esm/create-editor/create-schema.js +1 -1
- package/dist/esm/presets/universal.js +0 -1
- package/dist/esm/presets/useUniversalPreset.js +4 -2
- package/dist/esm/ui/ContentStyles/layout.js +2 -2
- package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/editor-internal.d.ts +1 -1
- package/dist/types/composable-editor/hooks/useEditorMeasuresConstructor.d.ts +1 -1
- package/dist/types/composable-editor/hooks/useMeasureEditorMountTime.d.ts +1 -1
- package/dist/types/composable-editor/hooks/useProviderFactory.d.ts +1 -1
- package/dist/types/composable-editor/utils/editorMeasureTTICallback.d.ts +1 -1
- package/dist/types/composable-editor/utils/sendDurationAnalytics.d.ts +1 -1
- package/dist/types/create-editor/ErrorBoundary.d.ts +1 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +1 -1
- package/dist/types/create-editor/create-plugins-list.d.ts +1 -1
- package/dist/types/presets/default.d.ts +1 -1
- package/dist/types/presets/universal.d.ts +2 -1
- package/dist/types/types/editor-props.d.ts +2 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/composable-editor/editor-internal.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/hooks/useEditorMeasuresConstructor.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/hooks/useMeasureEditorMountTime.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/hooks/useProviderFactory.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/utils/editorMeasureTTICallback.d.ts +1 -1
- package/dist/types-ts4.5/composable-editor/utils/sendDurationAnalytics.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/ErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +1 -1
- package/dist/types-ts4.5/presets/default.d.ts +1 -1
- package/dist/types-ts4.5/presets/universal.d.ts +2 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +2 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +4 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#136143](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136143)
|
|
8
|
+
[`851c2575d214e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/851c2575d214e) -
|
|
9
|
+
Use optimised entry-points for analytics packages to reduce bundle size.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 197.2.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#135954](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135954)
|
|
17
|
+
[`62ec64be9ed01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/62ec64be9ed01) -
|
|
18
|
+
Exposing a table's plugin configuration option for table alignment feature.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#136078](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136078)
|
|
23
|
+
[`09414d7233497`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/09414d7233497) -
|
|
24
|
+
ED-24507 Switch nested dnd FG to experiment and include padding changes"
|
|
25
|
+
- [#134667](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134667)
|
|
26
|
+
[`2c9b19e28b320`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c9b19e28b320) -
|
|
27
|
+
Add assistiveDescribedBy prop for aria-describedby to address a11y issues
|
|
28
|
+
- [#135936](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135936)
|
|
29
|
+
[`f5825c21dab81`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f5825c21dab81) -
|
|
30
|
+
Properly check should component update correctly in ToolbarInner
|
|
31
|
+
- [#135954](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135954)
|
|
32
|
+
[`62ec64be9ed01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/62ec64be9ed01) -
|
|
33
|
+
Table alignment feature flag cleanup
|
|
34
|
+
|
|
3
35
|
## 197.1.4
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -12,7 +12,7 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
13
13
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
14
14
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
15
|
-
var
|
|
15
|
+
var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
|
|
16
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
17
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
18
18
|
var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
|
|
@@ -51,7 +51,7 @@ function Editor(passedProps) {
|
|
|
51
51
|
}, []);
|
|
52
52
|
var editorActions = editorContext.editorActions || editorActionsPlaceholderInstance;
|
|
53
53
|
var startTime = (0, _react.useRef)(performance.now());
|
|
54
|
-
var _useAnalyticsEvents = (0,
|
|
54
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
55
55
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
56
56
|
var experienceStore = (0, _react.useRef)();
|
|
57
57
|
var handleAnalyticsEvent = (0, _react.useCallback)(function (data) {
|
|
@@ -31,6 +31,7 @@ var useMemoEditorProps = exports.useMemoEditorProps = function useMemoEditorProp
|
|
|
31
31
|
placeholderBracketHint: passedProps.placeholderBracketHint,
|
|
32
32
|
defaultValue: passedProps.defaultValue,
|
|
33
33
|
assistiveLabel: passedProps.assistiveLabel,
|
|
34
|
+
assistiveDescribedBy: passedProps.assistiveDescribedBy,
|
|
34
35
|
popupsMountPoint: passedProps.popupsMountPoint,
|
|
35
36
|
popupsBoundariesElement: passedProps.popupsBoundariesElement,
|
|
36
37
|
popupsScrollableElement: passedProps.popupsScrollableElement,
|
|
@@ -118,7 +119,7 @@ var useMemoEditorProps = exports.useMemoEditorProps = function useMemoEditorProp
|
|
|
118
119
|
};
|
|
119
120
|
var nextProps = _objectSpread(_objectSpread({}, defaultProps), allProps);
|
|
120
121
|
return nextProps;
|
|
121
|
-
}, [passedProps.preset, passedProps.appearance, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.inputSamplingLimit, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.trackValidTransactions, passedProps.useStickyToolbar, passedProps.featureFlags, passedProps.onSave, passedProps.performanceTracking, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.hideAvatarGroup, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowJiraIssue, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowNewInsertionBehaviour, passedProps.allowFindReplace, passedProps.UNSAFE_allowBorderMark, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.dangerouslyAppendPlugins, passedProps.__livePage, passedProps.AppearanceComponent]);
|
|
122
|
+
}, [passedProps.preset, passedProps.appearance, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.assistiveDescribedBy, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.inputSamplingLimit, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.trackValidTransactions, passedProps.useStickyToolbar, passedProps.featureFlags, passedProps.onSave, passedProps.performanceTracking, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.hideAvatarGroup, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowJiraIssue, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowNewInsertionBehaviour, passedProps.allowFindReplace, passedProps.UNSAFE_allowBorderMark, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.dangerouslyAppendPlugins, passedProps.__livePage, passedProps.AppearanceComponent]);
|
|
122
123
|
return memodProps;
|
|
123
124
|
};
|
|
124
125
|
var _default = exports.default = useMemoEditorProps;
|
|
@@ -87,7 +87,7 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
87
87
|
(0, _inherits2.default)(ReactEditorView, _React$Component);
|
|
88
88
|
var _super = _createSuper(ReactEditorView);
|
|
89
89
|
function ReactEditorView(props) {
|
|
90
|
-
var _props$setEditorApi, _props$editorProps;
|
|
90
|
+
var _this$props$editorPro5, _props$setEditorApi, _props$editorProps;
|
|
91
91
|
var _this;
|
|
92
92
|
(0, _classCallCheck2.default)(this, ReactEditorView);
|
|
93
93
|
_this = _super.call(this, props);
|
|
@@ -524,7 +524,7 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
526
|
});
|
|
527
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createEditor", function (assistiveLabel) {
|
|
527
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createEditor", function (assistiveLabel, assistiveDescribedBy) {
|
|
528
528
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
529
529
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
530
530
|
className: getUAPrefix(),
|
|
@@ -539,10 +539,11 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
539
539
|
,
|
|
540
540
|
"aria-multiline": _this.props.editorProps.appearance !== 'mobile' ? true : false,
|
|
541
541
|
role: "textbox",
|
|
542
|
-
id: EDIT_AREA_ID
|
|
542
|
+
id: EDIT_AREA_ID,
|
|
543
|
+
"aria-describedby": assistiveDescribedBy
|
|
543
544
|
});
|
|
544
545
|
});
|
|
545
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "editor", _this.createEditor(_this.props.editorProps.assistiveLabel));
|
|
546
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "editor", _this.createEditor(_this.props.editorProps.assistiveLabel, (_this$props$editorPro5 = _this.props.editorProps) === null || _this$props$editorPro5 === void 0 ? void 0 : _this$props$editorPro5.assistiveDescribedBy));
|
|
546
547
|
_this.pluginInjectionAPI = new _preset.EditorPluginInjectionAPI({
|
|
547
548
|
getEditorState: _this.getEditorState,
|
|
548
549
|
getEditorView: _this.getEditorView
|
|
@@ -603,8 +604,8 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
603
604
|
(0, _createClass2.default)(ReactEditorView, [{
|
|
604
605
|
key: "transactionTracking",
|
|
605
606
|
get: function get() {
|
|
606
|
-
var _this$props$
|
|
607
|
-
return (_this$props$
|
|
607
|
+
var _this$props$editorPro6, _this$props$editorPro7;
|
|
608
|
+
return (_this$props$editorPro6 = (_this$props$editorPro7 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro7 === void 0 ? void 0 : _this$props$editorPro7.transactionTracking) !== null && _this$props$editorPro6 !== void 0 ? _this$props$editorPro6 : {
|
|
608
609
|
enabled: false
|
|
609
610
|
};
|
|
610
611
|
}
|
|
@@ -624,15 +625,16 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
624
625
|
}, {
|
|
625
626
|
key: "isTransactionTrackingExplicitlyDisabled",
|
|
626
627
|
value: function isTransactionTrackingExplicitlyDisabled() {
|
|
627
|
-
var _this$props$
|
|
628
|
+
var _this$props$editorPro8;
|
|
628
629
|
// ED-16320: Check for explicit disable so that by default
|
|
629
630
|
// it will still be enabled as it currently is. Then we can
|
|
630
631
|
// progressively opt out synthetic tenants.
|
|
631
|
-
return ((_this$props$
|
|
632
|
+
return ((_this$props$editorPro8 = this.props.editorProps) === null || _this$props$editorPro8 === void 0 || (_this$props$editorPro8 = _this$props$editorPro8.performanceTracking) === null || _this$props$editorPro8 === void 0 || (_this$props$editorPro8 = _this$props$editorPro8.transactionTracking) === null || _this$props$editorPro8 === void 0 ? void 0 : _this$props$editorPro8.enabled) === false;
|
|
632
633
|
}
|
|
633
634
|
}, {
|
|
634
635
|
key: "UNSAFE_componentWillReceiveProps",
|
|
635
636
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
637
|
+
var _nextProps$editorProp, _this$props$editorPro9;
|
|
636
638
|
if (this.view && this.props.editorProps.disabled !== nextProps.editorProps.disabled) {
|
|
637
639
|
// Disables the contentEditable attribute of the editor if the editor is disabled
|
|
638
640
|
this.view.setProps({
|
|
@@ -665,8 +667,9 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
665
667
|
if (!this.transactionTracking.enabled) {
|
|
666
668
|
this.pluginPerformanceObserver.disconnect();
|
|
667
669
|
}
|
|
668
|
-
if (nextProps.editorProps.assistiveLabel !== this.props.editorProps.assistiveLabel) {
|
|
669
|
-
|
|
670
|
+
if (nextProps.editorProps.assistiveLabel !== this.props.editorProps.assistiveLabel || ((_nextProps$editorProp = nextProps.editorProps) === null || _nextProps$editorProp === void 0 ? void 0 : _nextProps$editorProp.assistiveDescribedBy) !== ((_this$props$editorPro9 = this.props.editorProps) === null || _this$props$editorPro9 === void 0 ? void 0 : _this$props$editorPro9.assistiveDescribedBy)) {
|
|
671
|
+
var _nextProps$editorProp2;
|
|
672
|
+
this.editor = this.createEditor(nextProps.editorProps.assistiveLabel, (_nextProps$editorProp2 = nextProps.editorProps) === null || _nextProps$editorProp2 === void 0 ? void 0 : _nextProps$editorProp2.assistiveDescribedBy);
|
|
670
673
|
}
|
|
671
674
|
}
|
|
672
675
|
}, {
|
|
@@ -767,9 +770,9 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
767
770
|
}, {
|
|
768
771
|
key: "render",
|
|
769
772
|
value: function render() {
|
|
770
|
-
var _this$props$
|
|
773
|
+
var _this$props$editorPro10,
|
|
771
774
|
_this3 = this;
|
|
772
|
-
var renderTracking = (_this$props$
|
|
775
|
+
var renderTracking = (_this$props$editorPro10 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro10 === void 0 || (_this$props$editorPro10 = _this$props$editorPro10.renderTracking) === null || _this$props$editorPro10 === void 0 ? void 0 : _this$props$editorPro10.reactEditorView;
|
|
773
776
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
774
777
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
775
778
|
return /*#__PURE__*/_react.default.createElement(_ReactEditorViewContext.default.Provider, {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createSchema = createSchema;
|
|
7
|
-
var
|
|
7
|
+
var _schema = require("@atlaskit/adf-schema/schema");
|
|
8
8
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
9
|
var _createEditor = require("./create-editor");
|
|
10
10
|
var _sortByOrder = require("./sort-by-order");
|
|
@@ -13,7 +13,7 @@ function createSchema(editorConfig) {
|
|
|
13
13
|
acc[mark.name] = mark.mark;
|
|
14
14
|
return acc;
|
|
15
15
|
}, {}));
|
|
16
|
-
var nodes = (0,
|
|
16
|
+
var nodes = (0, _schema.sanitizeNodes)(editorConfig.nodes.sort((0, _sortByOrder.sortByOrder)('nodes')).reduce(function (acc, node) {
|
|
17
17
|
acc[node.name] = node.node;
|
|
18
18
|
return acc;
|
|
19
19
|
}, {}), marks);
|
|
@@ -152,7 +152,6 @@ function createUniversalPresetInternal(_ref) {
|
|
|
152
152
|
fullWidthEnabled: appearance === 'full-width',
|
|
153
153
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
154
154
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
155
|
-
isTableAlignmentEnabled: (0, _platformFeatureFlags.fg)('platform.editor.table.allow-table-alignment') && (isFullPage || isComment && (0, _platformFeatureFlags.fg)('platform_editor_table_support_in_comment')),
|
|
156
155
|
isNewColumnResizingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableNewColumnResizing) && isFullPage,
|
|
157
156
|
isCommentEditor: isComment,
|
|
158
157
|
isChromelessEditor: isChromeless
|
|
@@ -32,10 +32,12 @@ function useUniversalPreset(_ref) {
|
|
|
32
32
|
if (!recreate) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
+
// we are not comparing the previous initialPluginConfiguration to the new one assuming that it never changes
|
|
35
36
|
setPreset((0, _createUniversalPreset.createUniversalPreset)({
|
|
36
37
|
props: props,
|
|
37
|
-
prevProps: previousEditorProps
|
|
38
|
+
prevProps: previousEditorProps,
|
|
39
|
+
initialPluginConfiguration: initialPluginConfiguration
|
|
38
40
|
}));
|
|
39
|
-
}, [props, previousEditorProps]);
|
|
41
|
+
}, [props, previousEditorProps, initialPluginConfiguration]);
|
|
40
42
|
return preset;
|
|
41
43
|
}
|
|
@@ -23,10 +23,10 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
23
23
|
var _types = require("@atlaskit/editor-plugins/table/types");
|
|
24
24
|
var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
|
|
25
25
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
26
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
26
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
28
28
|
var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
29
29
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
30
30
|
var layoutStyles = exports.layoutStyles = function layoutStyles(viewMode) {
|
|
31
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", " [data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px ", "px ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t> :not(style):first-child,\n\t\t\t\t\t> style:first-child + * {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\tmargin-left: ", "px;\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\t\t\t// This is because the default state already uses the same token and, as such, the hover style won't change anything.\n\t\t\t// https://product-fabric.atlassian.net/browse/DSP-4441\n\t\t\t/* Shows the border when cursor is inside a layout */\n\t\t\t&.selected [data-layout-column],\n\t\t\t&:hover [data-layout-column] {\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&.selected.danger > [data-layout-column] {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&.", ":not(.danger) {\n\t\t\t\t[data-layout-column] {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n"])), _styles.columnLayoutSharedStyle, "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0,
|
|
31
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", " [data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px ", "px ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t> :not(style):first-child,\n\t\t\t\t\t> style:first-child + * {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t\t> style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\tmargin-left: ", "px;\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\t\t\t// This is because the default state already uses the same token and, as such, the hover style won't change anything.\n\t\t\t// https://product-fabric.atlassian.net/browse/DSP-4441\n\t\t\t/* Shows the border when cursor is inside a layout */\n\t\t\t&.selected [data-layout-column],\n\t\t\t&:hover [data-layout-column] {\n\t\t\t\tborder: ", "px solid\n\t\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&.selected.danger > [data-layout-column] {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&.", ":not(.danger) {\n\t\t\t\t[data-layout-column] {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n"])), _styles.columnLayoutSharedStyle, "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _experiments.editorExperiment)('nested-dnd', true) ? 8 : 0), _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _experiments.editorExperiment)('nested-dnd', true) ? 8 : 0), _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N50A, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Border, _editorSharedStyles.SelectionStyle.Blanket]), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode);
|
|
32
32
|
};
|
|
@@ -13,6 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
+
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
16
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
@@ -34,7 +35,7 @@ var ToolbarInner = exports.ToolbarInner = /*#__PURE__*/function (_React$Componen
|
|
|
34
35
|
(0, _createClass2.default)(ToolbarInner, [{
|
|
35
36
|
key: "shouldComponentUpdate",
|
|
36
37
|
value: function shouldComponentUpdate(nextProps) {
|
|
37
|
-
return
|
|
38
|
+
return !(0, _isEqual.default)(nextProps, this.props);
|
|
38
39
|
}
|
|
39
40
|
}, {
|
|
40
41
|
key: "render",
|
|
@@ -10,7 +10,7 @@ import { jsx } from '@emotion/react';
|
|
|
10
10
|
import isEqual from 'lodash/isEqual';
|
|
11
11
|
import uuid from 'uuid/v4';
|
|
12
12
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
13
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
14
14
|
import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { useConstructor } from '@atlaskit/editor-common/hooks';
|
|
16
16
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
@@ -21,6 +21,7 @@ export const useMemoEditorProps = passedProps => {
|
|
|
21
21
|
placeholderBracketHint: passedProps.placeholderBracketHint,
|
|
22
22
|
defaultValue: passedProps.defaultValue,
|
|
23
23
|
assistiveLabel: passedProps.assistiveLabel,
|
|
24
|
+
assistiveDescribedBy: passedProps.assistiveDescribedBy,
|
|
24
25
|
popupsMountPoint: passedProps.popupsMountPoint,
|
|
25
26
|
popupsBoundariesElement: passedProps.popupsBoundariesElement,
|
|
26
27
|
popupsScrollableElement: passedProps.popupsScrollableElement,
|
|
@@ -111,7 +112,7 @@ export const useMemoEditorProps = passedProps => {
|
|
|
111
112
|
...allProps
|
|
112
113
|
};
|
|
113
114
|
return nextProps;
|
|
114
|
-
}, [passedProps.preset, passedProps.appearance, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.inputSamplingLimit, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.trackValidTransactions, passedProps.useStickyToolbar, passedProps.featureFlags, passedProps.onSave, passedProps.performanceTracking, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.hideAvatarGroup, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowJiraIssue, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowNewInsertionBehaviour, passedProps.allowFindReplace, passedProps.UNSAFE_allowBorderMark, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.dangerouslyAppendPlugins, passedProps.__livePage, passedProps.AppearanceComponent]);
|
|
115
|
+
}, [passedProps.preset, passedProps.appearance, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.assistiveDescribedBy, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.inputSamplingLimit, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.trackValidTransactions, passedProps.useStickyToolbar, passedProps.featureFlags, passedProps.onSave, passedProps.performanceTracking, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.hideAvatarGroup, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowJiraIssue, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowNewInsertionBehaviour, passedProps.allowFindReplace, passedProps.UNSAFE_allowBorderMark, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.dangerouslyAppendPlugins, passedProps.__livePage, passedProps.AppearanceComponent]);
|
|
115
116
|
return memodProps;
|
|
116
117
|
};
|
|
117
118
|
export default useMemoEditorProps;
|
|
@@ -87,7 +87,7 @@ export class ReactEditorView extends React.Component {
|
|
|
87
87
|
return ((_this$props$editorPro3 = this.props.editorProps) === null || _this$props$editorPro3 === void 0 ? void 0 : (_this$props$editorPro4 = _this$props$editorPro3.performanceTracking) === null || _this$props$editorPro4 === void 0 ? void 0 : (_this$props$editorPro5 = _this$props$editorPro4.transactionTracking) === null || _this$props$editorPro5 === void 0 ? void 0 : _this$props$editorPro5.enabled) === false;
|
|
88
88
|
}
|
|
89
89
|
constructor(props) {
|
|
90
|
-
var _props$setEditorApi, _props$editorProps, _props$editorProps$pe, _props$editorProps$pe2;
|
|
90
|
+
var _this$props$editorPro12, _props$setEditorApi, _props$editorProps, _props$editorProps$pe, _props$editorProps$pe2;
|
|
91
91
|
super(props);
|
|
92
92
|
_defineProperty(this, "editorRef", /*#__PURE__*/React.createRef());
|
|
93
93
|
// ProseMirror is instantiated prior to the initial React render cycle,
|
|
@@ -523,7 +523,7 @@ export class ReactEditorView extends React.Component {
|
|
|
523
523
|
});
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
|
-
_defineProperty(this, "createEditor", assistiveLabel => {
|
|
526
|
+
_defineProperty(this, "createEditor", (assistiveLabel, assistiveDescribedBy) => {
|
|
527
527
|
return /*#__PURE__*/React.createElement("div", {
|
|
528
528
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
529
529
|
className: getUAPrefix(),
|
|
@@ -538,10 +538,11 @@ export class ReactEditorView extends React.Component {
|
|
|
538
538
|
,
|
|
539
539
|
"aria-multiline": this.props.editorProps.appearance !== 'mobile' ? true : false,
|
|
540
540
|
role: "textbox",
|
|
541
|
-
id: EDIT_AREA_ID
|
|
541
|
+
id: EDIT_AREA_ID,
|
|
542
|
+
"aria-describedby": assistiveDescribedBy
|
|
542
543
|
});
|
|
543
544
|
});
|
|
544
|
-
_defineProperty(this, "editor", this.createEditor(this.props.editorProps.assistiveLabel));
|
|
545
|
+
_defineProperty(this, "editor", this.createEditor(this.props.editorProps.assistiveLabel, (_this$props$editorPro12 = this.props.editorProps) === null || _this$props$editorPro12 === void 0 ? void 0 : _this$props$editorPro12.assistiveDescribedBy));
|
|
545
546
|
this.pluginInjectionAPI = new EditorPluginInjectionAPI({
|
|
546
547
|
getEditorState: this.getEditorState,
|
|
547
548
|
getEditorView: this.getEditorView
|
|
@@ -589,6 +590,7 @@ export class ReactEditorView extends React.Component {
|
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
592
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
593
|
+
var _nextProps$editorProp, _this$props$editorPro13;
|
|
592
594
|
if (this.view && this.props.editorProps.disabled !== nextProps.editorProps.disabled) {
|
|
593
595
|
// Disables the contentEditable attribute of the editor if the editor is disabled
|
|
594
596
|
this.view.setProps({
|
|
@@ -623,8 +625,9 @@ export class ReactEditorView extends React.Component {
|
|
|
623
625
|
if (!this.transactionTracking.enabled) {
|
|
624
626
|
this.pluginPerformanceObserver.disconnect();
|
|
625
627
|
}
|
|
626
|
-
if (nextProps.editorProps.assistiveLabel !== this.props.editorProps.assistiveLabel) {
|
|
627
|
-
|
|
628
|
+
if (nextProps.editorProps.assistiveLabel !== this.props.editorProps.assistiveLabel || ((_nextProps$editorProp = nextProps.editorProps) === null || _nextProps$editorProp === void 0 ? void 0 : _nextProps$editorProp.assistiveDescribedBy) !== ((_this$props$editorPro13 = this.props.editorProps) === null || _this$props$editorPro13 === void 0 ? void 0 : _this$props$editorPro13.assistiveDescribedBy)) {
|
|
629
|
+
var _nextProps$editorProp2;
|
|
630
|
+
this.editor = this.createEditor(nextProps.editorProps.assistiveLabel, (_nextProps$editorProp2 = nextProps.editorProps) === null || _nextProps$editorProp2 === void 0 ? void 0 : _nextProps$editorProp2.assistiveDescribedBy);
|
|
628
631
|
}
|
|
629
632
|
}
|
|
630
633
|
reconfigureState(props) {
|
|
@@ -712,8 +715,8 @@ export class ReactEditorView extends React.Component {
|
|
|
712
715
|
return this.editorPlugins;
|
|
713
716
|
}
|
|
714
717
|
render() {
|
|
715
|
-
var _this$props$
|
|
716
|
-
const renderTracking = (_this$props$
|
|
718
|
+
var _this$props$editorPro14, _this$props$editorPro15;
|
|
719
|
+
const renderTracking = (_this$props$editorPro14 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro14 === void 0 ? void 0 : (_this$props$editorPro15 = _this$props$editorPro14.renderTracking) === null || _this$props$editorPro15 === void 0 ? void 0 : _this$props$editorPro15.reactEditorView;
|
|
717
720
|
const renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
718
721
|
const useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
719
722
|
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sanitizeNodes } from '@atlaskit/adf-schema';
|
|
1
|
+
import { sanitizeNodes } from '@atlaskit/adf-schema/schema';
|
|
2
2
|
import { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { fixExcludes } from './create-editor';
|
|
4
4
|
import { sortByOrder } from './sort-by-order';
|
|
@@ -144,7 +144,6 @@ export default function createUniversalPresetInternal({
|
|
|
144
144
|
fullWidthEnabled: appearance === 'full-width',
|
|
145
145
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
146
146
|
getEditorFeatureFlags,
|
|
147
|
-
isTableAlignmentEnabled: fg('platform.editor.table.allow-table-alignment') && (isFullPage || isComment && fg('platform_editor_table_support_in_comment')),
|
|
148
147
|
isNewColumnResizingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableNewColumnResizing) && isFullPage,
|
|
149
148
|
isCommentEditor: isComment,
|
|
150
149
|
isChromelessEditor: isChromeless,
|
|
@@ -20,10 +20,12 @@ export default function useUniversalPreset({
|
|
|
20
20
|
if (!recreate) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
+
// we are not comparing the previous initialPluginConfiguration to the new one assuming that it never changes
|
|
23
24
|
setPreset(createUniversalPreset({
|
|
24
25
|
props,
|
|
25
|
-
prevProps: previousEditorProps
|
|
26
|
+
prevProps: previousEditorProps,
|
|
27
|
+
initialPluginConfiguration
|
|
26
28
|
}));
|
|
27
|
-
}, [props, previousEditorProps]);
|
|
29
|
+
}, [props, previousEditorProps, initialPluginConfiguration]);
|
|
28
30
|
return preset;
|
|
29
31
|
}
|
|
@@ -4,8 +4,8 @@ import { columnLayoutSharedStyle, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN }
|
|
|
4
4
|
import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
|
|
5
5
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
|
|
6
6
|
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
8
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
9
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
@@ -14,7 +14,7 @@ export const layoutStyles = viewMode => css`
|
|
|
14
14
|
${columnLayoutSharedStyle} [data-layout-section] {
|
|
15
15
|
// TODO: Migrate away from gridSize
|
|
16
16
|
// Recommendation: Replace directly with 7px
|
|
17
|
-
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (
|
|
17
|
+
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (editorExperiment('nested-dnd', true) ? 8 : 0)}px 0;
|
|
18
18
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
19
19
|
cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ export const layoutStyles = viewMode => css`
|
|
|
26
26
|
${`var(--ds-border, ${N40A})`};
|
|
27
27
|
border-radius: 4px;
|
|
28
28
|
padding: ${LAYOUT_COLUMN_PADDING}px ${LAYOUT_COLUMN_PADDING}px ${LAYOUT_COLUMN_PADDING}px
|
|
29
|
-
${LAYOUT_COLUMN_PADDING + (
|
|
29
|
+
${LAYOUT_COLUMN_PADDING + (editorExperiment('nested-dnd', true) ? 8 : 0)}px;
|
|
30
30
|
box-sizing: border-box;
|
|
31
31
|
|
|
32
32
|
> div {
|
|
@@ -6,6 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import isEqual from 'lodash/isEqual';
|
|
9
10
|
import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
10
11
|
const toolbarComponentsWrapper = css({
|
|
11
12
|
display: 'flex',
|
|
@@ -16,7 +17,7 @@ const toolbarComponentsWrapper = css({
|
|
|
16
17
|
});
|
|
17
18
|
export class ToolbarInner extends React.Component {
|
|
18
19
|
shouldComponentUpdate(nextProps) {
|
|
19
|
-
return nextProps
|
|
20
|
+
return !isEqual(nextProps, this.props);
|
|
20
21
|
}
|
|
21
22
|
render() {
|
|
22
23
|
const {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.1
|
|
2
|
+
export const version = "197.2.1";
|
|
@@ -10,7 +10,7 @@ import { jsx } from '@emotion/react';
|
|
|
10
10
|
import isEqual from 'lodash/isEqual';
|
|
11
11
|
import uuid from 'uuid/v4';
|
|
12
12
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
13
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
14
14
|
import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { useConstructor } from '@atlaskit/editor-common/hooks';
|
|
16
16
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
@@ -24,6 +24,7 @@ export var useMemoEditorProps = function useMemoEditorProps(passedProps) {
|
|
|
24
24
|
placeholderBracketHint: passedProps.placeholderBracketHint,
|
|
25
25
|
defaultValue: passedProps.defaultValue,
|
|
26
26
|
assistiveLabel: passedProps.assistiveLabel,
|
|
27
|
+
assistiveDescribedBy: passedProps.assistiveDescribedBy,
|
|
27
28
|
popupsMountPoint: passedProps.popupsMountPoint,
|
|
28
29
|
popupsBoundariesElement: passedProps.popupsBoundariesElement,
|
|
29
30
|
popupsScrollableElement: passedProps.popupsScrollableElement,
|
|
@@ -111,7 +112,7 @@ export var useMemoEditorProps = function useMemoEditorProps(passedProps) {
|
|
|
111
112
|
};
|
|
112
113
|
var nextProps = _objectSpread(_objectSpread({}, defaultProps), allProps);
|
|
113
114
|
return nextProps;
|
|
114
|
-
}, [passedProps.preset, passedProps.appearance, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.inputSamplingLimit, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.trackValidTransactions, passedProps.useStickyToolbar, passedProps.featureFlags, passedProps.onSave, passedProps.performanceTracking, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.hideAvatarGroup, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowJiraIssue, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowNewInsertionBehaviour, passedProps.allowFindReplace, passedProps.UNSAFE_allowBorderMark, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.dangerouslyAppendPlugins, passedProps.__livePage, passedProps.AppearanceComponent]);
|
|
115
|
+
}, [passedProps.preset, passedProps.appearance, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.assistiveDescribedBy, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.inputSamplingLimit, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.trackValidTransactions, passedProps.useStickyToolbar, passedProps.featureFlags, passedProps.onSave, passedProps.performanceTracking, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.hideAvatarGroup, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowJiraIssue, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowNewInsertionBehaviour, passedProps.allowFindReplace, passedProps.UNSAFE_allowBorderMark, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.dangerouslyAppendPlugins, passedProps.__livePage, passedProps.AppearanceComponent]);
|
|
115
116
|
return memodProps;
|
|
116
117
|
};
|
|
117
118
|
export default useMemoEditorProps;
|