@atlaskit/editor-core 190.2.0 → 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 +16 -0
- package/dist/cjs/keymaps/index.js +36 -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/keymaps/index.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/keymaps/index.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/keymaps/index.d.ts +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/keymaps/index.d.ts +1 -1
- 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 +12 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
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
|
+
|
|
13
|
+
## 190.2.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#64359](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64359) [`e728a3537d3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e728a3537d3b) - [ux] Adds table shortcust to move row or column and to delete row or column when drag and drop enabled
|
|
18
|
+
|
|
3
19
|
## 190.2.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -171,12 +171,24 @@ Object.defineProperty(exports, "cut", {
|
|
|
171
171
|
return _keymaps.cut;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
+
Object.defineProperty(exports, "deleteColumn", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function get() {
|
|
177
|
+
return _keymaps.deleteColumn;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
174
180
|
Object.defineProperty(exports, "deleteKey", {
|
|
175
181
|
enumerable: true,
|
|
176
182
|
get: function get() {
|
|
177
183
|
return _keymaps.deleteKey;
|
|
178
184
|
}
|
|
179
185
|
});
|
|
186
|
+
Object.defineProperty(exports, "deleteRow", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function get() {
|
|
189
|
+
return _keymaps.deleteRow;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
180
192
|
Object.defineProperty(exports, "enter", {
|
|
181
193
|
enumerable: true,
|
|
182
194
|
get: function get() {
|
|
@@ -261,6 +273,18 @@ Object.defineProperty(exports, "makeKeymap", {
|
|
|
261
273
|
return _keymaps.makeKeymap;
|
|
262
274
|
}
|
|
263
275
|
});
|
|
276
|
+
Object.defineProperty(exports, "moveColumnLeft", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function get() {
|
|
279
|
+
return _keymaps.moveColumnLeft;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(exports, "moveColumnRight", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function get() {
|
|
285
|
+
return _keymaps.moveColumnRight;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
264
288
|
Object.defineProperty(exports, "moveDown", {
|
|
265
289
|
enumerable: true,
|
|
266
290
|
get: function get() {
|
|
@@ -279,6 +303,18 @@ Object.defineProperty(exports, "moveRight", {
|
|
|
279
303
|
return _keymaps.moveRight;
|
|
280
304
|
}
|
|
281
305
|
});
|
|
306
|
+
Object.defineProperty(exports, "moveRowDown", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function get() {
|
|
309
|
+
return _keymaps.moveRowDown;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "moveRowUp", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function get() {
|
|
315
|
+
return _keymaps.moveRowUp;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
282
318
|
Object.defineProperty(exports, "moveUp", {
|
|
283
319
|
enumerable: true,
|
|
284
320
|
get: function get() {
|
|
@@ -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 +1 @@
|
|
|
1
|
-
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
|
|
1
|
+
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, deleteColumn, deleteRow, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
|
|
@@ -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%;
|