@atlaskit/embedded-document 0.9.102 → 0.9.103

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/document.js +11 -0
  3. package/dist/cjs/components/toolbar.js +3 -0
  4. package/dist/cjs/consumers/consumer.js +2 -0
  5. package/dist/cjs/consumers/document-body.js +12 -0
  6. package/dist/cjs/consumers/with-document-actions.js +10 -0
  7. package/dist/cjs/context/context.js +4 -0
  8. package/dist/cjs/context/embedded-document.js +8 -0
  9. package/dist/cjs/provider/service-provider.js +4 -2
  10. package/dist/es2019/components/document.js +12 -2
  11. package/dist/es2019/components/toolbar.js +5 -0
  12. package/dist/es2019/consumers/consumer.js +3 -2
  13. package/dist/es2019/consumers/document-body.js +13 -2
  14. package/dist/es2019/consumers/with-document-actions.js +11 -2
  15. package/dist/es2019/context/context.js +4 -0
  16. package/dist/es2019/context/embedded-document.js +8 -0
  17. package/dist/es2019/provider/service-provider.js +6 -0
  18. package/dist/esm/components/document.js +12 -2
  19. package/dist/esm/components/toolbar.js +3 -0
  20. package/dist/esm/consumers/consumer.js +3 -2
  21. package/dist/esm/consumers/document-body.js +13 -2
  22. package/dist/esm/consumers/with-document-actions.js +11 -2
  23. package/dist/esm/context/context.js +4 -0
  24. package/dist/esm/context/embedded-document.js +8 -0
  25. package/dist/esm/provider/service-provider.js +4 -2
  26. package/dist/types/consumers/consumer.d.ts +3 -4
  27. package/dist/types/consumers/with-document-actions.d.ts +1 -2
  28. package/dist/types/model/index.d.ts +1 -2
  29. package/dist/types/provider/service-provider.d.ts +1 -2
  30. package/dist/types-ts4.5/consumers/consumer.d.ts +3 -4
  31. package/dist/types-ts4.5/consumers/with-document-actions.d.ts +1 -2
  32. package/dist/types-ts4.5/model/index.d.ts +1 -2
  33. package/dist/types-ts4.5/provider/service-provider.d.ts +1 -2
  34. package/package.json +4 -4
  35. package/tsconfig.json +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/embedded-document
2
2
 
3
+ ## 0.9.103
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 0.9.102
4
10
 
5
11
  ### Patch Changes
@@ -21,6 +21,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
21
21
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
22
22
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
23
  var emptyDoc = '{ "type": "doc", "version": 1, "content": [] }';
24
+
25
+ // Ignored via go/ees005
26
+ // eslint-disable-next-line @repo/internal/react/no-class-components
24
27
  var Document = exports.default = /*#__PURE__*/function (_Component) {
25
28
  function Document() {
26
29
  (0, _classCallCheck2.default)(this, Document);
@@ -69,6 +72,8 @@ var Document = exports.default = /*#__PURE__*/function (_Component) {
69
72
  defaultValue: body,
70
73
  primaryToolbarComponents: this.renderToolbar(),
71
74
  contentComponents: this.renderTitle()
75
+ // Ignored via go/ees005
76
+ // eslint-disable-next-line react/jsx-props-no-spreading
72
77
  }, editorProps)));
73
78
  }
