@atlaskit/editor-plugin-table 5.8.4 → 5.8.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 5.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238) [`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) - [ED-21835] Change EditorAPI type to always union with undefined
8
+
3
9
  ## 5.8.4
4
10
 
5
11
  ### Patch Changes
@@ -57,11 +57,11 @@ var tablesPlugin = function tablesPlugin(_ref) {
57
57
  current: null
58
58
  };
59
59
  var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
60
- var _document$body$offset, _document, _api$width$sharedStat;
60
+ var _document$body$offset, _document, _api$width$sharedStat, _api$width;
61
61
  var defaultState = {
62
62
  width: (_document$body$offset = (_document = document) === null || _document === void 0 || (_document = _document.body) === null || _document === void 0 ? void 0 : _document.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
63
63
  };
64
- return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : api.width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
64
+ return (_api$width$sharedStat = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
65
65
  };
66
66
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
67
67
  return {
@@ -49,11 +49,11 @@ const tablesPlugin = ({
49
49
  current: null
50
50
  };
51
51
  const defaultGetEditorContainerWidth = () => {
52
- var _document$body$offset, _document, _document$body, _api$width$sharedStat;
52
+ var _document$body$offset, _document, _document$body, _api$width$sharedStat, _api$width;
53
53
  const defaultState = {
54
54
  width: (_document$body$offset = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
55
55
  };
56
- return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : api.width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
56
+ return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
57
57
  };
58
58
  const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
59
59
  return {
@@ -50,11 +50,11 @@ var tablesPlugin = function tablesPlugin(_ref) {
50
50
  current: null
51
51
  };
52
52
  var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
53
- var _document$body$offset, _document, _api$width$sharedStat;
53
+ var _document$body$offset, _document, _api$width$sharedStat, _api$width;
54
54
  var defaultState = {
55
55
  width: (_document$body$offset = (_document = document) === null || _document === void 0 || (_document = _document.body) === null || _document === void 0 ? void 0 : _document.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
56
56
  };
57
- return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : api.width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
57
+ return (_api$width$sharedStat = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
58
58
  };
59
59
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
60
60
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "5.8.4",
3
+ "version": "5.8.5",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/src/plugin.tsx CHANGED
@@ -136,7 +136,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
136
136
  const defaultState = {
137
137
  width: document?.body?.offsetWidth ?? 500,
138
138
  };
139
- return api?.width.sharedState.currentState() ?? defaultState;
139
+ return api?.width?.sharedState.currentState() ?? defaultState;
140
140
  };
141
141
  const editorAnalyticsAPI = api?.analytics?.actions;
142
142