@atlaskit/editor-core 190.2.2 → 190.2.3
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 +10 -0
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -13
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +3 -1
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -4
- package/dist/cjs/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +72 -4
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +2 -11
- package/dist/cjs/ui/ContentStyles/extension.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/ContentStyles/layout.js +2 -13
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +6 -14
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +3 -1
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -4
- package/dist/es2019/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +77 -5
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +5 -13
- package/dist/es2019/ui/ContentStyles/extension.js +5 -4
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ContentStyles/layout.js +5 -16
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +3 -14
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +3 -1
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -4
- package/dist/esm/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +74 -5
- package/dist/esm/plugins/extension/ui/Extension/styles.js +3 -12
- package/dist/esm/ui/ContentStyles/extension.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ContentStyles/layout.js +2 -15
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/styles.d.ts +2 -3
- package/dist/types/plugins/extension/ui/Extension/InlineExtension/styles.d.ts +1 -2
- package/dist/types/plugins/extension/ui/Extension/MultiBodiedExtension/index.d.ts +9 -1
- package/dist/types/plugins/extension/ui/Extension/styles.d.ts +1 -2
- package/dist/types/ui/ContentStyles/layout.d.ts +1 -2
- package/dist/types-ts4.5/plugins/extension/ui/Extension/Extension/styles.d.ts +2 -3
- package/dist/types-ts4.5/plugins/extension/ui/Extension/InlineExtension/styles.d.ts +1 -2
- package/dist/types-ts4.5/plugins/extension/ui/Extension/MultiBodiedExtension/index.d.ts +9 -1
- package/dist/types-ts4.5/plugins/extension/ui/Extension/styles.d.ts +1 -2
- package/dist/types-ts4.5/ui/ContentStyles/layout.d.ts +1 -2
- package/package.json +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 190.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#64335](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64335) [`efc8826c907f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/efc8826c907f) - [ux] [ED-16509] Restart numbered list inserting nodes via QUICK INSERT, nodes including : panels, expands, decisions, tables, layout, quotes, actions, dividers, headings. Changes are being guarded behind feature flag platform.editor.ordered-list-inserting-nodes_bh0vo
|
|
8
|
+
- [#65015](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65015) [`15b8e45585f2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15b8e45585f2) - [ux] ED-21757 Fix for width change buttons in MBE floating toolbar.
|
|
9
|
+
- [#64281](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64281) [`b523d60b380c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b523d60b380c) - Remove legacy theming logic from @atlaskit/editor-core and @atlaskit/renderer. Theming is still available via @atlaskit/tokens.
|
|
10
|
+
- [#63266](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63266) [`630f6c9fc80c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/630f6c9fc80c) - ED-21576: Added new Example for MBE - Interactive Fake Tabs
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 190.2.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -7,22 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.wrapperStyle = exports.widerLayoutClassName = exports.header = exports.contentWrapper = exports.content = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
-
var _components = require("@atlaskit/theme/components");
|
|
11
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
12
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
11
|
var _styles = require("../styles");
|
|
14
12
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
15
13
|
var widerLayoutClassName = exports.widerLayoutClassName = 'wider-layout';
|
|
16
|
-
var wrapperStyle = exports.wrapperStyle =
|
|
17
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n &.without-frame {\n background: transparent;\n }\n cursor: pointer;\n width: 100%;\n\n .extension-overflow-wrapper:not(.with-body) {\n overflow-x: auto;\n }\n"])), (0, _styles.wrapperDefault)(theme));
|
|
18
|
-
};
|
|
14
|
+
var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n &.without-frame {\n background: transparent;\n }\n cursor: pointer;\n width: 100%;\n\n .extension-overflow-wrapper:not(.with-body) {\n overflow-x: auto;\n }\n"])), _styles.wrapperDefault);
|
|
19
15
|
var header = exports.header = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px 0px;\n vertical-align: middle;\n\n &.with-children:not(.without-frame) {\n padding: ", " ", "\n ", ";\n }\n &.without-frame {\n padding: 0;\n }\n"])), _styles.padding / 2, _styles.padding / 2, "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
20
|
-
var content = exports.content =
|
|
21
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n width: 100%;\n"])), _styles.padding, (0, _components.themed)({
|
|
22
|
-
light: "var(--ds-surface, white)",
|
|
23
|
-
dark: "var(--ds-surface, ".concat(_colors.DN30, ")")
|
|
24
|
-
})(theme), (0, _components.themed)({
|
|
25
|
-
dark: "var(--ds-text, ".concat(_colors.DN900, ")")
|
|
26
|
-
})(theme), "var(--ds-border, ".concat(_colors.N30, ")"), (0, _constants.borderRadius)());
|
|
27
|
-
};
|
|
16
|
+
var content = exports.content = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px;\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n cursor: initial;\n width: 100%;\n"])), _styles.padding, "var(--ds-surface, white)", "var(--ds-border, ".concat(_colors.N30, ")"), "var(--ds-border-radius, 3px)");
|
|
28
17
|
var contentWrapper = exports.contentWrapper = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 ", "px ", "px;\n display: flex;\n justify-content: center;\n"])), _styles.padding, _styles.padding);
|
|
@@ -201,7 +201,9 @@ var ExtensionComponent = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
201
201
|
getPos: getPos,
|
|
202
202
|
handleContentDOMRef: handleContentDOMRef,
|
|
203
203
|
tryExtensionHandler: this.tryExtensionHandler.bind(this),
|
|
204
|
-
eventDispatcher: eventDispatcher
|
|
204
|
+
eventDispatcher: eventDispatcher,
|
|
205
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
206
|
+
editorAppearance: editorAppearance
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
209
|
var extensionHandlerResult = this.tryExtensionHandler(undefined);
|
|
@@ -7,9 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.wrapperStyle = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
11
10
|
var _styles = require("../styles");
|
|
12
11
|
var _templateObject;
|
|
13
|
-
var wrapperStyle = exports.wrapperStyle =
|
|
14
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px 1px ", ";\n\n > img {\n border-radius: ", "px;\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), (0, _styles.wrapperDefault)(theme), "var(--ds-space-050, 4px)", (0, _constants.borderRadius)(), "var(--ds-background-neutral-subtle, white)");
|
|
15
|
-
};
|
|
12
|
+
var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px 1px ", ";\n\n > img {\n border-radius: ", ";\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), _styles.wrapperDefault, "var(--ds-space-050, 4px)", "var(--ds-border-radius, 3px)", "var(--ds-background-neutral-subtle, white)");
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -15,6 +17,8 @@ var _react2 = _interopRequireWildcard(require("react"));
|
|
|
15
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
18
|
var _eventDispatcher = require("@atlaskit/editor-common/event-dispatcher");
|
|
17
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
21
|
+
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
18
22
|
var _templateObject, _templateObject2;
|
|
19
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -125,14 +129,16 @@ var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActions(_re
|
|
|
125
129
|
}, [node, editorView, getPos, updateActiveChild, eventDispatcher]);
|
|
126
130
|
return actions;
|
|
127
131
|
};
|
|
128
|
-
var navigationCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n
|
|
129
|
-
var
|
|
132
|
+
var navigationCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n"])), "var(--ds-border, ".concat(_colors.N40, ")"));
|
|
133
|
+
var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2) {
|
|
130
134
|
var node = _ref2.node,
|
|
131
135
|
handleContentDOMRef = _ref2.handleContentDOMRef,
|
|
132
136
|
getPos = _ref2.getPos,
|
|
133
137
|
tryExtensionHandler = _ref2.tryExtensionHandler,
|
|
134
138
|
editorView = _ref2.editorView,
|
|
135
|
-
eventDispatcher = _ref2.eventDispatcher
|
|
139
|
+
eventDispatcher = _ref2.eventDispatcher,
|
|
140
|
+
widthState = _ref2.widthState,
|
|
141
|
+
editorAppearance = _ref2.editorAppearance;
|
|
136
142
|
var _useState = (0, _react2.useState)(0),
|
|
137
143
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
138
144
|
activeChildIndex = _useState2[0],
|
|
@@ -160,11 +166,27 @@ var MultiBodiedExtension = function MultiBodiedExtension(_ref2) {
|
|
|
160
166
|
return handleContentDOMRef(node);
|
|
161
167
|
}, [handleContentDOMRef]);
|
|
162
168
|
var containerCSS = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n min-height: 100px;\n .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true'] {\n display: none;\n }\n\n .multiBodiedExtension-content-dom-wrapper\n > [data-extension-frame='true']:nth-of-type(", ") {\n border: 1px solid ", ";\n display: block;\n min-height: 100px;\n }\n "])), "var(--ds-border, ".concat(_colors.N30, ")"), activeChildIndex + 1, "var(--ds-border, ".concat(_colors.N50, ")"));
|
|
169
|
+
var shouldBreakout =
|
|
170
|
+
// Extension should breakout when the layout is set to 'full-width' or 'wide'.
|
|
171
|
+
['full-width', 'wide'].includes(node.attrs.layout) &&
|
|
172
|
+
// Extension breakout state should not be respected when the editor appearance is full-width mode
|
|
173
|
+
editorAppearance !== 'full-width';
|
|
174
|
+
var mbeContainerStyles = {};
|
|
175
|
+
if (shouldBreakout) {
|
|
176
|
+
var _calculateBreakoutSty = (0, _utils.calculateBreakoutStyles)({
|
|
177
|
+
mode: node.attrs.layout,
|
|
178
|
+
widthStateLineLength: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
179
|
+
widthStateWidth: widthState === null || widthState === void 0 ? void 0 : widthState.width
|
|
180
|
+
}),
|
|
181
|
+
breakoutStyles = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_calculateBreakoutSty), _calculateBreakoutSty));
|
|
182
|
+
mbeContainerStyles = breakoutStyles;
|
|
183
|
+
}
|
|
163
184
|
return (0, _react.jsx)("section", {
|
|
164
185
|
className: "multiBodiedExtension--container",
|
|
165
186
|
css: containerCSS,
|
|
166
187
|
"data-testid": "multiBodiedExtension--container",
|
|
167
|
-
"data-active-child-index": activeChildIndex
|
|
188
|
+
"data-active-child-index": activeChildIndex,
|
|
189
|
+
style: mbeContainerStyles
|
|
168
190
|
}, (0, _react.jsx)("nav", {
|
|
169
191
|
className: "multiBodiedExtension-navigation",
|
|
170
192
|
css: navigationCSS,
|
|
@@ -192,4 +214,50 @@ var sendMBEAnalyticsEvent = function sendMBEAnalyticsEvent(action, node, eventDi
|
|
|
192
214
|
}
|
|
193
215
|
});
|
|
194
216
|
};
|
|
217
|
+
var MultiBodiedExtensionWithSharedState = function MultiBodiedExtensionWithSharedState(props) {
|
|
218
|
+
var pluginInjectionApi = props.pluginInjectionApi;
|
|
219
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
|
|
220
|
+
widthState = _useSharedPluginState.widthState;
|
|
221
|
+
return (0, _react.jsx)(MultiBodiedExtensionWithWidth, (0, _extends2.default)({
|
|
222
|
+
widthState: widthState
|
|
223
|
+
}, props));
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// Workaround taken from platform/packages/editor/editor-core/src/plugins/extension/ui/Extension/Extension/index.tsx
|
|
227
|
+
var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
228
|
+
// TODO: ED-17836 This code is here because confluence injects
|
|
229
|
+
// the `editor-referentiality` plugin via `dangerouslyAppendPlugins`
|
|
230
|
+
// which cannot access the `pluginInjectionApi`. When we move
|
|
231
|
+
// Confluence to using presets we can remove this workaround.
|
|
232
|
+
var pluginInjectionApi = props.pluginInjectionApi;
|
|
233
|
+
return pluginInjectionApi === undefined ? (0, _react.jsx)(MultiBodiedExtensionDeprecated, props) : (0, _react.jsx)(MultiBodiedExtensionWithSharedState, props);
|
|
234
|
+
};
|
|
235
|
+
// TODO: ED-17836 This code is here because Confluence injects
|
|
236
|
+
// the `editor-referentiality` plugin via `dangerouslyAppendPlugins`
|
|
237
|
+
// which cannot access the `pluginInjectionApi`. When we move
|
|
238
|
+
// Confluence to using presets we can remove this workaround.
|
|
239
|
+
// @ts-ignore
|
|
240
|
+
var widthPluginKey = {
|
|
241
|
+
key: 'widthPlugin$',
|
|
242
|
+
getState: function getState(state) {
|
|
243
|
+
return state['widthPlugin$'];
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var MultiBodiedExtensionDeprecated = function MultiBodiedExtensionDeprecated(props) {
|
|
247
|
+
return (0, _react.jsx)(_withPluginState.WithPluginState, {
|
|
248
|
+
editorView: props.editorView,
|
|
249
|
+
plugins: {
|
|
250
|
+
widthState: widthPluginKey
|
|
251
|
+
},
|
|
252
|
+
render: function render(_ref3) {
|
|
253
|
+
var widthState = _ref3.widthState;
|
|
254
|
+
return (0, _react.jsx)(MultiBodiedExtensionWithWidth, (0, _extends2.default)({
|
|
255
|
+
widthState: widthState
|
|
256
|
+
}, props));
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* End workaround
|
|
262
|
+
*/
|
|
195
263
|
var _default = exports.default = MultiBodiedExtension;
|
|
@@ -20,20 +20,11 @@ Object.defineProperty(exports, "padding", {
|
|
|
20
20
|
exports.wrapperDefault = exports.styledImage = exports.placeholderFallbackParams = exports.placeholderFallback = void 0;
|
|
21
21
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
22
22
|
var _react = require("@emotion/react");
|
|
23
|
-
var _components = require("@atlaskit/theme/components");
|
|
24
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
25
23
|
var _colors = require("@atlaskit/theme/colors");
|
|
26
24
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
27
25
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
28
|
-
var wrapperDefault = exports.wrapperDefault =
|
|
29
|
-
|
|
30
|
-
light: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
31
|
-
dark: "var(--ds-background-neutral, ".concat(_colors.DN50, ")")
|
|
32
|
-
})(theme), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
33
|
-
dark: "var(--ds-text, ".concat(_colors.DN700, ")")
|
|
34
|
-
})(theme), "var(--ds-border-selected, ".concat(_colors.B200, ")"), "var(--ds-background-neutral-hovered, ".concat(_colors.N20A, ")"));
|
|
35
|
-
};
|
|
36
|
-
var overlay = exports.overlay = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s;\n"])), (0, _constants.borderRadius)());
|
|
26
|
+
var wrapperDefault = exports.wrapperDefault = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-radius: ", ";\n position: relative;\n vertical-align: middle;\n\n .ProseMirror-selectednode > span > & > .extension-overlay {\n box-shadow: inset 0px 0px 0px 2px ", ";\n opacity: 1;\n }\n\n &.with-overlay {\n .extension-overlay {\n background: ", ";\n color: transparent;\n }\n\n &:hover .extension-overlay {\n opacity: 1;\n }\n }\n"])), "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", "var(--ds-border-selected, ".concat(_colors.B200, ")"), "var(--ds-background-neutral-hovered, ".concat(_colors.N20A, ")"));
|
|
27
|
+
var overlay = exports.overlay = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s;\n"])), "var(--ds-border-radius, 3px)");
|
|
37
28
|
var placeholderFallback = exports.placeholderFallback = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n align-items: center;\n\n & > img {\n margin: 0 ", ";\n }\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: placeholder-fallback;\n"])), "var(--ds-space-050, 4px)");
|
|
38
29
|
var placeholderFallbackParams = exports.placeholderFallbackParams = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n max-width: 200px;\n margin-left: 5px;\n color: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])), "var(--ds-text-subtlest, ".concat(_colors.N70, ")"));
|
|
39
30
|
var styledImage = exports.styledImage = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-height: 16px;\n max-width: 16px;\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: lozenge-image;\n"])));
|
|
@@ -10,4 +10,4 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
11
|
var _templateObject;
|
|
12
12
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
13
|
-
var extensionStyles = exports.extensionStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .multiBodiedExtensionView-content-wrap
|
|
13
|
+
var extensionStyles = exports.extensionStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .multiBodiedExtensionView-content-wrap {\n &.danger > span > .multiBodiedExtension--container {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n }\n &:not(.danger).", " {\n & > span > .multiBodiedExtension--container {\n ", "\n }\n }\n .multiBodiedExtension--container {\n width: 100%;\n max-width: 100%; // ensure width can't go over 100%;\n }\n }\n\n .extensionView-content-wrap,\n .multiBodiedExtensionView-content-wrap,\n .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n\n &:first-of-type {\n margin-top: 0;\n }\n\n &:last-of-type {\n margin-bottom: 0;\n }\n\n &:not(.danger).", " {\n & > span > .extension-container {\n ", "\n }\n }\n\n &.danger > span > .extension-container {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n }\n\n &.inline {\n word-wrap: break-all;\n }\n }\n\n .extensionView-content-wrap .extension-container {\n overflow: hidden;\n }\n\n .bodiedExtensionView-content-wrap\n .extensionView-content-wrap\n .extension-container {\n width: 100%;\n max-width: 100%; // ensure width can't go over 100%;\n }\n\n [data-mark-type='fragment'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n }\n }\n\n &:first-child {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-top: 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-top: 0;\n }\n }\n }\n\n &:nth-last-of-type(-n + 2):not(:first-of-type) {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-bottom: 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-bottom: 0;\n }\n }\n }\n }\n"])), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin);
|
|
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
|
|
|
47
47
|
var contentStyles = function contentStyles(props) {
|
|
48
48
|
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (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 .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\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)({
|
|
49
49
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles3.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, listsStyles, ruleStyles(), _media.mediaStyles,
|
|
50
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles3.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, listsStyles, ruleStyles(), _media.mediaStyles, _layout.layoutStyles, _styles2.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)(), _styles6.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
51
51
|
};
|
|
52
52
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
53
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -19,21 +19,10 @@ Object.defineProperty(exports, "LAYOUT_SECTION_MARGIN", {
|
|
|
19
19
|
exports.layoutStyles = void 0;
|
|
20
20
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
21
21
|
var _react = require("@emotion/react");
|
|
22
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
23
22
|
var _colors = require("@atlaskit/theme/colors");
|
|
24
|
-
var _components = require("@atlaskit/theme/components");
|
|
25
23
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
26
24
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
27
25
|
var _types = require("@atlaskit/editor-plugin-table/types");
|
|
28
26
|
var _consts = require("@atlaskit/editor-plugin-table/ui/consts");
|
|
29
|
-
var _templateObject;
|
|
30
|
-
//
|
|
31
|
-
var layoutStyles = exports.layoutStyles = function layoutStyles(props) {
|
|
32
|
-
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 -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\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 }\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, (0, _constants.gridSize)() - 1, _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSelectedBorderSize, (0, _components.themed)({
|
|
33
|
-
light: "var(--ds-border, ".concat(_colors.N40A, ")"),
|
|
34
|
-
dark: "var(--ds-border, ".concat(_colors.DN70, ")")
|
|
35
|
-
})(props), _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.akEditorSelectedBorderSize, (0, _components.themed)({
|
|
36
|
-
light: "var(--ds-border, ".concat(_colors.N50A, ")"),
|
|
37
|
-
dark: "var(--ds-border, ".concat(_colors.DN80, ")")
|
|
38
|
-
})(props), "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);
|
|
39
|
-
};
|
|
27
|
+
var _templateObject;
|
|
28
|
+
var layoutStyles = exports.layoutStyles = (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 -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\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 }\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, 8 - 1, _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, _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);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import {
|
|
3
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
4
|
-
import { DN30, DN900, N30 } from '@atlaskit/theme/colors';
|
|
2
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
5
3
|
import { wrapperDefault, padding } from '../styles';
|
|
6
4
|
export const widerLayoutClassName = 'wider-layout';
|
|
7
|
-
export const wrapperStyle =
|
|
8
|
-
${wrapperDefault
|
|
5
|
+
export const wrapperStyle = css`
|
|
6
|
+
${wrapperDefault}
|
|
9
7
|
|
|
10
8
|
&.without-frame {
|
|
11
9
|
background: transparent;
|
|
@@ -29,17 +27,11 @@ export const header = css`
|
|
|
29
27
|
padding: 0;
|
|
30
28
|
}
|
|
31
29
|
`;
|
|
32
|
-
export const content =
|
|
30
|
+
export const content = css`
|
|
33
31
|
padding: ${padding}px;
|
|
34
|
-
background: ${
|
|
35
|
-
light: "var(--ds-surface, white)",
|
|
36
|
-
dark: `var(--ds-surface, ${DN30})`
|
|
37
|
-
})(theme)};
|
|
38
|
-
color: ${themed({
|
|
39
|
-
dark: `var(--ds-text, ${DN900})`
|
|
40
|
-
})(theme)};
|
|
32
|
+
background: ${"var(--ds-surface, white)"};
|
|
41
33
|
border: 1px solid ${`var(--ds-border, ${N30})`};
|
|
42
|
-
border-radius: ${
|
|
34
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
43
35
|
cursor: initial;
|
|
44
36
|
width: 100%;
|
|
45
37
|
`;
|
|
@@ -155,7 +155,9 @@ export default class ExtensionComponent extends Component {
|
|
|
155
155
|
getPos: getPos,
|
|
156
156
|
handleContentDOMRef: handleContentDOMRef,
|
|
157
157
|
tryExtensionHandler: this.tryExtensionHandler.bind(this),
|
|
158
|
-
eventDispatcher: eventDispatcher
|
|
158
|
+
eventDispatcher: eventDispatcher,
|
|
159
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
160
|
+
editorAppearance: editorAppearance
|
|
159
161
|
});
|
|
160
162
|
}
|
|
161
163
|
const extensionHandlerResult = this.tryExtensionHandler(undefined);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
3
2
|
import { wrapperDefault } from '../styles';
|
|
4
|
-
export const wrapperStyle =
|
|
5
|
-
${wrapperDefault
|
|
3
|
+
export const wrapperStyle = css`
|
|
4
|
+
${wrapperDefault}
|
|
6
5
|
|
|
7
6
|
cursor: pointer;
|
|
8
7
|
display: inline-flex;
|
|
9
8
|
margin: 1px 1px ${"var(--ds-space-050, 4px)"};
|
|
10
9
|
|
|
11
10
|
> img {
|
|
12
|
-
border-radius: ${
|
|
11
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
&::after,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
|
|
3
4
|
import { jsx, css } from '@emotion/react';
|
|
@@ -5,7 +6,8 @@ import { N30, N40, N50 } from '@atlaskit/theme/colors';
|
|
|
5
6
|
import React, { useState } from 'react';
|
|
6
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
8
|
import { createDispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
-
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { analyticsEventKey, calculateBreakoutStyles } from '@atlaskit/editor-common/utils';
|
|
10
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
9
11
|
const useMultiBodiedExtensionActions = ({
|
|
10
12
|
updateActiveChild,
|
|
11
13
|
editorView,
|
|
@@ -128,15 +130,16 @@ const navigationCSS = css`
|
|
|
128
130
|
user-select: none;
|
|
129
131
|
-webkit-user-modify: read-only;
|
|
130
132
|
border: 1px solid ${`var(--ds-border, ${N40})`};
|
|
131
|
-
background-color: ${`var(--ds-background-inverse-subtle, ${N50})`};
|
|
132
133
|
`;
|
|
133
|
-
const
|
|
134
|
+
const MultiBodiedExtensionWithWidth = ({
|
|
134
135
|
node,
|
|
135
136
|
handleContentDOMRef,
|
|
136
137
|
getPos,
|
|
137
138
|
tryExtensionHandler,
|
|
138
139
|
editorView,
|
|
139
|
-
eventDispatcher
|
|
140
|
+
eventDispatcher,
|
|
141
|
+
widthState,
|
|
142
|
+
editorAppearance
|
|
140
143
|
}) => {
|
|
141
144
|
const [activeChildIndex, setActiveChildIndex] = useState(0);
|
|
142
145
|
// Adding to avoid aliasing `this` for the callbacks
|
|
@@ -175,11 +178,28 @@ const MultiBodiedExtension = ({
|
|
|
175
178
|
min-height: 100px;
|
|
176
179
|
}
|
|
177
180
|
`;
|
|
181
|
+
const shouldBreakout =
|
|
182
|
+
// Extension should breakout when the layout is set to 'full-width' or 'wide'.
|
|
183
|
+
['full-width', 'wide'].includes(node.attrs.layout) &&
|
|
184
|
+
// Extension breakout state should not be respected when the editor appearance is full-width mode
|
|
185
|
+
editorAppearance !== 'full-width';
|
|
186
|
+
let mbeContainerStyles = {};
|
|
187
|
+
if (shouldBreakout) {
|
|
188
|
+
const {
|
|
189
|
+
...breakoutStyles
|
|
190
|
+
} = calculateBreakoutStyles({
|
|
191
|
+
mode: node.attrs.layout,
|
|
192
|
+
widthStateLineLength: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
193
|
+
widthStateWidth: widthState === null || widthState === void 0 ? void 0 : widthState.width
|
|
194
|
+
});
|
|
195
|
+
mbeContainerStyles = breakoutStyles;
|
|
196
|
+
}
|
|
178
197
|
return jsx("section", {
|
|
179
198
|
className: "multiBodiedExtension--container",
|
|
180
199
|
css: containerCSS,
|
|
181
200
|
"data-testid": "multiBodiedExtension--container",
|
|
182
|
-
"data-active-child-index": activeChildIndex
|
|
201
|
+
"data-active-child-index": activeChildIndex,
|
|
202
|
+
style: mbeContainerStyles
|
|
183
203
|
}, jsx("nav", {
|
|
184
204
|
className: "multiBodiedExtension-navigation",
|
|
185
205
|
css: navigationCSS,
|
|
@@ -207,4 +227,56 @@ const sendMBEAnalyticsEvent = (action, node, eventDispatcher) => {
|
|
|
207
227
|
}
|
|
208
228
|
});
|
|
209
229
|
};
|
|
230
|
+
const MultiBodiedExtensionWithSharedState = props => {
|
|
231
|
+
const {
|
|
232
|
+
pluginInjectionApi
|
|
233
|
+
} = props;
|
|
234
|
+
const {
|
|
235
|
+
widthState
|
|
236
|
+
} = useSharedPluginState(pluginInjectionApi, ['width']);
|
|
237
|
+
return jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
238
|
+
widthState: widthState
|
|
239
|
+
}, props));
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// Workaround taken from platform/packages/editor/editor-core/src/plugins/extension/ui/Extension/Extension/index.tsx
|
|
243
|
+
const MultiBodiedExtension = props => {
|
|
244
|
+
// TODO: ED-17836 This code is here because confluence injects
|
|
245
|
+
// the `editor-referentiality` plugin via `dangerouslyAppendPlugins`
|
|
246
|
+
// which cannot access the `pluginInjectionApi`. When we move
|
|
247
|
+
// Confluence to using presets we can remove this workaround.
|
|
248
|
+
const {
|
|
249
|
+
pluginInjectionApi
|
|
250
|
+
} = props;
|
|
251
|
+
return pluginInjectionApi === undefined ? jsx(MultiBodiedExtensionDeprecated, props) : jsx(MultiBodiedExtensionWithSharedState, props);
|
|
252
|
+
};
|
|
253
|
+
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
254
|
+
// TODO: ED-17836 This code is here because Confluence injects
|
|
255
|
+
// the `editor-referentiality` plugin via `dangerouslyAppendPlugins`
|
|
256
|
+
// which cannot access the `pluginInjectionApi`. When we move
|
|
257
|
+
// Confluence to using presets we can remove this workaround.
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
const widthPluginKey = {
|
|
260
|
+
key: 'widthPlugin$',
|
|
261
|
+
getState: state => {
|
|
262
|
+
return state['widthPlugin$'];
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const MultiBodiedExtensionDeprecated = props => {
|
|
266
|
+
return jsx(WithPluginState, {
|
|
267
|
+
editorView: props.editorView,
|
|
268
|
+
plugins: {
|
|
269
|
+
widthState: widthPluginKey
|
|
270
|
+
},
|
|
271
|
+
render: ({
|
|
272
|
+
widthState
|
|
273
|
+
}) => jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
274
|
+
widthState: widthState
|
|
275
|
+
}, props))
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* End workaround
|
|
280
|
+
*/
|
|
281
|
+
|
|
210
282
|
export default MultiBodiedExtension;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import {
|
|
3
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
4
|
-
import { N20, DN50, DN700, B200, N20A, N70 } from '@atlaskit/theme/colors';
|
|
2
|
+
import { N20, B200, N20A, N70 } from '@atlaskit/theme/colors';
|
|
5
3
|
import { EXTENSION_PADDING, BODIED_EXT_PADDING } from '@atlaskit/editor-common/styles';
|
|
6
4
|
export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
|
|
7
|
-
export const wrapperDefault =
|
|
8
|
-
background: ${
|
|
9
|
-
|
|
10
|
-
dark: `var(--ds-background-neutral, ${DN50})`
|
|
11
|
-
})(theme)};
|
|
12
|
-
border-radius: ${borderRadius()}px;
|
|
13
|
-
color: ${themed({
|
|
14
|
-
dark: `var(--ds-text, ${DN700})`
|
|
15
|
-
})(theme)};
|
|
5
|
+
export const wrapperDefault = css`
|
|
6
|
+
background: ${`var(--ds-background-neutral, ${N20})`};
|
|
7
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
16
8
|
position: relative;
|
|
17
9
|
vertical-align: middle;
|
|
18
10
|
|
|
@@ -33,7 +25,7 @@ export const wrapperDefault = theme => css`
|
|
|
33
25
|
}
|
|
34
26
|
`;
|
|
35
27
|
export const overlay = css`
|
|
36
|
-
border-radius: ${
|
|
28
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
37
29
|
position: absolute;
|
|
38
30
|
width: 100%;
|
|
39
31
|
height: 100%;
|
|
@@ -2,16 +2,17 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { blockNodesVerticalMargin, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackground, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
4
4
|
export const extensionStyles = css`
|
|
5
|
-
.multiBodiedExtensionView-content-wrap.${akEditorSelectedNodeClassName}:not(.danger) {
|
|
6
|
-
${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket])}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
5
|
.multiBodiedExtensionView-content-wrap {
|
|
10
6
|
&.danger > span > .multiBodiedExtension--container {
|
|
11
7
|
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
12
8
|
${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
|
|
13
9
|
background-color: ${`var(--ds-background-danger, ${akEditorDeleteBackground})`};
|
|
14
10
|
}
|
|
11
|
+
&:not(.danger).${akEditorSelectedNodeClassName} {
|
|
12
|
+
& > span > .multiBodiedExtension--container {
|
|
13
|
+
${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket])}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
.multiBodiedExtension--container {
|
|
16
17
|
width: 100%;
|
|
17
18
|
max-width: 100%; // ensure width can't go over 100%;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
import { N40A, N50A, DN70, DN80 } from '@atlaskit/theme/colors';
|
|
6
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
7
|
-
import { themed } from '@atlaskit/theme/components';
|
|
2
|
+
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
8
3
|
import { columnLayoutSharedStyle, LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
|
|
9
4
|
import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
10
5
|
import { TableCssClassName } from '@atlaskit/editor-plugin-table/types';
|
|
11
6
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugin-table/ui/consts';
|
|
12
7
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
13
|
-
export const layoutStyles =
|
|
8
|
+
export const layoutStyles = css`
|
|
14
9
|
.ProseMirror {
|
|
15
10
|
${columnLayoutSharedStyle} [data-layout-section] {
|
|
16
11
|
// TODO: Migrate away from gridSize
|
|
17
12
|
// Recommendation: Replace directly with 7px
|
|
18
|
-
margin: ${
|
|
13
|
+
margin: ${8 - 1}px -${akLayoutGutterOffset}px 0;
|
|
19
14
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
20
15
|
cursor: pointer;
|
|
21
16
|
|
|
@@ -24,10 +19,7 @@ export const layoutStyles = props => css`
|
|
|
24
19
|
flex: 1;
|
|
25
20
|
min-width: 0;
|
|
26
21
|
border: ${akEditorSelectedBorderSize}px solid
|
|
27
|
-
${
|
|
28
|
-
light: `var(--ds-border, ${N40A})`,
|
|
29
|
-
dark: `var(--ds-border, ${DN70})`
|
|
30
|
-
})(props)};
|
|
22
|
+
${`var(--ds-border, ${N40A})`};
|
|
31
23
|
border-radius: 4px;
|
|
32
24
|
padding: ${LAYOUT_COLUMN_PADDING}px;
|
|
33
25
|
box-sizing: border-box;
|
|
@@ -115,10 +107,7 @@ export const layoutStyles = props => css`
|
|
|
115
107
|
&.selected [data-layout-column],
|
|
116
108
|
&:hover [data-layout-column] {
|
|
117
109
|
border: ${akEditorSelectedBorderSize}px solid
|
|
118
|
-
${
|
|
119
|
-
light: `var(--ds-border, ${N50A})`,
|
|
120
|
-
dark: `var(--ds-border, ${DN80})`
|
|
121
|
-
})(props)};
|
|
110
|
+
${`var(--ds-border, ${N50A})`};
|
|
122
111
|
}
|
|
123
112
|
|
|
124
113
|
&.selected.danger > [data-layout-column] {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "190.2.
|
|
2
|
+
export const version = "190.2.3";
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
6
|
-
import { DN30, DN900, N30 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
7
5
|
import { wrapperDefault, padding } from '../styles';
|
|
8
6
|
export var widerLayoutClassName = 'wider-layout';
|
|
9
|
-
export var wrapperStyle =
|
|
10
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n &.without-frame {\n background: transparent;\n }\n cursor: pointer;\n width: 100%;\n\n .extension-overflow-wrapper:not(.with-body) {\n overflow-x: auto;\n }\n"])), wrapperDefault(theme));
|
|
11
|
-
};
|
|
7
|
+
export var wrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n &.without-frame {\n background: transparent;\n }\n cursor: pointer;\n width: 100%;\n\n .extension-overflow-wrapper:not(.with-body) {\n overflow-x: auto;\n }\n"])), wrapperDefault);
|
|
12
8
|
export var header = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", "px ", "px 0px;\n vertical-align: middle;\n\n &.with-children:not(.without-frame) {\n padding: ", " ", "\n ", ";\n }\n &.without-frame {\n padding: 0;\n }\n"])), padding / 2, padding / 2, "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
13
|
-
export var content =
|
|
14
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n width: 100%;\n"])), padding, themed({
|
|
15
|
-
light: "var(--ds-surface, white)",
|
|
16
|
-
dark: "var(--ds-surface, ".concat(DN30, ")")
|
|
17
|
-
})(theme), themed({
|
|
18
|
-
dark: "var(--ds-text, ".concat(DN900, ")")
|
|
19
|
-
})(theme), "var(--ds-border, ".concat(N30, ")"), borderRadius());
|
|
20
|
-
};
|
|
9
|
+
export var content = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n cursor: initial;\n width: 100%;\n"])), padding, "var(--ds-surface, white)", "var(--ds-border, ".concat(N30, ")"), "var(--ds-border-radius, 3px)");
|
|
21
10
|
export var contentWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px ", "px;\n display: flex;\n justify-content: center;\n"])), padding, padding);
|
|
@@ -192,7 +192,9 @@ var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
192
192
|
getPos: getPos,
|
|
193
193
|
handleContentDOMRef: handleContentDOMRef,
|
|
194
194
|
tryExtensionHandler: this.tryExtensionHandler.bind(this),
|
|
195
|
-
eventDispatcher: eventDispatcher
|
|
195
|
+
eventDispatcher: eventDispatcher,
|
|
196
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
197
|
+
editorAppearance: editorAppearance
|
|
196
198
|
});
|
|
197
199
|
}
|
|
198
200
|
var extensionHandlerResult = this.tryExtensionHandler(undefined);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
5
4
|
import { wrapperDefault } from '../styles';
|
|
6
|
-
export var wrapperStyle =
|
|
7
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px 1px ", ";\n\n > img {\n border-radius: ", "px;\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), wrapperDefault(theme), "var(--ds-space-050, 4px)", borderRadius(), "var(--ds-background-neutral-subtle, white)");
|
|
8
|
-
};
|
|
5
|
+
export var wrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px 1px ", ";\n\n > img {\n border-radius: ", ";\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), wrapperDefault, "var(--ds-space-050, 4px)", "var(--ds-border-radius, 3px)", "var(--ds-background-neutral-subtle, white)");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
@@ -11,7 +13,8 @@ import { N30, N40, N50 } from '@atlaskit/theme/colors';
|
|
|
11
13
|
import React, { useState } from 'react';
|
|
12
14
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
13
15
|
import { createDispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
14
|
-
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
16
|
+
import { analyticsEventKey, calculateBreakoutStyles } from '@atlaskit/editor-common/utils';
|
|
17
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
15
18
|
var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActions(_ref) {
|
|
16
19
|
var updateActiveChild = _ref.updateActiveChild,
|
|
17
20
|
editorView = _ref.editorView,
|
|
@@ -117,14 +120,16 @@ var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActions(_re
|
|
|
117
120
|
}, [node, editorView, getPos, updateActiveChild, eventDispatcher]);
|
|
118
121
|
return actions;
|
|
119
122
|
};
|
|
120
|
-
var navigationCSS = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n
|
|
121
|
-
var
|
|
123
|
+
var navigationCSS = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n"])), "var(--ds-border, ".concat(N40, ")"));
|
|
124
|
+
var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2) {
|
|
122
125
|
var node = _ref2.node,
|
|
123
126
|
handleContentDOMRef = _ref2.handleContentDOMRef,
|
|
124
127
|
getPos = _ref2.getPos,
|
|
125
128
|
tryExtensionHandler = _ref2.tryExtensionHandler,
|
|
126
129
|
editorView = _ref2.editorView,
|
|
127
|
-
eventDispatcher = _ref2.eventDispatcher
|
|
130
|
+
eventDispatcher = _ref2.eventDispatcher,
|
|
131
|
+
widthState = _ref2.widthState,
|
|
132
|
+
editorAppearance = _ref2.editorAppearance;
|
|
128
133
|
var _useState = useState(0),
|
|
129
134
|
_useState2 = _slicedToArray(_useState, 2),
|
|
130
135
|
activeChildIndex = _useState2[0],
|
|
@@ -152,11 +157,27 @@ var MultiBodiedExtension = function MultiBodiedExtension(_ref2) {
|
|
|
152
157
|
return handleContentDOMRef(node);
|
|
153
158
|
}, [handleContentDOMRef]);
|
|
154
159
|
var containerCSS = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n min-height: 100px;\n .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true'] {\n display: none;\n }\n\n .multiBodiedExtension-content-dom-wrapper\n > [data-extension-frame='true']:nth-of-type(", ") {\n border: 1px solid ", ";\n display: block;\n min-height: 100px;\n }\n "])), "var(--ds-border, ".concat(N30, ")"), activeChildIndex + 1, "var(--ds-border, ".concat(N50, ")"));
|
|
160
|
+
var shouldBreakout =
|
|
161
|
+
// Extension should breakout when the layout is set to 'full-width' or 'wide'.
|
|
162
|
+
['full-width', 'wide'].includes(node.attrs.layout) &&
|
|
163
|
+
// Extension breakout state should not be respected when the editor appearance is full-width mode
|
|
164
|
+
editorAppearance !== 'full-width';
|
|
165
|
+
var mbeContainerStyles = {};
|
|
166
|
+
if (shouldBreakout) {
|
|
167
|
+
var _calculateBreakoutSty = calculateBreakoutStyles({
|
|
168
|
+
mode: node.attrs.layout,
|
|
169
|
+
widthStateLineLength: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
170
|
+
widthStateWidth: widthState === null || widthState === void 0 ? void 0 : widthState.width
|
|
171
|
+
}),
|
|
172
|
+
breakoutStyles = _extends({}, (_objectDestructuringEmpty(_calculateBreakoutSty), _calculateBreakoutSty));
|
|
173
|
+
mbeContainerStyles = breakoutStyles;
|
|
174
|
+
}
|
|
155
175
|
return jsx("section", {
|
|
156
176
|
className: "multiBodiedExtension--container",
|
|
157
177
|
css: containerCSS,
|
|
158
178
|
"data-testid": "multiBodiedExtension--container",
|
|
159
|
-
"data-active-child-index": activeChildIndex
|
|
179
|
+
"data-active-child-index": activeChildIndex,
|
|
180
|
+
style: mbeContainerStyles
|
|
160
181
|
}, jsx("nav", {
|
|
161
182
|
className: "multiBodiedExtension-navigation",
|
|
162
183
|
css: navigationCSS,
|
|
@@ -184,4 +205,52 @@ var sendMBEAnalyticsEvent = function sendMBEAnalyticsEvent(action, node, eventDi
|
|
|
184
205
|
}
|
|
185
206
|
});
|
|
186
207
|
};
|
|
208
|
+
var MultiBodiedExtensionWithSharedState = function MultiBodiedExtensionWithSharedState(props) {
|
|
209
|
+
var pluginInjectionApi = props.pluginInjectionApi;
|
|
210
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width']),
|
|
211
|
+
widthState = _useSharedPluginState.widthState;
|
|
212
|
+
return jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
213
|
+
widthState: widthState
|
|
214
|
+
}, props));
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// Workaround taken from platform/packages/editor/editor-core/src/plugins/extension/ui/Extension/Extension/index.tsx
|
|
218
|
+
var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
219
|
+
// TODO: ED-17836 This code is here because confluence injects
|
|
220
|
+
// the `editor-referentiality` plugin via `dangerouslyAppendPlugins`
|
|
221
|
+
// which cannot access the `pluginInjectionApi`. When we move
|
|
222
|
+
// Confluence to using presets we can remove this workaround.
|
|
223
|
+
var pluginInjectionApi = props.pluginInjectionApi;
|
|
224
|
+
return pluginInjectionApi === undefined ? jsx(MultiBodiedExtensionDeprecated, props) : jsx(MultiBodiedExtensionWithSharedState, props);
|
|
225
|
+
};
|
|
226
|
+
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
227
|
+
// TODO: ED-17836 This code is here because Confluence injects
|
|
228
|
+
// the `editor-referentiality` plugin via `dangerouslyAppendPlugins`
|
|
229
|
+
// which cannot access the `pluginInjectionApi`. When we move
|
|
230
|
+
// Confluence to using presets we can remove this workaround.
|
|
231
|
+
// @ts-ignore
|
|
232
|
+
var widthPluginKey = {
|
|
233
|
+
key: 'widthPlugin$',
|
|
234
|
+
getState: function getState(state) {
|
|
235
|
+
return state['widthPlugin$'];
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
var MultiBodiedExtensionDeprecated = function MultiBodiedExtensionDeprecated(props) {
|
|
239
|
+
return jsx(WithPluginState, {
|
|
240
|
+
editorView: props.editorView,
|
|
241
|
+
plugins: {
|
|
242
|
+
widthState: widthPluginKey
|
|
243
|
+
},
|
|
244
|
+
render: function render(_ref3) {
|
|
245
|
+
var widthState = _ref3.widthState;
|
|
246
|
+
return jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
247
|
+
widthState: widthState
|
|
248
|
+
}, props));
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* End workaround
|
|
254
|
+
*/
|
|
255
|
+
|
|
187
256
|
export default MultiBodiedExtension;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
6
|
-
import { N20, DN50, DN700, B200, N20A, N70 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { N20, B200, N20A, N70 } from '@atlaskit/theme/colors';
|
|
7
5
|
import { EXTENSION_PADDING, BODIED_EXT_PADDING } from '@atlaskit/editor-common/styles';
|
|
8
6
|
export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
|
|
9
|
-
export var wrapperDefault =
|
|
10
|
-
|
|
11
|
-
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
12
|
-
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
13
|
-
})(theme), borderRadius(), themed({
|
|
14
|
-
dark: "var(--ds-text, ".concat(DN700, ")")
|
|
15
|
-
})(theme), "var(--ds-border-selected, ".concat(B200, ")"), "var(--ds-background-neutral-hovered, ".concat(N20A, ")"));
|
|
16
|
-
};
|
|
17
|
-
export var overlay = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s;\n"])), borderRadius());
|
|
7
|
+
export var wrapperDefault = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", ";\n position: relative;\n vertical-align: middle;\n\n .ProseMirror-selectednode > span > & > .extension-overlay {\n box-shadow: inset 0px 0px 0px 2px ", ";\n opacity: 1;\n }\n\n &.with-overlay {\n .extension-overlay {\n background: ", ";\n color: transparent;\n }\n\n &:hover .extension-overlay {\n opacity: 1;\n }\n }\n"])), "var(--ds-background-neutral, ".concat(N20, ")"), "var(--ds-border-radius, 3px)", "var(--ds-border-selected, ".concat(B200, ")"), "var(--ds-background-neutral-hovered, ".concat(N20A, ")"));
|
|
8
|
+
export var overlay = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: ", ";\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s;\n"])), "var(--ds-border-radius, 3px)");
|
|
18
9
|
export var placeholderFallback = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > img {\n margin: 0 ", ";\n }\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: placeholder-fallback;\n"])), "var(--ds-space-050, 4px)");
|
|
19
10
|
export var placeholderFallbackParams = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n max-width: 200px;\n margin-left: 5px;\n color: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])), "var(--ds-text-subtlest, ".concat(N70, ")"));
|
|
20
11
|
export var styledImage = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-height: 16px;\n max-width: 16px;\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: lozenge-image;\n"])));
|
|
@@ -3,4 +3,4 @@ var _templateObject;
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { blockNodesVerticalMargin, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackground, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
6
|
-
export var extensionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .multiBodiedExtensionView-content-wrap
|
|
6
|
+
export var extensionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .multiBodiedExtensionView-content-wrap {\n &.danger > span > .multiBodiedExtension--container {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n }\n &:not(.danger).", " {\n & > span > .multiBodiedExtension--container {\n ", "\n }\n }\n .multiBodiedExtension--container {\n width: 100%;\n max-width: 100%; // ensure width can't go over 100%;\n }\n }\n\n .extensionView-content-wrap,\n .multiBodiedExtensionView-content-wrap,\n .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n\n &:first-of-type {\n margin-top: 0;\n }\n\n &:last-of-type {\n margin-bottom: 0;\n }\n\n &:not(.danger).", " {\n & > span > .extension-container {\n ", "\n }\n }\n\n &.danger > span > .extension-container {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n }\n\n &.inline {\n word-wrap: break-all;\n }\n }\n\n .extensionView-content-wrap .extension-container {\n overflow: hidden;\n }\n\n .bodiedExtensionView-content-wrap\n .extensionView-content-wrap\n .extension-container {\n width: 100%;\n max-width: 100%; // ensure width can't go over 100%;\n }\n\n [data-mark-type='fragment'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n }\n }\n\n &:first-child {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-top: 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-top: 0;\n }\n }\n }\n\n &:nth-last-of-type(-n + 2):not(:first-of-type) {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-bottom: 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-bottom: 0;\n }\n }\n }\n }\n"])), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), blockNodesVerticalMargin, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), blockNodesVerticalMargin, blockNodesVerticalMargin);
|
|
@@ -39,7 +39,7 @@ export var placeholderStyles = css(_templateObject6 || (_templateObject6 = _tagg
|
|
|
39
39
|
var contentStyles = function contentStyles(props) {
|
|
40
40
|
return css(_templateObject7 || (_templateObject7 = _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 .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\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({
|
|
41
41
|
theme: props.theme
|
|
42
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, listsStyles, ruleStyles(), mediaStyles, layoutStyles
|
|
42
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, 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, MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
43
43
|
};
|
|
44
44
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
45
45
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
6
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
|
-
import { N40A, N50A, DN70, DN80 } from '@atlaskit/theme/colors';
|
|
8
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
9
|
-
import { themed } from '@atlaskit/theme/components';
|
|
4
|
+
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
10
5
|
import { columnLayoutSharedStyle, LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
|
|
11
6
|
import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
12
7
|
import { TableCssClassName } from '@atlaskit/editor-plugin-table/types';
|
|
13
8
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugin-table/ui/consts';
|
|
14
9
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
15
|
-
export var layoutStyles =
|
|
16
|
-
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 -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\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 }\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, gridSize() - 1, akLayoutGutterOffset, akEditorSwoopCubicBezier, akEditorSelectedBorderSize, themed({
|
|
17
|
-
light: "var(--ds-border, ".concat(N40A, ")"),
|
|
18
|
-
dark: "var(--ds-border, ".concat(DN70, ")")
|
|
19
|
-
})(props), LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, akEditorSelectedBorderSize, themed({
|
|
20
|
-
light: "var(--ds-border, ".concat(N50A, ")"),
|
|
21
|
-
dark: "var(--ds-border, ".concat(DN80, ")")
|
|
22
|
-
})(props), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket]), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode);
|
|
23
|
-
};
|
|
10
|
+
export var layoutStyles = 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 -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\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 }\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, 8 - 1, akLayoutGutterOffset, akEditorSwoopCubicBezier, akEditorSelectedBorderSize, "var(--ds-border, ".concat(N40A, ")"), LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, 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);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "190.2.
|
|
2
|
+
export var version = "190.2.3";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
1
|
export declare const widerLayoutClassName = "wider-layout";
|
|
3
|
-
export declare const wrapperStyle:
|
|
2
|
+
export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
|
|
4
3
|
export declare const header: import("@emotion/react").SerializedStyles;
|
|
5
|
-
export declare const content:
|
|
4
|
+
export declare const content: import("@emotion/react").SerializedStyles;
|
|
6
5
|
export declare const contentWrapper: import("@emotion/react").SerializedStyles;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const wrapperStyle: (theme: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
1
|
+
export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -5,6 +5,9 @@ import type { MultiBodiedExtensionActions } from '@atlaskit/editor-common/extens
|
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
+
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
9
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
|
+
import type { EditorAppearance, PluginInjectionAPIWithDependency } from '@atlaskit/editor-common/types';
|
|
8
11
|
export type TryExtensionHandlerType = (actions: MultiBodiedExtensionActions | undefined) => React.ReactElement | null;
|
|
9
12
|
type Props = {
|
|
10
13
|
node: PmNode;
|
|
@@ -13,6 +16,11 @@ type Props = {
|
|
|
13
16
|
getPos: () => number | undefined;
|
|
14
17
|
tryExtensionHandler: TryExtensionHandlerType;
|
|
15
18
|
eventDispatcher?: EventDispatcher;
|
|
19
|
+
pluginInjectionApi?: PluginInjectionAPIWithDependency<WidthPlugin>;
|
|
20
|
+
editorAppearance?: EditorAppearance;
|
|
16
21
|
};
|
|
17
|
-
declare const MultiBodiedExtension: (
|
|
22
|
+
declare const MultiBodiedExtension: (props: Props & OverflowShadowProps) => jsx.JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* End workaround
|
|
25
|
+
*/
|
|
18
26
|
export default MultiBodiedExtension;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
1
|
import { EXTENSION_PADDING, BODIED_EXT_PADDING } from '@atlaskit/editor-common/styles';
|
|
3
2
|
export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
|
|
4
|
-
export declare const wrapperDefault:
|
|
3
|
+
export declare const wrapperDefault: import("@emotion/react").SerializedStyles;
|
|
5
4
|
export declare const overlay: import("@emotion/react").SerializedStyles;
|
|
6
5
|
export declare const placeholderFallback: import("@emotion/react").SerializedStyles;
|
|
7
6
|
export declare const placeholderFallbackParams: import("@emotion/react").SerializedStyles;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
2
1
|
import { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
|
|
3
2
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
4
|
-
export declare const layoutStyles:
|
|
3
|
+
export declare const layoutStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
1
|
export declare const widerLayoutClassName = "wider-layout";
|
|
3
|
-
export declare const wrapperStyle:
|
|
2
|
+
export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
|
|
4
3
|
export declare const header: import("@emotion/react").SerializedStyles;
|
|
5
|
-
export declare const content:
|
|
4
|
+
export declare const content: import("@emotion/react").SerializedStyles;
|
|
6
5
|
export declare const contentWrapper: import("@emotion/react").SerializedStyles;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const wrapperStyle: (theme: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
1
|
+
export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -5,6 +5,9 @@ import type { MultiBodiedExtensionActions } from '@atlaskit/editor-common/extens
|
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
+
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
9
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
|
+
import type { EditorAppearance, PluginInjectionAPIWithDependency } from '@atlaskit/editor-common/types';
|
|
8
11
|
export type TryExtensionHandlerType = (actions: MultiBodiedExtensionActions | undefined) => React.ReactElement | null;
|
|
9
12
|
type Props = {
|
|
10
13
|
node: PmNode;
|
|
@@ -13,6 +16,11 @@ type Props = {
|
|
|
13
16
|
getPos: () => number | undefined;
|
|
14
17
|
tryExtensionHandler: TryExtensionHandlerType;
|
|
15
18
|
eventDispatcher?: EventDispatcher;
|
|
19
|
+
pluginInjectionApi?: PluginInjectionAPIWithDependency<WidthPlugin>;
|
|
20
|
+
editorAppearance?: EditorAppearance;
|
|
16
21
|
};
|
|
17
|
-
declare const MultiBodiedExtension: (
|
|
22
|
+
declare const MultiBodiedExtension: (props: Props & OverflowShadowProps) => jsx.JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* End workaround
|
|
25
|
+
*/
|
|
18
26
|
export default MultiBodiedExtension;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
1
|
import { EXTENSION_PADDING, BODIED_EXT_PADDING } from '@atlaskit/editor-common/styles';
|
|
3
2
|
export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
|
|
4
|
-
export declare const wrapperDefault:
|
|
3
|
+
export declare const wrapperDefault: import("@emotion/react").SerializedStyles;
|
|
5
4
|
export declare const overlay: import("@emotion/react").SerializedStyles;
|
|
6
5
|
export declare const placeholderFallback: import("@emotion/react").SerializedStyles;
|
|
7
6
|
export declare const placeholderFallbackParams: import("@emotion/react").SerializedStyles;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
2
1
|
import { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
|
|
3
2
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
4
|
-
export declare const layoutStyles:
|
|
3
|
+
export declare const layoutStyles: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "190.2.
|
|
3
|
+
"version": "190.2.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
49
49
|
"@atlaskit/avatar": "^21.4.0",
|
|
50
50
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
51
|
-
"@atlaskit/button": "^17.
|
|
51
|
+
"@atlaskit/button": "^17.2.0",
|
|
52
52
|
"@atlaskit/checkbox": "^13.0.0",
|
|
53
53
|
"@atlaskit/date": "^0.10.0",
|
|
54
54
|
"@atlaskit/datetime-picker": "^13.0.3",
|
|
55
|
-
"@atlaskit/editor-common": "^76.
|
|
55
|
+
"@atlaskit/editor-common": "^76.34.0",
|
|
56
56
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
57
57
|
"@atlaskit/editor-plugin-alignment": "^0.1.0",
|
|
58
58
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
79
79
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
80
80
|
"@atlaskit/editor-plugin-emoji": "^1.0.0",
|
|
81
|
-
"@atlaskit/editor-plugin-expand": "^0.
|
|
81
|
+
"@atlaskit/editor-plugin-expand": "^0.4.0",
|
|
82
82
|
"@atlaskit/editor-plugin-extension": "^0.4.0",
|
|
83
83
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
84
84
|
"@atlaskit/editor-plugin-feedback-dialog": "^0.1.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@atlaskit/editor-plugin-max-content-size": "^0.1.0",
|
|
100
100
|
"@atlaskit/editor-plugin-media": "^0.9.0",
|
|
101
101
|
"@atlaskit/editor-plugin-mentions": "^0.1.0",
|
|
102
|
-
"@atlaskit/editor-plugin-panel": "^0.
|
|
102
|
+
"@atlaskit/editor-plugin-panel": "^0.2.0",
|
|
103
103
|
"@atlaskit/editor-plugin-paste": "^0.2.0",
|
|
104
104
|
"@atlaskit/editor-plugin-paste-options-toolbar": "^0.3.0",
|
|
105
105
|
"@atlaskit/editor-plugin-placeholder": "^0.1.0",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"@atlaskit/editor-plugin-text-color": "^0.1.0",
|
|
118
118
|
"@atlaskit/editor-plugin-text-formatting": "^0.4.0",
|
|
119
119
|
"@atlaskit/editor-plugin-toolbar-lists-indentation": "^0.2.0",
|
|
120
|
-
"@atlaskit/editor-plugin-type-ahead": "^0.
|
|
120
|
+
"@atlaskit/editor-plugin-type-ahead": "^0.9.0",
|
|
121
121
|
"@atlaskit/editor-plugin-undo-redo": "^0.1.0",
|
|
122
122
|
"@atlaskit/editor-plugin-unsupported-content": "^0.2.0",
|
|
123
123
|
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
190
190
|
"@atlaskit/menu": "^2.1.0",
|
|
191
191
|
"@atlaskit/modal-dialog": "^12.10.0",
|
|
192
|
-
"@atlaskit/renderer": "^109.
|
|
192
|
+
"@atlaskit/renderer": "^109.2.0",
|
|
193
193
|
"@atlaskit/smart-card": "^26.43.0",
|
|
194
194
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
195
195
|
"@atlaskit/util-data-test": "^17.8.0",
|
|
@@ -378,6 +378,10 @@
|
|
|
378
378
|
},
|
|
379
379
|
"platform.editor.deprecate-jira-issue-plugin": {
|
|
380
380
|
"type": "boolean"
|
|
381
|
+
},
|
|
382
|
+
"platform.editor.ordered-list-inserting-nodes_bh0vo": {
|
|
383
|
+
"type": "boolean",
|
|
384
|
+
"referenceOnly": "true"
|
|
381
385
|
}
|
|
382
386
|
}
|
|
383
387
|
}
|