@atlaskit/editor-core 207.11.0 → 207.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +22 -62
- package/dist/cjs/ui/EditorContentContainer/styles/emoji.js +61 -0
- package/dist/cjs/ui/EditorContentContainer/styles/mentions.js +107 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +19 -150
- package/dist/es2019/ui/EditorContentContainer/styles/emoji.js +74 -0
- package/dist/es2019/ui/EditorContentContainer/styles/mentions.js +115 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +22 -62
- package/dist/esm/ui/EditorContentContainer/styles/emoji.js +53 -0
- package/dist/esm/ui/EditorContentContainer/styles/mentions.js +100 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -1
- package/dist/types/ui/EditorContentContainer/styles/emoji.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/mentions.d.ts +3 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/emoji.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/mentions.d.ts +3 -0
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 207.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159712](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159712)
|
|
8
|
+
[`ed0d352587eaf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ed0d352587eaf) -
|
|
9
|
+
refactor emotion styles for emoji and mentions
|
|
10
|
+
- [#157348](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157348)
|
|
11
|
+
[`2745ba38d05fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2745ba38d05fd) -
|
|
12
|
+
Implemented the new manager set selection and hover APIs. This will allow anyone with access to
|
|
13
|
+
the annotations manager the ability to control when/what annotation is selected/hovered.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 207.11.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -4,14 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.placeholderStyles = exports.
|
|
7
|
+
exports.placeholderStyles = exports.default = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
12
12
|
var _collab = require("@atlaskit/editor-common/collab");
|
|
13
|
-
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
14
|
-
var _mention = require("@atlaskit/editor-common/mention");
|
|
15
13
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
16
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
17
15
|
var _styles2 = require("@atlaskit/editor-plugins/block-type/styles");
|
|
@@ -38,6 +36,7 @@ var _codeBlockStyles = require("./styles/codeBlockStyles");
|
|
|
38
36
|
var _codeMarkStyles = require("./styles/codeMarkStyles");
|
|
39
37
|
var _dateStyles = require("./styles/dateStyles");
|
|
40
38
|
var _embedCardStyles = require("./styles/embedCardStyles");
|
|
39
|
+
var _emoji = require("./styles/emoji");
|
|
41
40
|
var _firstBlockNodeStyles = require("./styles/firstBlockNodeStyles");
|
|
42
41
|
var _gridStyles = require("./styles/gridStyles");
|
|
43
42
|
var _indentationStyles = require("./styles/indentationStyles");
|
|
@@ -45,6 +44,7 @@ var _layout = require("./styles/layout");
|
|
|
45
44
|
var _link = require("./styles/link");
|
|
46
45
|
var _list = require("./styles/list");
|
|
47
46
|
var _mediaStyles = require("./styles/mediaStyles");
|
|
47
|
+
var _mentions = require("./styles/mentions");
|
|
48
48
|
var _paragraphStyles = require("./styles/paragraphStyles");
|
|
49
49
|
var _resizerStyles = require("./styles/resizerStyles");
|
|
50
50
|
var _rule = require("./styles/rule");
|
|
@@ -54,7 +54,7 @@ var _tasksAndDecisionsStyles = require("./styles/tasksAndDecisionsStyles");
|
|
|
54
54
|
var _textColorStyles = require("./styles/textColorStyles");
|
|
55
55
|
var _unsupportedStyles = require("./styles/unsupportedStyles");
|
|
56
56
|
var _whitespaceStyles = require("./styles/whitespaceStyles");
|
|
57
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5
|
|
57
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
58
58
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
59
59
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
60
60
|
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Requires manual remediation over time due to use of unsafe nested mixins */
|
|
@@ -63,55 +63,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
63
63
|
* @jsx jsx
|
|
64
64
|
*/
|
|
65
65
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
66
|
-
var isFirefox =
|
|
67
|
-
var vanillaMentionsStyles = (0, _react2.css)({
|
|
68
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
69
|
-
'.editor-mention-primitive': {
|
|
70
|
-
display: 'inline',
|
|
71
|
-
borderRadius: '20px',
|
|
72
|
-
cursor: 'pointer',
|
|
73
|
-
padding: '0 0.3em 2px 0.23em',
|
|
74
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
75
|
-
wordBreak: 'break-word',
|
|
76
|
-
background: "var(--ds-background-neutral, #091E420F)",
|
|
77
|
-
border: '1px solid transparent',
|
|
78
|
-
color: "var(--ds-text-subtle, #44546F)",
|
|
79
|
-
'&:hover': {
|
|
80
|
-
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
81
|
-
},
|
|
82
|
-
'&:active': {
|
|
83
|
-
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
87
|
-
'.editor-mention-primitive.mention-restricted': {
|
|
88
|
-
background: 'transparent',
|
|
89
|
-
border: "1px solid ".concat("var(--ds-border-bold, #758195)"),
|
|
90
|
-
color: "var(--ds-text, #172B4D)",
|
|
91
|
-
'&:hover': {
|
|
92
|
-
background: 'transparent'
|
|
93
|
-
},
|
|
94
|
-
'&:active': {
|
|
95
|
-
background: 'transparent'
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
99
|
-
'.editor-mention-primitive.mention-self': {
|
|
100
|
-
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
101
|
-
border: '1px solid transparent',
|
|
102
|
-
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
103
|
-
'&:hover': {
|
|
104
|
-
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
105
|
-
},
|
|
106
|
-
'&:active': {
|
|
107
|
-
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
var vanillaSelectionStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.danger {\n\t\t.editor-mention-primitive {\n\t\t\tbox-shadow: 0 0 0 ", "px ", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t.", " > .editor-mention-primitive,\n\t.", " > .editor-mention-primitive.mention-self,\n\t.", " > .editor-mention-primitive.mention-restricted {\n\t\t", "\n\t\t/* need to specify dark text colour because personal mentions\n\t\t (in dark blue) have white text by default */\n\t\tcolor: ", "\n\t}\n"])), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackgroundWithOpacity, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Background]), "var(--ds-text-subtle, #44546F)");
|
|
112
|
-
var mentionsStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\t&.", " [data-mention-id] > span {\n\t\t\t", "\n\n\t\t\t/* need to specify dark text colour because personal mentions\n\t\t (in dark blue) have white text by default */\n\t color: ", ";\n\t\t}\n\t}\n\n\t.danger {\n\t\t.", ".", "\n\t\t\t> span\n\t\t\t> span\n\t\t\t> span {\n\t\t\tbox-shadow: 0 0 0 ", "px ", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\t\t.", " > span > span > span {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Background]), "var(--ds-text-subtle, #44546F)", _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackgroundWithOpacity, ")"), _mention.MentionSharedCssClassName.MENTION_CONTAINER, "var(--ds-background-neutral, #091E420F)", "var(--ds-text-subtle, #44546F)");
|
|
113
|
-
var reactEmojiStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tdisplay: inline-block;\n\n\t\t.", " {\n\t\t\tcursor: pointer;\n\n\t\t\t&.", " > span {\n\t\t\t\t/** needed for selection style to cover custom emoji image properly */\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t&.", " {\n\t\t\t.", ", .", " {\n\t\t\t\tborder-radius: 2px;\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), _emoji.EmojiSharedCssClassName.EMOJI_CONTAINER, _emoji.EmojiSharedCssClassName.EMOJI_NODE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, _editorSharedStyles.akEditorSelectedNodeClassName, _emoji.EmojiSharedCssClassName.EMOJI_SPRITE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
|
|
114
|
-
var emojiStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-prosemirror-node-view-type='vanilla'] {\n\t\t.", " {\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t.", ", .", " {\n\t\t\tbackground: no-repeat transparent;\n\t\t\tdisplay: inline-block;\n\t\t\theight: ", "px;\n\t\t\tmax-height: ", "px;\n\t\t\tcursor: pointer;\n\t\t\tvertical-align: middle;\n\t\t\tuser-select: all;\n\t\t}\n\n\t\t&.", " {\n\t\t\t.", ", .", " {\n\t\t\t\tborder-radius: 2px;\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), _emoji.EmojiSharedCssClassName.EMOJI_CONTAINER, _emoji.EmojiSharedCssClassName.EMOJI_SPRITE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, _emoji.defaultEmojiHeight, _emoji.defaultEmojiHeight, _editorSharedStyles.akEditorSelectedNodeClassName, _emoji.EmojiSharedCssClassName.EMOJI_SPRITE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
|
|
66
|
+
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
115
67
|
|
|
116
68
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
117
69
|
var placeholderStyles = exports.placeholderStyles = (0, _react2.css)({
|
|
@@ -152,13 +104,7 @@ var akEditorBreakpointForSmallDevice = "1266px";
|
|
|
152
104
|
|
|
153
105
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
154
106
|
var contentStyles = function contentStyles() {
|
|
155
|
-
return (0, _react2.css)(
|
|
156
|
-
exposure: false
|
|
157
|
-
}) && vanillaMentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
158
|
-
exposure: false
|
|
159
|
-
}) && vanillaSelectionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
160
|
-
exposure: false
|
|
161
|
-
}) ? emojiStyles : reactEmojiStyles, emojiStyles, _tasksAndDecisionsStyles.tasksAndDecisionsStyles, _gridStyles.gridStyles, _blockMarksStyles.blockMarksStyles, _dateStyles.dateStyles, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
107
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: var(--ak-editor-base-font-size);\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\t}\n\n\t", "\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n ", ";\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n\t is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, (0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, _whitespaceStyles.whitespaceStyles, _styles.listsSharedStyles, _indentationStyles.indentationStyles, _shadowStyles.shadowStyles, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, _codeBlockStyles.codeBlockStyles, (0, _styles2.blocktypeStyles)(), _codeMarkStyles.codeMarkStyles, _textColorStyles.textColorStyles, _backgroundColorStyles.backgroundColorStyles, _list.listsStyles, _rule.ruleStyles, _mediaStyles.mediaStyles, (0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer') ? _collab.telepointerStyle : _collab.telepointerStyleWithInitialOnly, _selection.gapCursorStyles, (0, _panel.panelStyles)(), _mentions.mentionsStyles, _tasksAndDecisionsStyles.tasksAndDecisionsStyles, _gridStyles.gridStyles, _blockMarksStyles.blockMarksStyles, _dateStyles.dateStyles, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
162
108
|
exposure: false
|
|
163
109
|
}) && _tasksAndDecisions.vanillaTaskItemStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
164
110
|
exposure: false
|
|
@@ -166,7 +112,7 @@ var contentStyles = function contentStyles() {
|
|
|
166
112
|
exposure: false
|
|
167
113
|
}) && (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithVisualRefresh, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
168
114
|
exposure: false
|
|
169
|
-
}) && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithoutVisualRefresh, _status.statusStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? (0, _status.vanillaStatusStyles)() : null, _annotationStyles.annotationStyles, _smartCardStyles.smartCardStyles, _embedCardStyles.embedCardStyles, _unsupportedStyles.unsupportedStyles, _resizerStyles.resizerStyles, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(
|
|
115
|
+
}) && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithoutVisualRefresh, _status.statusStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? (0, _status.vanillaStatusStyles)() : null, _annotationStyles.annotationStyles, _smartCardStyles.smartCardStyles, _embedCardStyles.embedCardStyles, _unsupportedStyles.unsupportedStyles, _resizerStyles.resizerStyles, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
|
|
170
116
|
};
|
|
171
117
|
var CommentEditorMargin = 14;
|
|
172
118
|
|
|
@@ -274,7 +220,21 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
274
220
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
275
221
|
_firstBlockNodeStyles.firstBlockNodeStyles :
|
|
276
222
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
277
|
-
_firstBlockNodeStyles.firstBlockNodeStylesOld
|
|
223
|
+
_firstBlockNodeStyles.firstBlockNodeStylesOld, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
224
|
+
exposure: false
|
|
225
|
+
}) &&
|
|
226
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
227
|
+
_mentions.vanillaMentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
228
|
+
exposure: false
|
|
229
|
+
}) &&
|
|
230
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
231
|
+
_mentions.vanillaMentionsSelectionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
|
|
232
|
+
exposure: false
|
|
233
|
+
}) ?
|
|
234
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
235
|
+
_emoji.vanillaEmojiStyles :
|
|
236
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
237
|
+
_emoji.reactEmojiStyles],
|
|
278
238
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
279
239
|
"data-testid": "editor-content-container",
|
|
280
240
|
style: {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.vanillaEmojiStyles = exports.reactEmojiStyles = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
11
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
|
+
var _selectionStyles = require("./selectionStyles");
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
14
|
+
|
|
15
|
+
var reactEmojiSelectionStyles = (0, _react.css)({
|
|
16
|
+
borderRadius: '2px'
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
20
|
+
var reactEmojiStyles = exports.reactEmojiStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_CONTAINER), (0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
21
|
+
display: 'inline-block'
|
|
22
|
+
}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_NODE), (0, _defineProperty2.default)({
|
|
23
|
+
cursor: 'pointer'
|
|
24
|
+
}, "&.".concat(_emoji.EmojiSharedCssClassName.EMOJI_IMAGE, " > span"), {
|
|
25
|
+
/** needed for selection style to cover custom emoji image properly */
|
|
26
|
+
display: 'flex'
|
|
27
|
+
})), "&.".concat(_editorSharedStyles.akEditorSelectedNodeClassName), (0, _defineProperty2.default)({}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_SPRITE, ", .").concat(_emoji.EmojiSharedCssClassName.EMOJI_IMAGE), [
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
29
|
+
_selectionStyles.blanketSelectionStyles,
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
31
|
+
_selectionStyles.boxShadowSelectionStyles,
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
33
|
+
_selectionStyles.hideNativeBrowserTextSelectionStyles, reactEmojiSelectionStyles]))));
|
|
34
|
+
var vanillaEmojiSelectionStyles = (0, _react.css)({
|
|
35
|
+
borderRadius: '2px'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Emoji styles from Emoji vanilla node view
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
40
|
+
var vanillaEmojiStyles = exports.vanillaEmojiStyles = (0, _react.css)({
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
42
|
+
'[data-prosemirror-node-view-type="vanilla"]': (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_CONTAINER), {
|
|
43
|
+
display: 'inline-block'
|
|
44
|
+
}), ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_SPRITE, ", .").concat(_emoji.EmojiSharedCssClassName.EMOJI_IMAGE), {
|
|
45
|
+
background: 'no-repeat transparent',
|
|
46
|
+
display: 'inline-block',
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
48
|
+
height: "".concat(_emoji.defaultEmojiHeight, "px"),
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
50
|
+
maxHeight: "".concat(_emoji.defaultEmojiHeight, "px"),
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
verticalAlign: 'middle',
|
|
53
|
+
userSelect: 'all'
|
|
54
|
+
}), "&.".concat(_editorSharedStyles.akEditorSelectedNodeClassName), (0, _defineProperty2.default)({}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_SPRITE, ", .").concat(_emoji.EmojiSharedCssClassName.EMOJI_IMAGE), [vanillaEmojiSelectionStyles,
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
56
|
+
_selectionStyles.blanketSelectionStyles,
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
58
|
+
_selectionStyles.boxShadowSelectionStyles,
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
60
|
+
_selectionStyles.hideNativeBrowserTextSelectionStyles]))
|
|
61
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.vanillaMentionsStyles = exports.vanillaMentionsSelectionStyles = exports.mentionsStyles = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _mention = require("@atlaskit/editor-common/mention");
|
|
11
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
|
+
var _selectionStyles = require("./selectionStyles");
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
14
|
+
|
|
15
|
+
/* need to specify dark text colour because personal mentions
|
|
16
|
+
(in dark blue) have white text by default */
|
|
17
|
+
var mentionsSelectedColor = (0, _react.css)({
|
|
18
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
22
|
+
var mentionsStyles = exports.mentionsStyles = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_mention.MentionSharedCssClassName.MENTION_CONTAINER), (0, _defineProperty2.default)({}, "&.".concat(_editorSharedStyles.akEditorSelectedNodeClassName, " [data-mention-id] > span"), [
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
24
|
+
_selectionStyles.boxShadowSelectionStyles,
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
26
|
+
_selectionStyles.backgroundSelectionStyles, mentionsSelectedColor])), '.danger', (0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_mention.MentionSharedCssClassName.MENTION_CONTAINER, ".").concat(_editorSharedStyles.akEditorSelectedNodeClassName), {
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
28
|
+
'> span > span > span': {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
30
|
+
boxShadow: "0 0 0 ".concat(_editorSharedStyles.akEditorSelectedBorderSize, "px ").concat(_editorSharedStyles.akEditorDeleteBorder),
|
|
31
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
32
|
+
}
|
|
33
|
+
}), ".".concat(_mention.MentionSharedCssClassName.MENTION_CONTAINER, " > span > span > span"), {
|
|
34
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
35
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
36
|
+
})));
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
39
|
+
var vanillaMentionsStyles = exports.vanillaMentionsStyles = (0, _react.css)({
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
41
|
+
'.editor-mention-primitive': {
|
|
42
|
+
display: 'inline',
|
|
43
|
+
borderRadius: '20px',
|
|
44
|
+
cursor: 'pointer',
|
|
45
|
+
padding: '0 0.3em 2px 0.23em',
|
|
46
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
47
|
+
wordBreak: 'break-word',
|
|
48
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
49
|
+
border: '1px solid transparent',
|
|
50
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
51
|
+
'&:hover': {
|
|
52
|
+
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
53
|
+
},
|
|
54
|
+
'&:active': {
|
|
55
|
+
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
59
|
+
'.editor-mention-primitive.mention-restricted': {
|
|
60
|
+
background: 'transparent',
|
|
61
|
+
border: "1px solid ".concat("var(--ds-border-bold, #758195)"),
|
|
62
|
+
color: "var(--ds-text, #172B4D)",
|
|
63
|
+
'&:hover': {
|
|
64
|
+
background: 'transparent'
|
|
65
|
+
},
|
|
66
|
+
'&:active': {
|
|
67
|
+
background: 'transparent'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
71
|
+
'.editor-mention-primitive.mention-self': {
|
|
72
|
+
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
73
|
+
border: '1px solid transparent',
|
|
74
|
+
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
75
|
+
'&:hover': {
|
|
76
|
+
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
77
|
+
},
|
|
78
|
+
'&:active': {
|
|
79
|
+
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// This is mentions styles for mentions selection styles based on the vanilla node view
|
|
85
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
86
|
+
var vanillaMentionsSelectionStyles = exports.vanillaMentionsSelectionStyles = (0, _react.css)((0, _defineProperty2.default)({
|
|
87
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
88
|
+
'.danger': {
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
90
|
+
'.editor-mention-primitive': {
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
92
|
+
boxShadow: "0 0 0 ".concat(_editorSharedStyles.akEditorSelectedBorderSize, "px ").concat(_editorSharedStyles.akEditorDeleteBorder),
|
|
93
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, ".".concat(_editorSharedStyles.akEditorSelectedNodeClassName), {
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
98
|
+
'> .editor-mention-primitive, > .editor-mention-primitive.mention-self, > .editor-mention-primitive.mention-restricted':
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values,
|
|
100
|
+
[
|
|
101
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
102
|
+
_selectionStyles.boxShadowSelectionStyles,
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
104
|
+
_selectionStyles.backgroundSelectionStyles,
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
106
|
+
_selectionStyles.hideNativeBrowserTextSelectionStyles, mentionsSelectedColor]
|
|
107
|
+
}));
|
|
@@ -11,8 +11,6 @@ import React from 'react';
|
|
|
11
11
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
12
12
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
13
13
|
import { telepointerStyle, telepointerStyleWithInitialOnly } from '@atlaskit/editor-common/collab';
|
|
14
|
-
import { EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
|
|
15
|
-
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
16
14
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
17
15
|
import { GRID_GUTTER, listsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
18
16
|
import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
|
|
@@ -20,7 +18,7 @@ import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles'
|
|
|
20
18
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
21
19
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
22
20
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
23
|
-
import {
|
|
21
|
+
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
24
22
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
25
23
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
26
24
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -39,6 +37,7 @@ import { codeBlockStyles, firstCodeBlockWithNoMargin, firstCodeBlockWithNoMargin
|
|
|
39
37
|
import { codeMarkStyles } from './styles/codeMarkStyles';
|
|
40
38
|
import { dateStyles, dateVanillaStyles } from './styles/dateStyles';
|
|
41
39
|
import { embedCardStyles } from './styles/embedCardStyles';
|
|
40
|
+
import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
|
|
42
41
|
import { firstBlockNodeStyles, firstBlockNodeStylesOld } from './styles/firstBlockNodeStyles';
|
|
43
42
|
import { gridStyles } from './styles/gridStyles';
|
|
44
43
|
import { indentationStyles } from './styles/indentationStyles';
|
|
@@ -46,6 +45,7 @@ import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
|
|
|
46
45
|
import { linkStyles, linkStylesOld } from './styles/link';
|
|
47
46
|
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
48
47
|
import { mediaStyles } from './styles/mediaStyles';
|
|
48
|
+
import { mentionsStyles, vanillaMentionsStyles, vanillaMentionsSelectionStyles } from './styles/mentions';
|
|
49
49
|
import { paragraphStylesOld, paragraphStylesUGCModernized, paragraphStylesUGCRefreshed } from './styles/paragraphStyles';
|
|
50
50
|
import { resizerStyles, pragmaticResizerStyles } from './styles/resizerStyles';
|
|
51
51
|
import { ruleStyles } from './styles/rule';
|
|
@@ -55,138 +55,7 @@ import { tasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
|
55
55
|
import { textColorStyles } from './styles/textColorStyles';
|
|
56
56
|
import { unsupportedStyles } from './styles/unsupportedStyles';
|
|
57
57
|
import { whitespaceStyles } from './styles/whitespaceStyles';
|
|
58
|
-
|
|
59
|
-
const vanillaMentionsStyles = css({
|
|
60
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
61
|
-
'.editor-mention-primitive': {
|
|
62
|
-
display: 'inline',
|
|
63
|
-
borderRadius: '20px',
|
|
64
|
-
cursor: 'pointer',
|
|
65
|
-
padding: '0 0.3em 2px 0.23em',
|
|
66
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
67
|
-
wordBreak: 'break-word',
|
|
68
|
-
background: "var(--ds-background-neutral, #091E420F)",
|
|
69
|
-
border: '1px solid transparent',
|
|
70
|
-
color: "var(--ds-text-subtle, #44546F)",
|
|
71
|
-
'&:hover': {
|
|
72
|
-
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
73
|
-
},
|
|
74
|
-
'&:active': {
|
|
75
|
-
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
79
|
-
'.editor-mention-primitive.mention-restricted': {
|
|
80
|
-
background: 'transparent',
|
|
81
|
-
border: `1px solid ${"var(--ds-border-bold, #758195)"}`,
|
|
82
|
-
color: "var(--ds-text, #172B4D)",
|
|
83
|
-
'&:hover': {
|
|
84
|
-
background: 'transparent'
|
|
85
|
-
},
|
|
86
|
-
'&:active': {
|
|
87
|
-
background: 'transparent'
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
91
|
-
'.editor-mention-primitive.mention-self': {
|
|
92
|
-
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
93
|
-
border: '1px solid transparent',
|
|
94
|
-
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
95
|
-
'&:hover': {
|
|
96
|
-
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
97
|
-
},
|
|
98
|
-
'&:active': {
|
|
99
|
-
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
const vanillaSelectionStyles = css`
|
|
104
|
-
.danger {
|
|
105
|
-
.editor-mention-primitive {
|
|
106
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
|
|
107
|
-
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackgroundWithOpacity})`};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.${akEditorSelectedNodeClassName} > .editor-mention-primitive,
|
|
112
|
-
.${akEditorSelectedNodeClassName} > .editor-mention-primitive.mention-self,
|
|
113
|
-
.${akEditorSelectedNodeClassName} > .editor-mention-primitive.mention-restricted {
|
|
114
|
-
${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background])}
|
|
115
|
-
/* need to specify dark text colour because personal mentions
|
|
116
|
-
(in dark blue) have white text by default */
|
|
117
|
-
color: ${"var(--ds-text-subtle, #44546F)"}
|
|
118
|
-
}
|
|
119
|
-
`;
|
|
120
|
-
const mentionsStyles = css`
|
|
121
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER} {
|
|
122
|
-
&.${akEditorSelectedNodeClassName} [data-mention-id] > span {
|
|
123
|
-
${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background])}
|
|
124
|
-
|
|
125
|
-
/* need to specify dark text colour because personal mentions
|
|
126
|
-
(in dark blue) have white text by default */
|
|
127
|
-
color: ${"var(--ds-text-subtle, #44546F)"};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.danger {
|
|
132
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}
|
|
133
|
-
> span
|
|
134
|
-
> span
|
|
135
|
-
> span {
|
|
136
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
|
|
137
|
-
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackgroundWithOpacity})`};
|
|
138
|
-
}
|
|
139
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span {
|
|
140
|
-
background-color: ${"var(--ds-background-neutral, #091E420F)"};
|
|
141
|
-
color: ${"var(--ds-text-subtle, #44546F)"};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
|
-
const reactEmojiStyles = css`
|
|
146
|
-
.${EmojiSharedCssClassName.EMOJI_CONTAINER} {
|
|
147
|
-
display: inline-block;
|
|
148
|
-
|
|
149
|
-
.${EmojiSharedCssClassName.EMOJI_NODE} {
|
|
150
|
-
cursor: pointer;
|
|
151
|
-
|
|
152
|
-
&.${EmojiSharedCssClassName.EMOJI_IMAGE} > span {
|
|
153
|
-
/** needed for selection style to cover custom emoji image properly */
|
|
154
|
-
display: flex;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&.${akEditorSelectedNodeClassName} {
|
|
159
|
-
.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
|
|
160
|
-
border-radius: 2px;
|
|
161
|
-
${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
`;
|
|
166
|
-
const emojiStyles = css`
|
|
167
|
-
[data-prosemirror-node-view-type='vanilla'] {
|
|
168
|
-
.${EmojiSharedCssClassName.EMOJI_CONTAINER} {
|
|
169
|
-
display: inline-block;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
|
|
173
|
-
background: no-repeat transparent;
|
|
174
|
-
display: inline-block;
|
|
175
|
-
height: ${defaultEmojiHeight}px;
|
|
176
|
-
max-height: ${defaultEmojiHeight}px;
|
|
177
|
-
cursor: pointer;
|
|
178
|
-
vertical-align: middle;
|
|
179
|
-
user-select: all;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&.${akEditorSelectedNodeClassName} {
|
|
183
|
-
.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE} {
|
|
184
|
-
border-radius: 2px;
|
|
185
|
-
${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
`;
|
|
58
|
+
const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
190
59
|
|
|
191
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
192
61
|
export const placeholderStyles = css({
|
|
@@ -361,20 +230,6 @@ const contentStyles = () => css`
|
|
|
361
230
|
|
|
362
231
|
${mentionsStyles}
|
|
363
232
|
|
|
364
|
-
${editorExperiment('platform_editor_vanilla_dom', true, {
|
|
365
|
-
exposure: false
|
|
366
|
-
}) && vanillaMentionsStyles}
|
|
367
|
-
|
|
368
|
-
${editorExperiment('platform_editor_vanilla_dom', true, {
|
|
369
|
-
exposure: false
|
|
370
|
-
}) && vanillaSelectionStyles}
|
|
371
|
-
|
|
372
|
-
${editorExperiment('platform_editor_vanilla_dom', true, {
|
|
373
|
-
exposure: false
|
|
374
|
-
}) ? emojiStyles : reactEmojiStyles}
|
|
375
|
-
|
|
376
|
-
${emojiStyles}
|
|
377
|
-
|
|
378
233
|
${tasksAndDecisionsStyles}
|
|
379
234
|
|
|
380
235
|
${gridStyles}
|
|
@@ -599,7 +454,21 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
599
454
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
600
455
|
firstBlockNodeStyles :
|
|
601
456
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
602
|
-
firstBlockNodeStylesOld
|
|
457
|
+
firstBlockNodeStylesOld, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
458
|
+
exposure: false
|
|
459
|
+
}) &&
|
|
460
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
461
|
+
vanillaMentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
462
|
+
exposure: false
|
|
463
|
+
}) &&
|
|
464
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
465
|
+
vanillaMentionsSelectionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
466
|
+
exposure: false
|
|
467
|
+
}) ?
|
|
468
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
469
|
+
vanillaEmojiStyles :
|
|
470
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
471
|
+
reactEmojiStyles],
|
|
603
472
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
604
473
|
"data-testid": "editor-content-container",
|
|
605
474
|
style: {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { defaultEmojiHeight, EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
4
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { blanketSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
6
|
+
const reactEmojiSelectionStyles = css({
|
|
7
|
+
borderRadius: '2px'
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
11
|
+
export const reactEmojiStyles = css({
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
13
|
+
[`.${EmojiSharedCssClassName.EMOJI_CONTAINER}`]: {
|
|
14
|
+
display: 'inline-block',
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
16
|
+
[`.${EmojiSharedCssClassName.EMOJI_NODE}`]: {
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
19
|
+
[`&.${EmojiSharedCssClassName.EMOJI_IMAGE} > span`]: {
|
|
20
|
+
/** needed for selection style to cover custom emoji image properly */
|
|
21
|
+
display: 'flex'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
25
|
+
[`&.${akEditorSelectedNodeClassName}`]: {
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
27
|
+
[`.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE}`]: [
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
29
|
+
blanketSelectionStyles,
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
31
|
+
boxShadowSelectionStyles,
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
33
|
+
hideNativeBrowserTextSelectionStyles, reactEmojiSelectionStyles]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const vanillaEmojiSelectionStyles = css({
|
|
38
|
+
borderRadius: '2px'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Emoji styles from Emoji vanilla node view
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
43
|
+
export const vanillaEmojiStyles = css({
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
45
|
+
'[data-prosemirror-node-view-type="vanilla"]': {
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
47
|
+
[`.${EmojiSharedCssClassName.EMOJI_CONTAINER}`]: {
|
|
48
|
+
display: 'inline-block'
|
|
49
|
+
},
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
51
|
+
[`.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE}`]: {
|
|
52
|
+
background: 'no-repeat transparent',
|
|
53
|
+
display: 'inline-block',
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
55
|
+
height: `${defaultEmojiHeight}px`,
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
57
|
+
maxHeight: `${defaultEmojiHeight}px`,
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
verticalAlign: 'middle',
|
|
60
|
+
userSelect: 'all'
|
|
61
|
+
},
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
63
|
+
[`&.${akEditorSelectedNodeClassName}`]: {
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
65
|
+
[`.${EmojiSharedCssClassName.EMOJI_SPRITE}, .${EmojiSharedCssClassName.EMOJI_IMAGE}`]: [vanillaEmojiSelectionStyles,
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
67
|
+
blanketSelectionStyles,
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
69
|
+
boxShadowSelectionStyles,
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
71
|
+
hideNativeBrowserTextSelectionStyles]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
4
|
+
import { akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { backgroundSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
6
|
+
|
|
7
|
+
/* need to specify dark text colour because personal mentions
|
|
8
|
+
(in dark blue) have white text by default */
|
|
9
|
+
const mentionsSelectedColor = css({
|
|
10
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
14
|
+
export const mentionsStyles = css({
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
16
|
+
[`.${MentionSharedCssClassName.MENTION_CONTAINER}`]: {
|
|
17
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
19
|
+
[`&.${akEditorSelectedNodeClassName} [data-mention-id] > span`]: [
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
21
|
+
boxShadowSelectionStyles,
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
23
|
+
backgroundSelectionStyles, mentionsSelectedColor]
|
|
24
|
+
},
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
26
|
+
'.danger': {
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
28
|
+
[`.${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}`]: {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
30
|
+
'> span > span > span': {
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
32
|
+
boxShadow: `0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder}`,
|
|
33
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
37
|
+
[`.${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span`]: {
|
|
38
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
39
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
45
|
+
export const vanillaMentionsStyles = css({
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
47
|
+
'.editor-mention-primitive': {
|
|
48
|
+
display: 'inline',
|
|
49
|
+
borderRadius: '20px',
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
padding: '0 0.3em 2px 0.23em',
|
|
52
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
53
|
+
wordBreak: 'break-word',
|
|
54
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
55
|
+
border: '1px solid transparent',
|
|
56
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
57
|
+
'&:hover': {
|
|
58
|
+
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
59
|
+
},
|
|
60
|
+
'&:active': {
|
|
61
|
+
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
65
|
+
'.editor-mention-primitive.mention-restricted': {
|
|
66
|
+
background: 'transparent',
|
|
67
|
+
border: `1px solid ${"var(--ds-border-bold, #758195)"}`,
|
|
68
|
+
color: "var(--ds-text, #172B4D)",
|
|
69
|
+
'&:hover': {
|
|
70
|
+
background: 'transparent'
|
|
71
|
+
},
|
|
72
|
+
'&:active': {
|
|
73
|
+
background: 'transparent'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
77
|
+
'.editor-mention-primitive.mention-self': {
|
|
78
|
+
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
79
|
+
border: '1px solid transparent',
|
|
80
|
+
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
81
|
+
'&:hover': {
|
|
82
|
+
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
83
|
+
},
|
|
84
|
+
'&:active': {
|
|
85
|
+
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// This is mentions styles for mentions selection styles based on the vanilla node view
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
92
|
+
export const vanillaMentionsSelectionStyles = css({
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
94
|
+
'.danger': {
|
|
95
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
96
|
+
'.editor-mention-primitive': {
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
98
|
+
boxShadow: `0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder}`,
|
|
99
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
103
|
+
[`.${akEditorSelectedNodeClassName}`]: {
|
|
104
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
105
|
+
'> .editor-mention-primitive, > .editor-mention-primitive.mention-self, > .editor-mention-primitive.mention-restricted':
|
|
106
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values,
|
|
107
|
+
[
|
|
108
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
109
|
+
boxShadowSelectionStyles,
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
111
|
+
backgroundSelectionStyles,
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
113
|
+
hideNativeBrowserTextSelectionStyles, mentionsSelectedColor]
|
|
114
|
+
}
|
|
115
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "207.11.
|
|
2
|
+
export const version = "207.11.1";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
3
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
4
4
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
5
5
|
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- Requires manual remediation over time due to use of unsafe nested mixins */
|
|
@@ -13,8 +13,6 @@ import React from 'react';
|
|
|
13
13
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
14
14
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
15
15
|
import { telepointerStyle, telepointerStyleWithInitialOnly } from '@atlaskit/editor-common/collab';
|
|
16
|
-
import { EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
|
|
17
|
-
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
18
16
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
19
17
|
import { GRID_GUTTER, listsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
20
18
|
import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
|
|
@@ -22,7 +20,7 @@ import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles'
|
|
|
22
20
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
23
21
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
24
22
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
25
|
-
import {
|
|
23
|
+
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
26
24
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
27
25
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
26
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -41,6 +39,7 @@ import { codeBlockStyles, firstCodeBlockWithNoMargin, firstCodeBlockWithNoMargin
|
|
|
41
39
|
import { codeMarkStyles } from './styles/codeMarkStyles';
|
|
42
40
|
import { dateStyles, dateVanillaStyles } from './styles/dateStyles';
|
|
43
41
|
import { embedCardStyles } from './styles/embedCardStyles';
|
|
42
|
+
import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
|
|
44
43
|
import { firstBlockNodeStyles, firstBlockNodeStylesOld } from './styles/firstBlockNodeStyles';
|
|
45
44
|
import { gridStyles } from './styles/gridStyles';
|
|
46
45
|
import { indentationStyles } from './styles/indentationStyles';
|
|
@@ -48,6 +47,7 @@ import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
|
|
|
48
47
|
import { linkStyles, linkStylesOld } from './styles/link';
|
|
49
48
|
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
50
49
|
import { mediaStyles } from './styles/mediaStyles';
|
|
50
|
+
import { mentionsStyles, vanillaMentionsStyles, vanillaMentionsSelectionStyles } from './styles/mentions';
|
|
51
51
|
import { paragraphStylesOld, paragraphStylesUGCModernized, paragraphStylesUGCRefreshed } from './styles/paragraphStyles';
|
|
52
52
|
import { resizerStyles, pragmaticResizerStyles } from './styles/resizerStyles';
|
|
53
53
|
import { ruleStyles } from './styles/rule';
|
|
@@ -57,55 +57,7 @@ import { tasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
|
57
57
|
import { textColorStyles } from './styles/textColorStyles';
|
|
58
58
|
import { unsupportedStyles } from './styles/unsupportedStyles';
|
|
59
59
|
import { whitespaceStyles } from './styles/whitespaceStyles';
|
|
60
|
-
|
|
61
|
-
var vanillaMentionsStyles = css({
|
|
62
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
63
|
-
'.editor-mention-primitive': {
|
|
64
|
-
display: 'inline',
|
|
65
|
-
borderRadius: '20px',
|
|
66
|
-
cursor: 'pointer',
|
|
67
|
-
padding: '0 0.3em 2px 0.23em',
|
|
68
|
-
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
69
|
-
wordBreak: 'break-word',
|
|
70
|
-
background: "var(--ds-background-neutral, #091E420F)",
|
|
71
|
-
border: '1px solid transparent',
|
|
72
|
-
color: "var(--ds-text-subtle, #44546F)",
|
|
73
|
-
'&:hover': {
|
|
74
|
-
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
75
|
-
},
|
|
76
|
-
'&:active': {
|
|
77
|
-
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
81
|
-
'.editor-mention-primitive.mention-restricted': {
|
|
82
|
-
background: 'transparent',
|
|
83
|
-
border: "1px solid ".concat("var(--ds-border-bold, #758195)"),
|
|
84
|
-
color: "var(--ds-text, #172B4D)",
|
|
85
|
-
'&:hover': {
|
|
86
|
-
background: 'transparent'
|
|
87
|
-
},
|
|
88
|
-
'&:active': {
|
|
89
|
-
background: 'transparent'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
93
|
-
'.editor-mention-primitive.mention-self': {
|
|
94
|
-
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
95
|
-
border: '1px solid transparent',
|
|
96
|
-
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
97
|
-
'&:hover': {
|
|
98
|
-
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
99
|
-
},
|
|
100
|
-
'&:active': {
|
|
101
|
-
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
var vanillaSelectionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.danger {\n\t\t.editor-mention-primitive {\n\t\t\tbox-shadow: 0 0 0 ", "px ", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t.", " > .editor-mention-primitive,\n\t.", " > .editor-mention-primitive.mention-self,\n\t.", " > .editor-mention-primitive.mention-restricted {\n\t\t", "\n\t\t/* need to specify dark text colour because personal mentions\n\t\t (in dark blue) have white text by default */\n\t\tcolor: ", "\n\t}\n"])), akEditorSelectedBorderSize, akEditorDeleteBorder, "var(--ds-background-danger, ".concat(akEditorDeleteBackgroundWithOpacity, ")"), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background]), "var(--ds-text-subtle, #44546F)");
|
|
106
|
-
var mentionsStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t.", " {\n\t\t&.", " [data-mention-id] > span {\n\t\t\t", "\n\n\t\t\t/* need to specify dark text colour because personal mentions\n\t\t (in dark blue) have white text by default */\n\t color: ", ";\n\t\t}\n\t}\n\n\t.danger {\n\t\t.", ".", "\n\t\t\t> span\n\t\t\t> span\n\t\t\t> span {\n\t\t\tbox-shadow: 0 0 0 ", "px ", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\t\t.", " > span > span > span {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background]), "var(--ds-text-subtle, #44546F)", MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, akEditorDeleteBorder, "var(--ds-background-danger, ".concat(akEditorDeleteBackgroundWithOpacity, ")"), MentionSharedCssClassName.MENTION_CONTAINER, "var(--ds-background-neutral, #091E420F)", "var(--ds-text-subtle, #44546F)");
|
|
107
|
-
var reactEmojiStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t.", " {\n\t\tdisplay: inline-block;\n\n\t\t.", " {\n\t\t\tcursor: pointer;\n\n\t\t\t&.", " > span {\n\t\t\t\t/** needed for selection style to cover custom emoji image properly */\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t&.", " {\n\t\t\t.", ", .", " {\n\t\t\t\tborder-radius: 2px;\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), EmojiSharedCssClassName.EMOJI_CONTAINER, EmojiSharedCssClassName.EMOJI_NODE, EmojiSharedCssClassName.EMOJI_IMAGE, akEditorSelectedNodeClassName, EmojiSharedCssClassName.EMOJI_SPRITE, EmojiSharedCssClassName.EMOJI_IMAGE, getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow]));
|
|
108
|
-
var emojiStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t[data-prosemirror-node-view-type='vanilla'] {\n\t\t.", " {\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t.", ", .", " {\n\t\t\tbackground: no-repeat transparent;\n\t\t\tdisplay: inline-block;\n\t\t\theight: ", "px;\n\t\t\tmax-height: ", "px;\n\t\t\tcursor: pointer;\n\t\t\tvertical-align: middle;\n\t\t\tuser-select: all;\n\t\t}\n\n\t\t&.", " {\n\t\t\t.", ", .", " {\n\t\t\t\tborder-radius: 2px;\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), EmojiSharedCssClassName.EMOJI_CONTAINER, EmojiSharedCssClassName.EMOJI_SPRITE, EmojiSharedCssClassName.EMOJI_IMAGE, defaultEmojiHeight, defaultEmojiHeight, akEditorSelectedNodeClassName, EmojiSharedCssClassName.EMOJI_SPRITE, EmojiSharedCssClassName.EMOJI_IMAGE, getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow]));
|
|
60
|
+
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
109
61
|
|
|
110
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
111
63
|
export var placeholderStyles = css({
|
|
@@ -146,13 +98,7 @@ var akEditorBreakpointForSmallDevice = "1266px";
|
|
|
146
98
|
|
|
147
99
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
148
100
|
var contentStyles = function contentStyles() {
|
|
149
|
-
return css(
|
|
150
|
-
exposure: false
|
|
151
|
-
}) && vanillaMentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
152
|
-
exposure: false
|
|
153
|
-
}) && vanillaSelectionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
154
|
-
exposure: false
|
|
155
|
-
}) ? emojiStyles : reactEmojiStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, blockMarksStyles, dateStyles, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, taskDecisionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
101
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: var(--ak-editor-base-font-size);\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\t}\n\n\t", "\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n ", ";\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n\t is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), akEditorGutterPadding, akEditorGutterPaddingDynamic(), akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, akEditorCalculatedWideLayoutWidth, whitespaceStyles, listsSharedStyles, indentationStyles, shadowStyles, InlineNodeViewSharedStyles, fg('editor_request_to_edit_task') ? null : css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, codeBlockStyles, blocktypeStyles(), codeMarkStyles, textColorStyles, backgroundColorStyles, listsStyles, ruleStyles, mediaStyles, fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, gapCursorStyles, panelStyles(), mentionsStyles, tasksAndDecisionsStyles, gridStyles, blockMarksStyles, dateStyles, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, taskDecisionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
156
102
|
exposure: false
|
|
157
103
|
}) && vanillaTaskItemStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
158
104
|
exposure: false
|
|
@@ -160,7 +106,7 @@ var contentStyles = function contentStyles() {
|
|
|
160
106
|
exposure: false
|
|
161
107
|
}) && fg('platform-visual-refresh-icons') && vanillaDecisionIconWithVisualRefresh, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
162
108
|
exposure: false
|
|
163
|
-
}) && !fg('platform-visual-refresh-icons') && vanillaDecisionIconWithoutVisualRefresh, statusStyles, editorExperiment('platform_editor_vanilla_dom', true) ? vanillaStatusStyles() : null, annotationStyles, smartCardStyles, embedCardStyles, unsupportedStyles, resizerStyles, !fg('platform-visual-refresh-icons') ? css(
|
|
109
|
+
}) && !fg('platform-visual-refresh-icons') && vanillaDecisionIconWithoutVisualRefresh, statusStyles, editorExperiment('platform_editor_vanilla_dom', true) ? vanillaStatusStyles() : null, annotationStyles, smartCardStyles, embedCardStyles, unsupportedStyles, resizerStyles, !fg('platform-visual-refresh-icons') ? css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
|
|
164
110
|
};
|
|
165
111
|
var CommentEditorMargin = 14;
|
|
166
112
|
|
|
@@ -268,7 +214,21 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
268
214
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
269
215
|
firstBlockNodeStyles :
|
|
270
216
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
271
|
-
firstBlockNodeStylesOld
|
|
217
|
+
firstBlockNodeStylesOld, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
218
|
+
exposure: false
|
|
219
|
+
}) &&
|
|
220
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
221
|
+
vanillaMentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
222
|
+
exposure: false
|
|
223
|
+
}) &&
|
|
224
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
225
|
+
vanillaMentionsSelectionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
226
|
+
exposure: false
|
|
227
|
+
}) ?
|
|
228
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
229
|
+
vanillaEmojiStyles :
|
|
230
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
231
|
+
reactEmojiStyles],
|
|
272
232
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
273
233
|
"data-testid": "editor-content-container",
|
|
274
234
|
style: {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { defaultEmojiHeight, EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
5
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { blanketSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
7
|
+
var reactEmojiSelectionStyles = css({
|
|
8
|
+
borderRadius: '2px'
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
12
|
+
export var reactEmojiStyles = css(_defineProperty({}, ".".concat(EmojiSharedCssClassName.EMOJI_CONTAINER), _defineProperty(_defineProperty({
|
|
13
|
+
display: 'inline-block'
|
|
14
|
+
}, ".".concat(EmojiSharedCssClassName.EMOJI_NODE), _defineProperty({
|
|
15
|
+
cursor: 'pointer'
|
|
16
|
+
}, "&.".concat(EmojiSharedCssClassName.EMOJI_IMAGE, " > span"), {
|
|
17
|
+
/** needed for selection style to cover custom emoji image properly */
|
|
18
|
+
display: 'flex'
|
|
19
|
+
})), "&.".concat(akEditorSelectedNodeClassName), _defineProperty({}, ".".concat(EmojiSharedCssClassName.EMOJI_SPRITE, ", .").concat(EmojiSharedCssClassName.EMOJI_IMAGE), [
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
21
|
+
blanketSelectionStyles,
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
23
|
+
boxShadowSelectionStyles,
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
25
|
+
hideNativeBrowserTextSelectionStyles, reactEmojiSelectionStyles]))));
|
|
26
|
+
var vanillaEmojiSelectionStyles = css({
|
|
27
|
+
borderRadius: '2px'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Emoji styles from Emoji vanilla node view
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
32
|
+
export var vanillaEmojiStyles = css({
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
34
|
+
'[data-prosemirror-node-view-type="vanilla"]': _defineProperty(_defineProperty(_defineProperty({}, ".".concat(EmojiSharedCssClassName.EMOJI_CONTAINER), {
|
|
35
|
+
display: 'inline-block'
|
|
36
|
+
}), ".".concat(EmojiSharedCssClassName.EMOJI_SPRITE, ", .").concat(EmojiSharedCssClassName.EMOJI_IMAGE), {
|
|
37
|
+
background: 'no-repeat transparent',
|
|
38
|
+
display: 'inline-block',
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
40
|
+
height: "".concat(defaultEmojiHeight, "px"),
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
42
|
+
maxHeight: "".concat(defaultEmojiHeight, "px"),
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
verticalAlign: 'middle',
|
|
45
|
+
userSelect: 'all'
|
|
46
|
+
}), "&.".concat(akEditorSelectedNodeClassName), _defineProperty({}, ".".concat(EmojiSharedCssClassName.EMOJI_SPRITE, ", .").concat(EmojiSharedCssClassName.EMOJI_IMAGE), [vanillaEmojiSelectionStyles,
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
48
|
+
blanketSelectionStyles,
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
50
|
+
boxShadowSelectionStyles,
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
52
|
+
hideNativeBrowserTextSelectionStyles]))
|
|
53
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
5
|
+
import { akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { backgroundSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
7
|
+
|
|
8
|
+
/* need to specify dark text colour because personal mentions
|
|
9
|
+
(in dark blue) have white text by default */
|
|
10
|
+
var mentionsSelectedColor = css({
|
|
11
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
15
|
+
export var mentionsStyles = css(_defineProperty(_defineProperty({}, ".".concat(MentionSharedCssClassName.MENTION_CONTAINER), _defineProperty({}, "&.".concat(akEditorSelectedNodeClassName, " [data-mention-id] > span"), [
|
|
16
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
17
|
+
boxShadowSelectionStyles,
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
19
|
+
backgroundSelectionStyles, mentionsSelectedColor])), '.danger', _defineProperty(_defineProperty({}, ".".concat(MentionSharedCssClassName.MENTION_CONTAINER, ".").concat(akEditorSelectedNodeClassName), {
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
21
|
+
'> span > span > span': {
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
23
|
+
boxShadow: "0 0 0 ".concat(akEditorSelectedBorderSize, "px ").concat(akEditorDeleteBorder),
|
|
24
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
25
|
+
}
|
|
26
|
+
}), ".".concat(MentionSharedCssClassName.MENTION_CONTAINER, " > span > span > span"), {
|
|
27
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
28
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
29
|
+
})));
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
32
|
+
export var vanillaMentionsStyles = css({
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
34
|
+
'.editor-mention-primitive': {
|
|
35
|
+
display: 'inline',
|
|
36
|
+
borderRadius: '20px',
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
padding: '0 0.3em 2px 0.23em',
|
|
39
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
40
|
+
wordBreak: 'break-word',
|
|
41
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
42
|
+
border: '1px solid transparent',
|
|
43
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
44
|
+
'&:hover': {
|
|
45
|
+
background: "var(--ds-background-neutral-hovered, #091E4224)"
|
|
46
|
+
},
|
|
47
|
+
'&:active': {
|
|
48
|
+
background: "var(--ds-background-neutral-pressed, #091E424F)"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
52
|
+
'.editor-mention-primitive.mention-restricted': {
|
|
53
|
+
background: 'transparent',
|
|
54
|
+
border: "1px solid ".concat("var(--ds-border-bold, #758195)"),
|
|
55
|
+
color: "var(--ds-text, #172B4D)",
|
|
56
|
+
'&:hover': {
|
|
57
|
+
background: 'transparent'
|
|
58
|
+
},
|
|
59
|
+
'&:active': {
|
|
60
|
+
background: 'transparent'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
64
|
+
'.editor-mention-primitive.mention-self': {
|
|
65
|
+
background: "var(--ds-background-brand-bold, #0C66E4)",
|
|
66
|
+
border: '1px solid transparent',
|
|
67
|
+
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
68
|
+
'&:hover': {
|
|
69
|
+
background: "var(--ds-background-brand-bold-hovered, #0055CC)"
|
|
70
|
+
},
|
|
71
|
+
'&:active': {
|
|
72
|
+
background: "var(--ds-background-brand-bold-pressed, #09326C)"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// This is mentions styles for mentions selection styles based on the vanilla node view
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
79
|
+
export var vanillaMentionsSelectionStyles = css(_defineProperty({
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
81
|
+
'.danger': {
|
|
82
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
83
|
+
'.editor-mention-primitive': {
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
85
|
+
boxShadow: "0 0 0 ".concat(akEditorSelectedBorderSize, "px ").concat(akEditorDeleteBorder),
|
|
86
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, ".".concat(akEditorSelectedNodeClassName), {
|
|
90
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
91
|
+
'> .editor-mention-primitive, > .editor-mention-primitive.mention-self, > .editor-mention-primitive.mention-restricted':
|
|
92
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values,
|
|
93
|
+
[
|
|
94
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
95
|
+
boxShadowSelectionStyles,
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
97
|
+
backgroundSelectionStyles,
|
|
98
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
99
|
+
hideNativeBrowserTextSelectionStyles, mentionsSelectedColor]
|
|
100
|
+
}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "207.11.
|
|
2
|
+
export var version = "207.11.1";
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { EditorAppearance, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
-
export declare const isFirefox: boolean;
|
|
8
7
|
export declare const placeholderStyles: import("@emotion/react").SerializedStyles;
|
|
9
8
|
export type EditorContentContainerProps = {
|
|
10
9
|
className?: string;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { EditorAppearance, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
-
export declare const isFirefox: boolean;
|
|
8
7
|
export declare const placeholderStyles: import("@emotion/react").SerializedStyles;
|
|
9
8
|
export type EditorContentContainerProps = {
|
|
10
9
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "207.11.
|
|
3
|
+
"version": "207.11.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@atlaskit/adf-utils": "^19.20.0",
|
|
92
92
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
93
93
|
"@atlaskit/collab-provider": "^10.16.0",
|
|
94
|
-
"@atlaskit/editor-plugin-annotation": "^2.
|
|
94
|
+
"@atlaskit/editor-plugin-annotation": "^2.9.0",
|
|
95
95
|
"@atlaskit/editor-plugin-card": "^6.3.0",
|
|
96
96
|
"@atlaskit/editor-plugin-list": "^4.2.0",
|
|
97
97
|
"@atlaskit/editor-plugin-paste": "^3.3.0",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"@atlaskit/modal-dialog": "^14.2.0",
|
|
104
104
|
"@atlaskit/primitives": "^14.8.0",
|
|
105
105
|
"@atlaskit/renderer": "^118.4.0",
|
|
106
|
+
"@atlaskit/section-message": "^8.2.0",
|
|
106
107
|
"@atlaskit/smart-card": "^38.5.0",
|
|
107
108
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
108
109
|
"@atlaskit/toggle": "^15.0.0",
|
|
@@ -563,6 +564,10 @@
|
|
|
563
564
|
"type": "boolean",
|
|
564
565
|
"referenceOnly": true
|
|
565
566
|
},
|
|
567
|
+
"platform_editor_comments_api_manager_select": {
|
|
568
|
+
"type": "boolean",
|
|
569
|
+
"referenceOnly": true
|
|
570
|
+
},
|
|
566
571
|
"platform_editor_elements_dnd_multi_select_patch_3": {
|
|
567
572
|
"type": "boolean",
|
|
568
573
|
"referenceOnly": true
|