@atlaskit/editor-core 207.15.1 → 207.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/cjs/ui/ContentStyles/index.js +10 -2
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +14 -6
- package/dist/cjs/ui/EditorContentContainer/styles/expandStyles.js +263 -0
- package/dist/cjs/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.js +46 -0
- package/dist/cjs/ui/EditorContentContainer/styles/placeholderTextStyles.js +72 -0
- package/dist/cjs/utils/validateNodes.js +46 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +9 -0
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +16 -5
- package/dist/es2019/ui/EditorContentContainer/styles/expandStyles.js +256 -0
- package/dist/es2019/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.js +40 -0
- package/dist/es2019/ui/EditorContentContainer/styles/placeholderTextStyles.js +65 -0
- package/dist/es2019/utils/validateNodes.js +43 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +10 -2
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +14 -6
- package/dist/esm/ui/EditorContentContainer/styles/expandStyles.js +256 -0
- package/dist/esm/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.js +40 -0
- package/dist/esm/ui/EditorContentContainer/styles/placeholderTextStyles.js +65 -0
- package/dist/esm/utils/validateNodes.js +47 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/styles/expandStyles.d.ts +4 -0
- package/dist/types/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.d.ts +1 -0
- package/dist/types/ui/EditorContentContainer/styles/placeholderTextStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/expandStyles.d.ts +4 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/inlineNodeViewSharedStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/placeholderTextStyles.d.ts +1 -0
- package/package.json +10 -8
|
@@ -14,14 +14,11 @@ import { css, jsx, useTheme } from '@emotion/react';
|
|
|
14
14
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
15
15
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
16
16
|
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
17
|
-
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
18
17
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
19
18
|
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
20
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
21
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
23
|
-
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
24
|
-
import { expandStyles } from '../ContentStyles/expand';
|
|
25
22
|
import { extensionStyles } from '../ContentStyles/extension';
|
|
26
23
|
import { panelStyles } from '../ContentStyles/panel';
|
|
27
24
|
import { statusStyles, vanillaStatusStyles } from '../ContentStyles/status';
|
|
@@ -36,16 +33,19 @@ import { dateStyles, dateVanillaStyles } from './styles/dateStyles';
|
|
|
36
33
|
import { editorUGCTokensDefault, editorUGCTokensModernized, editorUGCTokensRefreshed } from './styles/editorUGCTokenStyles';
|
|
37
34
|
import { embedCardStyles } from './styles/embedCardStyles';
|
|
38
35
|
import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
|
|
36
|
+
import { expandStyles, expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes, expandStylesMixin_fg_platform_visual_refresh_icons, expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes } from './styles/expandStyles';
|
|
39
37
|
import { findReplaceStyles } from './styles/findReplaceStyles';
|
|
40
38
|
import { firstBlockNodeStyles } from './styles/firstBlockNodeStyles';
|
|
41
39
|
import { gridStyles } from './styles/gridStyles';
|
|
42
40
|
import { indentationStyles } from './styles/indentationStyles';
|
|
41
|
+
import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
|
|
43
42
|
import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
|
|
44
43
|
import { linkStyles, linkStylesOld } from './styles/link';
|
|
45
44
|
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
46
45
|
import { mediaStyles } from './styles/mediaStyles';
|
|
47
46
|
import { mentionsStyles, vanillaMentionsStyles, vanillaMentionsSelectionStyles } from './styles/mentions';
|
|
48
47
|
import { paragraphStylesOld, paragraphStylesUGCModernized, paragraphStylesUGCRefreshed } from './styles/paragraphStyles';
|
|
48
|
+
import { placeholderTextStyles } from './styles/placeholderTextStyles';
|
|
49
49
|
import { resizerStyles, pragmaticResizerStyles } from './styles/resizerStyles';
|
|
50
50
|
import { ruleStyles } from './styles/rule';
|
|
51
51
|
import { shadowStyles } from './styles/shadowStyles';
|
|
@@ -97,7 +97,7 @@ var akEditorBreakpointForSmallDevice = "1266px";
|
|
|
97
97
|
|
|
98
98
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
99
99
|
var contentStyles = function contentStyles() {
|
|
100
|
-
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\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\t", "\n\n\t", "\n\t", "\n \t", "\n\n\n \t", "\n\n\t", "\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n /* This needs to be after telepointer styles as some overlapping rules have equal specificity, and so the order is significant */\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\t.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, indentationStyles, shadowStyles, InlineNodeViewSharedStyles, fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject2 || (_templateObject2 = _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(_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, "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, !fg('platform_editor_typography_ugc') && editorUGCTokensDefault,
|
|
100
|
+
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\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\t", "\n\n\t", "\n\t", "\n \t", "\n\n\n \t", "\n\n\t", "\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n /* This needs to be after telepointer styles as some overlapping rules have equal specificity, and so the order is significant */\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\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\t.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, indentationStyles, shadowStyles, InlineNodeViewSharedStyles, fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject2 || (_templateObject2 = _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(_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, "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, !fg('platform_editor_typography_ugc') && editorUGCTokensDefault,
|
|
101
101
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
102
102
|
fg('platform_editor_typography_ugc') && ( /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
103
103
|
fg('platform-dst-jira-web-fonts') || fg('confluence_typography_refreshed') || fg('atlas_editor_typography_refreshed')) && editorUGCTokensRefreshed
|
|
@@ -105,7 +105,7 @@ var contentStyles = function contentStyles() {
|
|
|
105
105
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
106
106
|
fg('platform_editor_typography_ugc') && /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
107
107
|
!(fg('platform-dst-jira-web-fonts') || fg('confluence_typography_refreshed') || fg('atlas_editor_typography_refreshed')) && editorUGCTokensModernized
|
|
108
|
-
/* eslint-enable @atlaskit/platform/ensure-feature-flag-prefix */, blocktypeStyles, fg('platform_editor_typography_ugc') && blocktypeStyles_fg_platform_editor_typography_ugc, !fg('platform_editor_typography_ugc') && blocktypeStyles_without_fg_platform_editor_typography_ugc, fg('platform_editor_nested_dnd_styles_changes') && blocktypeStyles_fg_platform_editor_nested_dnd_styles_changes, codeMarkStyles, textColorStyles, backgroundColorStyles, listsStyles, ruleStyles, mediaStyles, fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, telepointerColorAndCommonStyle, gapCursorStyles, panelStyles(), mentionsStyles, tasksAndDecisionsStyles, gridStyles, blockMarksStyles, dateStyles, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, decisionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
108
|
+
/* eslint-enable @atlaskit/platform/ensure-feature-flag-prefix */, blocktypeStyles, fg('platform_editor_typography_ugc') && blocktypeStyles_fg_platform_editor_typography_ugc, !fg('platform_editor_typography_ugc') && blocktypeStyles_without_fg_platform_editor_typography_ugc, fg('platform_editor_nested_dnd_styles_changes') && blocktypeStyles_fg_platform_editor_nested_dnd_styles_changes, codeMarkStyles, textColorStyles, backgroundColorStyles, listsStyles, ruleStyles, mediaStyles, fg('confluence_team_presence_scroll_to_pointer') ? telepointerStyle : telepointerStyleWithInitialOnly, telepointerColorAndCommonStyle, gapCursorStyles, panelStyles(), mentionsStyles, tasksAndDecisionsStyles, gridStyles, blockMarksStyles, dateStyles, extensionStyles, expandStyles, fg('platform_editor_nested_dnd_styles_changes') && expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes, !fg('platform_editor_nested_dnd_styles_changes') && expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes, fg('platform-visual-refresh-icons') && expandStylesMixin_fg_platform_visual_refresh_icons, findReplaceStyles, textHighlightStyle, decisionStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
109
109
|
exposure: false
|
|
110
110
|
}) && vanillaTaskItemStyles, editorExperiment('platform_editor_vanilla_dom', true, {
|
|
111
111
|
exposure: false
|
|
@@ -181,6 +181,14 @@ var listLayoutShiftFix = css({
|
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
+
// Make sure the first floating toolbar button has focus ring when focused via .focus()
|
|
185
|
+
var firstFloatingToolbarButtonStyles = css({
|
|
186
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
187
|
+
'button.first-floating-toolbar-button:focus': {
|
|
188
|
+
outline: "2px solid ".concat("var(--ds-border-focused, #2684FF)")
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
|
|
184
192
|
/**
|
|
185
193
|
* EditorContentStyles is a wrapper component that applies styles to its children
|
|
186
194
|
* based on the provided feature flags, view mode, and other props.
|
|
@@ -255,7 +263,7 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
255
263
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
256
264
|
vanillaEmojiStyles :
|
|
257
265
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
258
|
-
reactEmojiStyles],
|
|
266
|
+
reactEmojiStyles, fg('platform_editor_fix_floating_toolbar_focus') && firstFloatingToolbarButtonStyles],
|
|
259
267
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
260
268
|
"data-testid": "editor-content-container",
|
|
261
269
|
style: {
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
4
|
+
export var expandStyles = css({
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
6
|
+
'.ak-editor-expand__icon > div': {
|
|
7
|
+
display: 'flex'
|
|
8
|
+
},
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
10
|
+
'.ak-editor-expand': {
|
|
11
|
+
// sharedExpandStyles.containerStyles({ expanded: false, focused: false })(),
|
|
12
|
+
borderWidth: '1px',
|
|
13
|
+
borderStyle: 'solid',
|
|
14
|
+
borderColor: 'transparent',
|
|
15
|
+
borderRadius: "var(--ds-border-radius-100, 4px)",
|
|
16
|
+
minHeight: '25px',
|
|
17
|
+
background: "var(--ds-background-neutral-subtle, transparent)",
|
|
18
|
+
margin: "var(--ds-space-050, 0.25rem)".concat(" 0 0"),
|
|
19
|
+
transition: 'background 0.3s cubic-bezier(0.15, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.15, 1, 0.3, 1)',
|
|
20
|
+
padding: "var(--ds-space-100, 8px)",
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
22
|
+
'td > :not(style):first-child, td > style:first-child + *': {
|
|
23
|
+
marginTop: 0
|
|
24
|
+
},
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
boxSizing: 'border-box',
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
28
|
+
'td > &': {
|
|
29
|
+
marginTop: 0
|
|
30
|
+
},
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
32
|
+
'.ak-editor-expand__icon-container svg': {
|
|
33
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
34
|
+
transform: 'rotate(90deg)'
|
|
35
|
+
},
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
37
|
+
'&.ak-editor-selected-node:not(.danger)': {
|
|
38
|
+
// SelectionStyle.Blanket
|
|
39
|
+
position: 'relative',
|
|
40
|
+
// Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel
|
|
41
|
+
// in Safari. Looks like it's caused by user-select: all in the emoji element
|
|
42
|
+
'-webkit-user-select': 'text',
|
|
43
|
+
'&::before': {
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
content: "''",
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
top: 0,
|
|
49
|
+
bottom: 0,
|
|
50
|
+
width: '100%',
|
|
51
|
+
pointerEvents: 'none',
|
|
52
|
+
zIndex: 12,
|
|
53
|
+
// akEditorStickyheaderZIndex (11) + 1
|
|
54
|
+
backgroundColor: "var(--ds-blanket-selected, #388BFF14)"
|
|
55
|
+
},
|
|
56
|
+
// SelectionStyle.Border (common case)
|
|
57
|
+
border: "1px solid ".concat("var(--ds-border-selected, #0C66E4)"),
|
|
58
|
+
// If fg('platform_editor_nested_dnd_styles_changes') is true,
|
|
59
|
+
// then we'll also need the rest of the selection styles for blanket
|
|
60
|
+
|
|
61
|
+
// hideNativeBrowserTextSelectionStyles
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
63
|
+
'&::selection, *::selection': {
|
|
64
|
+
backgroundColor: 'transparent'
|
|
65
|
+
},
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
67
|
+
'&::-moz-selection, *::-moz-selection': {
|
|
68
|
+
backgroundColor: 'transparent'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
72
|
+
'&.danger': {
|
|
73
|
+
background: "var(--ds-background-danger, #FFECEB)",
|
|
74
|
+
borderColor: "var(--ds-border-danger, #E2483D)"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
78
|
+
'.ProseMirror > .ak-editor-expand__type-expand, .fabric-editor-breakout-mark-dom > .ak-editor-expand__type-expand': {
|
|
79
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
80
|
+
marginLeft: '-12px',
|
|
81
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
82
|
+
marginRight: '-12px'
|
|
83
|
+
},
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
85
|
+
'.ak-editor-expand__content': {
|
|
86
|
+
// sharedExpandStyles.contentStyles({ expanded: false, focused: false })(),
|
|
87
|
+
paddingTop: "var(--ds-space-0, 0px)",
|
|
88
|
+
paddingRight: "var(--ds-space-100, 8px)",
|
|
89
|
+
paddingLeft: "var(--ds-space-300, 24px)",
|
|
90
|
+
marginLeft: "var(--ds-space-050, 4px)",
|
|
91
|
+
display: 'flow-root',
|
|
92
|
+
/* The follow rules inside @supports block are added as a part of ED-8893
|
|
93
|
+
The fix is targeting mobile bridge on iOS 12 or below,
|
|
94
|
+
We should consider remove this fix when we no longer support iOS 12 */
|
|
95
|
+
'@supports not (display: flow-root)': {
|
|
96
|
+
width: '100%',
|
|
97
|
+
boxSizing: 'border-box'
|
|
98
|
+
},
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
100
|
+
'.expand-content-wrapper, .nestedExpand-content-wrapper': {
|
|
101
|
+
/* We visually hide the content here to preserve the content during copy+paste */
|
|
102
|
+
/* Do not add text nowrap here because inline comment navigation depends on the location of the text */
|
|
103
|
+
width: '100%',
|
|
104
|
+
display: 'block',
|
|
105
|
+
height: 0,
|
|
106
|
+
overflow: 'hidden',
|
|
107
|
+
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
108
|
+
userSelect: 'none'
|
|
109
|
+
},
|
|
110
|
+
cursor: 'text'
|
|
111
|
+
},
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
113
|
+
'.ak-editor-expand__title-input': {
|
|
114
|
+
// sharedExpandStyles.titleInputStyles(),
|
|
115
|
+
outline: 'none',
|
|
116
|
+
border: 'none',
|
|
117
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
118
|
+
fontSize: 'calc(14rem / 16)',
|
|
119
|
+
// relativeFontSizeToBase16(14),
|
|
120
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
121
|
+
lineHeight: 1.714,
|
|
122
|
+
// If fg('platform-visual-refresh-icons') then this needs to be overridden
|
|
123
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
124
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
125
|
+
background: 'transparent',
|
|
126
|
+
display: 'flex',
|
|
127
|
+
flex: 1,
|
|
128
|
+
padding: "0 0 0 ".concat("var(--ds-space-050, 4px)"),
|
|
129
|
+
width: '100%',
|
|
130
|
+
'&::placeholder': {
|
|
131
|
+
opacity: 1,
|
|
132
|
+
color: "var(--ds-text-subtlest, #626F86)"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
136
|
+
'.ak-editor-expand__title-container': {
|
|
137
|
+
// sharedExpandStyles.titleContainerStyles(),
|
|
138
|
+
padding: 0,
|
|
139
|
+
display: 'flex',
|
|
140
|
+
// Omitting alignItems: 'flex-start' as it would be overridden
|
|
141
|
+
background: 'none',
|
|
142
|
+
border: 'none',
|
|
143
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
144
|
+
fontSize: 'calc(14rem / 16)',
|
|
145
|
+
// relativeFontSizeToBase16(14),
|
|
146
|
+
width: '100%',
|
|
147
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
148
|
+
// Omitting overflow: 'hidden' as it would be overridden
|
|
149
|
+
cursor: 'pointer',
|
|
150
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
151
|
+
'&:focus': {
|
|
152
|
+
outline: 0
|
|
153
|
+
},
|
|
154
|
+
alignItems: 'center',
|
|
155
|
+
overflow: 'visible'
|
|
156
|
+
},
|
|
157
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
158
|
+
'.ak-editor-expand__expanded': {
|
|
159
|
+
background: "var(--ds-background-neutral-subtle, #00000000)",
|
|
160
|
+
borderColor: "var(--ds-border, #091E4224)",
|
|
161
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
162
|
+
'.ak-editor-expand__content': {
|
|
163
|
+
paddingTop: "var(--ds-space-100, 8px)"
|
|
164
|
+
// If fg('platform_editor_nested_dnd_styles_changes') then this needs to be extended
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
168
|
+
'.ak-editor-expand__input-container': {
|
|
169
|
+
width: '100%'
|
|
170
|
+
},
|
|
171
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
172
|
+
'.ak-editor-expand:not(.ak-editor-expand__expanded)': {
|
|
173
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
174
|
+
'.ak-editor-expand__content': {
|
|
175
|
+
position: 'absolute',
|
|
176
|
+
height: '1px',
|
|
177
|
+
width: '1px',
|
|
178
|
+
overflow: 'hidden',
|
|
179
|
+
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
180
|
+
whiteSpace: 'nowrap'
|
|
181
|
+
},
|
|
182
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
183
|
+
'.ak-editor-expand__icon-container svg': {
|
|
184
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
185
|
+
transform: 'rotate(0deg)'
|
|
186
|
+
},
|
|
187
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
188
|
+
'&:not(.ak-editor-selected-node):not(.danger)': {
|
|
189
|
+
background: 'transparent',
|
|
190
|
+
borderColor: 'transparent',
|
|
191
|
+
'&:hover': {
|
|
192
|
+
borderColor: "var(--ds-border, #091E4224)",
|
|
193
|
+
background: "var(--ds-background-neutral-subtle, #00000000)"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
200
|
+
export var expandStylesMixin_fg_platform_visual_refresh_icons = css({
|
|
201
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
202
|
+
'.ak-editor-expand__title-input': {
|
|
203
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
204
|
+
lineHeight: 1
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
209
|
+
export var expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes = css({
|
|
210
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
211
|
+
'.ak-editor-content-area.appearance-full-page .ProseMirror > .ak-editor-expand__type-expand, .fabric-editor-breakout-mark-dom > .ak-editor-expand__type-expand': {
|
|
212
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
213
|
+
marginLeft: '-20px',
|
|
214
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
215
|
+
marginRight: '-20px'
|
|
216
|
+
},
|
|
217
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
218
|
+
'.ak-editor-expand__expanded': {
|
|
219
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
220
|
+
'.ak-editor-expand__content': {
|
|
221
|
+
// firstNodeWithNotMarginTop
|
|
222
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
223
|
+
'> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span))': {
|
|
224
|
+
marginTop: 0
|
|
225
|
+
},
|
|
226
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
227
|
+
'> div.ak-editor-expand[data-node-type="nestedExpand"]': {
|
|
228
|
+
marginTop: "var(--ds-space-050, 0.25rem)"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
235
|
+
export var expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes = css({
|
|
236
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
237
|
+
'.ak-editor-expand': {
|
|
238
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
239
|
+
'&.ak-editor-selected-node:not(.danger)': {
|
|
240
|
+
// SelectionStyle.Border (with fg('platform_editor_nested_dnd_styles_changes'))
|
|
241
|
+
// Fixes ED-15246: Trello card is visible through a border of a table border
|
|
242
|
+
'&::after': {
|
|
243
|
+
height: '100%',
|
|
244
|
+
content: "'\\00a0'",
|
|
245
|
+
background: "var(--ds-border-selected, #0C66E4)",
|
|
246
|
+
position: 'absolute',
|
|
247
|
+
right: '-1px',
|
|
248
|
+
top: 0,
|
|
249
|
+
bottom: 0,
|
|
250
|
+
width: '1px',
|
|
251
|
+
border: 'none',
|
|
252
|
+
display: 'inline-block'
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
5
|
+
export var InlineNodeViewSharedStyles = css({
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
7
|
+
'.inlineNodeView': {
|
|
8
|
+
display: 'inline',
|
|
9
|
+
userSelect: 'all',
|
|
10
|
+
whiteSpace: 'nowrap',
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
12
|
+
'& > *:not(.zeroWidthSpaceContainer)': {
|
|
13
|
+
whiteSpace: 'pre-wrap'
|
|
14
|
+
},
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
16
|
+
'& > .assistive': {
|
|
17
|
+
userSelect: 'none'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
21
|
+
'&.ua-safari': {
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
23
|
+
'.inlineNodeView': {
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
25
|
+
'&::selection, *::selection': {
|
|
26
|
+
background: 'transparent'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
31
|
+
'&.ua-chrome .inlineNodeView > span': {
|
|
32
|
+
userSelect: 'none'
|
|
33
|
+
},
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
35
|
+
'.inlineNodeViewAddZeroWidthSpace': {
|
|
36
|
+
'&::after': {
|
|
37
|
+
content: "'\u200B'" // ZERO_WIDTH_SPACE
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
4
|
+
export var placeholderTextStyles = css({
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
6
|
+
'.ProseMirror span[data-placeholder]': {
|
|
7
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
8
|
+
display: 'inline'
|
|
9
|
+
},
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
11
|
+
'.ProseMirror span.pm-placeholder': {
|
|
12
|
+
display: 'inline',
|
|
13
|
+
color: "var(--ds-text-subtlest, #626F86)"
|
|
14
|
+
},
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
16
|
+
'.ProseMirror span.pm-placeholder__text': {
|
|
17
|
+
display: 'inline',
|
|
18
|
+
color: "var(--ds-text-subtlest, #626F86)"
|
|
19
|
+
},
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
21
|
+
'.ProseMirror span.pm-placeholder.ak-editor-selected-node': {
|
|
22
|
+
// ...backgroundSelectionStyles
|
|
23
|
+
backgroundColor: "var(--ds-background-selected, #E9F2FF)",
|
|
24
|
+
// ...backgroundSelectionStyles -> hideNativeBrowserTextSelectionStyles
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
26
|
+
'&::selection,*::selection': {
|
|
27
|
+
backgroundColor: 'transparent'
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-nested-selectors
|
|
30
|
+
'&::-moz-selection,*::-moz-selection': {
|
|
31
|
+
backgroundColor: 'transparent'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
35
|
+
'.ProseMirror span.pm-placeholder__text[data-placeholder]::after': {
|
|
36
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
37
|
+
cursor: 'text',
|
|
38
|
+
content: 'attr(data-placeholder)',
|
|
39
|
+
display: 'inline'
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
42
|
+
'.ProseMirror': {
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
44
|
+
'.ProseMirror-fake-text-cursor': {
|
|
45
|
+
display: 'inline',
|
|
46
|
+
pointerEvents: 'none',
|
|
47
|
+
position: 'relative'
|
|
48
|
+
},
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
50
|
+
'.ProseMirror-fake-text-cursor::after': {
|
|
51
|
+
content: '""',
|
|
52
|
+
display: 'inline',
|
|
53
|
+
top: 0,
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
borderRight: "1px solid ".concat("var(--ds-border, #091E4224)")
|
|
56
|
+
},
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
58
|
+
'.ProseMirror-fake-text-selection': {
|
|
59
|
+
display: 'inline',
|
|
60
|
+
pointerEvents: 'none',
|
|
61
|
+
position: 'relative',
|
|
62
|
+
backgroundColor: "var(--ds-background-selected, #B3D4FF)"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
@@ -1,6 +1,52 @@
|
|
|
1
|
+
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
|
+
|
|
4
|
+
// We don't want to use memoize from lodash, because we need to use WeakMap or WeakSet
|
|
5
|
+
// to avoid memory leaks, but lodash allow to change the cache type only globally
|
|
6
|
+
// like `memoize.Cache = WeakMap`, and we don't want to do that.
|
|
7
|
+
// So we use our own cache implementation.
|
|
8
|
+
var cache = new WeakSet();
|
|
9
|
+
|
|
10
|
+
// See https://github.com/ProseMirror/prosemirror-model/blob/20d26c9843d6a69a1d417d937c401537ee0b2342/src/node.ts#L303
|
|
11
|
+
function checkNode(node) {
|
|
12
|
+
if (cache.has(node)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
17
|
+
node.type.checkContent(node.content);
|
|
18
|
+
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
19
|
+
node.type.checkAttrs(node.attrs);
|
|
20
|
+
var copy = Mark.none;
|
|
21
|
+
for (var i = 0; i < node.marks.length; i++) {
|
|
22
|
+
var mark = node.marks[i];
|
|
23
|
+
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
24
|
+
mark.type.checkAttrs(mark.attrs);
|
|
25
|
+
copy = mark.addToSet(copy);
|
|
26
|
+
}
|
|
27
|
+
if (!Mark.sameSet(copy, node.marks)) {
|
|
28
|
+
throw new RangeError("Invalid collection of marks for node ".concat(node.type.name, ": ").concat(node.marks.map(function (m) {
|
|
29
|
+
return m.type.name;
|
|
30
|
+
})));
|
|
31
|
+
}
|
|
32
|
+
node.content.forEach(function (node) {
|
|
33
|
+
return checkNode(node);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// The set value should be added in the end of the function,
|
|
37
|
+
// because any previous check can throw an error,
|
|
38
|
+
// and we don't want to add invalid node to the cache.
|
|
39
|
+
cache.add(node);
|
|
40
|
+
}
|
|
1
41
|
export var validNode = function validNode(node) {
|
|
2
42
|
try {
|
|
3
|
-
|
|
43
|
+
if (editorExperiment('platform_editor_memoized_node_check', true, {
|
|
44
|
+
exposure: true
|
|
45
|
+
})) {
|
|
46
|
+
checkNode(node);
|
|
47
|
+
} else {
|
|
48
|
+
node.check();
|
|
49
|
+
}
|
|
4
50
|
} catch (error) {
|
|
5
51
|
return false;
|
|
6
52
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "207.
|
|
2
|
+
export var version = "207.17.0";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const expandStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const expandStylesMixin_fg_platform_visual_refresh_icons: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InlineNodeViewSharedStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const placeholderTextStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const expandStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const expandStylesMixin_fg_platform_visual_refresh_icons: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InlineNodeViewSharedStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const placeholderTextStyles: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "207.
|
|
3
|
+
"version": "207.17.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
63
63
|
"@atlaskit/react-ufo": "^3.13.0",
|
|
64
64
|
"@atlaskit/task-decision": "^19.2.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
66
|
-
"@atlaskit/tokens": "^5.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^5.14.0",
|
|
66
|
+
"@atlaskit/tokens": "^5.1.0",
|
|
67
67
|
"@atlaskit/tooltip": "^20.3.0",
|
|
68
68
|
"@atlaskit/width-detector": "^5.0.0",
|
|
69
69
|
"@babel/runtime": "^7.0.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
93
93
|
"@atlaskit/collab-provider": "^10.19.0",
|
|
94
94
|
"@atlaskit/editor-plugin-annotation": "^2.9.0",
|
|
95
|
-
"@atlaskit/editor-plugin-card": "^6.
|
|
95
|
+
"@atlaskit/editor-plugin-card": "^6.6.0",
|
|
96
96
|
"@atlaskit/editor-plugin-list": "^4.2.0",
|
|
97
97
|
"@atlaskit/editor-plugin-paste": "^3.3.0",
|
|
98
98
|
"@atlaskit/link-provider": "^3.3.0",
|
|
@@ -530,10 +530,6 @@
|
|
|
530
530
|
"type": "boolean",
|
|
531
531
|
"referenceOnly": true
|
|
532
532
|
},
|
|
533
|
-
"platform_editor_controls_move_actions": {
|
|
534
|
-
"type": "boolean",
|
|
535
|
-
"referenceOnly": true
|
|
536
|
-
},
|
|
537
533
|
"platform_editor_undo_redo_find_on_primary_toolbar": {
|
|
538
534
|
"type": "boolean",
|
|
539
535
|
"referenceOnly": true
|
|
@@ -565,6 +561,9 @@
|
|
|
565
561
|
"platform_editor_find_and_replace_duplication": {
|
|
566
562
|
"type": "boolean"
|
|
567
563
|
},
|
|
564
|
+
"platform_editor_find_and_replace_1": {
|
|
565
|
+
"type": "boolean"
|
|
566
|
+
},
|
|
568
567
|
"editor_a11y_aria_label_removal_popup": {
|
|
569
568
|
"type": "boolean",
|
|
570
569
|
"referenceOnly": true
|
|
@@ -629,6 +628,9 @@
|
|
|
629
628
|
},
|
|
630
629
|
"atlas_editor_typography_refreshed": {
|
|
631
630
|
"type": "boolean"
|
|
631
|
+
},
|
|
632
|
+
"platform_editor_fix_floating_toolbar_focus": {
|
|
633
|
+
"type": "boolean"
|
|
632
634
|
}
|
|
633
635
|
},
|
|
634
636
|
"stricter": {
|