@atlaskit/editor-plugin-insert-block 1.1.4 → 1.1.5
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 +6 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +0 -1
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +6 -4
- package/dist/cjs/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +5 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +0 -1
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +26 -24
- package/dist/es2019/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +3 -1
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +0 -1
- package/dist/esm/ui/ToolbarInsertBlock/index.js +4 -2
- package/dist/esm/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 1.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#80518](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80518) [`e0d5e8fd9495`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e0d5e8fd9495) - Migrates some style calls to a slightly different object syntax and other minor cleanup around eslint rules.
|
|
8
|
+
|
|
3
9
|
## 1.1.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -33,15 +33,15 @@ var _messages = require("./messages");
|
|
|
33
33
|
var _tableSelectorPopupWithListeners = _interopRequireDefault(require("./table-selector-popup-with-listeners"));
|
|
34
34
|
var _templateObject;
|
|
35
35
|
/** @jsx jsx */
|
|
36
|
-
function _getRequireWildcardCache(
|
|
37
|
-
function _interopRequireWildcard(
|
|
36
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
37
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
38
38
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
39
39
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
40
40
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
41
41
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
42
42
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
43
43
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
44
|
-
function _isNativeReflectConstruct() {
|
|
44
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
45
45
|
/**
|
|
46
46
|
* Checks if an element is detached (i.e. not in the current document)
|
|
47
47
|
*/
|
|
@@ -59,7 +59,9 @@ var getHoverStyles = function getHoverStyles(selector) {
|
|
|
59
59
|
var tableButtonWrapper = exports.tableButtonWrapper = function tableButtonWrapper(_ref) {
|
|
60
60
|
var isTableSelectorOpen = _ref.isTableSelectorOpen,
|
|
61
61
|
isButtonDisabled = _ref.isButtonDisabled;
|
|
62
|
-
return (
|
|
62
|
+
return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation due to mixins
|
|
63
|
+
(0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n ", "\n ", "\n\n .table-toolbar-btn {\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n margin-right: ", ";\n padding: ", ";\n & > span {\n min-width: 16px;\n margin: ", ";\n }\n }\n .table-selector-toolbar-btn {\n padding: ", ";\n & > span {\n margin: ", ";\n width: 16px !important;\n display: flex;\n justify-content: center;\n }\n\n border-top-left-radius: ", " !important;\n border-bottom-left-radius: ", " !important;\n }\n "])), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-selector-toolbar-btn'), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-toolbar-btn'), "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-space-025, 1px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)")
|
|
64
|
+
);
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -16,8 +16,8 @@ var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
18
|
var _tableSelectorPopup = _interopRequireWildcard(require("./table-selector-popup"));
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
|
|
23
23
|
var TABLE_SELECTOR_PADDING_TOP = 8;
|
|
@@ -165,7 +165,9 @@ var TableSelectorPopup = exports.TableSelectorPopup = function TableSelectorPopu
|
|
|
165
165
|
setSize(initialSizeState);
|
|
166
166
|
}
|
|
167
167
|
}, [enableKeyboardMode, setSize]);
|
|
168
|
-
var handleKeyDown = (0, _react.useCallback)(
|
|
168
|
+
var handleKeyDown = (0, _react.useCallback)(
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
170
|
+
function (event) {
|
|
169
171
|
if (event.key === 'ArrowDown') {
|
|
170
172
|
enableKeyboardMode();
|
|
171
173
|
setSize(function (prevSize) {
|
|
@@ -35,34 +35,36 @@ const getHoverStyles = selector => `&:hover ${selector} {
|
|
|
35
35
|
export const tableButtonWrapper = ({
|
|
36
36
|
isTableSelectorOpen,
|
|
37
37
|
isButtonDisabled
|
|
38
|
-
}) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}) =>
|
|
39
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation due to mixins
|
|
40
|
+
css`
|
|
41
|
+
display: flex;
|
|
42
|
+
${!isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-selector-toolbar-btn')}
|
|
43
|
+
${!isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-toolbar-btn')}
|
|
42
44
|
|
|
43
45
|
.table-toolbar-btn {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
.table-selector-toolbar-btn {
|
|
54
|
-
padding: ${"var(--ds-space-0, 0px)"};
|
|
55
|
-
& > span {
|
|
56
|
-
margin: ${"var(--ds-space-0, 0px)"};
|
|
57
|
-
width: 16px !important;
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: center;
|
|
46
|
+
border-top-right-radius: ${"var(--ds-border-radius-200, 0px)"};
|
|
47
|
+
border-bottom-right-radius: ${"var(--ds-border-radius-200, 0px)"};
|
|
48
|
+
margin-right: ${"var(--ds-space-025, 1px)"};
|
|
49
|
+
padding: ${"var(--ds-space-0, 0px)"};
|
|
50
|
+
& > span {
|
|
51
|
+
min-width: 16px;
|
|
52
|
+
margin: ${"var(--ds-space-0, 0px)"};
|
|
53
|
+
}
|
|
60
54
|
}
|
|
55
|
+
.table-selector-toolbar-btn {
|
|
56
|
+
padding: ${"var(--ds-space-0, 0px)"};
|
|
57
|
+
& > span {
|
|
58
|
+
margin: ${"var(--ds-space-0, 0px)"};
|
|
59
|
+
width: 16px !important;
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
}
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`;
|
|
64
|
+
border-top-left-radius: ${"var(--ds-border-radius-200, 0px)"} !important;
|
|
65
|
+
border-bottom-left-radius: ${"var(--ds-border-radius-200, 0px)"} !important;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
66
68
|
|
|
67
69
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
68
70
|
export class ToolbarInsertBlock extends React.PureComponent {
|
|
@@ -151,7 +151,9 @@ export const TableSelectorPopup = props => {
|
|
|
151
151
|
setSize(initialSizeState);
|
|
152
152
|
}
|
|
153
153
|
}, [enableKeyboardMode, setSize]);
|
|
154
|
-
const handleKeyDown = useCallback(
|
|
154
|
+
const handleKeyDown = useCallback(
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
event => {
|
|
155
157
|
if (event.key === 'ArrowDown') {
|
|
156
158
|
enableKeyboardMode();
|
|
157
159
|
setSize(prevSize => {
|
|
@@ -14,7 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
18
|
/** @jsx jsx */
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import { css, jsx } from '@emotion/react';
|
|
@@ -49,7 +49,9 @@ var getHoverStyles = function getHoverStyles(selector) {
|
|
|
49
49
|
export var tableButtonWrapper = function tableButtonWrapper(_ref) {
|
|
50
50
|
var isTableSelectorOpen = _ref.isTableSelectorOpen,
|
|
51
51
|
isButtonDisabled = _ref.isButtonDisabled;
|
|
52
|
-
return
|
|
52
|
+
return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation due to mixins
|
|
53
|
+
css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n ", "\n ", "\n\n .table-toolbar-btn {\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n margin-right: ", ";\n padding: ", ";\n & > span {\n min-width: 16px;\n margin: ", ";\n }\n }\n .table-selector-toolbar-btn {\n padding: ", ";\n & > span {\n margin: ", ";\n width: 16px !important;\n display: flex;\n justify-content: center;\n }\n\n border-top-left-radius: ", " !important;\n border-bottom-left-radius: ", " !important;\n }\n "])), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-selector-toolbar-btn'), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-toolbar-btn'), "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-space-025, 1px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)")
|
|
54
|
+
);
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -157,7 +157,9 @@ export var TableSelectorPopup = function TableSelectorPopup(props) {
|
|
|
157
157
|
setSize(initialSizeState);
|
|
158
158
|
}
|
|
159
159
|
}, [enableKeyboardMode, setSize]);
|
|
160
|
-
var handleKeyDown = useCallback(
|
|
160
|
+
var handleKeyDown = useCallback(
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
162
|
+
function (event) {
|
|
161
163
|
if (event.key === 'ArrowDown') {
|
|
162
164
|
enableKeyboardMode();
|
|
163
165
|
setSize(function (prevSize) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/editor-plugin-quick-insert": "^1.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-rule": "^1.1.0",
|
|
53
53
|
"@atlaskit/editor-plugin-status": "^1.0.0",
|
|
54
|
-
"@atlaskit/editor-plugin-table": "^7.
|
|
54
|
+
"@atlaskit/editor-plugin-table": "^7.5.0",
|
|
55
55
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^1.0.0",
|
|
56
56
|
"@atlaskit/editor-plugin-type-ahead": "^1.0.0",
|
|
57
57
|
"@atlaskit/editor-prosemirror": "3.0.0",
|