@atlaskit/editor-core 185.2.13 → 185.2.16

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,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 185.2.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b273cb8b28a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b273cb8b28a) - The ModalElementBrower will no longer rerender when the editor state changes, instead it will only cause a rerender when the view is changed. This is to avoid lose of context within the element browser.
8
+
9
+ ## 185.2.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6de13a329d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6de13a329d4) - Move `width` and `layout` out from `datasource` into `attr` root (context blockCard node)
14
+ - Updated dependencies
15
+
3
16
  ## 185.2.13
4
17
 
5
18
  ### Patch Changes
@@ -30,11 +30,11 @@ exports.itemSpacing = itemSpacing;
30
30
  var contextualMenuArrow = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n &::after {\n content: '\u203A';\n margin-left: 4px;\n line-height: 20px;\n color: ", ";\n }\n"])), "var(--ds-icon, ".concat(colors.N90, ")"));
31
31
  exports.contextualMenuArrow = contextualMenuArrow;
32
32
  var contextualMenuColorIcon = function contextualMenuColorIcon(color) {
33
- return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n ", "\n }\n"])), contextualMenuArrow, _uiColor.DEFAULT_BORDER_COLOR, "var(--ds-radius-100, 3px)", color && "background: ".concat(color));
33
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n ", "\n }\n"])), contextualMenuArrow, _uiColor.DEFAULT_BORDER_COLOR, "var(--ds-border-radius-100, 3px)", color && "background: ".concat(color));
34
34
  };
35
35
  exports.contextualMenuColorIcon = contextualMenuColorIcon;
36
36
  var contextualSubMenu = function contextualSubMenu(index) {
37
- return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: flex;\n position: absolute;\n top: ", "px;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n"])), "var(--ds-radius-100, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(colors.N60A, ", 0 0 1px ").concat(colors.N60A), ")"), index * (menuItemDimensions.height + itemSpacing * 2), menuItemDimensions.width);
37
+ return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: flex;\n position: absolute;\n top: ", "px;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n"])), "var(--ds-border-radius-100, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(colors.N60A, ", 0 0 1px ").concat(colors.N60A), ")"), index * (menuItemDimensions.height + itemSpacing * 2), menuItemDimensions.width);
38
38
  };
39
39
  exports.contextualSubMenu = contextualSubMenu;
40
40
  var buttonStyle = function buttonStyle(selected) {
@@ -30,11 +30,11 @@ var Modal = function Modal(_ref) {
30
30
  (0, _commands.closeElementBrowserModal)()(editorView.state, editorView.dispatch);
31
31
  focusInEditor();
32
32
  (0, _commands.insertItem)(item)(editorView.state, editorView.dispatch);
33
- }, [editorView.dispatch, editorView.state, focusInEditor]);
33
+ }, [editorView, focusInEditor]);
34
34
  var onClose = (0, _react.useCallback)(function () {
35
35
  (0, _commands.closeElementBrowserModal)()(editorView.state, editorView.dispatch);
36
36
  focusInEditor();
37
- }, [editorView.dispatch, editorView.state, focusInEditor]);
37
+ }, [editorView, focusInEditor]);
38
38
  return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
39
39
  getItems: getItems,
40
40
  onInsertItem: onInsertItem,
@@ -38,13 +38,15 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
38
38
  selectedItem = _useState2[0],
39
39
  setSelectedItem = _useState2[1];
40
40
  var helpUrl = props.helpUrl,
41
- intl = props.intl;
41
+ intl = props.intl,
42
+ onClose = props.onClose,
43
+ onInsertItemFn = props.onInsertItem;
42
44
  var onSelectItem = (0, _react.useCallback)(function (item) {
43
45
  setSelectedItem(item);
44
46
  }, [setSelectedItem]);
