@atlaskit/editor-core 215.25.0 → 215.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/create-editor/ReactEditorView.js +29 -11
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +5 -1
- package/dist/cjs/ui/EditorContentContainer/styles/placeholderStyles.js +13 -0
- package/dist/cjs/ui/EditorContentContainer/styles/tableStyles.js +16 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +30 -12
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +7 -3
- package/dist/es2019/ui/EditorContentContainer/styles/placeholderStyles.js +14 -1
- package/dist/es2019/ui/EditorContentContainer/styles/tableStyles.js +15 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +29 -11
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +7 -3
- package/dist/esm/ui/EditorContentContainer/styles/placeholderStyles.js +14 -1
- package/dist/esm/ui/EditorContentContainer/styles/tableStyles.js +15 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/styles/tableStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/tableStyles.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 215.26.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f41ee46c84bb1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f41ee46c84bb1) -
|
|
8
|
+
[EDITOR-3881] Fix table styling to work with SSR renderer
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 215.26.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`595b07a99bd65`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/595b07a99bd65) -
|
|
16
|
+
[https://hello.jira.atlassian.cloud/browse/EDITOR-3995](EDITOR-3995) - add toolbar supporting to
|
|
17
|
+
`EditorSSRRenderer`
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`58e8dc3afa08d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/58e8dc3afa08d) -
|
|
22
|
+
[ux] [EDITOR-2469] add fade in animation to placeholder on empty paragraph
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 215.25.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -74,6 +74,7 @@ function ReactEditorView(props) {
|
|
|
74
74
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
75
75
|
editorAPI = _useState2[0],
|
|
76
76
|
setEditorAPI = _useState2[1];
|
|
77
|
+
var ssrEditorStateRef = (0, _react.useRef)(undefined);
|
|
77
78
|
var editorRef = (0, _react.useRef)(null);
|
|
78
79
|
var viewRef = (0, _react.useRef)();
|
|
79
80
|
var focusTimeoutId = (0, _react.useRef)();
|
|
@@ -101,8 +102,8 @@ function ReactEditorView(props) {
|
|
|
101
102
|
return (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(editorPropFeatureFlags);
|
|
102
103
|
}, [editorPropFeatureFlags]);
|
|
103
104
|
var getEditorState = (0, _react.useCallback)(function () {
|
|
104
|
-
var _viewRef$current;
|
|
105
|
-
return (_viewRef$current = viewRef.current) === null || _viewRef$current === void 0 ? void 0 : _viewRef$current.state;
|
|
105
|
+
var _ssrEditorStateRef$cu, _viewRef$current;
|
|
106
|
+
return (_ssrEditorStateRef$cu = ssrEditorStateRef.current) !== null && _ssrEditorStateRef$cu !== void 0 ? _ssrEditorStateRef$cu : (_viewRef$current = viewRef.current) === null || _viewRef$current === void 0 ? void 0 : _viewRef$current.state;
|
|
106
107
|
}, []);
|
|
107
108
|
var getEditorView = (0, _react.useCallback)(function () {
|
|
108
109
|
return viewRef.current;
|
|
@@ -757,15 +758,16 @@ function ReactEditorView(props) {
|
|
|
757
758
|
doc: defaultValue
|
|
758
759
|
});
|
|
759
760
|
}, [defaultValue, parseDoc, props.editorProps.sanitizePrivateContent, props.providerFactory]);
|
|
760
|
-
|
|
761
|
-
assistiveLabel = _props$editorProps3.assistiveLabel,
|
|
762
|
-
assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
|
|
761
|
+
|
|
763
762
|
// We need to check `allowBlockType` in props, because it is now exist in EditorNextProps type.
|
|
764
763
|
var _ref5 = 'allowBlockType' in props.editorProps ? props.editorProps : {
|
|
765
764
|
allowBlockType: undefined
|
|
766
765
|
},
|
|
767
766
|
allowBlockType = _ref5.allowBlockType;
|
|
768
|
-
|
|
767
|
+
|
|
768
|
+
// In separate memo, because some props like `props.intl` that need only for rendering
|
|
769
|
+
// changes many times, but we don't want to process plugins and ADF document for each unnecessary changes.
|
|
770
|
+
var ssrDeps = (0, _react.useMemo)(function () {
|
|
769
771
|
if (!(0, _coreUtils.isSSR)() || !(0, _expValEquals.expValEquals)('platform_editor_ssr_renderer', 'isEnabled', true)) {
|
|
770
772
|
return null;
|
|
771
773
|
}
|
|
@@ -777,11 +779,24 @@ function ReactEditorView(props) {
|
|
|
777
779
|
}, pluginInjectionAPI.current);
|
|
778
780
|
var schema = (0, _createSchema.createSchema)((0, _createEditor.processPluginsList)(plugins));
|
|
779
781
|
var doc = buildDoc(schema);
|
|
782
|
+
return {
|
|
783
|
+
plugins: plugins,
|
|
784
|
+
schema: schema,
|
|
785
|
+
doc: doc
|
|
786
|
+
};
|
|
787
|
+
}, [allowBlockType, buildDoc, props.preset]);
|
|
788
|
+
var _props$editorProps3 = props.editorProps,
|
|
789
|
+
assistiveLabel = _props$editorProps3.assistiveLabel,
|
|
790
|
+
assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
|
|
791
|
+
var ssrEditor = (0, _react.useMemo)(function () {
|
|
792
|
+
if (!ssrDeps) {
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
780
795
|
return /*#__PURE__*/_react.default.createElement(_editorSsrRenderer.EditorSSRRenderer, {
|
|
781
796
|
intl: props.intl,
|
|
782
|
-
doc: doc,
|
|
783
|
-
schema: schema,
|
|
784
|
-
plugins: plugins,
|
|
797
|
+
doc: ssrDeps.doc,
|
|
798
|
+
schema: ssrDeps.schema,
|
|
799
|
+
plugins: ssrDeps.plugins,
|
|
785
800
|
portalProviderAPI: props.portalProviderAPI
|
|
786
801
|
// IMPORTANT: Keep next props in sync with div that renders a real ProseMirror editor.
|
|
787
802
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -791,9 +806,12 @@ function ReactEditorView(props) {
|
|
|
791
806
|
"aria-label": assistiveLabel || props.intl.formatMessage(_messages.editorMessages.editorAssistiveLabel),
|
|
792
807
|
id: EDIT_AREA_ID,
|
|
793
808
|
"aria-describedby": assistiveDescribedBy,
|
|
794
|
-
"data-editor-id": editorId.current
|
|
809
|
+
"data-editor-id": editorId.current,
|
|
810
|
+
onEditorStateChanged: function onEditorStateChanged(state) {
|
|
811
|
+
ssrEditorStateRef.current = state;
|
|
812
|
+
}
|
|
795
813
|
});
|
|
796
|
-
}, [
|
|
814
|
+
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, assistiveDescribedBy]);
|
|
797
815
|
var editor = (0, _react.useMemo)(function () {
|
|
798
816
|
// SSR editor will be available only in SSR environment,
|
|
799
817
|
// in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
|
|
@@ -476,7 +476,11 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
476
476
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
477
477
|
_tableStyles.tableContainerStyles,
|
|
478
478
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
479
|
-
!(0, _platformFeatureFlags.fg)('platform_editor_table_container_y_overflow_fix') && _tableStyles.tableContainerOverflowY,
|
|
479
|
+
!(0, _platformFeatureFlags.fg)('platform_editor_table_container_y_overflow_fix') && _tableStyles.tableContainerOverflowY, (0, _expValEquals.expValEquals)('platform_editor_ssr_renderer', 'isEnabled', true) &&
|
|
480
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
481
|
+
(0, _styles.tableSharedStyle)(),
|
|
482
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
483
|
+
(0, _expValEquals.expValEquals)('platform_editor_ssr_renderer', 'isEnabled', true) && _tableStyles.tableEmptyRowStyles,
|
|
480
484
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
481
485
|
_link.hyperLinkFloatingToolbarStyles,
|
|
482
486
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -7,6 +7,15 @@ exports.placeholderWrapStyles = exports.placeholderTextStyles = exports.placehol
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
9
9
|
|
|
10
|
+
var placeholderFadeInKeyframes = (0, _react.keyframes)({
|
|
11
|
+
from: {
|
|
12
|
+
opacity: 0
|
|
13
|
+
},
|
|
14
|
+
to: {
|
|
15
|
+
opacity: 1
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
10
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
11
20
|
var placeholderTextStyles = exports.placeholderTextStyles = (0, _react.css)({
|
|
12
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
@@ -90,6 +99,10 @@ var placeholderStyles = exports.placeholderStyles = (0, _react.css)({
|
|
|
90
99
|
userSelect: 'none',
|
|
91
100
|
position: 'absolute'
|
|
92
101
|
}
|
|
102
|
+
},
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
104
|
+
'.ProseMirror .placeholder-decoration-fade-in': {
|
|
105
|
+
animation: "".concat(placeholderFadeInKeyframes, " 300ms ease-out forwards")
|
|
93
106
|
}
|
|
94
107
|
});
|
|
95
108
|
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.tableLayoutFixes = exports.tableContainerStyles = exports.tableContainerOverflowY = exports.tableCommentEditorStyles = exports.tableCommentEditorMarginOverride = void 0;
|
|
7
|
+
exports.tableLayoutFixes = exports.tableEmptyRowStyles = exports.tableContainerStyles = exports.tableContainerOverflowY = exports.tableCommentEditorStyles = exports.tableCommentEditorMarginOverride = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _scrollbarStyles = require("./scrollbarStyles");
|
|
@@ -67,4 +67,19 @@ var tableContainerOverflowY = exports.tableContainerOverflowY = (0, _react.css)(
|
|
|
67
67
|
'.ProseMirror .pm-table-wrapper': {
|
|
68
68
|
overflowY: 'visible'
|
|
69
69
|
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
73
|
+
var tableEmptyRowStyles = exports.tableEmptyRowStyles = (0, _react.css)({
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
75
|
+
'.ProseMirror .pm-table-wrapper': {
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
77
|
+
'.pm-table-cell-content-wrap, .pm-table-header-content-wrap': {
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
79
|
+
'p:empty': {
|
|
80
|
+
/* add a minimum height to empty table rows in SSR */
|
|
81
|
+
minHeight: '1.714em'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
70
85
|
});
|
|
@@ -57,6 +57,7 @@ export function ReactEditorView(props) {
|
|
|
57
57
|
onEditorDestroyed
|
|
58
58
|
} = props;
|
|
59
59
|
const [editorAPI, setEditorAPI] = useState(undefined);
|
|
60
|
+
const ssrEditorStateRef = useRef(undefined);
|
|
60
61
|
const editorRef = useRef(null);
|
|
61
62
|
const viewRef = useRef();
|
|
62
63
|
const focusTimeoutId = useRef();
|
|
@@ -80,8 +81,8 @@ export function ReactEditorView(props) {
|
|
|
80
81
|
const contentTransformer = useRef(undefined);
|
|
81
82
|
const featureFlags = useMemo(() => createFeatureFlagsFromProps(editorPropFeatureFlags), [editorPropFeatureFlags]);
|
|
82
83
|
const getEditorState = useCallback(() => {
|
|
83
|
-
var _viewRef$current;
|
|
84
|
-
return (_viewRef$current = viewRef.current) === null || _viewRef$current === void 0 ? void 0 : _viewRef$current.state;
|
|
84
|
+
var _ssrEditorStateRef$cu, _viewRef$current;
|
|
85
|
+
return (_ssrEditorStateRef$cu = ssrEditorStateRef.current) !== null && _ssrEditorStateRef$cu !== void 0 ? _ssrEditorStateRef$cu : (_viewRef$current = viewRef.current) === null || _viewRef$current === void 0 ? void 0 : _viewRef$current.state;
|
|
85
86
|
}, []);
|
|
86
87
|
const getEditorView = useCallback(() => viewRef.current, []);
|
|
87
88
|
const dispatch = useMemo(() => createDispatch(eventDispatcher), [eventDispatcher]);
|
|
@@ -706,17 +707,17 @@ export function ReactEditorView(props) {
|
|
|
706
707
|
doc: defaultValue
|
|
707
708
|
});
|
|
708
709
|
}, [defaultValue, parseDoc, props.editorProps.sanitizePrivateContent, props.providerFactory]);
|
|
709
|
-
|
|
710
|
-
assistiveLabel,
|
|
711
|
-
assistiveDescribedBy
|
|
712
|
-
} = props.editorProps;
|
|
710
|
+
|
|
713
711
|
// We need to check `allowBlockType` in props, because it is now exist in EditorNextProps type.
|
|
714
712
|
const {
|
|
715
713
|
allowBlockType
|
|
716
714
|
} = 'allowBlockType' in props.editorProps ? props.editorProps : {
|
|
717
715
|
allowBlockType: undefined
|
|
718
716
|
};
|
|
719
|
-
|
|
717
|
+
|
|
718
|
+
// In separate memo, because some props like `props.intl` that need only for rendering
|
|
719
|
+
// changes many times, but we don't want to process plugins and ADF document for each unnecessary changes.
|
|
720
|
+
const ssrDeps = useMemo(() => {
|
|
720
721
|
if (!isSSR() || !expValEquals('platform_editor_ssr_renderer', 'isEnabled', true)) {
|
|
721
722
|
return null;
|
|
722
723
|
}
|
|
@@ -728,11 +729,25 @@ export function ReactEditorView(props) {
|
|
|
728
729
|
}, pluginInjectionAPI.current);
|
|
729
730
|
const schema = createSchema(processPluginsList(plugins));
|
|
730
731
|
const doc = buildDoc(schema);
|
|
732
|
+
return {
|
|
733
|
+
plugins,
|
|
734
|
+
schema,
|
|
735
|
+
doc
|
|
736
|
+
};
|
|
737
|
+
}, [allowBlockType, buildDoc, props.preset]);
|
|
738
|
+
const {
|
|
739
|
+
assistiveLabel,
|
|
740
|
+
assistiveDescribedBy
|
|
741
|
+
} = props.editorProps;
|
|
742
|
+
const ssrEditor = useMemo(() => {
|
|
743
|
+
if (!ssrDeps) {
|
|
744
|
+
return null;
|
|
745
|
+
}
|
|
731
746
|
return /*#__PURE__*/React.createElement(EditorSSRRenderer, {
|
|
732
747
|
intl: props.intl,
|
|
733
|
-
doc: doc,
|
|
734
|
-
schema: schema,
|
|
735
|
-
plugins: plugins,
|
|
748
|
+
doc: ssrDeps.doc,
|
|
749
|
+
schema: ssrDeps.schema,
|
|
750
|
+
plugins: ssrDeps.plugins,
|
|
736
751
|
portalProviderAPI: props.portalProviderAPI
|
|
737
752
|
// IMPORTANT: Keep next props in sync with div that renders a real ProseMirror editor.
|
|
738
753
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -742,9 +757,12 @@ export function ReactEditorView(props) {
|
|
|
742
757
|
"aria-label": assistiveLabel || props.intl.formatMessage(editorMessages.editorAssistiveLabel),
|
|
743
758
|
id: EDIT_AREA_ID,
|
|
744
759
|
"aria-describedby": assistiveDescribedBy,
|
|
745
|
-
"data-editor-id": editorId.current
|
|
760
|
+
"data-editor-id": editorId.current,
|
|
761
|
+
onEditorStateChanged: state => {
|
|
762
|
+
ssrEditorStateRef.current = state;
|
|
763
|
+
}
|
|
746
764
|
});
|
|
747
|
-
}, [
|
|
765
|
+
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, assistiveDescribedBy]);
|
|
748
766
|
const editor = useMemo(() => {
|
|
749
767
|
// SSR editor will be available only in SSR environment,
|
|
750
768
|
// in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx, useTheme } from '@emotion/react';
|
|
10
10
|
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
11
|
-
import { richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
11
|
+
import { richMediaClassName, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
12
12
|
import { akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -59,7 +59,7 @@ import { shadowStyles } from './styles/shadowStyles';
|
|
|
59
59
|
import { editorControlsSmartCardStyles, linkingVisualRefreshV1Styles, showDiffDeletedNodeStyles, smartCardDiffStyles, smartCardStyles, smartCardStylesWithSearchMatch, smartCardStylesWithSearchMatchAndBlockMenuDangerStyles, smartCardStylesWithSearchMatchAndPreviewPanelResponsiveness, smartLinksInLivePagesStyles } from './styles/smartCardStyles';
|
|
60
60
|
import { statusDangerStyles, statusStyles, statusStylesMixin_fg_platform_component_visual_refresh, statusStylesMixin_fg_platform_component_visual_refresh_with_search_match, statusStylesMixin_without_fg_platform_component_visual_refresh, statusStylesMixin_without_fg_platform_component_visual_refresh_with_search_match } from './styles/statusStyles';
|
|
61
61
|
import { syncBlockStyles } from './styles/syncBlockStyles';
|
|
62
|
-
import { tableCommentEditorStyles, tableContainerOverflowY, tableContainerStyles, tableLayoutFixes } from './styles/tableStyles';
|
|
62
|
+
import { tableCommentEditorStyles, tableContainerOverflowY, tableContainerStyles, tableLayoutFixes, tableEmptyRowStyles } from './styles/tableStyles';
|
|
63
63
|
import { decisionDangerStyles, decisionIconWithVisualRefresh, decisionIconWithoutVisualRefresh, decisionStyles, getDenseTasksAndDecisionsStyles, taskItemStyles, taskItemStylesWithBlockTaskItem, tasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
64
64
|
import { telepointerColorAndCommonStyle, telepointerStyle } from './styles/telepointerStyles';
|
|
65
65
|
import { textColorStyles } from './styles/textColorStyles';
|
|
@@ -472,7 +472,11 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
472
472
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
473
473
|
tableContainerStyles,
|
|
474
474
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
475
|
-
!fg('platform_editor_table_container_y_overflow_fix') && tableContainerOverflowY,
|
|
475
|
+
!fg('platform_editor_table_container_y_overflow_fix') && tableContainerOverflowY, expValEquals('platform_editor_ssr_renderer', 'isEnabled', true) &&
|
|
476
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
477
|
+
tableSharedStyle(),
|
|
478
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
479
|
+
expValEquals('platform_editor_ssr_renderer', 'isEnabled', true) && tableEmptyRowStyles,
|
|
476
480
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
477
481
|
hyperLinkFloatingToolbarStyles,
|
|
478
482
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, keyframes } from '@emotion/react';
|
|
3
|
+
const placeholderFadeInKeyframes = keyframes({
|
|
4
|
+
from: {
|
|
5
|
+
opacity: 0
|
|
6
|
+
},
|
|
7
|
+
to: {
|
|
8
|
+
opacity: 1
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
3
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
4
13
|
export const placeholderTextStyles = css({
|
|
5
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
@@ -83,6 +92,10 @@ export const placeholderStyles = css({
|
|
|
83
92
|
userSelect: 'none',
|
|
84
93
|
position: 'absolute'
|
|
85
94
|
}
|
|
95
|
+
},
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
97
|
+
'.ProseMirror .placeholder-decoration-fade-in': {
|
|
98
|
+
animation: `${placeholderFadeInKeyframes} 300ms ease-out forwards`
|
|
86
99
|
}
|
|
87
100
|
});
|
|
88
101
|
|
|
@@ -63,4 +63,19 @@ export const tableContainerOverflowY = css({
|
|
|
63
63
|
'.ProseMirror .pm-table-wrapper': {
|
|
64
64
|
overflowY: 'visible'
|
|
65
65
|
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
69
|
+
export const tableEmptyRowStyles = css({
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
71
|
+
'.ProseMirror .pm-table-wrapper': {
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
73
|
+
'.pm-table-cell-content-wrap, .pm-table-header-content-wrap': {
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
75
|
+
'p:empty': {
|
|
76
|
+
/* add a minimum height to empty table rows in SSR */
|
|
77
|
+
minHeight: '1.714em'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
66
81
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "215.
|
|
2
|
+
export const version = "215.26.0";
|
|
@@ -65,6 +65,7 @@ export function ReactEditorView(props) {
|
|
|
65
65
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
66
|
editorAPI = _useState2[0],
|
|
67
67
|
setEditorAPI = _useState2[1];
|
|
68
|
+
var ssrEditorStateRef = useRef(undefined);
|
|
68
69
|
var editorRef = useRef(null);
|
|
69
70
|
var viewRef = useRef();
|
|
70
71
|
var focusTimeoutId = useRef();
|
|
@@ -92,8 +93,8 @@ export function ReactEditorView(props) {
|
|
|
92
93
|
return createFeatureFlagsFromProps(editorPropFeatureFlags);
|
|
93
94
|
}, [editorPropFeatureFlags]);
|
|
94
95
|
var getEditorState = useCallback(function () {
|
|
95
|
-
var _viewRef$current;
|
|
96
|
-
return (_viewRef$current = viewRef.current) === null || _viewRef$current === void 0 ? void 0 : _viewRef$current.state;
|
|
96
|
+
var _ssrEditorStateRef$cu, _viewRef$current;
|
|
97
|
+
return (_ssrEditorStateRef$cu = ssrEditorStateRef.current) !== null && _ssrEditorStateRef$cu !== void 0 ? _ssrEditorStateRef$cu : (_viewRef$current = viewRef.current) === null || _viewRef$current === void 0 ? void 0 : _viewRef$current.state;
|
|
97
98
|
}, []);
|
|
98
99
|
var getEditorView = useCallback(function () {
|
|
99
100
|
return viewRef.current;
|
|
@@ -748,15 +749,16 @@ export function ReactEditorView(props) {
|
|
|
748
749
|
doc: defaultValue
|
|
749
750
|
});
|
|
750
751
|
}, [defaultValue, parseDoc, props.editorProps.sanitizePrivateContent, props.providerFactory]);
|
|
751
|
-
|
|
752
|
-
assistiveLabel = _props$editorProps3.assistiveLabel,
|
|
753
|
-
assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
|
|
752
|
+
|
|
754
753
|
// We need to check `allowBlockType` in props, because it is now exist in EditorNextProps type.
|
|
755
754
|
var _ref5 = 'allowBlockType' in props.editorProps ? props.editorProps : {
|
|
756
755
|
allowBlockType: undefined
|
|
757
756
|
},
|
|
758
757
|
allowBlockType = _ref5.allowBlockType;
|
|
759
|
-
|
|
758
|
+
|
|
759
|
+
// In separate memo, because some props like `props.intl` that need only for rendering
|
|
760
|
+
// changes many times, but we don't want to process plugins and ADF document for each unnecessary changes.
|
|
761
|
+
var ssrDeps = useMemo(function () {
|
|
760
762
|
if (!isSSR() || !expValEquals('platform_editor_ssr_renderer', 'isEnabled', true)) {
|
|
761
763
|
return null;
|
|
762
764
|
}
|
|
@@ -768,11 +770,24 @@ export function ReactEditorView(props) {
|
|
|
768
770
|
}, pluginInjectionAPI.current);
|
|
769
771
|
var schema = createSchema(processPluginsList(plugins));
|
|
770
772
|
var doc = buildDoc(schema);
|
|
773
|
+
return {
|
|
774
|
+
plugins: plugins,
|
|
775
|
+
schema: schema,
|
|
776
|
+
doc: doc
|
|
777
|
+
};
|
|
778
|
+
}, [allowBlockType, buildDoc, props.preset]);
|
|
779
|
+
var _props$editorProps3 = props.editorProps,
|
|
780
|
+
assistiveLabel = _props$editorProps3.assistiveLabel,
|
|
781
|
+
assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
|
|
782
|
+
var ssrEditor = useMemo(function () {
|
|
783
|
+
if (!ssrDeps) {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
771
786
|
return /*#__PURE__*/React.createElement(EditorSSRRenderer, {
|
|
772
787
|
intl: props.intl,
|
|
773
|
-
doc: doc,
|
|
774
|
-
schema: schema,
|
|
775
|
-
plugins: plugins,
|
|
788
|
+
doc: ssrDeps.doc,
|
|
789
|
+
schema: ssrDeps.schema,
|
|
790
|
+
plugins: ssrDeps.plugins,
|
|
776
791
|
portalProviderAPI: props.portalProviderAPI
|
|
777
792
|
// IMPORTANT: Keep next props in sync with div that renders a real ProseMirror editor.
|
|
778
793
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -782,9 +797,12 @@ export function ReactEditorView(props) {
|
|
|
782
797
|
"aria-label": assistiveLabel || props.intl.formatMessage(editorMessages.editorAssistiveLabel),
|
|
783
798
|
id: EDIT_AREA_ID,
|
|
784
799
|
"aria-describedby": assistiveDescribedBy,
|
|
785
|
-
"data-editor-id": editorId.current
|
|
800
|
+
"data-editor-id": editorId.current,
|
|
801
|
+
onEditorStateChanged: function onEditorStateChanged(state) {
|
|
802
|
+
ssrEditorStateRef.current = state;
|
|
803
|
+
}
|
|
786
804
|
});
|
|
787
|
-
}, [
|
|
805
|
+
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, assistiveDescribedBy]);
|
|
788
806
|
var editor = useMemo(function () {
|
|
789
807
|
// SSR editor will be available only in SSR environment,
|
|
790
808
|
// in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
|
|
@@ -9,7 +9,7 @@ import React from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx, useTheme } from '@emotion/react';
|
|
11
11
|
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
12
|
-
import { richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
12
|
+
import { richMediaClassName, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
13
13
|
import { akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -60,7 +60,7 @@ import { shadowStyles } from './styles/shadowStyles';
|
|
|
60
60
|
import { editorControlsSmartCardStyles, linkingVisualRefreshV1Styles, showDiffDeletedNodeStyles, smartCardDiffStyles, smartCardStyles, smartCardStylesWithSearchMatch, smartCardStylesWithSearchMatchAndBlockMenuDangerStyles, smartCardStylesWithSearchMatchAndPreviewPanelResponsiveness, smartLinksInLivePagesStyles } from './styles/smartCardStyles';
|
|
61
61
|
import { statusDangerStyles, statusStyles, statusStylesMixin_fg_platform_component_visual_refresh, statusStylesMixin_fg_platform_component_visual_refresh_with_search_match, statusStylesMixin_without_fg_platform_component_visual_refresh, statusStylesMixin_without_fg_platform_component_visual_refresh_with_search_match } from './styles/statusStyles';
|
|
62
62
|
import { syncBlockStyles } from './styles/syncBlockStyles';
|
|
63
|
-
import { tableCommentEditorStyles, tableContainerOverflowY, tableContainerStyles, tableLayoutFixes } from './styles/tableStyles';
|
|
63
|
+
import { tableCommentEditorStyles, tableContainerOverflowY, tableContainerStyles, tableLayoutFixes, tableEmptyRowStyles } from './styles/tableStyles';
|
|
64
64
|
import { decisionDangerStyles, decisionIconWithVisualRefresh, decisionIconWithoutVisualRefresh, decisionStyles, getDenseTasksAndDecisionsStyles, taskItemStyles, taskItemStylesWithBlockTaskItem, tasksAndDecisionsStyles } from './styles/tasksAndDecisionsStyles';
|
|
65
65
|
import { telepointerColorAndCommonStyle, telepointerStyle } from './styles/telepointerStyles';
|
|
66
66
|
import { textColorStyles } from './styles/textColorStyles';
|
|
@@ -468,7 +468,11 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
468
468
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
469
469
|
tableContainerStyles,
|
|
470
470
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
471
|
-
!fg('platform_editor_table_container_y_overflow_fix') && tableContainerOverflowY,
|
|
471
|
+
!fg('platform_editor_table_container_y_overflow_fix') && tableContainerOverflowY, expValEquals('platform_editor_ssr_renderer', 'isEnabled', true) &&
|
|
472
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
473
|
+
tableSharedStyle(),
|
|
474
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
475
|
+
expValEquals('platform_editor_ssr_renderer', 'isEnabled', true) && tableEmptyRowStyles,
|
|
472
476
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
473
477
|
hyperLinkFloatingToolbarStyles,
|
|
474
478
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, keyframes } from '@emotion/react';
|
|
3
|
+
var placeholderFadeInKeyframes = keyframes({
|
|
4
|
+
from: {
|
|
5
|
+
opacity: 0
|
|
6
|
+
},
|
|
7
|
+
to: {
|
|
8
|
+
opacity: 1
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
3
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
4
13
|
export var placeholderTextStyles = css({
|
|
5
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
@@ -83,6 +92,10 @@ export var placeholderStyles = css({
|
|
|
83
92
|
userSelect: 'none',
|
|
84
93
|
position: 'absolute'
|
|
85
94
|
}
|
|
95
|
+
},
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
97
|
+
'.ProseMirror .placeholder-decoration-fade-in': {
|
|
98
|
+
animation: "".concat(placeholderFadeInKeyframes, " 300ms ease-out forwards")
|
|
86
99
|
}
|
|
87
100
|
});
|
|
88
101
|
|
|
@@ -60,4 +60,19 @@ export var tableContainerOverflowY = css({
|
|
|
60
60
|
'.ProseMirror .pm-table-wrapper': {
|
|
61
61
|
overflowY: 'visible'
|
|
62
62
|
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
66
|
+
export var tableEmptyRowStyles = css({
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
68
|
+
'.ProseMirror .pm-table-wrapper': {
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
70
|
+
'.pm-table-cell-content-wrap, .pm-table-header-content-wrap': {
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
72
|
+
'p:empty': {
|
|
73
|
+
/* add a minimum height to empty table rows in SSR */
|
|
74
|
+
minHeight: '1.714em'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
63
78
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "215.
|
|
2
|
+
export var version = "215.26.0";
|
|
@@ -4,3 +4,4 @@ export declare const tableCommentEditorMarginOverride: SerializedStyles;
|
|
|
4
4
|
export declare const tableCommentEditorStyles: SerializedStyles;
|
|
5
5
|
export declare const tableContainerStyles: SerializedStyles;
|
|
6
6
|
export declare const tableContainerOverflowY: SerializedStyles;
|
|
7
|
+
export declare const tableEmptyRowStyles: SerializedStyles;
|
|
@@ -4,3 +4,4 @@ export declare const tableCommentEditorMarginOverride: SerializedStyles;
|
|
|
4
4
|
export declare const tableCommentEditorStyles: SerializedStyles;
|
|
5
5
|
export declare const tableContainerStyles: SerializedStyles;
|
|
6
6
|
export declare const tableContainerOverflowY: SerializedStyles;
|
|
7
|
+
export declare const tableEmptyRowStyles: SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "215.
|
|
3
|
+
"version": "215.26.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/editor-plugins": "^11.1.0",
|
|
55
55
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
56
56
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
57
|
-
"@atlaskit/editor-ssr-renderer": "^1.
|
|
57
|
+
"@atlaskit/editor-ssr-renderer": "^1.6.0",
|
|
58
58
|
"@atlaskit/editor-toolbar": "^0.18.0",
|
|
59
59
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
60
60
|
"@atlaskit/emoji": "^69.9.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"uuid": "^3.1.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@atlaskit/editor-common": "^110.
|
|
86
|
+
"@atlaskit/editor-common": "^110.49.0",
|
|
87
87
|
"@atlaskit/link-provider": "^4.0.0",
|
|
88
88
|
"@atlaskit/media-core": "^37.0.0",
|
|
89
89
|
"react": "^18.2.0",
|