@atlaskit/editor-plugin-synced-block 4.1.2 → 4.1.4
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
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 4.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 4.1.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7bb84f91500cf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7bb84f91500cf) -
|
|
14
|
+
[ux] EDITOR-2442 update warning modal on source sync block deletion
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 4.1.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -8,8 +8,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.DeleteConfirmationModal = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
12
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
13
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
14
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
15
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
17
|
var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteConfirmationModal(_ref) {
|
|
15
18
|
var syncBlockStoreManager = _ref.syncBlockStoreManager;
|
|
@@ -17,6 +20,12 @@ var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteC
|
|
|
17
20
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
18
21
|
isOpen = _useState2[0],
|
|
19
22
|
setIsOpen = _useState2[1];
|
|
23
|
+
var _useState3 = (0, _react.useState)(1),
|
|
24
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
25
|
+
syncBlockCount = _useState4[0],
|
|
26
|
+
setSyncBlockCount = _useState4[1];
|
|
27
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
28
|
+
formatMessage = _useIntl.formatMessage;
|
|
20
29
|
var resolverRef = _react.default.useRef(undefined);
|
|
21
30
|
var handleClose = (0, _react.useCallback)(function (confirm) {
|
|
22
31
|
return function () {
|
|
@@ -27,8 +36,9 @@ var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteC
|
|
|
27
36
|
setIsOpen(false);
|
|
28
37
|
};
|
|
29
38
|
}, []);
|
|
30
|
-
var confirmationCallback = (0, _react.useCallback)(function () {
|
|
39
|
+
var confirmationCallback = (0, _react.useCallback)(function (syncBlockCount) {
|
|
31
40
|
setIsOpen(true);
|
|
41
|
+
setSyncBlockCount(syncBlockCount);
|
|
32
42
|
var confirmedPromise = new Promise(function (resolve) {
|
|
33
43
|
resolverRef.current = resolve;
|
|
34
44
|
});
|
|
@@ -44,12 +54,16 @@ var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteC
|
|
|
44
54
|
onClose: handleClose(false)
|
|
45
55
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, {
|
|
46
56
|
hasCloseButton: true
|
|
47
|
-
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle,
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
58
|
+
appearance: "warning"
|
|
59
|
+
}, formatMessage(_messages.syncBlockMessages.deleteConfirmationModalTitle))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, null, formatMessage(_messages.syncBlockMessages.deleteConfirmationModalDescription, {
|
|
60
|
+
syncBlockCount: syncBlockCount
|
|
61
|
+
}))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
48
62
|
appearance: "subtle",
|
|
49
63
|
onClick: handleClose(false)
|
|
50
|
-
},
|
|
51
|
-
appearance: "
|
|
64
|
+
}, formatMessage(_messages.syncBlockMessages.deleteConfirmationModalCancelButton)), /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
65
|
+
appearance: "warning",
|
|
52
66
|
onClick: handleClose(true),
|
|
53
67
|
autoFocus: true
|
|
54
|
-
},
|
|
68
|
+
}, formatMessage(_messages.syncBlockMessages.deleteConfirmationModalDeleteButton)))));
|
|
55
69
|
};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
2
3
|
import Button from '@atlaskit/button/new';
|
|
4
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
5
|
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
6
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
4
7
|
export const DeleteConfirmationModal = ({
|
|
5
8
|
syncBlockStoreManager
|
|
6
9
|
}) => {
|
|
7
10
|
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
const [syncBlockCount, setSyncBlockCount] = useState(1);
|
|
12
|
+
const {
|
|
13
|
+
formatMessage
|
|
14
|
+
} = useIntl();
|
|
8
15
|
const resolverRef = React.useRef(undefined);
|
|
9
16
|
const handleClose = useCallback(confirm => () => {
|
|
10
17
|
if (resolverRef.current) {
|
|
@@ -13,8 +20,9 @@ export const DeleteConfirmationModal = ({
|
|
|
13
20
|
}
|
|
14
21
|
setIsOpen(false);
|
|
15
22
|
}, []);
|
|
16
|
-
const confirmationCallback = useCallback(
|
|
23
|
+
const confirmationCallback = useCallback(syncBlockCount => {
|
|
17
24
|
setIsOpen(true);
|
|
25
|
+
setSyncBlockCount(syncBlockCount);
|
|
18
26
|
const confirmedPromise = new Promise(resolve => {
|
|
19
27
|
resolverRef.current = resolve;
|
|
20
28
|
});
|
|
@@ -30,12 +38,16 @@ export const DeleteConfirmationModal = ({
|
|
|
30
38
|
onClose: handleClose(false)
|
|
31
39
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
32
40
|
hasCloseButton: true
|
|
33
|
-
}, /*#__PURE__*/React.createElement(ModalTitle,
|
|
41
|
+
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
42
|
+
appearance: "warning"
|
|
43
|
+
}, formatMessage(messages.deleteConfirmationModalTitle))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, null, formatMessage(messages.deleteConfirmationModalDescription, {
|
|
44
|
+
syncBlockCount
|
|
45
|
+
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
34
46
|
appearance: "subtle",
|
|
35
47
|
onClick: handleClose(false)
|
|
36
|
-
},
|
|
37
|
-
appearance: "
|
|
48
|
+
}, formatMessage(messages.deleteConfirmationModalCancelButton)), /*#__PURE__*/React.createElement(Button, {
|
|
49
|
+
appearance: "warning",
|
|
38
50
|
onClick: handleClose(true),
|
|
39
51
|
autoFocus: true
|
|
40
|
-
},
|
|
52
|
+
}, formatMessage(messages.deleteConfirmationModalDeleteButton)))));
|
|
41
53
|
};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
3
4
|
import Button from '@atlaskit/button/new';
|
|
5
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
6
|
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
7
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
5
8
|
export var DeleteConfirmationModal = function DeleteConfirmationModal(_ref) {
|
|
6
9
|
var syncBlockStoreManager = _ref.syncBlockStoreManager;
|
|
7
10
|
var _useState = useState(false),
|
|
8
11
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9
12
|
isOpen = _useState2[0],
|
|
10
13
|
setIsOpen = _useState2[1];
|
|
14
|
+
var _useState3 = useState(1),
|
|
15
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
16
|
+
syncBlockCount = _useState4[0],
|
|
17
|
+
setSyncBlockCount = _useState4[1];
|
|
18
|
+
var _useIntl = useIntl(),
|
|
19
|
+
formatMessage = _useIntl.formatMessage;
|
|
11
20
|
var resolverRef = React.useRef(undefined);
|
|
12
21
|
var handleClose = useCallback(function (confirm) {
|
|
13
22
|
return function () {
|
|
@@ -18,8 +27,9 @@ export var DeleteConfirmationModal = function DeleteConfirmationModal(_ref) {
|
|
|
18
27
|
setIsOpen(false);
|
|
19
28
|
};
|
|
20
29
|
}, []);
|
|
21
|
-
var confirmationCallback = useCallback(function () {
|
|
30
|
+
var confirmationCallback = useCallback(function (syncBlockCount) {
|
|
22
31
|
setIsOpen(true);
|
|
32
|
+
setSyncBlockCount(syncBlockCount);
|
|
23
33
|
var confirmedPromise = new Promise(function (resolve) {
|
|
24
34
|
resolverRef.current = resolve;
|
|
25
35
|
});
|
|
@@ -35,12 +45,16 @@ export var DeleteConfirmationModal = function DeleteConfirmationModal(_ref) {
|
|
|
35
45
|
onClose: handleClose(false)
|
|
36
46
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
37
47
|
hasCloseButton: true
|
|
38
|
-
}, /*#__PURE__*/React.createElement(ModalTitle,
|
|
48
|
+
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
49
|
+
appearance: "warning"
|
|
50
|
+
}, formatMessage(messages.deleteConfirmationModalTitle))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, null, formatMessage(messages.deleteConfirmationModalDescription, {
|
|
51
|
+
syncBlockCount: syncBlockCount
|
|
52
|
+
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
39
53
|
appearance: "subtle",
|
|
40
54
|
onClick: handleClose(false)
|
|
41
|
-
},
|
|
42
|
-
appearance: "
|
|
55
|
+
}, formatMessage(messages.deleteConfirmationModalCancelButton)), /*#__PURE__*/React.createElement(Button, {
|
|
56
|
+
appearance: "warning",
|
|
43
57
|
onClick: handleClose(true),
|
|
44
58
|
autoFocus: true
|
|
45
|
-
},
|
|
59
|
+
}, formatMessage(messages.deleteConfirmationModalDeleteButton)))));
|
|
46
60
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^51.3.2",
|
|
32
|
-
"@atlaskit/button": "23.
|
|
32
|
+
"@atlaskit/button": "23.6.0",
|
|
33
33
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-block-menu": "^5.0.0",
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
"@atlaskit/editor-synced-block-provider": "^2.7.0",
|
|
42
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
43
43
|
"@atlaskit/editor-toolbar": "^0.17.0",
|
|
44
|
-
"@atlaskit/icon": "28.5.
|
|
44
|
+
"@atlaskit/icon": "28.5.4",
|
|
45
45
|
"@atlaskit/logo": "^19.9.0",
|
|
46
|
-
"@atlaskit/lozenge": "^13.
|
|
46
|
+
"@atlaskit/lozenge": "^13.1.0",
|
|
47
47
|
"@atlaskit/modal-dialog": "^14.6.0",
|
|
48
48
|
"@atlaskit/primitives": "^16.1.0",
|
|
49
|
-
"@atlaskit/tooltip": "^20.
|
|
49
|
+
"@atlaskit/tooltip": "^20.8.0",
|
|
50
50
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@atlaskit/editor-common": "^110.
|
|
55
|
+
"@atlaskit/editor-common": "^110.24.0",
|
|
56
56
|
"react": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|