45
47
  var onInsertItem = (0, _react.useCallback)(function (item) {
46
- props.onInsertItem(item);
47
- }, [props]);
48
+ onInsertItemFn(item);
49
+ }, [onInsertItemFn]);
48
50
  var RenderFooter = (0, _react.useCallback)(function () {
49
51
  return (0, _react2.jsx)(Footer, {
50
52
  onInsert: function onInsert() {
@@ -57,9 +59,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
57
59
  // Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
58
60
  var onKeyDown = (0, _react.useCallback)(function (e) {
59
61
  if (e.key === 'Escape') {
60
- props.onClose();
62
+ onClose();
61
63
  }
62
- }, [props]);
64
+ }, [onClose]);
63
65
  var RenderBody = (0, _react.useCallback)(function () {
64
66
  return (0, _react2.jsx)("div", {
65
67
  css: wrapper
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "185.2.13";
9
+ var version = "185.2.16";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.2.13",
3
+ "version": "185.2.16",
4
4
  "sideEffects": false
5
5
  }
@@ -31,14 +31,14 @@ export const contextualMenuColorIcon = color => css`
31
31
  content: '';
32
32
  display: block;
33
33
  border: 1px solid ${DEFAULT_BORDER_COLOR};
34
- border-radius: ${"var(--ds-radius-100, 3px)"};
34
+ border-radius: ${"var(--ds-border-radius-100, 3px)"};
35
35
  width: 20px;
36
36
  height: 20px;
37
37
  ${color && `background: ${color}`}
38
38
  }
39
39
  `;
40
40
  export const contextualSubMenu = index => css`
41
- border-radius: ${"var(--ds-radius-100, 3px)"};
41
+ border-radius: ${"var(--ds-border-radius-100, 3px)"};
42
42
  background: ${"var(--ds-surface-overlay, white)"};
43
43
  box-shadow: ${`var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`};
44
44
  display: flex;
@@ -19,11 +19,11 @@ const Modal = ({
19
19
  closeElementBrowserModal()(editorView.state, editorView.dispatch);
20
20
  focusInEditor();
21
21
  insertItem(item)(editorView.state, editorView.dispatch);
22
- }, [editorView.dispatch, editorView.state, focusInEditor]);
22
+ }, [editorView, focusInEditor]);
23
23
  const onClose = useCallback(() => {
24
24
  closeElementBrowserModal()(editorView.state, editorView.dispatch);
25
25
  focusInEditor();
26
- }, [editorView.dispatch, editorView.state, focusInEditor]);
26
+ }, [editorView, focusInEditor]);
27
27
  return /*#__PURE__*/React.createElement(ModalElementBrowser, {
28
28
  getItems: getItems,
29
29
  onInsertItem: onInsertItem,
@@ -44,14 +44,16 @@ const ModalElementBrowser = props => {
44
44
  const [selectedItem, setSelectedItem] = useState();
45
45
  const {
46
46
  helpUrl,
47
- intl
47
+ intl,
48
+ onClose,
49
+ onInsertItem: onInsertItemFn
48
50
  } = props;
49
51
  const onSelectItem = useCallback(item => {
50
52
  setSelectedItem(item);
51
53
  }, [setSelectedItem]);
52
54
  const onInsertItem = useCallback(item => {
53
- props.onInsertItem(item);
54
- }, [props]);
55
+ onInsertItemFn(item);
56
+ }, [onInsertItemFn]);
55
57
  const RenderFooter = useCallback(() => jsx(Footer, {
56
58
  onInsert: () => onInsertItem(selectedItem),
57
59
  beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(messages.help)) : undefined
@@ -60,9 +62,9 @@ const ModalElementBrowser = props => {
60
62
  // Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
61
63
  const onKeyDown = useCallback(e => {
62
64
  if (e.key === 'Escape') {
63
- props.onClose();
65
+ onClose();
64
66
  }
65
- }, [props]);
67
+ }, [onClose]);
66
68
  const RenderBody = useCallback(() => jsx("div", {
67
69
  css: wrapper
68
70
  }, jsx(ElementBrowser, {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "185.2.13";
2
+ export const version = "185.2.16";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.2.13",
3
+ "version": "185.2.16",
4
4
  "sideEffects": false
5
5
  }
@@ -20,10 +20,10 @@ export var menuItemDimensions = {
20
20
  export var itemSpacing = gridSize() / 2;
21
21
  export var contextualMenuArrow = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n &::after {\n content: '\u203A';\n margin-left: 4px;\n line-height: 20px;\n color: ", ";\n }\n"])), "var(--ds-icon, ".concat(N90, ")"));
22
22
  export var contextualMenuColorIcon = function contextualMenuColorIcon(color) {
23
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n ", "\n }\n"])), contextualMenuArrow, DEFAULT_BORDER_COLOR, "var(--ds-radius-100, 3px)", color && "background: ".concat(color));
23
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n ", "\n }\n"])), contextualMenuArrow, DEFAULT_BORDER_COLOR, "var(--ds-border-radius-100, 3px)", color && "background: ".concat(color));
24
24
  };
25
25
  export var contextualSubMenu = function contextualSubMenu(index) {
26
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: flex;\n position: absolute;\n top: ", "px;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n"])), "var(--ds-radius-100, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), index * (menuItemDimensions.height + itemSpacing * 2), menuItemDimensions.width);
26
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: flex;\n position: absolute;\n top: ", "px;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n"])), "var(--ds-border-radius-100, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), index * (menuItemDimensions.height + itemSpacing * 2), menuItemDimensions.width);
27
27
  };
28
28
  export var buttonStyle = function buttonStyle(selected) {
29
29
  return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 26px;\n width: 26px;\n padding: 0;\n border-radius: 4px;\n background-color: ", ";\n border: 1px solid ", ";\n cursor: pointer;\n display: block;\n"])), selected ? "var(--ds-text, ".concat(N800, ")") : "var(--ds-background-neutral, ".concat(N20A, ")"), DEFAULT_BORDER_COLOR);
@@ -20,11 +20,11 @@ var Modal = function Modal(_ref) {
20
20
  closeElementBrowserModal()(editorView.state, editorView.dispatch);
21
21
  focusInEditor();
22
22
  insertItem(item)(editorView.state, editorView.dispatch);
23
- }, [editorView.dispatch, editorView.state, focusInEditor]);
23
+ }, [editorView, focusInEditor]);
24
24
  var onClose = useCallback(function () {
25
25
  closeElementBrowserModal()(editorView.state, editorView.dispatch);
26
26
  focusInEditor();
27
- }, [editorView.dispatch, editorView.state, focusInEditor]);
27
+ }, [editorView, focusInEditor]);
28
28
  return /*#__PURE__*/React.createElement(ModalElementBrowser, {
29
29
  getItems: getItems,
30
30
  onInsertItem: onInsertItem,
@@ -28,13 +28,15 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
28
28
  selectedItem = _useState2[0],
29
29
  setSelectedItem = _useState2[1];
30
30
  var helpUrl = props.helpUrl,
31
- intl = props.intl;
31
+ intl = props.intl,
32
+ onClose = props.onClose,
33
+ onInsertItemFn = props.onInsertItem;
32
34
  var onSelectItem = useCallback(function (item) {
33
35
  setSelectedItem(item);
34
36
  }, [setSelectedItem]);
35
37
  var onInsertItem = useCallback(function (item) {
36
- props.onInsertItem(item);
37
- }, [props]);
38
+ onInsertItemFn(item);
39
+ }, [onInsertItemFn]);
38
40
  var RenderFooter = useCallback(function () {
39
41
  return jsx(Footer, {
40
42
  onInsert: function onInsert() {
@@ -47,9 +49,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
47
49
  // Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
48
50
  var onKeyDown = useCallback(function (e) {
49
51
  if (e.key === 'Escape') {
50
- props.onClose();
52
+ onClose();
51
53
  }
52
- }, [props]);
54
+ }, [onClose]);
53
55
  var RenderBody = useCallback(function () {
54
56
  return jsx("div", {
55
57
  css: wrapper
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "185.2.13";
2
+ export var version = "185.2.16";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.2.13",
3
+ "version": "185.2.16",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.2.13",
3
+ "version": "185.2.16",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/activity-provider": "^2.4.0",
37
- "@atlaskit/adf-schema": "^25.8.0",
37
+ "@atlaskit/adf-schema": "^25.9.0",
38
38
  "@atlaskit/adf-utils": "^18.4.0",
39
39
  "@atlaskit/analytics-gas-types": "^5.1.0",
40
40
  "@atlaskit/analytics-listeners": "^8.7.0",
@@ -98,7 +98,7 @@
98
98
  "@atlaskit/textfield": "^5.5.0",
99
99
  "@atlaskit/theme": "^12.5.0",
100
100
  "@atlaskit/toggle": "^12.6.0",
101
- "@atlaskit/tokens": "^1.5.0",
101
+ "@atlaskit/tokens": "^1.6.0",
102
102
  "@atlaskit/tooltip": "^17.8.0",
103
103
  "@atlaskit/width-detector": "^4.1.0",
104
104
  "@babel/runtime": "^7.0.0",