@atlaskit/editor-core 215.1.6 → 215.3.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 +39 -2
- package/dist/cjs/create-editor/ReactEditorView.js +6 -0
- package/dist/cjs/create-editor/editorNativeAnchorSupportPlugin.js +6 -1
- package/dist/cjs/presets/universal.js +1 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +4 -1
- package/dist/cjs/ui/Appearance/Comment/CommentToolbar.js +8 -2
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +8 -0
- package/dist/cjs/ui/EditorContentContainer/styles/extensionStyles.js +4 -5
- package/dist/cjs/ui/EditorContentContainer/styles/list.js +28 -2
- package/dist/cjs/ui/EditorContentContainer/styles/tasksAndDecisionsStyles.js +29 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +6 -0
- package/dist/es2019/create-editor/editorNativeAnchorSupportPlugin.js +6 -1
- package/dist/es2019/presets/universal.js +1 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -1
- package/dist/es2019/ui/Appearance/Comment/CommentToolbar.js +8 -2
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +10 -2
- package/dist/es2019/ui/EditorContentContainer/styles/extensionStyles.js +4 -5
- package/dist/es2019/ui/EditorContentContainer/styles/list.js +27 -1
- package/dist/es2019/ui/EditorContentContainer/styles/tasksAndDecisionsStyles.js +37 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +6 -0
- package/dist/esm/create-editor/editorNativeAnchorSupportPlugin.js +6 -1
- package/dist/esm/presets/universal.js +1 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +4 -1
- package/dist/esm/ui/Appearance/Comment/CommentToolbar.js +8 -2
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +10 -2
- package/dist/esm/ui/EditorContentContainer/styles/extensionStyles.js +4 -5
- package/dist/esm/ui/EditorContentContainer/styles/list.js +27 -1
- package/dist/esm/ui/EditorContentContainer/styles/tasksAndDecisionsStyles.js +28 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Comment/CommentToolbar.d.ts +4 -1
- package/dist/types/ui/EditorContentContainer/styles/list.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/tasksAndDecisionsStyles.d.ts +2 -0
- package/dist/types-ts4.5/ui/Appearance/Comment/CommentToolbar.d.ts +4 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/list.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/tasksAndDecisionsStyles.d.ts +2 -0
- package/package.json +13 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 215.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5167552fe1a93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5167552fe1a93) -
|
|
8
|
+
[EDITOR-2339] Bump @atlaskit/adf-schema to 51.3.0
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`cebe32372285d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cebe32372285d) -
|
|
13
|
+
Tidy up feature gate
|
|
14
|
+
- [`c21648c080e0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c21648c080e0c) -
|
|
15
|
+
[ux] EDITOR-2291: Tighten list and task spacing in dense content mode
|
|
16
|
+
- [`0b0ef25b2f529`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b0ef25b2f529) -
|
|
17
|
+
Cleanup various feature gates and align them to aifc_create_enabled
|
|
18
|
+
- [`3feef799ad0a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3feef799ad0a5) -
|
|
19
|
+
[ED-29333] Fix 2 issues when platform_editor_native_anchor_support is enabled
|
|
20
|
+
1. Drag handle is rendered for media node
|
|
21
|
+
2. When advanced_layouts experiment is off, quick insert button is rendered based on child node
|
|
22
|
+
inside layout column (as opposed to layout section node )
|
|
23
|
+
|
|
24
|
+
- [`2bdec5e9ec1c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bdec5e9ec1c9) -
|
|
25
|
+
[EDITOR-442] Cleans up FG platform_editor_add_media_from_url_rollout
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
28
|
+
## 215.2.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- [`0560b4dfd1361`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0560b4dfd1361) -
|
|
33
|
+
Experiment with disabling prosemirror rendering in SSR
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [`e22968790f2b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e22968790f2b5) -
|
|
38
|
+
[ux] [EDITOR-2374] prevent style overrides on codemarks in excerpts
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
|
|
3
41
|
## 215.1.6
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -8903,8 +8941,7 @@
|
|
|
8903
8941
|
-
|
|
8904
8942
|
50. Another list item
|
|
8905
8943
|
|
|
8906
|
-
Should NOT auto join to be 1 & 2 in a single list however... 49. A list item
|
|
8907
|
-
-
|
|
8944
|
+
## Should NOT auto join to be 1 & 2 in a single list however... 49. A list item
|
|
8908
8945
|
50. Another list item
|
|
8909
8946
|
|
|
8910
8947
|
Should join to be 49 & 50 in a single list.
|
|
@@ -14,6 +14,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
16
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
|
+
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
17
18
|
var _eventDispatcher = require("@atlaskit/editor-common/event-dispatcher");
|
|
18
19
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
19
20
|
var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
|
|
@@ -30,6 +31,7 @@ var _view = require("@atlaskit/editor-prosemirror/view");
|
|
|
30
31
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
31
32
|
var _interactionMetrics = require("@atlaskit/react-ufo/interaction-metrics");
|
|
32
33
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
34
|
+
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
33
35
|
var _useProviders = require("../composable-editor/hooks/useProviders");
|
|
34
36
|
var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
|
|
35
37
|
var _getNodesCount = require("../utils/getNodesCount");
|
|
@@ -552,7 +554,11 @@ function ReactEditorView(props) {
|
|
|
552
554
|
};
|
|
553
555
|
}, []);
|
|
554
556
|
var handleEditorViewRef = (0, _react.useCallback)(function (node) {
|
|
557
|
+
if ((0, _coreUtils.isSSR)() && (0, _expVal.expVal)('platform_editor_no_ssr', 'isEnabled', false)) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
555
560
|
if (node) {
|
|
561
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
556
562
|
scrollElement.current = document.querySelector('[data-editor-scroll-container]');
|
|
557
563
|
var cleanupListeners = function cleanupListeners() {
|
|
558
564
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -7,7 +7,11 @@ exports.createEditorNativeAnchorSupportPlugin = void 0;
|
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
11
|
var injectNodeViewNodeTypeList = ['paragraph', 'heading', 'bulletList', 'orderedList', 'blockquote', 'rule', 'decisionList', 'taskList', 'layoutColumn', 'hardBreak'];
|
|
12
|
+
var injectNodeViewNodeTypeConditionalList = [].concat(injectNodeViewNodeTypeList, [
|
|
13
|
+
// nodes that have custom nodeView behind experiment/FG
|
|
14
|
+
'layoutSection']);
|
|
11
15
|
var key = new _state.PluginKey('editorNativeAnchorSupportPlugin');
|
|
12
16
|
|
|
13
17
|
// Internal plugin to enable native anchor support in the editor.
|
|
@@ -15,8 +19,9 @@ var key = new _state.PluginKey('editorNativeAnchorSupportPlugin');
|
|
|
15
19
|
// that do not already have a nodeView, allowing them to be rendered with native anchors when needed.
|
|
16
20
|
var createEditorNativeAnchorSupportPlugin = exports.createEditorNativeAnchorSupportPlugin = function createEditorNativeAnchorSupportPlugin(schema) {
|
|
17
21
|
var nodeViewEntries = [];
|
|
22
|
+
var injectList = (0, _expValEquals.expValEquals)('advanced_layouts', 'isEnabled', true) ? injectNodeViewNodeTypeList : injectNodeViewNodeTypeConditionalList;
|
|
18
23
|
schema.spec.nodes.forEach(function (nodeName, nodeSpec) {
|
|
19
|
-
if (
|
|
24
|
+
if (injectList.includes(nodeName)) {
|
|
20
25
|
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
21
26
|
var toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
22
27
|
nodeViewEntries.push([nodeName, function (node) {
|
|
@@ -57,7 +57,6 @@ var _tasksAndDecisions = require("@atlaskit/editor-plugins/tasks-and-decisions")
|
|
|
57
57
|
var _textColor = require("@atlaskit/editor-plugins/text-color");
|
|
58
58
|
var _toolbarListsIndentation = require("@atlaskit/editor-plugins/toolbar-lists-indentation");
|
|
59
59
|
var _ufo = require("@atlaskit/editor-plugins/ufo");
|
|
60
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
61
60
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
62
61
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
63
62
|
var _isFullPage = require("../utils/is-full-page");
|
|
@@ -143,7 +142,7 @@ function createUniversalPresetInternal(_ref) {
|
|
|
143
142
|
isCopyPasteEnabled: true,
|
|
144
143
|
alignLeftOnInsert: typeof ((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.alignLeftOnInsert) !== 'undefined' ? (_props$media6 = props.media) === null || _props$media6 === void 0 ? void 0 : _props$media6.alignLeftOnInsert : isComment,
|
|
145
144
|
getEditorFeatureFlags: getEditorFeatureFlags
|
|
146
|
-
})], Boolean(props.media)).maybeAdd(_mediaInsert.mediaInsertPlugin, Boolean(props.media
|
|
145
|
+
})], Boolean(props.media)).maybeAdd(_mediaInsert.mediaInsertPlugin, Boolean(props.media)).maybeAdd(_caption.captionPlugin, Boolean((_props$media7 = props.media) === null || _props$media7 === void 0 ? void 0 : _props$media7.allowCaptions)).maybeAdd([_mentions.mentionsPlugin, _objectSpread({
|
|
147
146
|
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
148
147
|
insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
|
|
149
148
|
allowZeroWidthSpaceAfter: true,
|
|
@@ -195,7 +195,10 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
195
195
|
editorAPI: editorAPI,
|
|
196
196
|
editorView: editorView,
|
|
197
197
|
editorAppearance: appearance,
|
|
198
|
-
disabled: patch6Enabled ? !!disabled : undefined
|
|
198
|
+
disabled: patch6Enabled ? !!disabled : undefined,
|
|
199
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
200
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
201
|
+
popupsMountPoint: popupsMountPoint
|
|
199
202
|
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
200
203
|
editorView: editorView,
|
|
201
204
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -17,7 +17,10 @@ var CommentToolbar = exports.CommentToolbar = function CommentToolbar(_ref) {
|
|
|
17
17
|
var editorAPI = _ref.editorAPI,
|
|
18
18
|
editorView = _ref.editorView,
|
|
19
19
|
editorAppearance = _ref.editorAppearance,
|
|
20
|
-
disabled = _ref.disabled
|
|
20
|
+
disabled = _ref.disabled,
|
|
21
|
+
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
22
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
23
|
+
popupsScrollableElement = _ref.popupsScrollableElement;
|
|
21
24
|
var components = editorAPI === null || editorAPI === void 0 || (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
|
|
22
25
|
var toolbar = components === null || components === void 0 ? void 0 : components.find(function (component) {
|
|
23
26
|
return component.key === _toolbar.TOOLBARS.PRIMARY_TOOLBAR;
|
|
@@ -31,6 +34,9 @@ var CommentToolbar = exports.CommentToolbar = function CommentToolbar(_ref) {
|
|
|
31
34
|
editorView: editorView,
|
|
32
35
|
editorAPI: editorAPI,
|
|
33
36
|
editorAppearance: editorAppearance,
|
|
34
|
-
isDisabled: disabled
|
|
37
|
+
isDisabled: disabled,
|
|
38
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
39
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
40
|
+
popupsMountPoint: popupsMountPoint
|
|
35
41
|
});
|
|
36
42
|
};
|
|
@@ -215,6 +215,10 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
215
215
|
_backgroundColorStyles.textHighlightPaddingStyles,
|
|
216
216
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
217
217
|
_list.listsStyles,
|
|
218
|
+
// Condense vertical spacing between list items when content mode dense is active
|
|
219
|
+
(0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') &&
|
|
220
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
221
|
+
(0, _list.getDenseListStyles)(baseFontSize),
|
|
218
222
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
219
223
|
_rule.ruleStyles,
|
|
220
224
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -243,6 +247,10 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
243
247
|
_mentions.mentionsStyles,
|
|
244
248
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
245
249
|
_tasksAndDecisionsStyles.tasksAndDecisionsStyles,
|
|
250
|
+
// condense vertical spacing between tasks/decisions items when content mode dense is active
|
|
251
|
+
(0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') &&
|
|
252
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
253
|
+
(0, _tasksAndDecisionsStyles.getDenseTasksAndDecisionsStyles)(baseFontSize),
|
|
246
254
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
247
255
|
_gridStyles.gridStyles,
|
|
248
256
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -368,13 +368,12 @@ var getExtensionStyles = exports.getExtensionStyles = function getExtensionStyle
|
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
370
|
|
|
371
|
-
// Dense content mode
|
|
371
|
+
// Dense content mode extensions styling fix - addresses EDITOR-1992
|
|
372
372
|
// When cleaning up the experiment, move this logic into the baseExtensionStyles above
|
|
373
373
|
var fontSize = (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') ? (0, _editorSharedStyles.relativeFontSizeToBase16)(_editorSharedStyles.akEditorFullPageDenseFontSize) : undefined;
|
|
374
|
-
|
|
375
|
-
var denseContentModeTocStyles = (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? (0, _react.css)({
|
|
374
|
+
var denseExtensionStyles = (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? (0, _react.css)({
|
|
376
375
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
377
|
-
'.extension-container :not([data-inline-card-lozenge]
|
|
376
|
+
'.extension-container :not([data-inline-card-lozenge] *, [data-prosemirror-mark-name="code"])': {
|
|
378
377
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
379
378
|
fontSize: 'var(--ak-editor-base-font-size)'
|
|
380
379
|
}
|
|
@@ -387,5 +386,5 @@ var getExtensionStyles = exports.getExtensionStyles = function getExtensionStyle
|
|
|
387
386
|
}) : (0, _react.css)({});
|
|
388
387
|
|
|
389
388
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
390
|
-
return (0, _react.css)(baseExtensionStyles,
|
|
389
|
+
return (0, _react.css)(baseExtensionStyles, denseExtensionStyles);
|
|
391
390
|
};
|
|
@@ -4,9 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.listsStylesSafariFix = exports.listsStyles = void 0;
|
|
7
|
+
exports.listsStylesSafariFix = exports.listsStyles = exports.getDenseListStyles = exports.EDITOR_LIST_DENSE_GAP = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
10
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
11
12
|
|
|
12
13
|
// copied from packages/editor/editor-shared-styles/src/consts/consts.ts
|
|
@@ -147,4 +148,29 @@ var listsStylesSafariFix = exports.listsStylesSafariFix = (0, _react.css)((0, _d
|
|
|
147
148
|
}), ".ProseMirror:not(.".concat(BLOCK_CARD_CONTAINER, ") > li > p:first-child, .ProseMirror:not(.").concat(BLOCK_CARD_CONTAINER, ") > li > .code-block:first-child, .ProseMirror:not(.").concat(BLOCK_CARD_CONTAINER, ") > li > .ProseMirror-gapcursor:first-child + .code-block"), {
|
|
148
149
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
149
150
|
marginTop: "-".concat(akEditorLineHeight, "em !important")
|
|
150
|
-
}));
|
|
151
|
+
}));
|
|
152
|
+
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
154
|
+
var EDITOR_LIST_DENSE_GAP = exports.EDITOR_LIST_DENSE_GAP = "max(0px, calc((var(--ak-editor-base-font-size, ".concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, "px) - ").concat(_editorSharedStyles.akEditorFullPageDenseFontSize, "px) * (4 / 3)))");
|
|
155
|
+
|
|
156
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
157
|
+
var getDenseListStyles = exports.getDenseListStyles = function getDenseListStyles(baseFontSize) {
|
|
158
|
+
if (!baseFontSize || baseFontSize === _editorSharedStyles.akEditorFullPageDefaultFontSize) {
|
|
159
|
+
return (0, _react.css)({});
|
|
160
|
+
}
|
|
161
|
+
return (0, _react.css)({
|
|
162
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
163
|
+
'.ProseMirror': {
|
|
164
|
+
// Adjacent list items
|
|
165
|
+
'li + li': {
|
|
166
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
167
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
168
|
+
},
|
|
169
|
+
// Nested lists directly under an li (unordered and ordered)
|
|
170
|
+
'li > ul, li > ol, .ak-ul li > ul, .ak-ul li > ol, .ak-ol li > ul, .ak-ol li > ol': {
|
|
171
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
172
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
@@ -4,9 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.tasksAndDecisionsStyles = exports.taskItemStylesWithBlockTaskItem = exports.taskItemStyles = exports.decisionStyles = exports.decisionIconWithoutVisualRefresh = exports.decisionIconWithVisualRefresh = exports.decisionDangerStyles = exports.TaskDecisionSharedCssClassName = void 0;
|
|
7
|
+
exports.tasksAndDecisionsStyles = exports.taskItemStylesWithBlockTaskItem = exports.taskItemStyles = exports.getDenseTasksAndDecisionsStyles = exports.decisionStyles = exports.decisionIconWithoutVisualRefresh = exports.decisionIconWithVisualRefresh = exports.decisionDangerStyles = exports.TaskDecisionSharedCssClassName = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
+
var _list = require("./list");
|
|
10
12
|
var _selectionStyles = require("./selectionStyles");
|
|
11
13
|
var _css; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
12
14
|
var akEditorLineHeight = 1.714;
|
|
@@ -14,6 +16,8 @@ var akEditorSelectedNodeClassName = 'ak-editor-selected-node';
|
|
|
14
16
|
var TaskDecisionSharedCssClassName = exports.TaskDecisionSharedCssClassName = {
|
|
15
17
|
DECISION_CONTAINER: 'decisionItemView-content-wrap',
|
|
16
18
|
TASK_CONTAINER: 'taskItemView-content-wrap',
|
|
19
|
+
//NOTE: value is a selector (data attribute), not a class name
|
|
20
|
+
TASK_LIST_CONTAINER: '[data-node-type="actionList"]',
|
|
17
21
|
TASK_ITEM: 'task-item',
|
|
18
22
|
TASK_CHECKBOX_CONTAINER: 'task-item-checkbox-wrap'
|
|
19
23
|
};
|
|
@@ -73,6 +77,30 @@ var tasksAndDecisionsStyles = exports.tasksAndDecisionsStyles = (0, _react.css)(
|
|
|
73
77
|
}
|
|
74
78
|
});
|
|
75
79
|
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
81
|
+
var TASKLIST_CONTAINER_MARGIN_DENSE = "max(0px, calc(10px + (var(--ak-editor-base-font-size, ".concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, "px) - ").concat(_editorSharedStyles.akEditorFullPageDenseFontSize, "px) * (2 / 3)))");
|
|
82
|
+
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
84
|
+
var getDenseTasksAndDecisionsStyles = exports.getDenseTasksAndDecisionsStyles = function getDenseTasksAndDecisionsStyles(baseFontSize) {
|
|
85
|
+
if (!baseFontSize || baseFontSize === _editorSharedStyles.akEditorFullPageDefaultFontSize) {
|
|
86
|
+
return (0, _react.css)({});
|
|
87
|
+
}
|
|
88
|
+
return (0, _react.css)({
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
90
|
+
'.ProseMirror': (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, {
|
|
91
|
+
// Task lists: container top margin
|
|
92
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
93
|
+
marginTop: TASKLIST_CONTAINER_MARGIN_DENSE
|
|
94
|
+
}), "".concat(TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, " > * + *"), {
|
|
95
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
96
|
+
marginTop: _list.EDITOR_LIST_DENSE_GAP
|
|
97
|
+
}), "".concat(TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, " ").concat(TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, ", .").concat(TaskDecisionSharedCssClassName.TASK_CONTAINER, " .").concat(TaskDecisionSharedCssClassName.TASK_CONTAINER), {
|
|
98
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
99
|
+
marginTop: _list.EDITOR_LIST_DENSE_GAP
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
76
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
77
105
|
var decisionStyles = exports.decisionStyles = (0, _react.css)((_css = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_css, ".".concat(akEditorSelectedNodeClassName, " > [data-decision-wrapper], ol[data-node-type='decisionList'].").concat(akEditorSelectedNodeClassName),
|
|
78
106
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -2,6 +2,7 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from '
|
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import uuid from 'uuid/v4';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent, PLATFORMS } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
5
6
|
import { createDispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
7
|
import { useConstructor, usePreviousState } from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
|
|
@@ -18,6 +19,7 @@ import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
18
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
20
21
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
22
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
21
23
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
22
24
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
23
25
|
import { getNodesCount } from '../utils/getNodesCount';
|
|
@@ -509,7 +511,11 @@ export function ReactEditorView(props) {
|
|
|
509
511
|
};
|
|
510
512
|
}, []);
|
|
511
513
|
const handleEditorViewRef = useCallback(node => {
|
|
514
|
+
if (isSSR() && expVal('platform_editor_no_ssr', 'isEnabled', false)) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
512
517
|
if (node) {
|
|
518
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
513
519
|
scrollElement.current = document.querySelector('[data-editor-scroll-container]');
|
|
514
520
|
const cleanupListeners = () => {
|
|
515
521
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
const injectNodeViewNodeTypeList = ['paragraph', 'heading', 'bulletList', 'orderedList', 'blockquote', 'rule', 'decisionList', 'taskList', 'layoutColumn', 'hardBreak'];
|
|
6
|
+
const injectNodeViewNodeTypeConditionalList = [...injectNodeViewNodeTypeList,
|
|
7
|
+
// nodes that have custom nodeView behind experiment/FG
|
|
8
|
+
'layoutSection'];
|
|
5
9
|
const key = new PluginKey('editorNativeAnchorSupportPlugin');
|
|
6
10
|
|
|
7
11
|
// Internal plugin to enable native anchor support in the editor.
|
|
@@ -9,8 +13,9 @@ const key = new PluginKey('editorNativeAnchorSupportPlugin');
|
|
|
9
13
|
// that do not already have a nodeView, allowing them to be rendered with native anchors when needed.
|
|
10
14
|
export const createEditorNativeAnchorSupportPlugin = schema => {
|
|
11
15
|
const nodeViewEntries = [];
|
|
16
|
+
const injectList = expValEquals('advanced_layouts', 'isEnabled', true) ? injectNodeViewNodeTypeList : injectNodeViewNodeTypeConditionalList;
|
|
12
17
|
schema.spec.nodes.forEach((nodeName, nodeSpec) => {
|
|
13
|
-
if (
|
|
18
|
+
if (injectList.includes(nodeName)) {
|
|
14
19
|
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
15
20
|
const toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
16
21
|
nodeViewEntries.push([nodeName, node => DOMSerializer.renderSpec(document, toDOM(node))]);
|
|
@@ -47,7 +47,6 @@ import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugins/tasks-and-deci
|
|
|
47
47
|
import { textColorPlugin } from '@atlaskit/editor-plugins/text-color';
|
|
48
48
|
import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugins/toolbar-lists-indentation';
|
|
49
49
|
import { ufoPlugin } from '@atlaskit/editor-plugins/ufo';
|
|
50
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
51
50
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
52
51
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
53
52
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
@@ -134,7 +133,7 @@ export default function createUniversalPresetInternal({
|
|
|
134
133
|
isCopyPasteEnabled: true,
|
|
135
134
|
alignLeftOnInsert: typeof ((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.alignLeftOnInsert) !== 'undefined' ? (_props$media6 = props.media) === null || _props$media6 === void 0 ? void 0 : _props$media6.alignLeftOnInsert : isComment,
|
|
136
135
|
getEditorFeatureFlags
|
|
137
|
-
}], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media
|
|
136
|
+
}], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media)).maybeAdd(captionPlugin, Boolean((_props$media7 = props.media) === null || _props$media7 === void 0 ? void 0 : _props$media7.allowCaptions)).maybeAdd([mentionsPlugin, {
|
|
138
137
|
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
139
138
|
insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
|
|
140
139
|
allowZeroWidthSpaceAfter: true,
|
|
@@ -183,7 +183,10 @@ export const CommentEditorWithIntl = props => {
|
|
|
183
183
|
editorAPI: editorAPI,
|
|
184
184
|
editorView: editorView,
|
|
185
185
|
editorAppearance: appearance,
|
|
186
|
-
disabled: patch6Enabled ? !!disabled : undefined
|
|
186
|
+
disabled: patch6Enabled ? !!disabled : undefined,
|
|
187
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
188
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
189
|
+
popupsMountPoint: popupsMountPoint
|
|
187
190
|
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : jsx(ToolbarArrowKeyNavigationProvider, {
|
|
188
191
|
editorView: editorView,
|
|
189
192
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -9,7 +9,10 @@ export const CommentToolbar = ({
|
|
|
9
9
|
editorAPI,
|
|
10
10
|
editorView,
|
|
11
11
|
editorAppearance,
|
|
12
|
-
disabled
|
|
12
|
+
disabled,
|
|
13
|
+
popupsBoundariesElement,
|
|
14
|
+
popupsMountPoint,
|
|
15
|
+
popupsScrollableElement
|
|
13
16
|
}) => {
|
|
14
17
|
var _editorAPI$toolbar;
|
|
15
18
|
const components = editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
|
|
@@ -23,6 +26,9 @@ export const CommentToolbar = ({
|
|
|
23
26
|
editorView: editorView,
|
|
24
27
|
editorAPI: editorAPI,
|
|
25
28
|
editorAppearance: editorAppearance,
|
|
26
|
-
isDisabled: disabled
|
|
29
|
+
isDisabled: disabled,
|
|
30
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
31
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
32
|
+
popupsMountPoint: popupsMountPoint
|
|
27
33
|
});
|
|
28
34
|
};
|
|
@@ -44,7 +44,7 @@ import { indentationStyles } from './styles/indentationStyles';
|
|
|
44
44
|
import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
|
|
45
45
|
import { layoutBaseStyles, layoutBaseStylesAdvanced, layoutBaseStylesFixesUnderNestedDnDFG, layoutColumnMartinTopFixesNew, layoutColumnMartinTopFixesOld, layoutColumnResponsiveStyles, layoutColumnStylesAdvanced, layoutColumnStylesNotAdvanced, layoutResponsiveBaseStyles, layoutResponsiveStylesForView, layoutSectionStylesAdvanced, layoutSectionStylesNotAdvanced, layoutSelectedStylesAdvanced, layoutSelectedStylesForViewAdvanced, layoutSelectedStylesForViewNotAdvanced, layoutSelectedStylesNotAdvanced, layoutStylesForView } from './styles/layout';
|
|
46
46
|
import { hyperLinkFloatingToolbarStyles, linkLegacyIconStylesFix, linkStyles } from './styles/link';
|
|
47
|
-
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
47
|
+
import { getDenseListStyles, listsStyles, listsStylesSafariFix } from './styles/list';
|
|
48
48
|
import { mediaAlignmentStyles, mediaCaptionStyles, mediaDangerStyles, mediaGroupStyles, mediaStyles } from './styles/mediaStyles';
|
|
49
49
|
import { mentionsStyles, mentionsSelectionStyles, mentionNodeStyles, mentionsStylesMixin_platform_editor_centre_mention_padding, mentionsSelectionStylesWithSearchMatch, mentionDangerStyles } from './styles/mentions';
|
|
50
50
|
import { panelStyles, panelStylesMixin, nestedPanelBorderStylesMixin, panelStylesMixin_fg_platform_editor_nested_dnd_styles_changes, panelViewStyles, nestedPanelDangerStyles } from './styles/panelStyles';
|
|
@@ -60,7 +60,7 @@ import { editorControlsSmartCardStyles, linkingVisualRefreshV1Styles, smartCardS
|
|
|
60
60
|
import { statusDangerStyles, statusStyles, statusStylesMixin_fg_platform_component_visual_refresh, statusStylesMixin_fg_platform_component_visual_refresh_with_search_match, statusStylesMixin_without_fg_platform_component_visual_refresh, statusStylesMixin_without_fg_platform_component_visual_refresh_with_search_match } from './styles/statusStyles';
|
|
61
61
|
import { syncBlockStyles } from './styles/syncBlockStyles';
|
|
62
62
|
import { tableCommentEditorStyles, tableContainerOverflowY, tableContainerStyles, tableLayoutFixes } from './styles/tableStyles';
|
|
63
|
-
import { decisionStyles, tasksAndDecisionsStyles, decisionIconWithVisualRefresh, decisionIconWithoutVisualRefresh, taskItemStyles, taskItemStylesWithBlockTaskItem, decisionDangerStyles } from './styles/tasksAndDecisionsStyles';
|
|
63
|
+
import { decisionStyles, tasksAndDecisionsStyles, decisionIconWithVisualRefresh, decisionIconWithoutVisualRefresh, taskItemStyles, taskItemStylesWithBlockTaskItem, decisionDangerStyles, getDenseTasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
64
64
|
import { telepointerColorAndCommonStyle, telepointerStyle } from './styles/telepointerStyles';
|
|
65
65
|
import { textColorStyles } from './styles/textColorStyles';
|
|
66
66
|
import { textHighlightStyle } from './styles/textHighlightStyles';
|
|
@@ -211,6 +211,10 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
211
211
|
textHighlightPaddingStyles,
|
|
212
212
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
213
213
|
listsStyles,
|
|
214
|
+
// Condense vertical spacing between list items when content mode dense is active
|
|
215
|
+
expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') &&
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
217
|
+
getDenseListStyles(baseFontSize),
|
|
214
218
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
215
219
|
ruleStyles,
|
|
216
220
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -239,6 +243,10 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
239
243
|
mentionsStyles,
|
|
240
244
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
241
245
|
tasksAndDecisionsStyles,
|
|
246
|
+
// condense vertical spacing between tasks/decisions items when content mode dense is active
|
|
247
|
+
expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') &&
|
|
248
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
249
|
+
getDenseTasksAndDecisionsStyles(baseFontSize),
|
|
242
250
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
243
251
|
gridStyles,
|
|
244
252
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -362,13 +362,12 @@ export const getExtensionStyles = () => {
|
|
|
362
362
|
}
|
|
363
363
|
});
|
|
364
364
|
|
|
365
|
-
// Dense content mode
|
|
365
|
+
// Dense content mode extensions styling fix - addresses EDITOR-1992
|
|
366
366
|
// When cleaning up the experiment, move this logic into the baseExtensionStyles above
|
|
367
367
|
const fontSize = expValEquals('cc_editor_ai_content_mode', 'variant', 'test') ? relativeFontSizeToBase16(akEditorFullPageDenseFontSize) : undefined;
|
|
368
|
-
|
|
369
|
-
const denseContentModeTocStyles = expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? css({
|
|
368
|
+
const denseExtensionStyles = expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? css({
|
|
370
369
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
371
|
-
'.extension-container :not([data-inline-card-lozenge]
|
|
370
|
+
'.extension-container :not([data-inline-card-lozenge] *, [data-prosemirror-mark-name="code"])': {
|
|
372
371
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
373
372
|
fontSize: 'var(--ak-editor-base-font-size)'
|
|
374
373
|
}
|
|
@@ -381,5 +380,5 @@ export const getExtensionStyles = () => {
|
|
|
381
380
|
}) : css({});
|
|
382
381
|
|
|
383
382
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
384
|
-
return css(baseExtensionStyles,
|
|
383
|
+
return css(baseExtensionStyles, denseExtensionStyles);
|
|
385
384
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
3
4
|
// copied from packages/editor/editor-shared-styles/src/consts/consts.ts
|
|
4
5
|
const akEditorLineHeight = 1.714;
|
|
5
6
|
// copied from packages/editor/editor-common/src/styles/shared/smart-card.ts
|
|
@@ -143,4 +144,29 @@ export const listsStylesSafariFix = css({
|
|
|
143
144
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
144
145
|
marginTop: `-${akEditorLineHeight}em !important`
|
|
145
146
|
}
|
|
146
|
-
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
150
|
+
export const EDITOR_LIST_DENSE_GAP = `max(0px, calc((var(--ak-editor-base-font-size, ${akEditorFullPageDefaultFontSize}px) - ${akEditorFullPageDenseFontSize}px) * (4 / 3)))`;
|
|
151
|
+
|
|
152
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
153
|
+
export const getDenseListStyles = baseFontSize => {
|
|
154
|
+
if (!baseFontSize || baseFontSize === akEditorFullPageDefaultFontSize) {
|
|
155
|
+
return css({});
|
|
156
|
+
}
|
|
157
|
+
return css({
|
|
158
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
159
|
+
'.ProseMirror': {
|
|
160
|
+
// Adjacent list items
|
|
161
|
+
'li + li': {
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
163
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
164
|
+
},
|
|
165
|
+
// Nested lists directly under an li (unordered and ordered)
|
|
166
|
+
'li > ul, li > ol, .ak-ul li > ul, .ak-ul li > ol, .ak-ol li > ul, .ak-ol li > ol': {
|
|
167
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
168
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { EDITOR_LIST_DENSE_GAP } from './list';
|
|
3
5
|
import { blanketSelectionStyles, boxShadowSelectionStyles, dangerBackgroundStyles, dangerBorderStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
4
6
|
const akEditorLineHeight = 1.714;
|
|
5
7
|
const akEditorSelectedNodeClassName = 'ak-editor-selected-node';
|
|
6
8
|
export const TaskDecisionSharedCssClassName = {
|
|
7
9
|
DECISION_CONTAINER: 'decisionItemView-content-wrap',
|
|
8
10
|
TASK_CONTAINER: 'taskItemView-content-wrap',
|
|
11
|
+
//NOTE: value is a selector (data attribute), not a class name
|
|
12
|
+
TASK_LIST_CONTAINER: '[data-node-type="actionList"]',
|
|
9
13
|
TASK_ITEM: 'task-item',
|
|
10
14
|
TASK_CHECKBOX_CONTAINER: 'task-item-checkbox-wrap'
|
|
11
15
|
};
|
|
@@ -74,6 +78,39 @@ export const tasksAndDecisionsStyles = css({
|
|
|
74
78
|
}
|
|
75
79
|
});
|
|
76
80
|
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
82
|
+
const TASKLIST_CONTAINER_MARGIN_DENSE = `max(0px, calc(10px + (var(--ak-editor-base-font-size, ${akEditorFullPageDefaultFontSize}px) - ${akEditorFullPageDenseFontSize}px) * (2 / 3)))`;
|
|
83
|
+
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
85
|
+
export const getDenseTasksAndDecisionsStyles = baseFontSize => {
|
|
86
|
+
if (!baseFontSize || baseFontSize === akEditorFullPageDefaultFontSize) {
|
|
87
|
+
return css({});
|
|
88
|
+
}
|
|
89
|
+
return css({
|
|
90
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
91
|
+
'.ProseMirror': {
|
|
92
|
+
// Task lists
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
94
|
+
[TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER]: {
|
|
95
|
+
// Task lists: container top margin
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
97
|
+
marginTop: TASKLIST_CONTAINER_MARGIN_DENSE
|
|
98
|
+
},
|
|
99
|
+
// Task lists: sibling items and nested lists
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
101
|
+
[`${TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER} > * + *`]: {
|
|
102
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
103
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
104
|
+
},
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
106
|
+
[`${TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER} ${TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER}, .${TaskDecisionSharedCssClassName.TASK_CONTAINER} .${TaskDecisionSharedCssClassName.TASK_CONTAINER}`]: {
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
108
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
77
114
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
78
115
|
export const decisionStyles = css({
|
|
79
116
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "
|
|
2
|
+
export const version = "0.0.0-development";
|
|
@@ -10,6 +10,7 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from '
|
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
11
|
import uuid from 'uuid/v4';
|
|
12
12
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent, PLATFORMS } from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
13
14
|
import { createDispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
14
15
|
import { useConstructor, usePreviousState } from '@atlaskit/editor-common/hooks';
|
|
15
16
|
import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
|
|
@@ -26,6 +27,7 @@ import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
26
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
28
|
import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
28
29
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
30
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
29
31
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
30
32
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
31
33
|
import { getNodesCount } from '../utils/getNodesCount';
|
|
@@ -542,7 +544,11 @@ export function ReactEditorView(props) {
|
|
|
542
544
|
};
|
|
543
545
|
}, []);
|
|
544
546
|
var handleEditorViewRef = useCallback(function (node) {
|
|
547
|
+
if (isSSR() && expVal('platform_editor_no_ssr', 'isEnabled', false)) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
545
550
|
if (node) {
|
|
551
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
546
552
|
scrollElement.current = document.querySelector('[data-editor-scroll-container]');
|
|
547
553
|
var cleanupListeners = function cleanupListeners() {
|
|
548
554
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
var injectNodeViewNodeTypeList = ['paragraph', 'heading', 'bulletList', 'orderedList', 'blockquote', 'rule', 'decisionList', 'taskList', 'layoutColumn', 'hardBreak'];
|
|
6
|
+
var injectNodeViewNodeTypeConditionalList = [].concat(injectNodeViewNodeTypeList, [
|
|
7
|
+
// nodes that have custom nodeView behind experiment/FG
|
|
8
|
+
'layoutSection']);
|
|
5
9
|
var key = new PluginKey('editorNativeAnchorSupportPlugin');
|
|
6
10
|
|
|
7
11
|
// Internal plugin to enable native anchor support in the editor.
|
|
@@ -9,8 +13,9 @@ var key = new PluginKey('editorNativeAnchorSupportPlugin');
|
|
|
9
13
|
// that do not already have a nodeView, allowing them to be rendered with native anchors when needed.
|
|
10
14
|
export var createEditorNativeAnchorSupportPlugin = function createEditorNativeAnchorSupportPlugin(schema) {
|
|
11
15
|
var nodeViewEntries = [];
|
|
16
|
+
var injectList = expValEquals('advanced_layouts', 'isEnabled', true) ? injectNodeViewNodeTypeList : injectNodeViewNodeTypeConditionalList;
|
|
12
17
|
schema.spec.nodes.forEach(function (nodeName, nodeSpec) {
|
|
13
|
-
if (
|
|
18
|
+
if (injectList.includes(nodeName)) {
|
|
14
19
|
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
15
20
|
var toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
16
21
|
nodeViewEntries.push([nodeName, function (node) {
|
|
@@ -51,7 +51,6 @@ import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugins/tasks-and-deci
|
|
|
51
51
|
import { textColorPlugin } from '@atlaskit/editor-plugins/text-color';
|
|
52
52
|
import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugins/toolbar-lists-indentation';
|
|
53
53
|
import { ufoPlugin } from '@atlaskit/editor-plugins/ufo';
|
|
54
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
55
54
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
56
55
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
57
56
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
@@ -136,7 +135,7 @@ export default function createUniversalPresetInternal(_ref) {
|
|
|
136
135
|
isCopyPasteEnabled: true,
|
|
137
136
|
alignLeftOnInsert: typeof ((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.alignLeftOnInsert) !== 'undefined' ? (_props$media6 = props.media) === null || _props$media6 === void 0 ? void 0 : _props$media6.alignLeftOnInsert : isComment,
|
|
138
137
|
getEditorFeatureFlags: getEditorFeatureFlags
|
|
139
|
-
})], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media
|
|
138
|
+
})], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media)).maybeAdd(captionPlugin, Boolean((_props$media7 = props.media) === null || _props$media7 === void 0 ? void 0 : _props$media7.allowCaptions)).maybeAdd([mentionsPlugin, _objectSpread({
|
|
140
139
|
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
141
140
|
insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
|
|
142
141
|
allowZeroWidthSpaceAfter: true,
|
|
@@ -184,7 +184,10 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
184
184
|
editorAPI: editorAPI,
|
|
185
185
|
editorView: editorView,
|
|
186
186
|
editorAppearance: appearance,
|
|
187
|
-
disabled: patch6Enabled ? !!disabled : undefined
|
|
187
|
+
disabled: patch6Enabled ? !!disabled : undefined,
|
|
188
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
189
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
190
|
+
popupsMountPoint: popupsMountPoint
|
|
188
191
|
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : jsx(ToolbarArrowKeyNavigationProvider, {
|
|
189
192
|
editorView: editorView,
|
|
190
193
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -10,7 +10,10 @@ export var CommentToolbar = function CommentToolbar(_ref) {
|
|
|
10
10
|
var editorAPI = _ref.editorAPI,
|
|
11
11
|
editorView = _ref.editorView,
|
|
12
12
|
editorAppearance = _ref.editorAppearance,
|
|
13
|
-
disabled = _ref.disabled
|
|
13
|
+
disabled = _ref.disabled,
|
|
14
|
+
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
15
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
16
|
+
popupsScrollableElement = _ref.popupsScrollableElement;
|
|
14
17
|
var components = editorAPI === null || editorAPI === void 0 || (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
|
|
15
18
|
var toolbar = components === null || components === void 0 ? void 0 : components.find(function (component) {
|
|
16
19
|
return component.key === TOOLBARS.PRIMARY_TOOLBAR;
|
|
@@ -24,6 +27,9 @@ export var CommentToolbar = function CommentToolbar(_ref) {
|
|
|
24
27
|
editorView: editorView,
|
|
25
28
|
editorAPI: editorAPI,
|
|
26
29
|
editorAppearance: editorAppearance,
|
|
27
|
-
isDisabled: disabled
|
|
30
|
+
isDisabled: disabled,
|
|
31
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
32
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
33
|
+
popupsMountPoint: popupsMountPoint
|
|
28
34
|
});
|
|
29
35
|
};
|
|
@@ -45,7 +45,7 @@ import { indentationStyles } from './styles/indentationStyles';
|
|
|
45
45
|
import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
|
|
46
46
|
import { layoutBaseStyles, layoutBaseStylesAdvanced, layoutBaseStylesFixesUnderNestedDnDFG, layoutColumnMartinTopFixesNew, layoutColumnMartinTopFixesOld, layoutColumnResponsiveStyles, layoutColumnStylesAdvanced, layoutColumnStylesNotAdvanced, layoutResponsiveBaseStyles, layoutResponsiveStylesForView, layoutSectionStylesAdvanced, layoutSectionStylesNotAdvanced, layoutSelectedStylesAdvanced, layoutSelectedStylesForViewAdvanced, layoutSelectedStylesForViewNotAdvanced, layoutSelectedStylesNotAdvanced, layoutStylesForView } from './styles/layout';
|
|
47
47
|
import { hyperLinkFloatingToolbarStyles, linkLegacyIconStylesFix, linkStyles } from './styles/link';
|
|
48
|
-
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
48
|
+
import { getDenseListStyles, listsStyles, listsStylesSafariFix } from './styles/list';
|
|
49
49
|
import { mediaAlignmentStyles, mediaCaptionStyles, mediaDangerStyles, mediaGroupStyles, mediaStyles } from './styles/mediaStyles';
|
|
50
50
|
import { mentionsStyles, mentionsSelectionStyles, mentionNodeStyles, mentionsStylesMixin_platform_editor_centre_mention_padding, mentionsSelectionStylesWithSearchMatch, mentionDangerStyles } from './styles/mentions';
|
|
51
51
|
import { panelStyles, panelStylesMixin, nestedPanelBorderStylesMixin, panelStylesMixin_fg_platform_editor_nested_dnd_styles_changes, panelViewStyles, nestedPanelDangerStyles } from './styles/panelStyles';
|
|
@@ -61,7 +61,7 @@ import { editorControlsSmartCardStyles, linkingVisualRefreshV1Styles, smartCardS
|
|
|
61
61
|
import { statusDangerStyles, statusStyles, statusStylesMixin_fg_platform_component_visual_refresh, statusStylesMixin_fg_platform_component_visual_refresh_with_search_match, statusStylesMixin_without_fg_platform_component_visual_refresh, statusStylesMixin_without_fg_platform_component_visual_refresh_with_search_match } from './styles/statusStyles';
|
|
62
62
|
import { syncBlockStyles } from './styles/syncBlockStyles';
|
|
63
63
|
import { tableCommentEditorStyles, tableContainerOverflowY, tableContainerStyles, tableLayoutFixes } from './styles/tableStyles';
|
|
64
|
-
import { decisionStyles, tasksAndDecisionsStyles, decisionIconWithVisualRefresh, decisionIconWithoutVisualRefresh, taskItemStyles, taskItemStylesWithBlockTaskItem, decisionDangerStyles } from './styles/tasksAndDecisionsStyles';
|
|
64
|
+
import { decisionStyles, tasksAndDecisionsStyles, decisionIconWithVisualRefresh, decisionIconWithoutVisualRefresh, taskItemStyles, taskItemStylesWithBlockTaskItem, decisionDangerStyles, getDenseTasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
65
65
|
import { telepointerColorAndCommonStyle, telepointerStyle } from './styles/telepointerStyles';
|
|
66
66
|
import { textColorStyles } from './styles/textColorStyles';
|
|
67
67
|
import { textHighlightStyle } from './styles/textHighlightStyles';
|
|
@@ -207,6 +207,10 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
207
207
|
textHighlightPaddingStyles,
|
|
208
208
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
209
209
|
listsStyles,
|
|
210
|
+
// Condense vertical spacing between list items when content mode dense is active
|
|
211
|
+
expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') &&
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
213
|
+
getDenseListStyles(baseFontSize),
|
|
210
214
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
211
215
|
ruleStyles,
|
|
212
216
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -235,6 +239,10 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
235
239
|
mentionsStyles,
|
|
236
240
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
237
241
|
tasksAndDecisionsStyles,
|
|
242
|
+
// condense vertical spacing between tasks/decisions items when content mode dense is active
|
|
243
|
+
expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') &&
|
|
244
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
245
|
+
getDenseTasksAndDecisionsStyles(baseFontSize),
|
|
238
246
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
239
247
|
gridStyles,
|
|
240
248
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -362,13 +362,12 @@ export var getExtensionStyles = function getExtensionStyles() {
|
|
|
362
362
|
}
|
|
363
363
|
});
|
|
364
364
|
|
|
365
|
-
// Dense content mode
|
|
365
|
+
// Dense content mode extensions styling fix - addresses EDITOR-1992
|
|
366
366
|
// When cleaning up the experiment, move this logic into the baseExtensionStyles above
|
|
367
367
|
var fontSize = expValEquals('cc_editor_ai_content_mode', 'variant', 'test') ? relativeFontSizeToBase16(akEditorFullPageDenseFontSize) : undefined;
|
|
368
|
-
|
|
369
|
-
var denseContentModeTocStyles = expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? css({
|
|
368
|
+
var denseExtensionStyles = expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? css({
|
|
370
369
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
371
|
-
'.extension-container :not([data-inline-card-lozenge]
|
|
370
|
+
'.extension-container :not([data-inline-card-lozenge] *, [data-prosemirror-mark-name="code"])': {
|
|
372
371
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
373
372
|
fontSize: 'var(--ak-editor-base-font-size)'
|
|
374
373
|
}
|
|
@@ -381,5 +380,5 @@ export var getExtensionStyles = function getExtensionStyles() {
|
|
|
381
380
|
}) : css({});
|
|
382
381
|
|
|
383
382
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
384
|
-
return css(baseExtensionStyles,
|
|
383
|
+
return css(baseExtensionStyles, denseExtensionStyles);
|
|
385
384
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
4
5
|
// copied from packages/editor/editor-shared-styles/src/consts/consts.ts
|
|
5
6
|
var akEditorLineHeight = 1.714;
|
|
6
7
|
// copied from packages/editor/editor-common/src/styles/shared/smart-card.ts
|
|
@@ -139,4 +140,29 @@ export var listsStylesSafariFix = css(_defineProperty(_defineProperty({}, ".Pros
|
|
|
139
140
|
}), ".ProseMirror:not(.".concat(BLOCK_CARD_CONTAINER, ") > li > p:first-child, .ProseMirror:not(.").concat(BLOCK_CARD_CONTAINER, ") > li > .code-block:first-child, .ProseMirror:not(.").concat(BLOCK_CARD_CONTAINER, ") > li > .ProseMirror-gapcursor:first-child + .code-block"), {
|
|
140
141
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
141
142
|
marginTop: "-".concat(akEditorLineHeight, "em !important")
|
|
142
|
-
}));
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
146
|
+
export var EDITOR_LIST_DENSE_GAP = "max(0px, calc((var(--ak-editor-base-font-size, ".concat(akEditorFullPageDefaultFontSize, "px) - ").concat(akEditorFullPageDenseFontSize, "px) * (4 / 3)))");
|
|
147
|
+
|
|
148
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
149
|
+
export var getDenseListStyles = function getDenseListStyles(baseFontSize) {
|
|
150
|
+
if (!baseFontSize || baseFontSize === akEditorFullPageDefaultFontSize) {
|
|
151
|
+
return css({});
|
|
152
|
+
}
|
|
153
|
+
return css({
|
|
154
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
155
|
+
'.ProseMirror': {
|
|
156
|
+
// Adjacent list items
|
|
157
|
+
'li + li': {
|
|
158
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
159
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
160
|
+
},
|
|
161
|
+
// Nested lists directly under an li (unordered and ordered)
|
|
162
|
+
'li > ul, li > ol, .ak-ul li > ul, .ak-ul li > ol, .ak-ol li > ul, .ak-ol li > ol': {
|
|
163
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
164
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
};
|
|
@@ -2,12 +2,16 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
var _css;
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { EDITOR_LIST_DENSE_GAP } from './list';
|
|
5
7
|
import { blanketSelectionStyles, boxShadowSelectionStyles, dangerBackgroundStyles, dangerBorderStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
6
8
|
var akEditorLineHeight = 1.714;
|
|
7
9
|
var akEditorSelectedNodeClassName = 'ak-editor-selected-node';
|
|
8
10
|
export var TaskDecisionSharedCssClassName = {
|
|
9
11
|
DECISION_CONTAINER: 'decisionItemView-content-wrap',
|
|
10
12
|
TASK_CONTAINER: 'taskItemView-content-wrap',
|
|
13
|
+
//NOTE: value is a selector (data attribute), not a class name
|
|
14
|
+
TASK_LIST_CONTAINER: '[data-node-type="actionList"]',
|
|
11
15
|
TASK_ITEM: 'task-item',
|
|
12
16
|
TASK_CHECKBOX_CONTAINER: 'task-item-checkbox-wrap'
|
|
13
17
|
};
|
|
@@ -67,6 +71,30 @@ export var tasksAndDecisionsStyles = css({
|
|
|
67
71
|
}
|
|
68
72
|
});
|
|
69
73
|
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
75
|
+
var TASKLIST_CONTAINER_MARGIN_DENSE = "max(0px, calc(10px + (var(--ak-editor-base-font-size, ".concat(akEditorFullPageDefaultFontSize, "px) - ").concat(akEditorFullPageDenseFontSize, "px) * (2 / 3)))");
|
|
76
|
+
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
78
|
+
export var getDenseTasksAndDecisionsStyles = function getDenseTasksAndDecisionsStyles(baseFontSize) {
|
|
79
|
+
if (!baseFontSize || baseFontSize === akEditorFullPageDefaultFontSize) {
|
|
80
|
+
return css({});
|
|
81
|
+
}
|
|
82
|
+
return css({
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
84
|
+
'.ProseMirror': _defineProperty(_defineProperty(_defineProperty({}, TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, {
|
|
85
|
+
// Task lists: container top margin
|
|
86
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
87
|
+
marginTop: TASKLIST_CONTAINER_MARGIN_DENSE
|
|
88
|
+
}), "".concat(TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, " > * + *"), {
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
90
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
91
|
+
}), "".concat(TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, " ").concat(TaskDecisionSharedCssClassName.TASK_LIST_CONTAINER, ", .").concat(TaskDecisionSharedCssClassName.TASK_CONTAINER, " .").concat(TaskDecisionSharedCssClassName.TASK_CONTAINER), {
|
|
92
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
93
|
+
marginTop: EDITOR_LIST_DENSE_GAP
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
70
98
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
71
99
|
export var decisionStyles = css((_css = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_css, ".".concat(akEditorSelectedNodeClassName, " > [data-decision-wrapper], ol[data-node-type='decisionList'].").concat(akEditorSelectedNodeClassName),
|
|
72
100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "
|
|
2
|
+
export var version = "0.0.0-development";
|
|
@@ -8,9 +8,12 @@ type CommentToolbarProps = {
|
|
|
8
8
|
editorAPI?: PublicPluginAPI<ToolbarEditorPlugins>;
|
|
9
9
|
editorAppearance: EditorAppearance;
|
|
10
10
|
editorView?: EditorView;
|
|
11
|
+
popupsBoundariesElement?: HTMLElement;
|
|
12
|
+
popupsMountPoint?: HTMLElement;
|
|
13
|
+
popupsScrollableElement?: HTMLElement;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* Primary toolbar driven by components registered by `editor-plugin-toolbar`, introduced in `platform_editor_toolbar_aifc`.
|
|
14
17
|
*/
|
|
15
|
-
export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, disabled, }: CommentToolbarProps) => React.JSX.Element | null;
|
|
18
|
+
export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, disabled, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, }: CommentToolbarProps) => React.JSX.Element | null;
|
|
16
19
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type SerializedStyles } from '@emotion/react';
|
|
2
2
|
export declare const listsStyles: SerializedStyles;
|
|
3
3
|
export declare const listsStylesSafariFix: SerializedStyles;
|
|
4
|
+
export declare const EDITOR_LIST_DENSE_GAP = "max(0px, calc((var(--ak-editor-base-font-size, 16px) - 13px) * (4 / 3)))";
|
|
5
|
+
export declare const getDenseListStyles: (baseFontSize?: number) => SerializedStyles;
|
|
@@ -2,10 +2,12 @@ import { type SerializedStyles } from '@emotion/react';
|
|
|
2
2
|
export declare const TaskDecisionSharedCssClassName: {
|
|
3
3
|
DECISION_CONTAINER: string;
|
|
4
4
|
TASK_CONTAINER: string;
|
|
5
|
+
TASK_LIST_CONTAINER: string;
|
|
5
6
|
TASK_ITEM: string;
|
|
6
7
|
TASK_CHECKBOX_CONTAINER: string;
|
|
7
8
|
};
|
|
8
9
|
export declare const tasksAndDecisionsStyles: SerializedStyles;
|
|
10
|
+
export declare const getDenseTasksAndDecisionsStyles: (baseFontSize?: number) => SerializedStyles;
|
|
9
11
|
export declare const decisionStyles: SerializedStyles;
|
|
10
12
|
export declare const decisionDangerStyles: SerializedStyles;
|
|
11
13
|
export declare const decisionIconWithVisualRefresh: SerializedStyles;
|
|
@@ -10,9 +10,12 @@ type CommentToolbarProps = {
|
|
|
10
10
|
editorAPI?: PublicPluginAPI<ToolbarEditorPlugins>;
|
|
11
11
|
editorAppearance: EditorAppearance;
|
|
12
12
|
editorView?: EditorView;
|
|
13
|
+
popupsBoundariesElement?: HTMLElement;
|
|
14
|
+
popupsMountPoint?: HTMLElement;
|
|
15
|
+
popupsScrollableElement?: HTMLElement;
|
|
13
16
|
};
|
|
14
17
|
/**
|
|
15
18
|
* Primary toolbar driven by components registered by `editor-plugin-toolbar`, introduced in `platform_editor_toolbar_aifc`.
|
|
16
19
|
*/
|
|
17
|
-
export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, disabled, }: CommentToolbarProps) => React.JSX.Element | null;
|
|
20
|
+
export declare const CommentToolbar: ({ editorAPI, editorView, editorAppearance, disabled, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, }: CommentToolbarProps) => React.JSX.Element | null;
|
|
18
21
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type SerializedStyles } from '@emotion/react';
|
|
2
2
|
export declare const listsStyles: SerializedStyles;
|
|
3
3
|
export declare const listsStylesSafariFix: SerializedStyles;
|
|
4
|
+
export declare const EDITOR_LIST_DENSE_GAP = "max(0px, calc((var(--ak-editor-base-font-size, 16px) - 13px) * (4 / 3)))";
|
|
5
|
+
export declare const getDenseListStyles: (baseFontSize?: number) => SerializedStyles;
|
|
@@ -2,10 +2,12 @@ import { type SerializedStyles } from '@emotion/react';
|
|
|
2
2
|
export declare const TaskDecisionSharedCssClassName: {
|
|
3
3
|
DECISION_CONTAINER: string;
|
|
4
4
|
TASK_CONTAINER: string;
|
|
5
|
+
TASK_LIST_CONTAINER: string;
|
|
5
6
|
TASK_ITEM: string;
|
|
6
7
|
TASK_CHECKBOX_CONTAINER: string;
|
|
7
8
|
};
|
|
8
9
|
export declare const tasksAndDecisionsStyles: SerializedStyles;
|
|
10
|
+
export declare const getDenseTasksAndDecisionsStyles: (baseFontSize?: number) => SerializedStyles;
|
|
9
11
|
export declare const decisionStyles: SerializedStyles;
|
|
10
12
|
export declare const decisionDangerStyles: SerializedStyles;
|
|
11
13
|
export declare const decisionIconWithVisualRefresh: SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "215.
|
|
3
|
+
"version": "215.3.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/activity-provider": "^2.5.0",
|
|
42
|
-
"@atlaskit/adf-schema": "^51.
|
|
42
|
+
"@atlaskit/adf-schema": "^51.3.0",
|
|
43
43
|
"@atlaskit/afm-i18n-platform-editor-editor-core": "2.7.0",
|
|
44
44
|
"@atlaskit/analytics-namespaced-context": "^7.1.0",
|
|
45
45
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
46
46
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
47
47
|
"@atlaskit/button": "^23.5.0",
|
|
48
48
|
"@atlaskit/css": "^0.15.0",
|
|
49
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
49
|
+
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
50
50
|
"@atlaskit/editor-performance-metrics": "^2.1.0",
|
|
51
51
|
"@atlaskit/editor-plugin-quick-insert": "^6.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-user-preferences": "^4.0.0",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
65
65
|
"@atlaskit/react-ufo": "^4.12.0",
|
|
66
66
|
"@atlaskit/task-decision": "^19.2.0",
|
|
67
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
68
|
-
"@atlaskit/tokens": "^
|
|
67
|
+
"@atlaskit/tmp-editor-statsig": "^13.13.0",
|
|
68
|
+
"@atlaskit/tokens": "^7.0.0",
|
|
69
69
|
"@atlaskit/tooltip": "^20.5.0",
|
|
70
70
|
"@atlaskit/width-detector": "^5.0.0",
|
|
71
71
|
"@babel/runtime": "^7.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"uuid": "^3.1.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@atlaskit/editor-common": "^110.
|
|
84
|
+
"@atlaskit/editor-common": "^110.14.0",
|
|
85
85
|
"@atlaskit/link-provider": "^4.0.0",
|
|
86
86
|
"@atlaskit/media-core": "^37.0.0",
|
|
87
87
|
"react": "^18.2.0",
|
|
@@ -91,21 +91,21 @@
|
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@af/editor-libra": "workspace:^",
|
|
93
93
|
"@af/visual-regression": "workspace:^",
|
|
94
|
-
"@atlaskit/adf-utils": "^19.
|
|
94
|
+
"@atlaskit/adf-utils": "^19.25.0",
|
|
95
95
|
"@atlaskit/analytics-listeners": "^9.1.0",
|
|
96
96
|
"@atlaskit/collab-provider": "^14.0.0",
|
|
97
|
-
"@atlaskit/editor-plugin-annotation": "^6.
|
|
98
|
-
"@atlaskit/editor-plugin-card": "^11.
|
|
99
|
-
"@atlaskit/editor-plugin-list": "^8.
|
|
100
|
-
"@atlaskit/editor-plugin-paste": "^7.
|
|
97
|
+
"@atlaskit/editor-plugin-annotation": "^6.2.0",
|
|
98
|
+
"@atlaskit/editor-plugin-card": "^11.4.0",
|
|
99
|
+
"@atlaskit/editor-plugin-list": "^8.2.0",
|
|
100
|
+
"@atlaskit/editor-plugin-paste": "^7.4.0",
|
|
101
101
|
"@atlaskit/link-provider": "^4.0.0",
|
|
102
102
|
"@atlaskit/logo": "^19.9.0",
|
|
103
103
|
"@atlaskit/media-core": "^37.0.0",
|
|
104
104
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
105
105
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
106
106
|
"@atlaskit/modal-dialog": "^14.5.0",
|
|
107
|
-
"@atlaskit/primitives": "^
|
|
108
|
-
"@atlaskit/renderer": "^124.
|
|
107
|
+
"@atlaskit/primitives": "^16.0.0",
|
|
108
|
+
"@atlaskit/renderer": "^124.7.0",
|
|
109
109
|
"@atlaskit/section-message": "^8.7.0",
|
|
110
110
|
"@atlaskit/smart-card": "^43.1.0",
|
|
111
111
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
@@ -164,9 +164,6 @@
|
|
|
164
164
|
"type": "boolean",
|
|
165
165
|
"referenceOnly": true
|
|
166
166
|
},
|
|
167
|
-
"platform_editor_ai_rovo_free_gen": {
|
|
168
|
-
"type": "boolean"
|
|
169
|
-
},
|
|
170
167
|
"editor_inline_comments_on_inline_nodes": {
|
|
171
168
|
"type": "boolean",
|
|
172
169
|
"referenceOnly": "true"
|
|
@@ -278,10 +275,6 @@
|
|
|
278
275
|
"type": "boolean",
|
|
279
276
|
"referenceOnly": true
|
|
280
277
|
},
|
|
281
|
-
"platform_editor_elements_dnd_multi_select_patch_1": {
|
|
282
|
-
"type": "boolean",
|
|
283
|
-
"referenceOnly": true
|
|
284
|
-
},
|
|
285
278
|
"platform_editor_content_mode_button_mvp": {
|
|
286
279
|
"type": "boolean"
|
|
287
280
|
},
|
|
@@ -300,9 +293,6 @@
|
|
|
300
293
|
"type": "boolean",
|
|
301
294
|
"referenceOnly": true
|
|
302
295
|
},
|
|
303
|
-
"platform_editor_add_media_from_url_rollout": {
|
|
304
|
-
"type": "boolean"
|
|
305
|
-
},
|
|
306
296
|
"platform_editor_elements_dnd_multi_select_patch_2": {
|
|
307
297
|
"type": "boolean",
|
|
308
298
|
"referenceOnly": true
|