74
79
  }, {
@@ -101,7 +106,11 @@ var Document = exports.default = /*#__PURE__*/function (_Component) {
101
106
  emojiProvider = editorProps.emojiProvider,
102
107
  media = editorProps.media;
103
108
  dataProviders = _providerFactory.ProviderFactory.create({
109
+ // Ignored via go/ees005
110
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
104
111
  mentionProvider: mentionProvider,
112
+ // Ignored via go/ees005
113
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
105
114
  emojiProvider: emojiProvider
106
115
  });
107
116
  if (media && media.provider) {
@@ -111,6 +120,8 @@ var Document = exports.default = /*#__PURE__*/function (_Component) {
111
120
  return /*#__PURE__*/_react.default.createElement(_renderer.ReactRenderer, (0, _extends2.default)({
112
121
  dataProviders: dataProviders,
113
122
  document: JSON.parse(body)
123
+ // Ignored via go/ees005
124
+ // eslint-disable-next-line react/jsx-props-no-spreading
114
125
  }, rendererProps));
115
126
  }
116
127
  }
@@ -22,6 +22,9 @@ var Toolbar = _styledComponents.default.div({
22
22
  padding: "0 ".concat("var(--ds-space-250, 20px)"),
23
23
  height: "var(--ds-space-1000, 80px)"
24
24
  });
25
+
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
28
  var _default = exports.default = function _default(props) {
26
29
  var mode = props.mode,
27
30
  editorActions = props.editorActions;
@@ -18,6 +18,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
18
18
  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 && {}.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; }
19
19
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
20
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
+ // Ignored via go/ees005
22
+ // eslint-disable-next-line @repo/internal/react/no-class-components
21
23
  var Consumer = exports.Consumer = /*#__PURE__*/function (_PureComponent) {
22
24
  function Consumer() {
23
25
  var _this;
@@ -20,6 +20,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
20
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 && {}.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 _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
22
22
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
+ // Ignored via go/ees005
24
+ // eslint-disable-next-line @repo/internal/react/no-class-components
23
25
  var DocumentBody = exports.default = /*#__PURE__*/function (_PureComponent) {
24
26
  function DocumentBody() {
25
27
  var _this;
@@ -28,9 +30,17 @@ var DocumentBody = exports.default = /*#__PURE__*/function (_PureComponent) {
28
30
  args[_key] = arguments[_key];
29
31
  }
30
32
  _this = _callSuper(this, DocumentBody, [].concat(args));
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
35
  (0, _defineProperty2.default)(_this, "renderChild", function (props) {
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line react/jsx-props-no-spreading
38
+ // Ignored via go/ees005
39
+ // eslint-disable-next-line react/jsx-props-no-spreading
32
40
  return /*#__PURE__*/_react.default.createElement(_document.default, (0, _extends2.default)({}, _this.props, props));
33
41
  });
42
+ // Ignored via go/ees005
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
44
  (0, _defineProperty2.default)(_this, "stateMapper", function (state) {
35
45
  var doc = state.doc,
36
46
  hasError = state.hasError,
@@ -43,6 +53,8 @@ var DocumentBody = exports.default = /*#__PURE__*/function (_PureComponent) {
43
53
  mode: mode
44
54
  };
45
55
  });
56
+ // Ignored via go/ees005
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
58
  (0, _defineProperty2.default)(_this, "renderPropsMapper", function (renderProps) {
47
59
  var renderTitle = renderProps.renderTitle,
48
60
  renderToolbar = renderProps.renderToolbar;
@@ -20,6 +20,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
20
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 && {}.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 _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
22
22
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
+ // Ignored via go/ees005
24
+ // eslint-disable-next-line @repo/internal/react/no-class-components
23
25
  var WithDocumentActions = exports.default = /*#__PURE__*/function (_PureComponent) {
24
26
  function WithDocumentActions() {
25
27
  var _this;
@@ -30,6 +32,8 @@ var WithDocumentActions = exports.default = /*#__PURE__*/function (_PureComponen
30
32
  _this = _callSuper(this, WithDocumentActions, [].concat(args));
31
33
  (0, _defineProperty2.default)(_this, "actionsMapper", function (actions) {
32
34
  return {
35
+ // Ignored via go/ees005
36
+ // eslint-disable-next-line require-await, @typescript-eslint/no-explicit-any
33
37
  createDocument: function createDocument(value) {
34
38
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
35
39
  return _regenerator.default.wrap(function _callee$(_context) {
@@ -43,6 +47,8 @@ var WithDocumentActions = exports.default = /*#__PURE__*/function (_PureComponen
43
47
  }, _callee);
44
48
  }))();
45
49
  },
50
+ // Ignored via go/ees005
51
+ // eslint-disable-next-line require-await
46
52
  editDocument: function editDocument() {
47
53
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
48
54
  return _regenerator.default.wrap(function _callee2$(_context2) {
@@ -56,6 +62,8 @@ var WithDocumentActions = exports.default = /*#__PURE__*/function (_PureComponen
56
62
  }, _callee2);
57
63
  }))();
58
64
  },
65
+ // Ignored via go/ees005
66
+ // eslint-disable-next-line require-await, @typescript-eslint/no-explicit-any
59
67
  updateDocument: function updateDocument(value) {
60
68
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
61
69
  return _regenerator.default.wrap(function _callee3$(_context3) {
@@ -69,6 +77,8 @@ var WithDocumentActions = exports.default = /*#__PURE__*/function (_PureComponen
69
77
  }, _callee3);
70
78
  }))();
71
79
  },
80
+ // Ignored via go/ees005
81
+ // eslint-disable-next-line require-await
72
82
  cancelEdit: function cancelEdit() {
73
83
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
74
84
  return _regenerator.default.wrap(function _callee4$(_context4) {
@@ -15,6 +15,8 @@ var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({
15
15
  getDocument: noop,
16
16
  getDocumentByObjectId: noop,
17
17
  setDocumentMode: noop,
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line require-await
18
20
  updateDocument: function () {
19
21
  var _updateDocument = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
20
22
  return _regenerator.default.wrap(function _callee$(_context) {
@@ -32,6 +34,8 @@ var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({
32
34
  }
33
35
  return updateDocument;
34
36
  }(),
37
+ // Ignored via go/ees005
38
+ // eslint-disable-next-line require-await
35
39
  createDocument: function () {
36
40
  var _createDocument = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
37
41
  return _regenerator.default.wrap(function _callee2$(_context2) {
@@ -42,6 +42,8 @@ var Content = _styledComponents.default.div({
42
42
  padding: "0 ".concat("var(--ds-space-400, 32px)")
43
43
  }
44
44
  });
45
+ // Ignored via go/ees005
46
+ // eslint-disable-next-line @repo/internal/react/no-class-components
45
47
  var EmbeddedDocument = exports.default = /*#__PURE__*/function (_Component) {
46
48
  function EmbeddedDocument(props) {
47
49
  var _this;
@@ -95,6 +97,8 @@ var EmbeddedDocument = exports.default = /*#__PURE__*/function (_Component) {
95
97
  return _ref2.apply(this, arguments);
96
98
  };
97
99
  }());
100
+ // Ignored via go/ees005
101
+ // eslint-disable-next-line require-await
98
102
  (0, _defineProperty2.default)(_this, "setDocumentMode", /*#__PURE__*/function () {
99
103
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(mode) {
100
104
  return _regenerator.default.wrap(function _callee3$(_context3) {
@@ -113,6 +117,8 @@ var EmbeddedDocument = exports.default = /*#__PURE__*/function (_Component) {
113
117
  return _ref3.apply(this, arguments);
114
118
  };
115
119
  }());
120
+ // Ignored via go/ees005
121
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
122
  (0, _defineProperty2.default)(_this, "updateDocument", /*#__PURE__*/function () {
117
123
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(body) {
118
124
  var _ref5, documentId, objectId, language, doc;
@@ -155,6 +161,8 @@ var EmbeddedDocument = exports.default = /*#__PURE__*/function (_Component) {
155
161
  return _ref4.apply(this, arguments);
156
162
  };
157
163
  }());
164
+ // Ignored via go/ees005
165
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
158
166
  (0, _defineProperty2.default)(_this, "createDocument", /*#__PURE__*/function () {
159
167
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(body) {
160
168
  var _this$props, objectId, language, doc;
@@ -99,7 +99,8 @@ var ServiceProvider = exports.default = /*#__PURE__*/function () {
99
99
  return _getDocumentByObjectId.apply(this, arguments);
100
100
  }
101
101
  return getDocumentByObjectId;
102
- }()
102
+ }() // Ignored via go/ees005
103
+ // eslint-disable-next-line @typescript-eslint/max-params
103
104
  }, {
104
105
  key: "updateDocument",
105
106
  value: function () {
@@ -144,7 +145,8 @@ var ServiceProvider = exports.default = /*#__PURE__*/function () {
144
145
  return _updateDocument.apply(this, arguments);
145
146
  }
146
147
  return updateDocument;
147
- }()
148
+ }() // Ignored via go/ees005
149
+ // eslint-disable-next-line @typescript-eslint/max-params
148
150
  }, {
149
151
  key: "createDocument",
150
152
  value: function () {
@@ -1,10 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { Component } from 'react';
2
+ import React, { Component } from 'react';
4
3
  import { Editor, EditorContext, WithEditorActions } from '@atlaskit/editor-core';
5
4
  import { ReactRenderer } from '@atlaskit/renderer';
6
5
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
6
  const emptyDoc = '{ "type": "doc", "version": 1, "content": [] }';
7
+
8
+ // Ignored via go/ees005
9
+ // eslint-disable-next-line @repo/internal/react/no-class-components
8
10
  export default class Document extends Component {
9
11
  renderToolbar() {
10
12
  const {
@@ -43,6 +45,8 @@ export default class Document extends Component {
43
45
  defaultValue: body,
44
46
  primaryToolbarComponents: this.renderToolbar(),
45
47
  contentComponents: this.renderTitle()
48
+ // Ignored via go/ees005
49
+ // eslint-disable-next-line react/jsx-props-no-spreading
46
50
  }, editorProps)));
47
51
  }
48
52
  render() {
@@ -76,7 +80,11 @@ export default class Document extends Component {
76
80
  media
77
81
  } = editorProps;
78
82
  dataProviders = ProviderFactory.create({
83
+ // Ignored via go/ees005
84
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
79
85
  mentionProvider: mentionProvider,
86
+ // Ignored via go/ees005
87
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
80
88
  emojiProvider: emojiProvider
81
89
  });
82
90
  if (media && media.provider) {
@@ -86,6 +94,8 @@ export default class Document extends Component {
86
94
  return /*#__PURE__*/React.createElement(ReactRenderer, _extends({
87
95
  dataProviders: dataProviders,
88
96
  document: JSON.parse(body)
97
+ // Ignored via go/ees005
98
+ // eslint-disable-next-line react/jsx-props-no-spreading
89
99
  }, rendererProps));
90
100
  }
91
101
  }
@@ -12,6 +12,9 @@ const Toolbar = styled.div({
12
12
  padding: `0 ${"var(--ds-space-250, 20px)"}`,
13
13
  height: "var(--ds-space-1000, 80px)"
14
14
  });
15
+
16
+ // Ignored via go/ees005
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
18
  export default (props => {
16
19
  const {
17
20
  mode,
@@ -25,6 +28,8 @@ export default (props => {
25
28
  return /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(Button, {
26
29
  appearance: "primary",
27
30
  onClick: async () => {
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
33
  const value = await editorActions.getValue();
29
34
  try {
30
35
  await (mode === 'create' ? actions.createDocument(value) : actions.updateDocument(value));
@@ -1,7 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import { PureComponent } from 'react';
2
+ import React, { PureComponent } from 'react';
4
3
  import { Context } from '../context/context';
4
+ // Ignored via go/ees005
5
+ // eslint-disable-next-line @repo/internal/react/no-class-components
5
6
  export class Consumer extends PureComponent {
6
7
  constructor(...args) {
7
8
  super(...args);
@@ -1,15 +1,24 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import React from 'react';
4
- import { PureComponent } from 'react';
3
+ import React, { PureComponent } from 'react';
5
4
  import { Consumer } from './consumer';
6
5
  import { default as Document } from '../components/document';
6
+ // Ignored via go/ees005
7
+ // eslint-disable-next-line @repo/internal/react/no-class-components
7
8
  export default class DocumentBody extends PureComponent {
8
9
  constructor(...args) {
9
10
  super(...args);
11
+ // Ignored via go/ees005
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
13
  _defineProperty(this, "renderChild", props => {
14
+ // Ignored via go/ees005
15
+ // eslint-disable-next-line react/jsx-props-no-spreading
16
+ // Ignored via go/ees005
17
+ // eslint-disable-next-line react/jsx-props-no-spreading
11
18
  return /*#__PURE__*/React.createElement(Document, _extends({}, this.props, props));
12
19
  });
20
+ // Ignored via go/ees005
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
22
  _defineProperty(this, "stateMapper", state => {
14
23
  const {
15
24
  doc,
@@ -24,6 +33,8 @@ export default class DocumentBody extends PureComponent {
24
33
  mode
25
34
  };
26
35
  });
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
38
  _defineProperty(this, "renderPropsMapper", renderProps => {
28
39
  const {
29
40
  renderTitle,
@@ -1,20 +1,29 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import { PureComponent } from 'react';
2
+ import React, { PureComponent } from 'react';
4
3
  import { Consumer } from '../consumers/consumer';
4
+ // Ignored via go/ees005
5
+ // eslint-disable-next-line @repo/internal/react/no-class-components
5
6
  export default class WithDocumentActions extends PureComponent {
6
7
  constructor(...args) {
7
8
  super(...args);
8
9
  _defineProperty(this, "actionsMapper", actions => ({
10
+ // Ignored via go/ees005
11
+ // eslint-disable-next-line require-await, @typescript-eslint/no-explicit-any
9
12
  async createDocument(value) {
10
13
  return actions.createDocument(value);
11
14
  },
15
+ // Ignored via go/ees005
16
+ // eslint-disable-next-line require-await
12
17
  async editDocument() {
13
18
  actions.setDocumentMode('edit');
14
19
  },
20
+ // Ignored via go/ees005
21
+ // eslint-disable-next-line require-await, @typescript-eslint/no-explicit-any
15
22
  async updateDocument(value) {
16
23
  return actions.updateDocument(value);
17
24
  },
25
+ // Ignored via go/ees005
26
+ // eslint-disable-next-line require-await
18
27
  async cancelEdit() {
19
28
  actions.setDocumentMode('view');
20
29
  }
@@ -6,9 +6,13 @@ export const Context = /*#__PURE__*/createContext({
6
6
  getDocument: noop,
7
7
  getDocumentByObjectId: noop,
8
8
  setDocumentMode: noop,
9
+ // Ignored via go/ees005
10
+ // eslint-disable-next-line require-await
9
11
  updateDocument: async () => {
10
12
  throw new Error('Not implemented.');
11
13
  },
14
+ // Ignored via go/ees005
15
+ // eslint-disable-next-line require-await
12
16
  createDocument: async () => {
13
17
  throw new Error('Not implemented.');
14
18
  }
@@ -24,6 +24,8 @@ const Content = styled.div({
24
24
  padding: `0 ${"var(--ds-space-400, 32px)"}`
25
25
  }
26
26
  });
27
+ // Ignored via go/ees005
28
+ // eslint-disable-next-line @repo/internal/react/no-class-components
27
29
  export default class EmbeddedDocument extends Component {
28
30
  constructor(props) {
29
31
  super(props);
@@ -41,11 +43,15 @@ export default class EmbeddedDocument extends Component {
41
43
  const doc = await this.provider.getDocument(documentId, language);
42
44
  this.setDocumentState(doc);
43
45
  });
46
+ // Ignored via go/ees005
47
+ // eslint-disable-next-line require-await
44
48
  _defineProperty(this, "setDocumentMode", async mode => {
45
49
  this.setState({
46
50
  mode
47
51
  });
48
52
  });
53
+ // Ignored via go/ees005
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
55
  _defineProperty(this, "updateDocument", async body => {
50
56
  const {
51
57
  documentId,
@@ -70,6 +76,8 @@ export default class EmbeddedDocument extends Component {
70
76
  throw new Error('Failed to update document');
71
77
  }
72
78
  });
79
+ // Ignored via go/ees005
80
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
81
  _defineProperty(this, "createDocument", async body => {
74
82
  const {
75
83
  objectId,
@@ -41,6 +41,9 @@ export default class ServiceProvider {
41
41
  return null;
42
42
  }
43
43
  }
44
+
45
+ // Ignored via go/ees005
46
+ // eslint-disable-next-line @typescript-eslint/max-params
44
47
  async updateDocument(documentId, body, objectId, title, language) {
45
48
  try {
46
49
  const document = await utils.requestService(this.config, {
@@ -65,6 +68,9 @@ export default class ServiceProvider {
65
68
  return null;
66
69
  }
67
70
  }
71
+
72
+ // Ignored via go/ees005
73
+ // eslint-disable-next-line @typescript-eslint/max-params
68
74
  async createDocument(body, objectId, title, language) {
69
75
  try {
70
76
  const document = await utils.requestService(this.config, {
@@ -6,12 +6,14 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _inherits from "@babel/runtime/helpers/inherits";
7
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
- import React from 'react';
10
- import { Component } from 'react';
9
+ import React, { Component } from 'react';
11
10
  import { Editor, EditorContext, WithEditorActions } from '@atlaskit/editor-core';
12
11
  import { ReactRenderer } from '@atlaskit/renderer';
13
12
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
14
13
  var emptyDoc = '{ "type": "doc", "version": 1, "content": [] }';
14
+
15
+ // Ignored via go/ees005
16
+ // eslint-disable-next-line @repo/internal/react/no-class-components
15
17
  var Document = /*#__PURE__*/function (_Component) {
16
18
  function Document() {
17
19
  _classCallCheck(this, Document);
@@ -60,6 +62,8 @@ var Document = /*#__PURE__*/function (_Component) {
60
62
  defaultValue: body,
61
63
  primaryToolbarComponents: this.renderToolbar(),
62
64
  contentComponents: this.renderTitle()
65
+ // Ignored via go/ees005
66
+ // eslint-disable-next-line react/jsx-props-no-spreading
63
67
  }, editorProps)));
64
68
  }
65
69
  }, {
@@ -92,7 +96,11 @@ var Document = /*#__PURE__*/function (_Component) {
92
96
  emojiProvider = editorProps.emojiProvider,
93
97
  media = editorProps.media;
94
98
  dataProviders = ProviderFactory.create({
99
+ // Ignored via go/ees005
100
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
95
101
  mentionProvider: mentionProvider,
102
+ // Ignored via go/ees005
103
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
96
104
  emojiProvider: emojiProvider
97
105
  });
98
106
  if (media && media.provider) {
@@ -102,6 +110,8 @@ var Document = /*#__PURE__*/function (_Component) {
102
110
  return /*#__PURE__*/React.createElement(ReactRenderer, _extends({
103
111
  dataProviders: dataProviders,
104
112
  document: JSON.parse(body)
113
+ // Ignored via go/ees005
114
+ // eslint-disable-next-line react/jsx-props-no-spreading
105
115
  }, rendererProps));
106
116
  }
107
117
  }
@@ -14,6 +14,9 @@ var Toolbar = styled.div({
14
14
  padding: "0 ".concat("var(--ds-space-250, 20px)"),
15
15
  height: "var(--ds-space-1000, 80px)"
16
16
  });
17
+
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
20
  export default (function (props) {
18
21
  var mode = props.mode,
19
22
  editorActions = props.editorActions;
@@ -6,9 +6,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
- import React from 'react';
10
- import { PureComponent } from 'react';
9
+ import React, { PureComponent } from 'react';
11
10
  import { Context } from '../context/context';
11
+ // Ignored via go/ees005
12
+ // eslint-disable-next-line @repo/internal/react/no-class-components
12
13
  export var Consumer = /*#__PURE__*/function (_PureComponent) {
13
14
  function Consumer() {
14
15
  var _this;
@@ -7,10 +7,11 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
- import React from 'react';
11
- import { PureComponent } from 'react';
10
+ import React, { PureComponent } from 'react';
12
11
  import { Consumer } from './consumer';
13
12
  import { default as Document } from '../components/document';
13
+ // Ignored via go/ees005
14
+ // eslint-disable-next-line @repo/internal/react/no-class-components
14
15
  var DocumentBody = /*#__PURE__*/function (_PureComponent) {
15
16
  function DocumentBody() {
16
17
  var _this;
@@ -19,9 +20,17 @@ var DocumentBody = /*#__PURE__*/function (_PureComponent) {
19
20
  args[_key] = arguments[_key];
20
21
  }
21
22
  _this = _callSuper(this, DocumentBody, [].concat(args));
23
+ // Ignored via go/ees005
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
25
  _defineProperty(_this, "renderChild", function (props) {
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line react/jsx-props-no-spreading
28
+ // Ignored via go/ees005
29
+ // eslint-disable-next-line react/jsx-props-no-spreading
23
30
  return /*#__PURE__*/React.createElement(Document, _extends({}, _this.props, props));
24
31
  });
32
+ // Ignored via go/ees005
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
34
  _defineProperty(_this, "stateMapper", function (state) {
26
35
  var doc = state.doc,
27
36
  hasError = state.hasError,
@@ -34,6 +43,8 @@ var DocumentBody = /*#__PURE__*/function (_PureComponent) {
34
43
  mode: mode
35
44
  };
36
45
  });
46
+ // Ignored via go/ees005
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
48
  _defineProperty(_this, "renderPropsMapper", function (renderProps) {
38
49
  var renderTitle = renderProps.renderTitle,
39
50
  renderToolbar = renderProps.renderToolbar;
@@ -8,9 +8,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
- import React from 'react';
12
- import { PureComponent } from 'react';
11
+ import React, { PureComponent } from 'react';
13
12
  import { Consumer } from '../consumers/consumer';
13
+ // Ignored via go/ees005
14
+ // eslint-disable-next-line @repo/internal/react/no-class-components
14
15
  var WithDocumentActions = /*#__PURE__*/function (_PureComponent) {
15
16
  function WithDocumentActions() {
16
17
  var _this;
@@ -21,6 +22,8 @@ var WithDocumentActions = /*#__PURE__*/function (_PureComponent) {
21
22
  _this = _callSuper(this, WithDocumentActions, [].concat(args));
22
23
  _defineProperty(_this, "actionsMapper", function (actions) {
23
24
  return {
25
+ // Ignored via go/ees005
26
+ // eslint-disable-next-line require-await, @typescript-eslint/no-explicit-any
24
27
  createDocument: function createDocument(value) {
25
28
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
26
29
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -34,6 +37,8 @@ var WithDocumentActions = /*#__PURE__*/function (_PureComponent) {
34
37
  }, _callee);
35
38
  }))();
36
39
  },
40
+ // Ignored via go/ees005
41
+ // eslint-disable-next-line require-await
37
42
  editDocument: function editDocument() {
38
43
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
39
44
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -47,6 +52,8 @@ var WithDocumentActions = /*#__PURE__*/function (_PureComponent) {
47
52
  }, _callee2);
48
53
  }))();
49
54
  },
55
+ // Ignored via go/ees005
56
+ // eslint-disable-next-line require-await, @typescript-eslint/no-explicit-any
50
57
  updateDocument: function updateDocument(value) {
51
58
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
52
59
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -60,6 +67,8 @@ var WithDocumentActions = /*#__PURE__*/function (_PureComponent) {
60
67
  }, _callee3);
61
68
  }))();
62
69
  },
70
+ // Ignored via go/ees005
71
+ // eslint-disable-next-line require-await
63
72
  cancelEdit: function cancelEdit() {
64
73
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
65
74
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
@@ -8,6 +8,8 @@ export var Context = /*#__PURE__*/createContext({
8
8
  getDocument: noop,
9
9
  getDocumentByObjectId: noop,
10
10
  setDocumentMode: noop,
11
+ // Ignored via go/ees005
12
+ // eslint-disable-next-line require-await
11
13
  updateDocument: function () {
12
14
  var _updateDocument = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
13
15
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -25,6 +27,8 @@ export var Context = /*#__PURE__*/createContext({
25
27
  }
26
28
  return updateDocument;
27
29
  }(),
30
+ // Ignored via go/ees005
31
+ // eslint-disable-next-line require-await
28
32
  createDocument: function () {
29
33
  var _createDocument = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
30
34
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -33,6 +33,8 @@ var Content = styled.div({
33
33
  padding: "0 ".concat("var(--ds-space-400, 32px)")
34
34
  }
35
35
  });
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line @repo/internal/react/no-class-components
36
38
  var EmbeddedDocument = /*#__PURE__*/function (_Component) {
37
39
  function EmbeddedDocument(props) {
38
40
  var _this;
@@ -86,6 +88,8 @@ var EmbeddedDocument = /*#__PURE__*/function (_Component) {
86
88
  return _ref2.apply(this, arguments);
87
89
  };
88
90
  }());
91
+ // Ignored via go/ees005
92
+ // eslint-disable-next-line require-await
89
93
  _defineProperty(_this, "setDocumentMode", /*#__PURE__*/function () {
90
94
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(mode) {
91
95
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -104,6 +108,8 @@ var EmbeddedDocument = /*#__PURE__*/function (_Component) {
104
108
  return _ref3.apply(this, arguments);
105
109
  };
106
110
  }());
111
+ // Ignored via go/ees005
112
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
113
  _defineProperty(_this, "updateDocument", /*#__PURE__*/function () {
108
114
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(body) {
109
115
  var _ref5, documentId, objectId, language, doc;
@@ -146,6 +152,8 @@ var EmbeddedDocument = /*#__PURE__*/function (_Component) {
146
152
  return _ref4.apply(this, arguments);
147
153
  };
148
154
  }());
155
+ // Ignored via go/ees005
156
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
157
  _defineProperty(_this, "createDocument", /*#__PURE__*/function () {
150
158
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(body) {
151
159
  var _this$props, objectId, language, doc;
@@ -92,7 +92,8 @@ var ServiceProvider = /*#__PURE__*/function () {
92
92
  return _getDocumentByObjectId.apply(this, arguments);
93
93
  }
94
94
  return getDocumentByObjectId;
95
- }()
95
+ }() // Ignored via go/ees005
96
+ // eslint-disable-next-line @typescript-eslint/max-params
96
97
  }, {
97
98
  key: "updateDocument",
98
99
  value: function () {
@@ -137,7 +138,8 @@ var ServiceProvider = /*#__PURE__*/function () {
137
138
  return _updateDocument.apply(this, arguments);
138
139
  }
139
140
  return updateDocument;
140
- }()
141
+ }() // Ignored via go/ees005
142
+ // eslint-disable-next-line @typescript-eslint/max-params
141
143
  }, {
142
144
  key: "createDocument",
143
145
  value: function () {
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
- import { PureComponent } from 'react';
1
+ import React, { PureComponent } from 'react';
3
2
  import { type Actions, type State } from '../context/context';
4
- export interface Props<PropsFromState extends {}, PropsFromActions extends {}, RenderProps extends {}> {
3
+ export interface Props<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> {
5
4
  stateMapper?: (state: State) => PropsFromState;
6
5
  actionsMapper?: (actions: Actions) => PropsFromActions;
7
6
  renderPropsMapper?: (renderProps: any) => RenderProps;
@@ -12,7 +11,7 @@ export interface ConsumerProps<A, V, R> {
12
11
  value: V;
13
12
  renderProps: R;
14
13
  }
15
- export declare class Consumer<PropsFromState extends {}, PropsFromActions extends {}, RenderProps extends {}> extends PureComponent<Props<PropsFromState, PropsFromActions, RenderProps>> {
14
+ export declare class Consumer<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> extends PureComponent<Props<PropsFromState, PropsFromActions, RenderProps>> {
16
15
  private previousActions;
17
16
  private propsFromActions;
18
17
  private getPropsFromActions;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { PureComponent } from 'react';
1
+ import React, { PureComponent } from 'react';
3
2
  import { type Document as DocumentModel } from '../model';
4
3
  export interface Props {
5
4
  render(actions: DocumentActions): React.ReactNode;
@@ -7,8 +7,7 @@ export interface Document {
7
7
  title?: string;
8
8
  body: string;
9
9
  }
10
- export interface User {
11
- }
10
+ export type User = Object;
12
11
  export interface BatchDocumentResponse {
13
12
  documentId: string;
14
13
  language: {
@@ -1,8 +1,7 @@
1
1
  import { type ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import { type Provider } from './provider';
3
3
  import { type Document } from '../model';
4
- export interface Config extends ServiceConfig {
5
- }
4
+ export type Config = ServiceConfig;
6
5
  export default class ServiceProvider implements Provider {
7
6
  private config;
8
7
  constructor(config: Config);
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
- import { PureComponent } from 'react';
1
+ import React, { PureComponent } from 'react';
3
2
  import { type Actions, type State } from '../context/context';
4
- export interface Props<PropsFromState extends {}, PropsFromActions extends {}, RenderProps extends {}> {
3
+ export interface Props<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> {
5
4
  stateMapper?: (state: State) => PropsFromState;
6
5
  actionsMapper?: (actions: Actions) => PropsFromActions;
7
6
  renderPropsMapper?: (renderProps: any) => RenderProps;
@@ -12,7 +11,7 @@ export interface ConsumerProps<A, V, R> {
12
11
  value: V;
13
12
  renderProps: R;
14
13
  }
15
- export declare class Consumer<PropsFromState extends {}, PropsFromActions extends {}, RenderProps extends {}> extends PureComponent<Props<PropsFromState, PropsFromActions, RenderProps>> {
14
+ export declare class Consumer<PropsFromState extends Object, PropsFromActions extends Object, RenderProps extends Object> extends PureComponent<Props<PropsFromState, PropsFromActions, RenderProps>> {
16
15
  private previousActions;
17
16
  private propsFromActions;
18
17
  private getPropsFromActions;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { PureComponent } from 'react';
1
+ import React, { PureComponent } from 'react';
3
2
  import { type Document as DocumentModel } from '../model';
4
3
  export interface Props {
5
4
  render(actions: DocumentActions): React.ReactNode;
@@ -7,8 +7,7 @@ export interface Document {
7
7
  title?: string;
8
8
  body: string;
9
9
  }
10
- export interface User {
11
- }
10
+ export type User = Object;
12
11
  export interface BatchDocumentResponse {
13
12
  documentId: string;
14
13
  language: {
@@ -1,8 +1,7 @@
1
1
  import { type ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import { type Provider } from './provider';
3
3
  import { type Document } from '../model';
4
- export interface Config extends ServiceConfig {
5
- }
4
+ export type Config = ServiceConfig;
6
5
  export default class ServiceProvider implements Provider {
7
6
  private config;
8
7
  constructor(config: Config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/embedded-document",
3
- "version": "0.9.102",
3
+ "version": "0.9.103",
4
4
  "description": "DEPRECATED Embedded Document component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@atlaskit/button": "^20.3.0",
38
- "@atlaskit/editor-common": "^97.0.0",
39
- "@atlaskit/editor-core": "^203.7.0",
38
+ "@atlaskit/editor-common": "^98.0.0",
39
+ "@atlaskit/editor-core": "^203.9.0",
40
40
  "@atlaskit/editor-shared-styles": "^3.2.0",
41
- "@atlaskit/renderer": "^112.7.0",
41
+ "@atlaskit/renderer": "^112.8.0",
42
42
  "@atlaskit/tokens": "2.5.0",
43
43
  "@atlaskit/util-service-support": "^6.2.0",
44
44
  "@babel/runtime": "^7.0.0"
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "baseUrl": "./"
5
4
  },
6
5
  "include": [
7
6
  "./src/**/*.ts",