@atlaskit/editor-core 197.1.3 → 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 +33 -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/ErrorBoundary.js +2 -2
- package/dist/cjs/create-editor/ReactEditorView.js +16 -13
- package/dist/cjs/presets/universal.js +0 -1
- package/dist/cjs/presets/useUniversalPreset.js +4 -2
- package/dist/cjs/ui/ContentStyles/expand.js +3 -4
- 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/ErrorBoundary.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +12 -9
- package/dist/es2019/presets/universal.js +0 -1
- package/dist/es2019/presets/useUniversalPreset.js +4 -2
- package/dist/es2019/ui/ContentStyles/expand.js +1 -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/ErrorBoundary.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +16 -13
- package/dist/esm/presets/universal.js +0 -1
- package/dist/esm/presets/useUniversalPreset.js +4 -2
- package/dist/esm/ui/ContentStyles/expand.js +1 -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 +6 -17
- package/dist/cjs/EditorWithActions/index.js +0 -77
- package/dist/es2019/EditorWithActions/index.js +0 -43
- package/dist/esm/EditorWithActions/index.js +0 -71
- package/dist/types/EditorWithActions/index.d.ts +0 -21
- package/dist/types-ts4.5/EditorWithActions/index.d.ts +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
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
|
+
|
|
26
|
+
## 197.1.4
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- [`ed9e420d175b8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ed9e420d175b8) -
|
|
31
|
+
New entry-point for intl-error-boundary component on editor-common. Further sharedExpandStyles is
|
|
32
|
+
now available on editor-common/styles entry-point. These are to remove `editor-common/ui`
|
|
33
|
+
entry-point from the critical path in editor-core.
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 197.1.3
|
|
4
37
|
|
|
5
38
|
### 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;
|
|
@@ -18,9 +18,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
18
18
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
19
19
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
20
20
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
21
|
+
var _intlErrorBoundary = require("@atlaskit/editor-common/intl-error-boundary");
|
|
21
22
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
22
23
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
23
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
24
24
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
25
25
|
var _WithEditorView = require("./WithEditorView");
|
|
26
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -195,7 +195,7 @@ var ErrorBoundaryWithEditorView = exports.ErrorBoundaryWithEditorView = /*#__PUR
|
|
|
195
195
|
}, {
|
|
196
196
|
key: "render",
|
|
197
197
|
value: function render() {
|
|
198
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
198
|
+
return /*#__PURE__*/_react.default.createElement(_intlErrorBoundary.IntlErrorBoundary, null, this.props.children);
|
|
199
199
|
}
|
|
200
200
|
}]);
|
|
201
201
|
return ErrorBoundaryWithEditorView;
|
|
@@ -22,7 +22,6 @@ var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-
|
|
|
22
22
|
var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
|
|
23
23
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
24
24
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
25
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
26
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
27
26
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
28
27
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
@@ -46,6 +45,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
46
45
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
47
46
|
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); }; }
|
|
48
47
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
48
|
+
var EDIT_AREA_ID = 'ak-editor-textarea';
|
|
49
49
|
function handleEditorFocus(view) {
|
|
50
50
|
if (view.hasFocus()) {
|
|
51
51
|
return;
|
|
@@ -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:
|
|
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
|
}
|
|
@@ -8,7 +8,6 @@ exports.expandStyles = void 0;
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -25,11 +24,11 @@ var DANGER_STATE_BORDER_COLOR = "var(--ds-border-danger, ".concat(_colors.R300,
|
|
|
25
24
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
26
25
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
27
26
|
var expandStyles = exports.expandStyles = function expandStyles() {
|
|
28
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " > div {\n\t\tdisplay: flex;\n\t}\n\n\t.", " {\n\t\t", "\n\n\t\tcursor: pointer;\n\t\tbox-sizing: border-box;\n\n\t\ttd > & {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(90deg);\n\t\t}\n\n\t\t&.", ":not(.danger) {\n\t\t\t", "\n\t\t}\n\n\t\t&.danger {\n\t\t\tbackground: ", ";\n\t\t\tborder-color: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror\n\t\t> .", ",\n\t\t.", "\n\t\t> .", " {\n\t\tmargin-left: -", "px;\n\t\tmargin-right: -", "px;\n\t}\n\n\t.", " {\n\t\t", "\n\t\tcursor: text;\n\t\tpadding-top: 0px;\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", ";\n\t\talign-items: center;\n\t\toverflow: visible;\n\t}\n\n\t.", " {\n\t\tbackground: ", ";\n\t\tborder-color: ", ";\n\n\t\t.", " {\n\t\t\tpadding-top: ", ";\n\t\t}\n\t}\n\n\t.", " {\n\t\twidth: 100%;\n\t}\n\n\t/* stylelint-disable property-no-unknown, value-keyword-case */\n\t.", ":(.", ") {\n\t\t.expand-content-wrapper {\n\t\t\theight: auto;\n\t\t}\n\t}\n\t/* stylelint-enable property-no-unknown, value-keyword-case */\n\n\t.", ":not(.", ") {\n\t\t.ak-editor-expand__content {\n\t\t\tposition: absolute;\n\t\t\theight: 1px;\n\t\t\twidth: 1px;\n\t\t\toverflow: hidden;\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\n\t\t&:not(.", "):not(.danger) {\n\t\t\tbackground: transparent;\n\t\t\tborder-color: transparent;\n\n\t\t\t&:hover {\n\t\t\t\tborder-color: ", ";\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n"])), _styles.expandClassNames.icon, _styles.expandClassNames.prefix,
|
|
27
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " > div {\n\t\tdisplay: flex;\n\t}\n\n\t.", " {\n\t\t", "\n\n\t\tcursor: pointer;\n\t\tbox-sizing: border-box;\n\n\t\ttd > & {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(90deg);\n\t\t}\n\n\t\t&.", ":not(.danger) {\n\t\t\t", "\n\t\t}\n\n\t\t&.danger {\n\t\t\tbackground: ", ";\n\t\t\tborder-color: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror\n\t\t> .", ",\n\t\t.", "\n\t\t> .", " {\n\t\tmargin-left: -", "px;\n\t\tmargin-right: -", "px;\n\t}\n\n\t.", " {\n\t\t", "\n\t\tcursor: text;\n\t\tpadding-top: 0px;\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", ";\n\t\talign-items: center;\n\t\toverflow: visible;\n\t}\n\n\t.", " {\n\t\tbackground: ", ";\n\t\tborder-color: ", ";\n\n\t\t.", " {\n\t\t\tpadding-top: ", ";\n\t\t}\n\t}\n\n\t.", " {\n\t\twidth: 100%;\n\t}\n\n\t/* stylelint-disable property-no-unknown, value-keyword-case */\n\t.", ":(.", ") {\n\t\t.expand-content-wrapper {\n\t\t\theight: auto;\n\t\t}\n\t}\n\t/* stylelint-enable property-no-unknown, value-keyword-case */\n\n\t.", ":not(.", ") {\n\t\t.ak-editor-expand__content {\n\t\t\tposition: absolute;\n\t\t\theight: 1px;\n\t\t\twidth: 1px;\n\t\t\toverflow: hidden;\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\n\t\t&:not(.", "):not(.danger) {\n\t\t\tbackground: transparent;\n\t\t\tborder-color: transparent;\n\n\t\t\t&:hover {\n\t\t\t\tborder-color: ", ";\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n"])), _styles.expandClassNames.icon, _styles.expandClassNames.prefix, _styles.sharedExpandStyles.containerStyles({
|
|
29
28
|
expanded: false,
|
|
30
29
|
focused: false
|
|
31
|
-
})(), _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), DANGER_STATE_BACKGROUND_COLOR, DANGER_STATE_BORDER_COLOR, _styles.expandClassNames.type('expand'), _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM, _styles.expandClassNames.type('expand'), _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akLayoutGutterOffset, _styles.expandClassNames.content,
|
|
30
|
+
})(), _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), DANGER_STATE_BACKGROUND_COLOR, DANGER_STATE_BORDER_COLOR, _styles.expandClassNames.type('expand'), _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM, _styles.expandClassNames.type('expand'), _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akLayoutGutterOffset, _styles.expandClassNames.content, _styles.sharedExpandStyles.contentStyles({
|
|
32
31
|
expanded: false,
|
|
33
32
|
focused: false
|
|
34
|
-
})(), (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_expand_style_fix') && "overflow-x: clip;", _styles.expandClassNames.titleInput,
|
|
33
|
+
})(), (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_expand_style_fix') && "overflow-x: clip;", _styles.expandClassNames.titleInput, _styles.sharedExpandStyles.titleInputStyles(), _styles.expandClassNames.titleContainer, _styles.sharedExpandStyles.titleContainerStyles(), _styles.expandClassNames.expanded, EXPAND_SELECTED_BACKGROUND, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.expandClassNames.content, "var(--ds-space-100, 8px)", _styles.expandClassNames.inputContainer, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, ".concat(_colors.N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
35
34
|
};
|
|
@@ -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;
|
|
@@ -3,9 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import uuid from 'uuid';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, editorAnalyticsChannel, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getDocStructure } from '@atlaskit/editor-common/core-utils';
|
|
6
|
+
import { IntlErrorBoundary } from '@atlaskit/editor-common/intl-error-boundary';
|
|
6
7
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
7
8
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
8
|
-
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { WithEditorView } from './WithEditorView';
|
|
11
11
|
export class ErrorBoundaryWithEditorView extends React.Component {
|
|
@@ -8,7 +8,6 @@ import { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-fea
|
|
|
8
8
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
9
9
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
10
10
|
import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlaskit/editor-common/ufo';
|
|
11
|
-
import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
|
|
12
11
|
import { analyticsEventKey, browser, countNodes, findChangedNodesFromTransaction, getAnalyticsEventSeverity, getResponseEndTime, measureRender, processRawValue, shouldForceTracking, validateNodes, validNode } from '@atlaskit/editor-common/utils';
|
|
13
12
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
13
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -28,6 +27,7 @@ import { createSchema } from './create-schema';
|
|
|
28
27
|
import { createFeatureFlagsFromProps } from './feature-flags-from-props';
|
|
29
28
|
import { editorMessages } from './messages';
|
|
30
29
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
30
|
+
const EDIT_AREA_ID = 'ak-editor-textarea';
|
|
31
31
|
function handleEditorFocus(view) {
|
|
32
32
|
if (view.hasFocus()) {
|
|
33
33
|
return;
|
|
@@ -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
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
-
import { BreakoutCssClassName, expandClassNames } from '@atlaskit/editor-common/styles';
|
|
4
|
-
import { sharedExpandStyles } from '@atlaskit/editor-common/ui';
|
|
3
|
+
import { BreakoutCssClassName, expandClassNames, sharedExpandStyles } from '@atlaskit/editor-common/styles';
|
|
5
4
|
import { akEditorSelectedNodeClassName, akLayoutGutterOffset, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
6
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { N100A, N40A, N50A, R300, R50 } from '@atlaskit/theme/colors';
|
|
@@ -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;
|
|
@@ -15,9 +15,9 @@ import React from 'react';
|
|
|
15
15
|
import uuid from 'uuid';
|
|
16
16
|
import { ACTION, ACTION_SUBJECT, editorAnalyticsChannel, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
17
17
|
import { getDocStructure } from '@atlaskit/editor-common/core-utils';
|
|
18
|
+
import { IntlErrorBoundary } from '@atlaskit/editor-common/intl-error-boundary';
|
|
18
19
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
19
20
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
20
|
-
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
21
21
|
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
22
22
|
import { WithEditorView } from './WithEditorView';
|
|
23
23
|
export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
@@ -19,7 +19,6 @@ import { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-fea
|
|
|
19
19
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
20
20
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
21
21
|
import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlaskit/editor-common/ufo';
|
|
22
|
-
import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
|
|
23
22
|
import { analyticsEventKey, browser, countNodes as _countNodes, findChangedNodesFromTransaction, getAnalyticsEventSeverity, getResponseEndTime, measureRender, processRawValue, shouldForceTracking, validateNodes, validNode } from '@atlaskit/editor-common/utils';
|
|
24
23
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
25
24
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -39,6 +38,7 @@ import { createSchema } from './create-schema';
|
|
|
39
38
|
import { createFeatureFlagsFromProps } from './feature-flags-from-props';
|
|
40
39
|
import { editorMessages } from './messages';
|
|
41
40
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
41
|
+
var EDIT_AREA_ID = 'ak-editor-textarea';
|
|
42
42
|
function handleEditorFocus(view) {
|
|
43
43
|
if (view.hasFocus()) {
|
|
44
44
|
return;
|
|
@@ -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
|
}
|
|
@@ -2,8 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
import { BreakoutCssClassName, expandClassNames } from '@atlaskit/editor-common/styles';
|
|
6
|
-
import { sharedExpandStyles } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import { BreakoutCssClassName, expandClassNames, sharedExpandStyles } from '@atlaskit/editor-common/styles';
|
|
7
6
|
import { akEditorSelectedNodeClassName, akLayoutGutterOffset, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { N100A, N40A, N50A, R300, R50 } from '@atlaskit/theme/colors';
|
|
@@ -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/"
|
|
@@ -25,8 +25,6 @@
|
|
|
25
25
|
"atlassian": {
|
|
26
26
|
"team": "Editor",
|
|
27
27
|
"singleton": true,
|
|
28
|
-
"inPublicMirror": true,
|
|
29
|
-
"releaseModel": "continuous",
|
|
30
28
|
"website": {
|
|
31
29
|
"name": "Editor Core"
|
|
32
30
|
},
|
|
@@ -45,7 +43,7 @@
|
|
|
45
43
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
46
44
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
47
45
|
"@atlaskit/button": "^20.1.0",
|
|
48
|
-
"@atlaskit/editor-common": "^88.
|
|
46
|
+
"@atlaskit/editor-common": "^88.6.0",
|
|
49
47
|
"@atlaskit/editor-plugins": "^4.3.0",
|
|
50
48
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
51
49
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
@@ -57,6 +55,7 @@
|
|
|
57
55
|
"@atlaskit/spinner": "^16.3.0",
|
|
58
56
|
"@atlaskit/task-decision": "^17.10.0",
|
|
59
57
|
"@atlaskit/theme": "^13.0.0",
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "*",
|
|
60
59
|
"@atlaskit/tokens": "^1.59.0",
|
|
61
60
|
"@atlaskit/tooltip": "^18.7.0",
|
|
62
61
|
"@atlaskit/width-detector": "^4.3.0",
|
|
@@ -80,12 +79,12 @@
|
|
|
80
79
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
|
-
"@af/editor-examples-helpers": "0.3.
|
|
82
|
+
"@af/editor-examples-helpers": "0.3.6",
|
|
84
83
|
"@af/editor-libra": "*",
|
|
85
84
|
"@af/visual-regression": "*",
|
|
86
85
|
"@atlaskit/adf-utils": "^19.8.0",
|
|
87
86
|
"@atlaskit/analytics-listeners": "^8.11.0",
|
|
88
|
-
"@atlaskit/collab-provider": "9.37.
|
|
87
|
+
"@atlaskit/collab-provider": "9.37.5",
|
|
89
88
|
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
90
89
|
"@atlaskit/editor-plugin-annotation": "1.19.3",
|
|
91
90
|
"@atlaskit/editor-plugin-card": "^2.14.0",
|
|
@@ -99,7 +98,7 @@
|
|
|
99
98
|
"@atlaskit/media-integration-test-helpers": "^3.1.0",
|
|
100
99
|
"@atlaskit/media-test-helpers": "^34.1.0",
|
|
101
100
|
"@atlaskit/modal-dialog": "^12.15.0",
|
|
102
|
-
"@atlaskit/primitives": "^12.
|
|
101
|
+
"@atlaskit/primitives": "^12.1.0",
|
|
103
102
|
"@atlaskit/renderer": "^109.51.0",
|
|
104
103
|
"@atlaskit/smart-card": "^27.19.0",
|
|
105
104
|
"@atlaskit/synchrony-test-helpers": "^2.5.0",
|
|
@@ -222,9 +221,6 @@
|
|
|
222
221
|
"platform_editor_context-panel_simplify_behaviour": {
|
|
223
222
|
"type": "boolean"
|
|
224
223
|
},
|
|
225
|
-
"platform.editor.table.allow-table-alignment": {
|
|
226
|
-
"type": "boolean"
|
|
227
|
-
},
|
|
228
224
|
"platform.confluence.frontend.narrow-full-page-editor-toolbar": {
|
|
229
225
|
"type": "boolean"
|
|
230
226
|
},
|
|
@@ -257,10 +253,6 @@
|
|
|
257
253
|
"type": "boolean",
|
|
258
254
|
"referenceOnly": true
|
|
259
255
|
},
|
|
260
|
-
"platform_editor_elements_dnd_nested": {
|
|
261
|
-
"type": "boolean",
|
|
262
|
-
"referenceOnly": true
|
|
263
|
-
},
|
|
264
256
|
"editor_support_code_block_wrapping": {
|
|
265
257
|
"type": "boolean",
|
|
266
258
|
"referenceOnly": true
|
|
@@ -268,9 +260,6 @@
|
|
|
268
260
|
"platform_editor_drag_and_drop_expand_style_fix": {
|
|
269
261
|
"type": "boolean"
|
|
270
262
|
},
|
|
271
|
-
"platform_editor_element_padding_changes_gate": {
|
|
272
|
-
"type": "boolean"
|
|
273
|
-
},
|
|
274
263
|
"platform_editor_toolbar_ssr": {
|
|
275
264
|
"type": "boolean"
|
|
276
265
|
},
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
-
var _editor = _interopRequireDefault(require("../editor"));
|
|
19
|
-
var _EditorContext = _interopRequireDefault(require("../ui/EditorContext"));
|
|
20
|
-
var _WithEditorActions = _interopRequireDefault(require("../ui/WithEditorActions"));
|
|
21
|
-
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); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
|
-
var EditorWithActions = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
24
|
-
(0, _inherits2.default)(EditorWithActions, _React$Component);
|
|
25
|
-
var _super = _createSuper(EditorWithActions);
|
|
26
|
-
function EditorWithActions() {
|
|
27
|
-
var _this;
|
|
28
|
-
(0, _classCallCheck2.default)(this, EditorWithActions);
|
|
29
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
|
-
args[_key] = arguments[_key];
|
|
31
|
-
}
|
|
32
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
33
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function (actions) {
|
|
34
|
-
return function () {
|
|
35
|
-
_this.props.onSave(actions);
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCancel", function (actions) {
|
|
39
|
-
return function () {
|
|
40
|
-
_this.props.onCancel(actions);
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleChange", function (actions) {
|
|
44
|
-
return function () {
|
|
45
|
-
_this.props.onChange(actions);
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
return _this;
|
|
49
|
-
}
|
|
50
|
-
(0, _createClass2.default)(EditorWithActions, [{
|
|
51
|
-
key: "render",
|
|
52
|
-
value: function render() {
|
|
53
|
-
var _this2 = this;
|
|
54
|
-
if (this.context.editorActions) {
|
|
55
|
-
var _actions = this.context.editorActions;
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement(_editor.default, (0, _extends2.default)({}, this.props, {
|
|
57
|
-
onSave: this.props.onSave ? this.handleSave(_actions) : undefined,
|
|
58
|
-
onChange: this.props.onChange ? this.handleChange(_actions) : undefined,
|
|
59
|
-
onCancel: this.props.onCancel ? this.handleCancel(_actions) : undefined
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(_EditorContext.default, null, /*#__PURE__*/_react.default.createElement(_WithEditorActions.default, {
|
|
63
|
-
render: function render(actions) {
|
|
64
|
-
return /*#__PURE__*/_react.default.createElement(_editor.default, (0, _extends2.default)({}, _this2.props, {
|
|
65
|
-
onSave: _this2.props.onSave ? _this2.handleSave(actions) : undefined,
|
|
66
|
-
onChange: _this2.props.onChange ? _this2.handleChange(actions) : undefined,
|
|
67
|
-
onCancel: _this2.props.onCancel ? _this2.handleCancel(actions) : undefined
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
}]);
|
|
73
|
-
return EditorWithActions;
|
|
74
|
-
}(_react.default.Component);
|
|
75
|
-
(0, _defineProperty2.default)(EditorWithActions, "contextTypes", {
|
|
76
|
-
editorActions: _propTypes.default.object.isRequired
|
|
77
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import Editor from '../editor';
|
|
6
|
-
import EditorContext from '../ui/EditorContext';
|
|
7
|
-
import WithEditorActions from '../ui/WithEditorActions';
|
|
8
|
-
export default class EditorWithActions extends React.Component {
|
|
9
|
-
constructor(...args) {
|
|
10
|
-
super(...args);
|
|
11
|
-
_defineProperty(this, "handleSave", actions => () => {
|
|
12
|
-
this.props.onSave(actions);
|
|
13
|
-
});
|
|
14
|
-
_defineProperty(this, "handleCancel", actions => () => {
|
|
15
|
-
this.props.onCancel(actions);
|
|
16
|
-
});
|
|
17
|
-
_defineProperty(this, "handleChange", actions => () => {
|
|
18
|
-
this.props.onChange(actions);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
if (this.context.editorActions) {
|
|
23
|
-
const {
|
|
24
|
-
editorActions: actions
|
|
25
|
-
} = this.context;
|
|
26
|
-
return /*#__PURE__*/React.createElement(Editor, _extends({}, this.props, {
|
|
27
|
-
onSave: this.props.onSave ? this.handleSave(actions) : undefined,
|
|
28
|
-
onChange: this.props.onChange ? this.handleChange(actions) : undefined,
|
|
29
|
-
onCancel: this.props.onCancel ? this.handleCancel(actions) : undefined
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
return /*#__PURE__*/React.createElement(EditorContext, null, /*#__PURE__*/React.createElement(WithEditorActions, {
|
|
33
|
-
render: actions => /*#__PURE__*/React.createElement(Editor, _extends({}, this.props, {
|
|
34
|
-
onSave: this.props.onSave ? this.handleSave(actions) : undefined,
|
|
35
|
-
onChange: this.props.onChange ? this.handleChange(actions) : undefined,
|
|
36
|
-
onCancel: this.props.onCancel ? this.handleCancel(actions) : undefined
|
|
37
|
-
}))
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
_defineProperty(EditorWithActions, "contextTypes", {
|
|
42
|
-
editorActions: PropTypes.object.isRequired
|
|
43
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import PropTypes from 'prop-types';
|
|
13
|
-
import Editor from '../editor';
|
|
14
|
-
import EditorContext from '../ui/EditorContext';
|
|
15
|
-
import WithEditorActions from '../ui/WithEditorActions';
|
|
16
|
-
var EditorWithActions = /*#__PURE__*/function (_React$Component) {
|
|
17
|
-
_inherits(EditorWithActions, _React$Component);
|
|
18
|
-
var _super = _createSuper(EditorWithActions);
|
|
19
|
-
function EditorWithActions() {
|
|
20
|
-
var _this;
|
|
21
|
-
_classCallCheck(this, EditorWithActions);
|
|
22
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
-
args[_key] = arguments[_key];
|
|
24
|
-
}
|
|
25
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
26
|
-
_defineProperty(_assertThisInitialized(_this), "handleSave", function (actions) {
|
|
27
|
-
return function () {
|
|
28
|
-
_this.props.onSave(actions);
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "handleCancel", function (actions) {
|
|
32
|
-
return function () {
|
|
33
|
-
_this.props.onCancel(actions);
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
_defineProperty(_assertThisInitialized(_this), "handleChange", function (actions) {
|
|
37
|
-
return function () {
|
|
38
|
-
_this.props.onChange(actions);
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
_createClass(EditorWithActions, [{
|
|
44
|
-
key: "render",
|
|
45
|
-
value: function render() {
|
|
46
|
-
var _this2 = this;
|
|
47
|
-
if (this.context.editorActions) {
|
|
48
|
-
var _actions = this.context.editorActions;
|
|
49
|
-
return /*#__PURE__*/React.createElement(Editor, _extends({}, this.props, {
|
|
50
|
-
onSave: this.props.onSave ? this.handleSave(_actions) : undefined,
|
|
51
|
-
onChange: this.props.onChange ? this.handleChange(_actions) : undefined,
|
|
52
|
-
onCancel: this.props.onCancel ? this.handleCancel(_actions) : undefined
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
return /*#__PURE__*/React.createElement(EditorContext, null, /*#__PURE__*/React.createElement(WithEditorActions, {
|
|
56
|
-
render: function render(actions) {
|
|
57
|
-
return /*#__PURE__*/React.createElement(Editor, _extends({}, _this2.props, {
|
|
58
|
-
onSave: _this2.props.onSave ? _this2.handleSave(actions) : undefined,
|
|
59
|
-
onChange: _this2.props.onChange ? _this2.handleChange(actions) : undefined,
|
|
60
|
-
onCancel: _this2.props.onCancel ? _this2.handleCancel(actions) : undefined
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
}]);
|
|
66
|
-
return EditorWithActions;
|
|
67
|
-
}(React.Component);
|
|
68
|
-
_defineProperty(EditorWithActions, "contextTypes", {
|
|
69
|
-
editorActions: PropTypes.object.isRequired
|
|
70
|
-
});
|
|
71
|
-
export { EditorWithActions as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type EditorActions from '../actions';
|
|
4
|
-
import type { EditorProps } from '../editor';
|
|
5
|
-
export interface EditorWithActionsProps extends Omit<EditorProps, 'onSave' | 'onChange' | 'onCancel'> {
|
|
6
|
-
onSave?: (actions: EditorActions) => void;
|
|
7
|
-
onChange?: (actions: EditorActions) => void;
|
|
8
|
-
onCancel?: (actions: EditorActions) => void;
|
|
9
|
-
}
|
|
10
|
-
export default class EditorWithActions extends React.Component<EditorWithActionsProps, {}> {
|
|
11
|
-
static contextTypes: {
|
|
12
|
-
editorActions: PropTypes.Validator<object>;
|
|
13
|
-
};
|
|
14
|
-
context: {
|
|
15
|
-
editorActions?: EditorActions;
|
|
16
|
-
};
|
|
17
|
-
handleSave: (actions: EditorActions) => () => void;
|
|
18
|
-
handleCancel: (actions: EditorActions) => () => void;
|
|
19
|
-
handleChange: (actions: EditorActions) => () => void;
|
|
20
|
-
render(): JSX.Element;
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type EditorActions from '../actions';
|
|
4
|
-
import type { EditorProps } from '../editor';
|
|
5
|
-
export interface EditorWithActionsProps extends Omit<EditorProps, 'onSave' | 'onChange' | 'onCancel'> {
|
|
6
|
-
onSave?: (actions: EditorActions) => void;
|
|
7
|
-
onChange?: (actions: EditorActions) => void;
|
|
8
|
-
onCancel?: (actions: EditorActions) => void;
|
|
9
|
-
}
|
|
10
|
-
export default class EditorWithActions extends React.Component<EditorWithActionsProps, {}> {
|
|
11
|
-
static contextTypes: {
|
|
12
|
-
editorActions: PropTypes.Validator<object>;
|
|
13
|
-
};
|
|
14
|
-
context: {
|
|
15
|
-
editorActions?: EditorActions;
|
|
16
|
-
};
|
|
17
|
-
handleSave: (actions: EditorActions) => () => void;
|
|
18
|
-
handleCancel: (actions: EditorActions) => () => void;
|
|
19
|
-
handleChange: (actions: EditorActions) => () => void;
|
|
20
|
-
render(): JSX.Element;
|
|
21
|
-
}
|