@atlaskit/editor-core 193.19.0 → 193.19.6
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 +9 -0
- package/dist/cjs/create-editor/create-plugins-list.js +0 -1
- package/dist/cjs/create-editor/create-preset.js +1 -0
- package/dist/cjs/presets/default.js +1 -3
- package/dist/cjs/presets/universal.js +12 -2
- package/dist/cjs/test-utils.js +7 -1
- package/dist/cjs/ui/ContentStyles/index.js +10 -3
- package/dist/cjs/ui/ContentStyles/layout.js +3 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +0 -1
- package/dist/es2019/create-editor/create-preset.js +1 -0
- package/dist/es2019/presets/default.js +1 -3
- package/dist/es2019/presets/universal.js +12 -2
- package/dist/es2019/test-utils.js +7 -1
- package/dist/es2019/ui/ContentStyles/index.js +11 -3
- package/dist/es2019/ui/ContentStyles/layout.js +4 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +0 -1
- package/dist/esm/create-editor/create-preset.js +1 -0
- package/dist/esm/presets/default.js +1 -3
- package/dist/esm/presets/universal.js +12 -2
- package/dist/esm/test-utils.js +7 -1
- package/dist/esm/ui/ContentStyles/index.js +10 -3
- package/dist/esm/ui/ContentStyles/layout.js +3 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-preset.d.ts +9 -9
- package/dist/types/presets/default.d.ts +6 -6
- package/dist/types/presets/universal.d.ts +9 -9
- package/dist/types/presets/useUniversalPreset.d.ts +9 -9
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -0
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/ui/ContentStyles/layout.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/create-preset.d.ts +9 -9
- package/dist/types-ts4.5/presets/default.d.ts +6 -6
- package/dist/types-ts4.5/presets/universal.d.ts +9 -9
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +9 -9
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -0
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/ContentStyles/layout.d.ts +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 193.19.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#98561](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98561)
|
|
8
|
+
[`ca9500b004d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ca9500b004d4) -
|
|
9
|
+
[ux] [ED-22668] remove the border from layouts on rest and on hover whilst on a live view page
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 193.19.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -52,7 +52,6 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent
|
|
|
52
52
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
53
53
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
54
54
|
typeAhead: {
|
|
55
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
56
55
|
isMobile: isMobile
|
|
57
56
|
},
|
|
58
57
|
featureFlags: (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(props),
|
|
@@ -31,6 +31,7 @@ function withDangerouslyAppendPlugins(preset) {
|
|
|
31
31
|
var presetWithAppendedPlugins = nextEditorPluginsToAppend.reduce(function (acc, plugin) {
|
|
32
32
|
// These are dangerously appended, we don't need their type information leaking into
|
|
33
33
|
// universal preset
|
|
34
|
+
// @ts-expect-error
|
|
34
35
|
return acc.add(plugin);
|
|
35
36
|
}, preset);
|
|
36
37
|
return presetWithAppendedPlugins;
|
|
@@ -53,9 +53,7 @@ function createDefaultPreset(options) {
|
|
|
53
53
|
performanceTracking: options.performanceTracking
|
|
54
54
|
}], Boolean(options.allowAnalyticsGASV3)).add(_betterTypeHistory.betterTypeHistoryPlugin).add([_paste.pastePlugin, _objectSpread({}, options === null || options === void 0 ? void 0 : options.paste)]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
|
|
55
55
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
56
|
-
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead || {
|
|
57
|
-
createAnalyticsEvent: options.createAnalyticsEvent
|
|
58
|
-
}]).maybeAdd(_history.historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([_blockType.blockTypePlugin, options.blockType]).add(_clearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd([_selectionToolbar.selectionToolbarPlugin, {
|
|
56
|
+
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([_blockType.blockTypePlugin, options.blockType]).add(_clearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd([_selectionToolbar.selectionToolbarPlugin, {
|
|
59
57
|
preferenceToolbarAboveSelection: false
|
|
60
58
|
}], function () {
|
|
61
59
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.enable-selection-toolbar_ucdwd')) {
|
|
@@ -141,7 +141,11 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
141
141
|
useLongPressSelection: false
|
|
142
142
|
}], Boolean(props.allowTasksAndDecisions || props.taskDecisionProvider)).maybeAdd([_feedbackDialog.feedbackDialogPlugin, _objectSpread({
|
|
143
143
|
coreVersion: _versionWrapper.version
|
|
144
|
-
}, props.feedbackInfo)], Boolean(props.feedbackInfo)).maybeAdd([_helpDialog.helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([_saveOnEnter.saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(_imageUpload.imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd(
|
|
144
|
+
}, props.feedbackInfo)], Boolean(props.feedbackInfo)).maybeAdd([_helpDialog.helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([_saveOnEnter.saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(_imageUpload.imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd(
|
|
145
|
+
// duplicate plugin exists because first one if media is enabled
|
|
146
|
+
// second one when “media is disabled, and legacyMediaProvider is enabled
|
|
147
|
+
// @ts-expect-error
|
|
148
|
+
[_media.mediaPlugin, {
|
|
145
149
|
allowMediaSingle: {
|
|
146
150
|
disableLayout: true
|
|
147
151
|
},
|
|
@@ -159,7 +163,13 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
159
163
|
extensionHandlers: props.extensionHandlers,
|
|
160
164
|
useLongPressSelection: false,
|
|
161
165
|
appearance: appearance
|
|
162
|
-
}], Boolean(props.allowExtension)).maybeAdd(
|
|
166
|
+
}], Boolean(props.allowExtension)).maybeAdd(
|
|
167
|
+
// we are ignoring a duplicate plugin error here
|
|
168
|
+
// this error exists because we have two annotation plugins being added
|
|
169
|
+
// one with annotationProviders and one with allowConfluenceInlineComment
|
|
170
|
+
// long term this and media should be consolidated into adding both only once
|
|
171
|
+
// @ts-expect-error
|
|
172
|
+
[_annotation.annotationPlugin, undefined], Boolean(!props.annotationProviders && props.allowConfluenceInlineComment)).maybeAdd([_date.datePlugin, {
|
|
163
173
|
weekStartDay: (0, _typeof2.default)(props.allowDate) === 'object' ? props.allowDate.weekStartDay : undefined
|
|
164
174
|
}], Boolean(props.allowDate)).maybeAdd([_placeholderText.placeholderTextPlugin,
|
|
165
175
|
// @ts-expect-error 2322: Type 'false | PlaceholderTextOptions | undefined'
|
package/dist/cjs/test-utils.js
CHANGED
|
@@ -90,7 +90,13 @@ var createPMSchemaAndPlugins = exports.createPMSchemaAndPlugins = function creat
|
|
|
90
90
|
var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _preset.EditorPresetBuilder();
|
|
91
91
|
return function (pluginFactoryParams) {
|
|
92
92
|
var editorPlugins = [];
|
|
93
|
-
|
|
93
|
+
|
|
94
|
+
// we are ignoring the below because while this logic knows if
|
|
95
|
+
// basePlugin is in the inputPreset, the type system does not
|
|
96
|
+
// so it marks it as a duplicate plugin :) - this is fine
|
|
97
|
+
var preset = inputPreset.has(_base.basePlugin) ? inputPreset :
|
|
98
|
+
// @ts-expect-error
|
|
99
|
+
inputPreset.add(_base.basePlugin);
|
|
94
100
|
editorPlugins = preset.build({
|
|
95
101
|
pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
|
|
96
102
|
});
|
|
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _collab = require("@atlaskit/editor-common/collab");
|
|
13
13
|
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
14
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
15
|
var _mention = require("@atlaskit/editor-common/mention");
|
|
15
16
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
16
17
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
@@ -24,6 +25,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
24
25
|
var _colors = require("@atlaskit/theme/colors");
|
|
25
26
|
var _tokens = require("@atlaskit/tokens");
|
|
26
27
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
28
|
+
var _context = require("../../presets/context");
|
|
27
29
|
var _aiPanels = require("./ai-panels");
|
|
28
30
|
var _codeBlock = require("./code-block");
|
|
29
31
|
var _date = require("./date");
|
|
@@ -68,7 +70,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)({
|
|
|
68
70
|
var contentStyles = function contentStyles(props) {
|
|
69
71
|
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\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 ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n .pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n clear: both;\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
70
72
|
theme: props.theme
|
|
71
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, _styles.backgroundColorStyles, listsStyles, ruleStyles(), _media.mediaStyles, _layout.layoutStyles, _collab.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, (0, _aiPanels.aiPanelStyles)(props.colorMode), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
73
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, _styles.backgroundColorStyles, listsStyles, ruleStyles(), _media.mediaStyles, (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, (0, _aiPanels.aiPanelStyles)(props.colorMode), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
72
74
|
};
|
|
73
75
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
74
76
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -78,13 +80,18 @@ var createEditorContentStyle = exports.createEditorContentStyle = function creat
|
|
|
78
80
|
var theme = (0, _react2.useTheme)();
|
|
79
81
|
var _useThemeObserver = (0, _tokens.useThemeObserver)(),
|
|
80
82
|
colorMode = _useThemeObserver.colorMode;
|
|
83
|
+
var editorAPI = (0, _context.usePresetContext)();
|
|
84
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['editorViewMode']),
|
|
85
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
86
|
+
var viewMode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
81
87
|
var memoizedStyle = (0, _react.useMemo)(function () {
|
|
82
88
|
return contentStyles({
|
|
83
89
|
theme: theme,
|
|
84
90
|
colorMode: colorMode,
|
|
85
|
-
featureFlags: featureFlags
|
|
91
|
+
featureFlags: featureFlags,
|
|
92
|
+
viewMode: viewMode
|
|
86
93
|
});
|
|
87
|
-
}, [theme, colorMode, featureFlags]);
|
|
94
|
+
}, [theme, colorMode, featureFlags, viewMode]);
|
|
88
95
|
return (0, _react2.jsx)("div", {
|
|
89
96
|
className: className,
|
|
90
97
|
ref: ref,
|
|
@@ -26,4 +26,6 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
26
26
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
27
|
var _templateObject;
|
|
28
28
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
29
|
-
var layoutStyles = exports.layoutStyles =
|
|
29
|
+
var layoutStyles = exports.layoutStyles = function layoutStyles(viewMode) {
|
|
30
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", " [data-layout-section] {\n // TODO: Migrate away from gridSize\n // Recommendation: Replace directly with 7px\n margin: ", " -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: ", ";\n\n /* Inner cursor located 26px from left */\n [data-layout-column] {\n flex: 1;\n min-width: 0;\n border: ", "px solid\n ", ";\n border-radius: 4px;\n padding: ", "px;\n box-sizing: border-box;\n\n > div {\n > :not(style):first-child,\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n > .embedCardView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > style:first-child\n + .ProseMirror-gapcursor.-right\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > .ProseMirror-gapcursor.-right:first-of-type\n + .embedCardView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > style:first-child\n + .ProseMirror-gapcursor\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n > [data-node-type='decisionList'] {\n li:first-of-type [data-decision-wrapper] {\n margin-top: 0;\n }\n }\n }\n\n /* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n [data-layout-content] {\n height: 100%;\n cursor: text;\n .mediaGroupView-content-wrap {\n clear: both;\n }\n }\n }\n\n [data-layout-column] + [data-layout-column] {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n [data-layout-column] + [data-layout-column] {\n margin-left: 0;\n }\n }\n\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4441\n /* Shows the border when cursor is inside a layout */\n &.selected [data-layout-column],\n &:hover [data-layout-column] {\n border: ", "px solid\n ", ";\n }\n\n &.selected.danger > [data-layout-column] {\n background-color: ", ";\n border-color: ", ";\n }\n\n &.", ":not(.danger) {\n [data-layout-column] {\n ", "\n }\n }\n }\n }\n\n .fabric-editor--full-width-mode .ProseMirror {\n [data-layout-section] {\n .", " {\n margin: 0 ", "px;\n }\n }\n }\n"])), _styles.columnLayoutSharedStyle, "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N50A, ")"), "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]), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode);
|
|
31
|
+
};
|
|
@@ -21,6 +21,7 @@ function withDangerouslyAppendPlugins(preset) {
|
|
|
21
21
|
const presetWithAppendedPlugins = nextEditorPluginsToAppend.reduce((acc, plugin) => {
|
|
22
22
|
// These are dangerously appended, we don't need their type information leaking into
|
|
23
23
|
// universal preset
|
|
24
|
+
// @ts-expect-error
|
|
24
25
|
return acc.add(plugin);
|
|
25
26
|
}, preset);
|
|
26
27
|
return presetWithAppendedPlugins;
|
|
@@ -47,9 +47,7 @@ export function createDefaultPreset(options) {
|
|
|
47
47
|
...(options === null || options === void 0 ? void 0 : options.paste)
|
|
48
48
|
}]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
49
49
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
50
|
-
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead || {
|
|
51
|
-
createAnalyticsEvent: options.createAnalyticsEvent
|
|
52
|
-
}]).maybeAdd(historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, options.blockType]).add(clearMarksOnEmptyDocPlugin).maybeAdd([selectionToolbarPlugin, {
|
|
50
|
+
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, options.blockType]).add(clearMarksOnEmptyDocPlugin).maybeAdd([selectionToolbarPlugin, {
|
|
53
51
|
preferenceToolbarAboveSelection: false
|
|
54
52
|
}], () => {
|
|
55
53
|
if (getBooleanFF('platform.editor.enable-selection-toolbar_ucdwd')) {
|
|
@@ -131,7 +131,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
131
131
|
}], Boolean(props.allowTasksAndDecisions || props.taskDecisionProvider)).maybeAdd([feedbackDialogPlugin, {
|
|
132
132
|
coreVersion,
|
|
133
133
|
...props.feedbackInfo
|
|
134
|
-
}], Boolean(props.feedbackInfo)).maybeAdd([helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd(
|
|
134
|
+
}], Boolean(props.feedbackInfo)).maybeAdd([helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd(
|
|
135
|
+
// duplicate plugin exists because first one if media is enabled
|
|
136
|
+
// second one when “media is disabled, and legacyMediaProvider is enabled
|
|
137
|
+
// @ts-expect-error
|
|
138
|
+
[mediaPlugin, {
|
|
135
139
|
allowMediaSingle: {
|
|
136
140
|
disableLayout: true
|
|
137
141
|
},
|
|
@@ -150,7 +154,13 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
150
154
|
extensionHandlers: props.extensionHandlers,
|
|
151
155
|
useLongPressSelection: false,
|
|
152
156
|
appearance
|
|
153
|
-
}], Boolean(props.allowExtension)).maybeAdd(
|
|
157
|
+
}], Boolean(props.allowExtension)).maybeAdd(
|
|
158
|
+
// we are ignoring a duplicate plugin error here
|
|
159
|
+
// this error exists because we have two annotation plugins being added
|
|
160
|
+
// one with annotationProviders and one with allowConfluenceInlineComment
|
|
161
|
+
// long term this and media should be consolidated into adding both only once
|
|
162
|
+
// @ts-expect-error
|
|
163
|
+
[annotationPlugin, undefined], Boolean(!props.annotationProviders && props.allowConfluenceInlineComment)).maybeAdd([datePlugin, {
|
|
154
164
|
weekStartDay: typeof props.allowDate === 'object' ? props.allowDate.weekStartDay : undefined
|
|
155
165
|
}], Boolean(props.allowDate)).maybeAdd([placeholderTextPlugin,
|
|
156
166
|
// @ts-expect-error 2322: Type 'false | PlaceholderTextOptions | undefined'
|
|
@@ -53,7 +53,13 @@ function lightProcessPluginsList(editorPlugins) {
|
|
|
53
53
|
}
|
|
54
54
|
export const createPMSchemaAndPlugins = (inputPreset = new EditorPresetBuilder()) => pluginFactoryParams => {
|
|
55
55
|
let editorPlugins = [];
|
|
56
|
-
|
|
56
|
+
|
|
57
|
+
// we are ignoring the below because while this logic knows if
|
|
58
|
+
// basePlugin is in the inputPreset, the type system does not
|
|
59
|
+
// so it marks it as a duplicate plugin :) - this is fine
|
|
60
|
+
const preset = inputPreset.has(basePlugin) ? inputPreset :
|
|
61
|
+
// @ts-expect-error
|
|
62
|
+
inputPreset.add(basePlugin);
|
|
57
63
|
editorPlugins = preset.build({
|
|
58
64
|
pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
|
|
59
65
|
});
|
|
@@ -6,6 +6,7 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
7
7
|
import { telepointerStyle } from '@atlaskit/editor-common/collab';
|
|
8
8
|
import { EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
9
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
9
10
|
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
10
11
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
11
12
|
import { annotationSharedStyles, backgroundColorStyles, blockMarksSharedStyles, codeBlockInListSafariFix, codeMarkSharedStyles, dateSharedStyle, embedCardStyles, gridStyles, indentationSharedStyles, linkSharedStyle, listsSharedStyles, MediaSharedClassNames, paragraphSharedStyles, resizerStyles, ruleSharedStyles, shadowSharedStyle, SmartCardSharedCssClassName, smartCardSharedStyles, smartCardStyles, tasksAndDecisionsStyles, textColorStyles, unsupportedStyles, whitespaceSharedStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -19,6 +20,7 @@ import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSele
|
|
|
19
20
|
import { N200, N30A, N500 } from '@atlaskit/theme/colors';
|
|
20
21
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
21
22
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
23
|
+
import { usePresetContext } from '../../presets/context';
|
|
22
24
|
import { aiPanelStyles } from './ai-panels';
|
|
23
25
|
import { codeBlockStyles } from './code-block';
|
|
24
26
|
import { dateStyles } from './date';
|
|
@@ -186,7 +188,7 @@ const contentStyles = props => css`
|
|
|
186
188
|
${listsStyles}
|
|
187
189
|
${ruleStyles()}
|
|
188
190
|
${mediaStyles}
|
|
189
|
-
${layoutStyles}
|
|
191
|
+
${layoutStyles(props.viewMode)}
|
|
190
192
|
${telepointerStyle}
|
|
191
193
|
${gapCursorStyles};
|
|
192
194
|
${tableStyles(props)}
|
|
@@ -282,11 +284,17 @@ export const createEditorContentStyle = styles => {
|
|
|
282
284
|
const {
|
|
283
285
|
colorMode
|
|
284
286
|
} = useThemeObserver();
|
|
287
|
+
const editorAPI = usePresetContext();
|
|
288
|
+
const {
|
|
289
|
+
editorViewModeState
|
|
290
|
+
} = useSharedPluginState(editorAPI, ['editorViewMode']);
|
|
291
|
+
const viewMode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
285
292
|
const memoizedStyle = useMemo(() => contentStyles({
|
|
286
293
|
theme,
|
|
287
294
|
colorMode,
|
|
288
|
-
featureFlags
|
|
289
|
-
|
|
295
|
+
featureFlags,
|
|
296
|
+
viewMode
|
|
297
|
+
}), [theme, colorMode, featureFlags, viewMode]);
|
|
290
298
|
return jsx("div", {
|
|
291
299
|
className: className,
|
|
292
300
|
ref: ref,
|
|
@@ -7,20 +7,20 @@ import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
|
7
7
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
10
|
-
export const layoutStyles = css`
|
|
10
|
+
export const layoutStyles = viewMode => css`
|
|
11
11
|
.ProseMirror {
|
|
12
12
|
${columnLayoutSharedStyle} [data-layout-section] {
|
|
13
13
|
// TODO: Migrate away from gridSize
|
|
14
14
|
// Recommendation: Replace directly with 7px
|
|
15
15
|
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset}px 0;
|
|
16
16
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
17
|
-
cursor: pointer;
|
|
17
|
+
cursor: ${viewMode === 'view' ? 'default' : 'pointer'};
|
|
18
18
|
|
|
19
19
|
/* Inner cursor located 26px from left */
|
|
20
20
|
[data-layout-column] {
|
|
21
21
|
flex: 1;
|
|
22
22
|
min-width: 0;
|
|
23
|
-
border: ${akEditorSelectedBorderSize}px solid
|
|
23
|
+
border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
|
|
24
24
|
${`var(--ds-border, ${N40A})`};
|
|
25
25
|
border-radius: 4px;
|
|
26
26
|
padding: ${LAYOUT_COLUMN_PADDING}px;
|
|
@@ -111,7 +111,7 @@ export const layoutStyles = css`
|
|
|
111
111
|
/* Shows the border when cursor is inside a layout */
|
|
112
112
|
&.selected [data-layout-column],
|
|
113
113
|
&:hover [data-layout-column] {
|
|
114
|
-
border: ${akEditorSelectedBorderSize}px solid
|
|
114
|
+
border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
|
|
115
115
|
${`var(--ds-border, ${N50A})`};
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "193.19.
|
|
2
|
+
export const version = "193.19.6";
|
|
@@ -43,7 +43,6 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
43
43
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
44
44
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
45
45
|
typeAhead: {
|
|
46
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
47
46
|
isMobile: isMobile
|
|
48
47
|
},
|
|
49
48
|
featureFlags: createFeatureFlagsFromProps(props),
|
|
@@ -25,6 +25,7 @@ function withDangerouslyAppendPlugins(preset) {
|
|
|
25
25
|
var presetWithAppendedPlugins = nextEditorPluginsToAppend.reduce(function (acc, plugin) {
|
|
26
26
|
// These are dangerously appended, we don't need their type information leaking into
|
|
27
27
|
// universal preset
|
|
28
|
+
// @ts-expect-error
|
|
28
29
|
return acc.add(plugin);
|
|
29
30
|
}, preset);
|
|
30
31
|
return presetWithAppendedPlugins;
|
|
@@ -48,9 +48,7 @@ export function createDefaultPreset(options) {
|
|
|
48
48
|
performanceTracking: options.performanceTracking
|
|
49
49
|
}], Boolean(options.allowAnalyticsGASV3)).add(betterTypeHistoryPlugin).add([pastePlugin, _objectSpread({}, options === null || options === void 0 ? void 0 : options.paste)]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
50
50
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
51
|
-
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead || {
|
|
52
|
-
createAnalyticsEvent: options.createAnalyticsEvent
|
|
53
|
-
}]).maybeAdd(historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, options.blockType]).add(clearMarksOnEmptyDocPlugin).maybeAdd([selectionToolbarPlugin, {
|
|
51
|
+
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, options.blockType]).add(clearMarksOnEmptyDocPlugin).maybeAdd([selectionToolbarPlugin, {
|
|
54
52
|
preferenceToolbarAboveSelection: false
|
|
55
53
|
}], function () {
|
|
56
54
|
if (getBooleanFF('platform.editor.enable-selection-toolbar_ucdwd')) {
|
|
@@ -133,7 +133,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
133
133
|
useLongPressSelection: false
|
|
134
134
|
}], Boolean(props.allowTasksAndDecisions || props.taskDecisionProvider)).maybeAdd([feedbackDialogPlugin, _objectSpread({
|
|
135
135
|
coreVersion: coreVersion
|
|
136
|
-
}, props.feedbackInfo)], Boolean(props.feedbackInfo)).maybeAdd([helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd(
|
|
136
|
+
}, props.feedbackInfo)], Boolean(props.feedbackInfo)).maybeAdd([helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd(
|
|
137
|
+
// duplicate plugin exists because first one if media is enabled
|
|
138
|
+
// second one when “media is disabled, and legacyMediaProvider is enabled
|
|
139
|
+
// @ts-expect-error
|
|
140
|
+
[mediaPlugin, {
|
|
137
141
|
allowMediaSingle: {
|
|
138
142
|
disableLayout: true
|
|
139
143
|
},
|
|
@@ -151,7 +155,13 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
151
155
|
extensionHandlers: props.extensionHandlers,
|
|
152
156
|
useLongPressSelection: false,
|
|
153
157
|
appearance: appearance
|
|
154
|
-
}], Boolean(props.allowExtension)).maybeAdd(
|
|
158
|
+
}], Boolean(props.allowExtension)).maybeAdd(
|
|
159
|
+
// we are ignoring a duplicate plugin error here
|
|
160
|
+
// this error exists because we have two annotation plugins being added
|
|
161
|
+
// one with annotationProviders and one with allowConfluenceInlineComment
|
|
162
|
+
// long term this and media should be consolidated into adding both only once
|
|
163
|
+
// @ts-expect-error
|
|
164
|
+
[annotationPlugin, undefined], Boolean(!props.annotationProviders && props.allowConfluenceInlineComment)).maybeAdd([datePlugin, {
|
|
155
165
|
weekStartDay: _typeof(props.allowDate) === 'object' ? props.allowDate.weekStartDay : undefined
|
|
156
166
|
}], Boolean(props.allowDate)).maybeAdd([placeholderTextPlugin,
|
|
157
167
|
// @ts-expect-error 2322: Type 'false | PlaceholderTextOptions | undefined'
|
package/dist/esm/test-utils.js
CHANGED
|
@@ -62,7 +62,13 @@ export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
|
|
|
62
62
|
var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new EditorPresetBuilder();
|
|
63
63
|
return function (pluginFactoryParams) {
|
|
64
64
|
var editorPlugins = [];
|
|
65
|
-
|
|
65
|
+
|
|
66
|
+
// we are ignoring the below because while this logic knows if
|
|
67
|
+
// basePlugin is in the inputPreset, the type system does not
|
|
68
|
+
// so it marks it as a duplicate plugin :) - this is fine
|
|
69
|
+
var preset = inputPreset.has(basePlugin) ? inputPreset :
|
|
70
|
+
// @ts-expect-error
|
|
71
|
+
inputPreset.add(basePlugin);
|
|
66
72
|
editorPlugins = preset.build({
|
|
67
73
|
pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
|
|
68
74
|
});
|
|
@@ -8,6 +8,7 @@ import React, { useMemo } from 'react';
|
|
|
8
8
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
9
9
|
import { telepointerStyle } from '@atlaskit/editor-common/collab';
|
|
10
10
|
import { EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
11
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
12
|
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
12
13
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
13
14
|
import { annotationSharedStyles, backgroundColorStyles, blockMarksSharedStyles, codeBlockInListSafariFix, codeMarkSharedStyles, dateSharedStyle, embedCardStyles, gridStyles, indentationSharedStyles, linkSharedStyle, listsSharedStyles, MediaSharedClassNames, paragraphSharedStyles, resizerStyles, ruleSharedStyles, shadowSharedStyle, SmartCardSharedCssClassName, smartCardSharedStyles, smartCardStyles, tasksAndDecisionsStyles, textColorStyles, unsupportedStyles, whitespaceSharedStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -21,6 +22,7 @@ import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSele
|
|
|
21
22
|
import { N200, N30A, N500 } from '@atlaskit/theme/colors';
|
|
22
23
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
23
24
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
25
|
+
import { usePresetContext } from '../../presets/context';
|
|
24
26
|
import { aiPanelStyles } from './ai-panels';
|
|
25
27
|
import { codeBlockStyles } from './code-block';
|
|
26
28
|
import { dateStyles } from './date';
|
|
@@ -59,7 +61,7 @@ export var placeholderStyles = css({
|
|
|
59
61
|
var contentStyles = function contentStyles(props) {
|
|
60
62
|
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\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 ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n .pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n clear: both;\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
|
|
61
63
|
theme: props.theme
|
|
62
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles, listsStyles, ruleStyles(), mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(), mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, taskDecisionStyles, statusStyles, annotationSharedStyles(), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, aiPanelStyles(props.colorMode), MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
64
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles, listsStyles, ruleStyles(), mediaStyles, layoutStyles(props.viewMode), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(), mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, taskDecisionStyles, statusStyles, annotationSharedStyles(), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, aiPanelStyles(props.colorMode), MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
63
65
|
};
|
|
64
66
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
65
67
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -69,13 +71,18 @@ export var createEditorContentStyle = function createEditorContentStyle(styles)
|
|
|
69
71
|
var theme = useTheme();
|
|
70
72
|
var _useThemeObserver = useThemeObserver(),
|
|
71
73
|
colorMode = _useThemeObserver.colorMode;
|
|
74
|
+
var editorAPI = usePresetContext();
|
|
75
|
+
var _useSharedPluginState = useSharedPluginState(editorAPI, ['editorViewMode']),
|
|
76
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
77
|
+
var viewMode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
72
78
|
var memoizedStyle = useMemo(function () {
|
|
73
79
|
return contentStyles({
|
|
74
80
|
theme: theme,
|
|
75
81
|
colorMode: colorMode,
|
|
76
|
-
featureFlags: featureFlags
|
|
82
|
+
featureFlags: featureFlags,
|
|
83
|
+
viewMode: viewMode
|
|
77
84
|
});
|
|
78
|
-
}, [theme, colorMode, featureFlags]);
|
|
85
|
+
}, [theme, colorMode, featureFlags, viewMode]);
|
|
79
86
|
return jsx("div", {
|
|
80
87
|
className: className,
|
|
81
88
|
ref: ref,
|
|
@@ -9,4 +9,6 @@ import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
|
9
9
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
12
|
-
export var layoutStyles =
|
|
12
|
+
export var layoutStyles = function layoutStyles(viewMode) {
|
|
13
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " [data-layout-section] {\n // TODO: Migrate away from gridSize\n // Recommendation: Replace directly with 7px\n margin: ", " -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: ", ";\n\n /* Inner cursor located 26px from left */\n [data-layout-column] {\n flex: 1;\n min-width: 0;\n border: ", "px solid\n ", ";\n border-radius: 4px;\n padding: ", "px;\n box-sizing: border-box;\n\n > div {\n > :not(style):first-child,\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n > .embedCardView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > style:first-child\n + .ProseMirror-gapcursor.-right\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > .ProseMirror-gapcursor.-right:first-of-type\n + .embedCardView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item,\n > style:first-child\n + .ProseMirror-gapcursor\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n > [data-node-type='decisionList'] {\n li:first-of-type [data-decision-wrapper] {\n margin-top: 0;\n }\n }\n }\n\n /* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n [data-layout-content] {\n height: 100%;\n cursor: text;\n .mediaGroupView-content-wrap {\n clear: both;\n }\n }\n }\n\n [data-layout-column] + [data-layout-column] {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n [data-layout-column] + [data-layout-column] {\n margin-left: 0;\n }\n }\n\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4441\n /* Shows the border when cursor is inside a layout */\n &.selected [data-layout-column],\n &:hover [data-layout-column] {\n border: ", "px solid\n ", ";\n }\n\n &.selected.danger > [data-layout-column] {\n background-color: ", ";\n border-color: ", ";\n }\n\n &.", ":not(.danger) {\n [data-layout-column] {\n ", "\n }\n }\n }\n }\n\n .fabric-editor--full-width-mode .ProseMirror {\n [data-layout-section] {\n .", " {\n margin: 0 ", "px;\n }\n }\n }\n"])), columnLayoutSharedStyle, "var(--ds-space-100, 8px)", akLayoutGutterOffset, akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N40A, ")"), LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, ".concat(N50A, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket]), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode);
|
|
14
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "193.19.
|
|
2
|
+
export var version = "193.19.6";
|
|
@@ -605,7 +605,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
605
605
|
actions: {
|
|
606
606
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
607
607
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
608
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
608
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
609
609
|
};
|
|
610
610
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
611
611
|
sharedState: import("@atlaskit/editor-plugins/media/types").MediaPluginState | null;
|
|
@@ -724,7 +724,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
724
724
|
actions: {
|
|
725
725
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
726
726
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
727
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
727
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
728
728
|
};
|
|
729
729
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
730
730
|
sharedState: {
|
|
@@ -1431,7 +1431,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
1431
1431
|
actions: {
|
|
1432
1432
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
1433
1433
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
1434
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
1434
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
1435
1435
|
};
|
|
1436
1436
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>, import("@atlaskit/editor-common/types").MaybePlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"extension", {
|
|
1437
1437
|
pluginConfiguration: import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined;
|
|
@@ -1840,7 +1840,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
1840
1840
|
actions: {
|
|
1841
1841
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
1842
1842
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
1843
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
1843
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
1844
1844
|
};
|
|
1845
1845
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
1846
1846
|
sharedState: import("@atlaskit/editor-plugins/media/types").MediaPluginState | null;
|
|
@@ -2571,7 +2571,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
2571
2571
|
actions: {
|
|
2572
2572
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
2573
2573
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
2574
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
2574
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
2575
2575
|
};
|
|
2576
2576
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
2577
2577
|
sharedState: import("@atlaskit/editor-plugins/media/types").MediaPluginState | null;
|
|
@@ -2644,7 +2644,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
2644
2644
|
actions: {
|
|
2645
2645
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
2646
2646
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
2647
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
2647
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
2648
2648
|
};
|
|
2649
2649
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>, import("@atlaskit/editor-common/types").MaybePlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"grid", {
|
|
2650
2650
|
pluginConfiguration: import("@atlaskit/editor-plugin-grid").GridPluginOptions | undefined;
|
|
@@ -3416,7 +3416,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
3416
3416
|
actions: {
|
|
3417
3417
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
3418
3418
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3419
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
3419
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3420
3420
|
};
|
|
3421
3421
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
3422
3422
|
sharedState: import("@atlaskit/editor-plugins/media/types").MediaPluginState | null;
|
|
@@ -4367,7 +4367,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
4367
4367
|
actions: {
|
|
4368
4368
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
4369
4369
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4370
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
4370
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4371
4371
|
};
|
|
4372
4372
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
4373
4373
|
sharedState: import("@atlaskit/editor-plugins/media/types").MediaPluginState | null;
|
|
@@ -4486,7 +4486,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
4486
4486
|
actions: {
|
|
4487
4487
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: import("prosemirror-state").EditorState) => boolean | undefined;
|
|
4488
4488
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: import("@atlaskit/editor-plugin-annotation").InlineCommentInputMethod, targetType?: import("@atlaskit/editor-plugin-annotation").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4489
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
4489
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4490
4490
|
};
|
|
4491
4491
|
}, import("@atlaskit/editor-plugin-annotation").AnnotationProviders | undefined>>];
|
|
4492
4492
|
sharedState: {
|