@atlaskit/editor-core 207.2.0 → 207.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +27 -11
- package/dist/cjs/ui/Appearance/Comment/Comment.js +25 -5
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +26 -4
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/cjs/ui/ContentStyles/layout.js +2 -2
- package/dist/cjs/ui/ContextPanel/index.js +10 -4
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +29 -234
- package/dist/cjs/ui/EditorContentContainer/styles/ai-panel.js +97 -0
- package/dist/cjs/ui/EditorContentContainer/styles/annotationStyles.js +45 -0
- package/dist/cjs/ui/EditorContentContainer/styles/embedCardStyles.js +34 -0
- package/dist/cjs/ui/EditorContentContainer/styles/layout.js +126 -0
- package/dist/cjs/ui/EditorContentContainer/styles/link.js +32 -0
- package/dist/cjs/ui/EditorContentContainer/styles/rule.js +29 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Chromeless.js +28 -10
- package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +24 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/layout.js +3 -2
- package/dist/es2019/ui/ContextPanel/index.js +11 -5
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +23 -773
- package/dist/es2019/ui/EditorContentContainer/styles/ai-panel.js +213 -0
- package/dist/es2019/ui/EditorContentContainer/styles/annotationStyles.js +47 -0
- package/dist/es2019/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
- package/dist/es2019/ui/EditorContentContainer/styles/layout.js +517 -0
- package/dist/es2019/ui/EditorContentContainer/styles/link.js +26 -0
- package/dist/es2019/ui/EditorContentContainer/styles/rule.js +22 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Chromeless.js +28 -12
- package/dist/esm/ui/Appearance/Comment/Comment.js +26 -6
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +27 -5
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/layout.js +2 -2
- package/dist/esm/ui/ContextPanel/index.js +11 -5
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +31 -237
- package/dist/esm/ui/EditorContentContainer/styles/ai-panel.js +91 -0
- package/dist/esm/ui/EditorContentContainer/styles/annotationStyles.js +37 -0
- package/dist/esm/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
- package/dist/esm/ui/EditorContentContainer/styles/layout.js +120 -0
- package/dist/esm/ui/EditorContentContainer/styles/link.js +26 -0
- package/dist/esm/ui/EditorContentContainer/styles/rule.js +21 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Chromeless.d.ts +0 -4
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
- package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
- package/dist/types/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
- package/dist/types/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
- package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/link.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/rule.d.ts +1 -0
- package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +0 -4
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -11
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/ai-panel.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/link.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/rule.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.embedCardStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
// eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
11
|
+
var embedCardStyles = exports.embedCardStyles = (0, _react.css)({
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
13
|
+
'.ProseMirror': {
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
15
|
+
".embedCardView-content-wrap[layout^='wrap-']": {
|
|
16
|
+
maxWidth: '100%',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
19
|
+
zIndex: 2
|
|
20
|
+
},
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
22
|
+
".embedCardView-content-wrap[layout='wrap-left']": {
|
|
23
|
+
float: 'left'
|
|
24
|
+
},
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
26
|
+
".embedCardView-content-wrap[layout='wrap-right']": {
|
|
27
|
+
float: 'right'
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
30
|
+
".embedCardView-content-wrap[layout='wrap-right'] + .embedCardView-content-wrap[layout='wrap-left']": {
|
|
31
|
+
clear: 'both'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.layoutViewStyles = exports.layoutBaseStyles = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
|
+
var _types = require("@atlaskit/editor-plugins/table/types");
|
|
13
|
+
var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
|
|
14
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
18
|
+
var columnLayoutSharedStyle = (0, _react.css)({
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
20
|
+
'[data-layout-section]': (0, _defineProperty2.default)({
|
|
21
|
+
position: 'relative',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
25
|
+
'& > *': {
|
|
26
|
+
flex: 1,
|
|
27
|
+
minWidth: 0
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
30
|
+
'& > .unsupportedBlockView-content-wrap': {
|
|
31
|
+
minWidth: 'initial'
|
|
32
|
+
}
|
|
33
|
+
}, "@media screen and (max-width: ".concat(_editorSharedStyles.gridMediumMaxWidth, "px)"), {
|
|
34
|
+
flexDirection: 'column'
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
var columnLayoutResponsiveSharedStyle = (0, _react.css)({
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
39
|
+
'[data-layout-section]': {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
gap: "var(--ds-space-100, 8px)",
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
44
|
+
'& > *': {
|
|
45
|
+
flex: 1,
|
|
46
|
+
minWidth: 0
|
|
47
|
+
},
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
49
|
+
'& > .unsupportedBlockView-content-wrap': {
|
|
50
|
+
minWidth: 'initial'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
54
|
+
'.layout-section-container': {
|
|
55
|
+
containerType: 'inline-size',
|
|
56
|
+
containerName: 'layout-area'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
60
|
+
return (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
61
|
+
(0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"]))) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
62
|
+
(0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> :not(style):first-child,\n\t\t\t\t> style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"])));
|
|
63
|
+
};
|
|
64
|
+
var layoutColumnStyles = function layoutColumnStyles() {
|
|
65
|
+
return (0, _experiments.editorExperiment)('advanced_layouts', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
66
|
+
(0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN / 2, _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), "var(--ds-border-radius, 3px)") : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
67
|
+
(0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: ", "px;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth);
|
|
68
|
+
};
|
|
69
|
+
var layoutSectionStyles = function layoutSectionStyles() {
|
|
70
|
+
return (0, _experiments.editorExperiment)('advanced_layouts', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
71
|
+
(0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t", ";\n\t\t\t\t.layout-section-container [data-layout-section] {\n\t\t\t\t\t> .ProseMirror-widget {\n\t\t\t\t\t\tflex: none;\n\t\t\t\t\t\tdisplay: contents !important;\n\n\t\t\t\t\t\t&[data-blocks-drag-handle-container] div {\n\t\t\t\t\t\t\tdisplay: contents !important;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&[data-blocks-drop-target-container] {\n\t\t\t\t\t\t\tdisplay: block !important;\n\t\t\t\t\t\t\tmargin: ", ";\n\n\t\t\t\t\t\t\t[data-drop-target-for-element] {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t& + [data-layout-column] {\n\t\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t> [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), columnLayoutResponsiveSharedStyle, "var(--ds-space-negative-050, -4px)") : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
72
|
+
(0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t", "\n\t\t\t"])), columnLayoutSharedStyle);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
76
|
+
var layoutBorderBaseStyles = (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n\t/* TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n\tThis is because the default state already uses the same token and, as such, the hover style won't change anything.\n\thttps://product-fabric.atlassian.net/browse/DSP-4441 */\n\t/* Shows the border when cursor is inside a layout */\n\t&.selected [data-layout-column],\n\t&:hover [data-layout-column] {\n\t\tborder: ", "px solid ", ";\n\t}\n\n\t&.selected.danger [data-layout-column] {\n\t\tbackground-color: ", ";\n\t\tborder-color: ", ";\n\t}\n\n\t&.", ":not(.danger) {\n\t\t[data-layout-column] {\n\t\t\t", "\n\t\t\t::after {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t}\n\t}\n"])), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Border, _editorSharedStyles.SelectionStyle.Blanket]));
|
|
77
|
+
|
|
78
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
79
|
+
var layoutBorderViewStyles = (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected [data-layout-column],\n\t&:hover [data-layout-column] {\n\t\tborder: 0;\n\t}\n"])));
|
|
80
|
+
|
|
81
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
82
|
+
var columnSeparatorBaseStyles = (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-layout-content]::before {\n\t\tcontent: '';\n\t\tborder-left: ", "px solid ", ";\n\t\tposition: absolute;\n\t\theight: calc(100% - 24px);\n\t\tmargin-left: -25px;\n\t}\n"])), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)");
|
|
83
|
+
|
|
84
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
85
|
+
var columnSeparatorViewStyles = (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-layout-content]::before {\n\t\tborder-left: 0;\n\t}\n"])));
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
88
|
+
var rowSeparatorBaseStyles = (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-layout-content]::before {\n\t\tcontent: '';\n\t\tborder-top: ", "px solid ", ";\n\t\tposition: absolute;\n\t\twidth: calc(100% - 32px);\n\t\tmargin-top: -13px;\n\n\t\t/* clear styles for column separator */\n\t\tborder-left: unset;\n\t\tmargin-left: unset;\n\t\theight: unset;\n\t}\n"])), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)");
|
|
89
|
+
|
|
90
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
91
|
+
var rowSeparatorViewStyles = (0, _react.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-layout-content]::before {\n\t\tborder-top: 0;\n\t}\n"])));
|
|
92
|
+
|
|
93
|
+
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
94
|
+
var layoutWithSeparatorBorderResponsiveBaseStyles = function layoutWithSeparatorBorderResponsiveBaseStyles(breakpoint
|
|
95
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
96
|
+
) {
|
|
97
|
+
return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected,\n\t&:hover,\n\t&.selected.danger,\n\t&.", ":not(.danger) {\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t@container editor-area (max-width:", "px) {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), _editorSharedStyles.akEditorSelectedNodeClassName, breakpoint, rowSeparatorBaseStyles);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
101
|
+
var layoutWithSeparatorBorderResponsiveViewStyles = function layoutWithSeparatorBorderResponsiveViewStyles(breakpoint
|
|
102
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
103
|
+
) {
|
|
104
|
+
return (0, _react.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected,\n\t&:hover,\n\t&.selected.danger,\n\t&.", ":not(.danger) {\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t@container editor-area (max-width:", "px) {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), _editorSharedStyles.akEditorSelectedNodeClassName, breakpoint, rowSeparatorViewStyles);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
108
|
+
var layoutWithSeparatorBorderBaseStyles = (0, _react.css)(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected [data-layout-column]:not(:first-of-type),\n\t[data-empty-layout='true'] [data-layout-column]:not(:first-of-type),\n\t&:hover [data-layout-column]:not(:first-of-type) {\n\t\t", "\n\t}\n\n\t&.selected.danger [data-layout-section] {\n\t\tbackground-color: ", ";\n\n\t\tbox-shadow: 0 0 0 ", "px ", ";\n\t\tborder-radius: 4px;\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&.", ":not(.danger) [data-layout-section] {\n\t\tbox-shadow: 0 0 0 ", "px ", ";\n\t\tborder-radius: 4px;\n\t\tbackground-color: ", ";\n\t\t[data-layout-column] {\n\t\t\t", "\n\t\t\tborder: 0px;\n\t\t\t::before {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t}\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n"])), columnSeparatorBaseStyles, "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, columnSeparatorBaseStyles, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-selected, #0C66E4)", "var(--ds-background-selected, #E9F2FF)", (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), columnSeparatorBaseStyles);
|
|
109
|
+
|
|
110
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
111
|
+
var layoutWithSeparatorBorderViewStyles = (0, _react.css)(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected [data-layout-column]:not(:first-of-type),\n\t[data-empty-layout='true'] [data-layout-column]:not(:first-of-type),\n\t&:hover [data-layout-column]:not(:first-of-type) {\n\t\t", "\n\t}\n\n\t&.selected.danger [data-layout-section] {\n\t\tbox-shadow: 0 0 0 0 ", ";\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&.", ":not(.danger) [data-layout-section] {\n\t\tbox-shadow: 0 0 0 0 ", ";\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n"])), columnSeparatorViewStyles, _editorSharedStyles.akEditorDeleteBorder, columnSeparatorViewStyles, _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border-selected, #0C66E4)", columnSeparatorViewStyles);
|
|
112
|
+
|
|
113
|
+
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
114
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
115
|
+
var layoutResponsiveBaseStyles = (0, _react.css)(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n\t/* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */\n\t/* not resized layout in full-width editor */\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t> .layoutSectionView-content-wrap {\n\t\t\t[data-layout-section] {\n\t\t\t\t@container editor-area (max-width:724px) {\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t}\n\n\t/* not resized layout in fixed-width editor */\n\t.ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {\n\t\t> .layoutSectionView-content-wrap {\n\t\t\t[data-layout-section] {\n\t\t\t\t@container editor-area (max-width:788px) {\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t}\n\n\t/* resized layout in full/fixed-width editor */\n\t.ProseMirror .fabric-editor-breakout-mark {\n\t\t.layoutSectionView-content-wrap {\n\t\t\t[data-layout-section] {\n\t\t\t\t@container editor-area (max-width:820px) {\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t}\n"])), layoutWithSeparatorBorderResponsiveBaseStyles(724), layoutWithSeparatorBorderResponsiveBaseStyles(788), layoutWithSeparatorBorderResponsiveBaseStyles(820));
|
|
116
|
+
|
|
117
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
118
|
+
var layoutResponsiveViewStyles = (0, _react.css)(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n\t/* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */\n\t/* not resized layout in full-width editor */\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t> .layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t/* not resized layout in fixed-width editor */\n\t.ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {\n\t\t> .layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t/* resized layout in full/fixed-width editor */\n\t.ProseMirror .fabric-editor-breakout-mark {\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n"])), layoutWithSeparatorBorderResponsiveViewStyles(724), layoutWithSeparatorBorderResponsiveViewStyles(788), layoutWithSeparatorBorderResponsiveViewStyles(820));
|
|
119
|
+
|
|
120
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
121
|
+
var layoutBaseStyles = exports.layoutBaseStyles = function layoutBaseStyles() {
|
|
122
|
+
return (0, _react.css)(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: pointer;\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n\t\t\t and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n\t\t handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t/* styles to support borders for layout */\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t/* hide separator when element is dragging on top of a layout column */\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? 8 : 0), _editorSharedStyles.akEditorSwoopCubicBezier, (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderBaseStyles : layoutBorderBaseStyles, (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveBaseStyles, _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('advanced_layouts', false) && (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Needs manual remediation
|
|
126
|
+
var layoutViewStyles = exports.layoutViewStyles = (0, _react.css)(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t[data-layout-section] {\n\t\t\tcursor: default;\n\t\t\t[data-layout-column] {\n\t\t\t\tborder: 0;\n\t\t\t}\n\t\t}\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n"])), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderViewStyles : layoutBorderViewStyles, (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveViewStyles);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.linkStylesOld = exports.linkStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
11
|
+
var linkStyles = exports.linkStyles = (0, _react.css)({
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
13
|
+
'.ProseMirror a.blockLink': {
|
|
14
|
+
display: 'block'
|
|
15
|
+
},
|
|
16
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
17
|
+
'.ProseMirror a[data-prosemirror-mark-name="link"]': {
|
|
18
|
+
textDecoration: 'underline'
|
|
19
|
+
},
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
21
|
+
'.ProseMirror a[data-prosemirror-mark-name="link"]:hover': {
|
|
22
|
+
textDecoration: 'none'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
27
|
+
var linkStylesOld = exports.linkStylesOld = (0, _react.css)({
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
29
|
+
'.ProseMirror a.blockLink': {
|
|
30
|
+
display: 'block'
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ruleStyles = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
14
|
+
var ruleStyles = exports.ruleStyles = (0, _react.css)((0, _defineProperty2.default)({
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
16
|
+
'.ProseMirror hr': {
|
|
17
|
+
border: 'none',
|
|
18
|
+
backgroundColor: "var(--ds-border, #091E4224)",
|
|
19
|
+
height: '2px',
|
|
20
|
+
borderRadius: '1px',
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
padding: "var(--ds-space-050, 4px)".concat(" 0"),
|
|
23
|
+
margin: "var(--ds-space-300, 24px)".concat(" 0"),
|
|
24
|
+
backgroundClip: 'content-box'
|
|
25
|
+
}
|
|
26
|
+
}, ".ProseMirror hr.".concat(_editorSharedStyles.akEditorSelectedNodeClassName), {
|
|
27
|
+
outline: 'none',
|
|
28
|
+
backgroundColor: "var(--ds-border-selected, #0C66E4)"
|
|
29
|
+
}));
|
|
@@ -7,7 +7,8 @@ import React, { Fragment } from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
12
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
12
13
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
13
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -44,6 +45,14 @@ ContentArea.displayName = 'ContentArea';
|
|
|
44
45
|
const EditorContainer = componentWithCondition(() => editorExperiment('platform_editor_core_static_emotion', true, {
|
|
45
46
|
exposure: true
|
|
46
47
|
}), EditorContentContainer, ContentArea);
|
|
48
|
+
const useEditorViewModePluginState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
|
|
49
|
+
const {
|
|
50
|
+
editorViewModeState
|
|
51
|
+
} = useSharedPluginState(pluginInjectionApi, ['editorViewMode']);
|
|
52
|
+
return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
53
|
+
}, pluginInjectionApi => {
|
|
54
|
+
return useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
55
|
+
});
|
|
47
56
|
|
|
48
57
|
/**
|
|
49
58
|
* Render the editor in a chromeless appearance.
|
|
@@ -78,9 +87,7 @@ export default class Editor extends React.Component {
|
|
|
78
87
|
featureFlags
|
|
79
88
|
} = this.props;
|
|
80
89
|
const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
81
|
-
const
|
|
82
|
-
editorViewModeState
|
|
83
|
-
} = useSharedPluginState(this.props.editorAPI, ['editorViewMode']);
|
|
90
|
+
const editorViewMode = useEditorViewModePluginState(this.props.editorAPI);
|
|
84
91
|
return jsx(WithFlash, {
|
|
85
92
|
animate: maxContentSizeReached
|
|
86
93
|
}, jsx("div", {
|
|
@@ -102,7 +109,7 @@ export default class Editor extends React.Component {
|
|
|
102
109
|
, {
|
|
103
110
|
className: "ak-editor-content-area",
|
|
104
111
|
featureFlags: featureFlags,
|
|
105
|
-
viewMode:
|
|
112
|
+
viewMode: editorViewMode,
|
|
106
113
|
appearance: this.appearance
|
|
107
114
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
108
115
|
editorView: editorView,
|
|
@@ -122,10 +129,6 @@ export default class Editor extends React.Component {
|
|
|
122
129
|
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null)));
|
|
123
130
|
});
|
|
124
131
|
}
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
*/
|
|
129
132
|
render() {
|
|
130
133
|
return jsx(RenderWithPluginState, {
|
|
131
134
|
editorAPI: this.props.editorAPI,
|
|
@@ -134,13 +137,28 @@ export default class Editor extends React.Component {
|
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
_defineProperty(Editor, "displayName", 'ChromelessEditorAppearance');
|
|
140
|
+
const useMaxContentSizePluginState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
|
|
141
|
+
const {
|
|
142
|
+
maxContentSizeState
|
|
143
|
+
} = useSharedPluginState(pluginInjectionApi, ['maxContentSize']);
|
|
144
|
+
return {
|
|
145
|
+
maxContentSizeState
|
|
146
|
+
};
|
|
147
|
+
}, pluginInjectionApi => {
|
|
148
|
+
const maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
|
|
149
|
+
return {
|
|
150
|
+
maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
|
|
151
|
+
maxContentSizeReached
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
});
|
|
137
155
|
function RenderWithPluginState({
|
|
138
156
|
renderChrome,
|
|
139
157
|
editorAPI
|
|
140
158
|
}) {
|
|
141
159
|
const {
|
|
142
160
|
maxContentSizeState
|
|
143
|
-
} =
|
|
161
|
+
} = useMaxContentSizePluginState(editorAPI);
|
|
144
162
|
return jsx(Fragment, null, renderChrome({
|
|
145
163
|
maxContentSize: maxContentSizeState
|
|
146
164
|
}));
|
|
@@ -10,11 +10,12 @@ import classnames from 'classnames';
|
|
|
10
10
|
import { useIntl } from 'react-intl-next';
|
|
11
11
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
12
12
|
import Button from '@atlaskit/button/new';
|
|
13
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
13
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
14
14
|
import messages from '@atlaskit/editor-common/messages';
|
|
15
15
|
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
16
16
|
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
18
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
19
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
19
20
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
20
21
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
@@ -79,16 +80,36 @@ const appearance = 'comment';
|
|
|
79
80
|
const EditorContainer = componentWithCondition(() => editorExperiment('platform_editor_core_static_emotion', true, {
|
|
80
81
|
exposure: true
|
|
81
82
|
}), EditorContentContainer, ContentArea);
|
|
83
|
+
const useCommentEditorPluginsStates = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
|
|
84
|
+
return useSharedPluginState(pluginInjectionApi, ['maxContentSize', 'primaryToolbar', 'editorViewMode']);
|
|
85
|
+
}, pluginInjectionApi => {
|
|
86
|
+
const maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
|
|
87
|
+
const primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
|
|
88
|
+
const editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
89
|
+
return {
|
|
90
|
+
maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
|
|
91
|
+
maxContentSizeReached
|
|
92
|
+
},
|
|
93
|
+
primaryToolbarState: !primaryToolbarComponents ? undefined : {
|
|
94
|
+
components: primaryToolbarComponents
|
|
95
|
+
},
|
|
96
|
+
editorViewModeState: !editorViewMode ? undefined : {
|
|
97
|
+
mode: editorViewMode
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
});
|
|
82
101
|
export const CommentEditorWithIntl = props => {
|
|
83
102
|
const {
|
|
84
103
|
editorAPI
|
|
85
104
|
} = props;
|
|
86
105
|
const {
|
|
87
|
-
mediaState,
|
|
88
106
|
maxContentSizeState,
|
|
89
107
|
primaryToolbarState,
|
|
90
108
|
editorViewModeState
|
|
91
|
-
} =
|
|
109
|
+
} = useCommentEditorPluginsStates(editorAPI);
|
|
110
|
+
const {
|
|
111
|
+
mediaState
|
|
112
|
+
} = useSharedPluginState(editorAPI, ['media']);
|
|
92
113
|
const intl = useIntl();
|
|
93
114
|
const {
|
|
94
115
|
editorDOMElement,
|
|
@@ -7,7 +7,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
10
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -49,6 +49,28 @@ const hasCustomComponents = components => {
|
|
|
49
49
|
}
|
|
50
50
|
return true;
|
|
51
51
|
};
|
|
52
|
+
const useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
|
|
53
|
+
return useSharedPluginState(pluginInjectionApi, ['editorViewMode', 'primaryToolbar', 'interaction']);
|
|
54
|
+
}, pluginInjectionApi => {
|
|
55
|
+
const primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
|
|
56
|
+
const editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
57
|
+
const showTopToolbar = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode._showTopToolbar');
|
|
58
|
+
const hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
|
|
59
|
+
const interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
|
|
60
|
+
return {
|
|
61
|
+
primaryToolbarState: !primaryToolbarComponents ? undefined : {
|
|
62
|
+
components: primaryToolbarComponents
|
|
63
|
+
},
|
|
64
|
+
editorViewModeState: !editorViewMode ? undefined : {
|
|
65
|
+
mode: editorViewMode,
|
|
66
|
+
_showTopToolbar: showTopToolbar
|
|
67
|
+
},
|
|
68
|
+
interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
|
|
69
|
+
hasHadInteraction,
|
|
70
|
+
interactionState
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
});
|
|
52
74
|
export const FullPageEditor = props => {
|
|
53
75
|
var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
|
|
54
76
|
const wrapperElementRef = useMemo(() => props.innerRef, [props.innerRef]);
|
|
@@ -59,7 +81,7 @@ export const FullPageEditor = props => {
|
|
|
59
81
|
editorViewModeState,
|
|
60
82
|
primaryToolbarState,
|
|
61
83
|
interactionState
|
|
62
|
-
} =
|
|
84
|
+
} = useFullPageEditorPluginsStates(editorAPI);
|
|
63
85
|
const viewMode = getEditorViewMode(editorViewModeState, props.preset);
|
|
64
86
|
const hasHadInteraction = fg('platform_editor_interaction_api_refactor') ? (interactionState === null || interactionState === void 0 ? void 0 : interactionState.interactionState) !== 'hasNotHadInteraction' : Boolean(interactionState === null || interactionState === void 0 ? void 0 : interactionState.hasHadInteraction);
|
|
65
87
|
let toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
@@ -9,7 +9,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
10
10
|
const SWOOP_ANIMATION = `0.5s ${akEditorSwoopCubicBezier}`;
|
|
11
11
|
const getTotalPadding = () => akEditorGutterPaddingDynamic() * 2;
|
|
12
|
-
const
|
|
12
|
+
const AK_NESTED_DND_GUTTER_OFFSET = 8;
|
|
13
13
|
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
15
15
|
export const fullPageEditorWrapper = css({
|
|
@@ -114,7 +114,7 @@ const editorContentAreaContainerStyle = () => css({
|
|
|
114
114
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
115
115
|
'[data-layout-section]': {
|
|
116
116
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
117
|
-
maxWidth: `calc(100% + ${(akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ?
|
|
117
|
+
maxWidth: `calc(100% + ${(akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2}px)`
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
});
|
|
@@ -13,7 +13,7 @@ import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/cons
|
|
|
13
13
|
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
|
-
const
|
|
16
|
+
const AK_NESTED_DND_GUTTER_OFFSET = 8;
|
|
17
17
|
const firstNodeWithNotMarginTop = () => fg('platform_editor_nested_dnd_styles_changes') ?
|
|
18
18
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
19
19
|
css`
|
|
@@ -283,7 +283,8 @@ export const layoutStyles = viewMode => css`
|
|
|
283
283
|
/* Ignored via go/ees007
|
|
284
284
|
TODO: Migrate away from gridSize
|
|
285
285
|
Recommendation: Replace directly with 7px */
|
|
286
|
-
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ?
|
|
286
|
+
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)}px
|
|
287
|
+
0;
|
|
287
288
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
288
289
|
cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
|
|
289
290
|
|
|
@@ -9,8 +9,9 @@ import React from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import Transition from 'react-transition-group/Transition';
|
|
12
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
13
13
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
14
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
15
|
import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
15
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
17
|
const ANIM_SPEED_MS = 500;
|
|
@@ -151,12 +152,17 @@ export class SwappableContentArea extends React.PureComponent {
|
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
|
|
155
|
-
var _contextPanelState$co;
|
|
155
|
+
const useContextPanelSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
|
|
156
156
|
const {
|
|
157
157
|
contextPanelState
|
|
158
|
-
} = useSharedPluginState(
|
|
159
|
-
|
|
158
|
+
} = useSharedPluginState(pluginInjectionApi, ['contextPanel']);
|
|
159
|
+
return contextPanelState === null || contextPanelState === void 0 ? void 0 : contextPanelState.contents;
|
|
160
|
+
}, pluginInjectionApi => {
|
|
161
|
+
return useSharedPluginStateSelector(pluginInjectionApi, 'contextPanel.contents');
|
|
162
|
+
});
|
|
163
|
+
export function ContextPanel(props) {
|
|
164
|
+
const contextPanelContents = useContextPanelSharedState(props.editorAPI);
|
|
165
|
+
const firstContent = contextPanelContents && contextPanelContents.find(Boolean);
|
|
160
166
|
return (
|
|
161
167
|
// Ignored via go/ees005
|
|
162
168
|
// eslint-disable-next-line react/jsx-props-no-spreading
|