@atlaskit/editor-core 197.1.4 → 197.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/dist/cjs/composable-editor/hooks/useMemoEditorProps.js +2 -1
- package/dist/cjs/create-editor/ReactEditorView.js +15 -12
- 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/hooks/useMemoEditorProps.js +2 -1
- package/dist/es2019/create-editor/ReactEditorView.js +11 -8
- 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/hooks/useMemoEditorProps.js +2 -1
- package/dist/esm/create-editor/ReactEditorView.js +15 -12
- 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/presets/universal.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +2 -0
- package/dist/types-ts4.5/presets/universal.d.ts +1 -0
- package/dist/types-ts4.5/types/editor-props.d.ts +2 -0
- package/package.json +4 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#135954](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135954)
|
|
8
|
+
[`62ec64be9ed01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/62ec64be9ed01) -
|
|
9
|
+
Exposing a table's plugin configuration option for table alignment feature.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#136078](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136078)
|
|
14
|
+
[`09414d7233497`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/09414d7233497) -
|
|
15
|
+
ED-24507 Switch nested dnd FG to experiment and include padding changes"
|
|
16
|
+
- [#134667](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134667)
|
|
17
|
+
[`2c9b19e28b320`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c9b19e28b320) -
|
|
18
|
+
Add assistiveDescribedBy prop for aria-describedby to address a11y issues
|
|
19
|
+
- [#135936](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135936)
|
|
20
|
+
[`f5825c21dab81`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f5825c21dab81) -
|
|
21
|
+
Properly check should component update correctly in ToolbarInner
|
|
22
|
+
- [#135954](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135954)
|
|
23
|
+
[`62ec64be9ed01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/62ec64be9ed01) -
|
|
24
|
+
Table alignment feature flag cleanup
|
|
25
|
+
|
|
3
26
|
## 197.1.4
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -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, {
|
|
@@ -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",
|
|
@@ -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, {
|
|
@@ -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.
|
|
2
|
+
export const version = "197.2.0";
|
|
@@ -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;
|
|
@@ -80,7 +80,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
80
80
|
_inherits(ReactEditorView, _React$Component);
|
|
81
81
|
var _super = _createSuper(ReactEditorView);
|
|
82
82
|
function ReactEditorView(props) {
|
|
83
|
-
var _props$setEditorApi, _props$editorProps;
|
|
83
|
+
var _this$props$editorPro5, _props$setEditorApi, _props$editorProps;
|
|
84
84
|
var _this;
|
|
85
85
|
_classCallCheck(this, ReactEditorView);
|
|
86
86
|
_this = _super.call(this, props);
|
|
@@ -517,7 +517,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
519
|
});
|
|
520
|
-
_defineProperty(_assertThisInitialized(_this), "createEditor", function (assistiveLabel) {
|
|
520
|
+
_defineProperty(_assertThisInitialized(_this), "createEditor", function (assistiveLabel, assistiveDescribedBy) {
|
|
521
521
|
return /*#__PURE__*/React.createElement("div", {
|
|
522
522
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
523
523
|
className: getUAPrefix(),
|
|
@@ -532,10 +532,11 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
532
532
|
,
|
|
533
533
|
"aria-multiline": _this.props.editorProps.appearance !== 'mobile' ? true : false,
|
|
534
534
|
role: "textbox",
|
|
535
|
-
id: EDIT_AREA_ID
|
|
535
|
+
id: EDIT_AREA_ID,
|
|
536
|
+
"aria-describedby": assistiveDescribedBy
|
|
536
537
|
});
|
|
537
538
|
});
|
|
538
|
-
_defineProperty(_assertThisInitialized(_this), "editor", _this.createEditor(_this.props.editorProps.assistiveLabel));
|
|
539
|
+
_defineProperty(_assertThisInitialized(_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));
|
|
539
540
|
_this.pluginInjectionAPI = new EditorPluginInjectionAPI({
|
|
540
541
|
getEditorState: _this.getEditorState,
|
|
541
542
|
getEditorView: _this.getEditorView
|
|
@@ -596,8 +597,8 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
596
597
|
_createClass(ReactEditorView, [{
|
|
597
598
|
key: "transactionTracking",
|
|
598
599
|
get: function get() {
|
|
599
|
-
var _this$props$
|
|
600
|
-
return (_this$props$
|
|
600
|
+
var _this$props$editorPro6, _this$props$editorPro7;
|
|
601
|
+
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 : {
|
|
601
602
|
enabled: false
|
|
602
603
|
};
|
|
603
604
|
}
|
|
@@ -617,15 +618,16 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
617
618
|
}, {
|
|
618
619
|
key: "isTransactionTrackingExplicitlyDisabled",
|
|
619
620
|
value: function isTransactionTrackingExplicitlyDisabled() {
|
|
620
|
-
var _this$props$
|
|
621
|
+
var _this$props$editorPro8;
|
|
621
622
|
// ED-16320: Check for explicit disable so that by default
|
|
622
623
|
// it will still be enabled as it currently is. Then we can
|
|
623
624
|
// progressively opt out synthetic tenants.
|
|
624
|
-
return ((_this$props$
|
|
625
|
+
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;
|
|
625
626
|
}
|
|
626
627
|
}, {
|
|
627
628
|
key: "UNSAFE_componentWillReceiveProps",
|
|
628
629
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
630
|
+
var _nextProps$editorProp, _this$props$editorPro9;
|
|
629
631
|
if (this.view && this.props.editorProps.disabled !== nextProps.editorProps.disabled) {
|
|
630
632
|
// Disables the contentEditable attribute of the editor if the editor is disabled
|
|
631
633
|
this.view.setProps({
|
|
@@ -658,8 +660,9 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
658
660
|
if (!this.transactionTracking.enabled) {
|
|
659
661
|
this.pluginPerformanceObserver.disconnect();
|
|
660
662
|
}
|
|
661
|
-
if (nextProps.editorProps.assistiveLabel !== this.props.editorProps.assistiveLabel) {
|
|
662
|
-
|
|
663
|
+
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)) {
|
|
664
|
+
var _nextProps$editorProp2;
|
|
665
|
+
this.editor = this.createEditor(nextProps.editorProps.assistiveLabel, (_nextProps$editorProp2 = nextProps.editorProps) === null || _nextProps$editorProp2 === void 0 ? void 0 : _nextProps$editorProp2.assistiveDescribedBy);
|
|
663
666
|
}
|
|
664
667
|
}
|
|
665
668
|
}, {
|
|
@@ -760,9 +763,9 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
760
763
|
}, {
|
|
761
764
|
key: "render",
|
|
762
765
|
value: function render() {
|
|
763
|
-
var _this$props$
|
|
766
|
+
var _this$props$editorPro10,
|
|
764
767
|
_this3 = this;
|
|
765
|
-
var renderTracking = (_this$props$
|
|
768
|
+
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;
|
|
766
769
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
767
770
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
768
771
|
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
@@ -145,7 +145,6 @@ export default function createUniversalPresetInternal(_ref) {
|
|
|
145
145
|
fullWidthEnabled: appearance === 'full-width',
|
|
146
146
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
147
147
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
148
|
-
isTableAlignmentEnabled: fg('platform.editor.table.allow-table-alignment') && (isFullPage || isComment && fg('platform_editor_table_support_in_comment')),
|
|
149
148
|
isNewColumnResizingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableNewColumnResizing) && isFullPage,
|
|
150
149
|
isCommentEditor: isComment,
|
|
151
150
|
isChromelessEditor: isChromeless
|
|
@@ -25,10 +25,12 @@ export default function useUniversalPreset(_ref) {
|
|
|
25
25
|
if (!recreate) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
+
// we are not comparing the previous initialPluginConfiguration to the new one assuming that it never changes
|
|
28
29
|
setPreset(createUniversalPreset({
|
|
29
30
|
props: props,
|
|
30
|
-
prevProps: previousEditorProps
|
|
31
|
+
prevProps: previousEditorProps,
|
|
32
|
+
initialPluginConfiguration: initialPluginConfiguration
|
|
31
33
|
}));
|
|
32
|
-
}, [props, previousEditorProps]);
|
|
34
|
+
}, [props, previousEditorProps, initialPluginConfiguration]);
|
|
33
35
|
return preset;
|
|
34
36
|
}
|
|
@@ -6,11 +6,11 @@ import { columnLayoutSharedStyle, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN }
|
|
|
6
6
|
import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
|
|
7
7
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
|
|
8
8
|
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
10
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
11
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
14
14
|
export var layoutStyles = function layoutStyles(viewMode) {
|
|
15
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), columnLayoutSharedStyle, "var(--ds-space-100, 8px)", akLayoutGutterOffset + (
|
|
15
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), columnLayoutSharedStyle, "var(--ds-space-100, 8px)", akLayoutGutterOffset + (editorExperiment('nested-dnd', true) ? 8 : 0), akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N40A, ")"), LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (editorExperiment('nested-dnd', true) ? 8 : 0), LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N50A, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket]), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode);
|
|
16
16
|
};
|
|
@@ -14,6 +14,7 @@ import React from 'react';
|
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
16
|
import { css, jsx } from '@emotion/react';
|
|
17
|
+
import isEqual from 'lodash/isEqual';
|
|
17
18
|
import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
18
19
|
var toolbarComponentsWrapper = css(_defineProperty({
|
|
19
20
|
display: 'flex'
|
|
@@ -30,7 +31,7 @@ export var ToolbarInner = /*#__PURE__*/function (_React$Component) {
|
|
|
30
31
|
_createClass(ToolbarInner, [{
|
|
31
32
|
key: "shouldComponentUpdate",
|
|
32
33
|
value: function shouldComponentUpdate(nextProps) {
|
|
33
|
-
return nextProps
|
|
34
|
+
return !isEqual(nextProps, this.props);
|
|
34
35
|
}
|
|
35
36
|
}, {
|
|
36
37
|
key: "render",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "197.
|
|
2
|
+
export var version = "197.2.0";
|
|
@@ -165,6 +165,7 @@ export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps,
|
|
|
165
165
|
*/
|
|
166
166
|
__plugins: EditorPlugin[];
|
|
167
167
|
};
|
|
168
|
+
assistiveDescribedBy?: string;
|
|
168
169
|
}
|
|
169
170
|
export interface EditorNextProps extends EditorBaseProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
170
171
|
preset: EditorPresetBuilder<AllPluginNames[], AllEditorPresetPluginTypes[]>;
|
|
@@ -212,6 +213,7 @@ export interface EditorNextProps extends EditorBaseProps, EditorSharedPropsWithP
|
|
|
212
213
|
* ```
|
|
213
214
|
*/
|
|
214
215
|
media?: MediaOptions;
|
|
216
|
+
assistiveDescribedBy?: string;
|
|
215
217
|
}
|
|
216
218
|
export interface EditorProviderProps {
|
|
217
219
|
activityProvider?: Promise<ActivityProvider>;
|
|
@@ -165,6 +165,7 @@ export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps,
|
|
|
165
165
|
*/
|
|
166
166
|
__plugins: EditorPlugin[];
|
|
167
167
|
};
|
|
168
|
+
assistiveDescribedBy?: string;
|
|
168
169
|
}
|
|
169
170
|
export interface EditorNextProps extends EditorBaseProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
170
171
|
preset: EditorPresetBuilder<AllPluginNames[], AllEditorPresetPluginTypes[]>;
|
|
@@ -212,6 +213,7 @@ export interface EditorNextProps extends EditorBaseProps, EditorSharedPropsWithP
|
|
|
212
213
|
* ```
|
|
213
214
|
*/
|
|
214
215
|
media?: MediaOptions;
|
|
216
|
+
assistiveDescribedBy?: string;
|
|
215
217
|
}
|
|
216
218
|
export interface EditorProviderProps {
|
|
217
219
|
activityProvider?: Promise<ActivityProvider>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "197.
|
|
3
|
+
"version": "197.2.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@atlaskit/spinner": "^16.3.0",
|
|
56
56
|
"@atlaskit/task-decision": "^17.10.0",
|
|
57
57
|
"@atlaskit/theme": "^13.0.0",
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "*",
|
|
58
59
|
"@atlaskit/tokens": "^1.59.0",
|
|
59
60
|
"@atlaskit/tooltip": "^18.7.0",
|
|
60
61
|
"@atlaskit/width-detector": "^4.3.0",
|
|
@@ -78,12 +79,12 @@
|
|
|
78
79
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
|
-
"@af/editor-examples-helpers": "0.3.
|
|
82
|
+
"@af/editor-examples-helpers": "0.3.6",
|
|
82
83
|
"@af/editor-libra": "*",
|
|
83
84
|
"@af/visual-regression": "*",
|
|
84
85
|
"@atlaskit/adf-utils": "^19.8.0",
|
|
85
86
|
"@atlaskit/analytics-listeners": "^8.11.0",
|
|
86
|
-
"@atlaskit/collab-provider": "9.37.
|
|
87
|
+
"@atlaskit/collab-provider": "9.37.5",
|
|
87
88
|
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
88
89
|
"@atlaskit/editor-plugin-annotation": "1.19.3",
|
|
89
90
|
"@atlaskit/editor-plugin-card": "^2.14.0",
|
|
@@ -220,9 +221,6 @@
|
|
|
220
221
|
"platform_editor_context-panel_simplify_behaviour": {
|
|
221
222
|
"type": "boolean"
|
|
222
223
|
},
|
|
223
|
-
"platform.editor.table.allow-table-alignment": {
|
|
224
|
-
"type": "boolean"
|
|
225
|
-
},
|
|
226
224
|
"platform.confluence.frontend.narrow-full-page-editor-toolbar": {
|
|
227
225
|
"type": "boolean"
|
|
228
226
|
},
|
|
@@ -255,10 +253,6 @@
|
|
|
255
253
|
"type": "boolean",
|
|
256
254
|
"referenceOnly": true
|
|
257
255
|
},
|
|
258
|
-
"platform_editor_elements_dnd_nested": {
|
|
259
|
-
"type": "boolean",
|
|
260
|
-
"referenceOnly": true
|
|
261
|
-
},
|
|
262
256
|
"editor_support_code_block_wrapping": {
|
|
263
257
|
"type": "boolean",
|
|
264
258
|
"referenceOnly": true
|
|
@@ -266,9 +260,6 @@
|
|
|
266
260
|
"platform_editor_drag_and_drop_expand_style_fix": {
|
|
267
261
|
"type": "boolean"
|
|
268
262
|
},
|
|
269
|
-
"platform_editor_element_padding_changes_gate": {
|
|
270
|
-
"type": "boolean"
|
|
271
|
-
},
|
|
272
263
|
"platform_editor_toolbar_ssr": {
|
|
273
264
|
"type": "boolean"
|
|
274
265
|
},
|