@atlaskit/editor-plugin-loom 0.2.2 → 0.2.3

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-loom
2
2
 
3
+ ## 0.2.3
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
  ## 0.2.2
4
10
 
5
11
  ### Patch Changes
@@ -78,8 +78,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
78
78
  view: function view(editorView) {
79
79
  var setupLoom = /*#__PURE__*/function () {
80
80
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
81
- var _api$analytics3;
82
- var _yield$import, isSupported, setup, _yield$isSupported, supported, error, _api$analytics2, _yield$setup, configureButton, loomButton, sdkButton;
81
+ var _api$core3, _api$analytics3;
82
+ var _yield$import, isSupported, setup, _yield$isSupported, supported, error, _api$core, _api$analytics2, _yield$setup, configureButton, loomButton, sdkButton;
83
83
  return _regenerator.default.wrap(function _callee2$(_context2) {
84
84
  while (1) switch (_context2.prev = _context2.next) {
85
85
  case 0:
@@ -103,7 +103,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
103
103
  }
104
104
  // Keep plugin state update and analytics separate to avoid accidentally not updating
105
105
  // plugin state due to collab-edit filtering out transactions with steps
106
- api === null || api === void 0 || api.core.actions.execute((0, _commands.disableLoom)({
106
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute((0, _commands.disableLoom)({
107
107
  error: error
108
108
  }));
109
109
  (0, _monitoring.logException)(new Error(error), {
@@ -135,7 +135,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
135
135
  }); // Attach insertion logic to the event handlers on the SDK
136
136
  sdkButton.on('insert-click', /*#__PURE__*/function () {
137
137
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(video) {
138
- var _api$hyperlink;
138
+ var _api$hyperlink, _api$core2;
139
139
  var state, dispatch, pos;
140
140
  return _regenerator.default.wrap(function _callee$(_context) {
141
141
  while (1) switch (_context.prev = _context.next) {
@@ -146,7 +146,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
146
146
  // from === to, don't replace text to avoid accidental content loss
147
147
  pos, video.sharedUrl, video.title, undefined, undefined, undefined, 'embed' // Convert to embed card instead of inline
148
148
  )(state, dispatch);
149
- api === null || api === void 0 || api.core.actions.execute((0, _commands.insertVideo)({
149
+ api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute((0, _commands.insertVideo)({
150
150
  editorAnalyticsAPI: editorAnalyticsAPI,
151
151
  video: video
152
152
  }));
@@ -160,7 +160,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
160
160
  return _ref2.apply(this, arguments);
161
161
  };
162
162
  }());
163
- api === null || api === void 0 || api.core.actions.execute((0, _commands.enableLoom)({
163
+ api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute((0, _commands.enableLoom)({
164
164
  loomButton: loomButton
165
165
  }));
166
166
  // We're not combining the analytics steps into the enable / disable commands because the collab-edit plugin
@@ -26,8 +26,8 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
26
26
  return /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarButton, {
27
27
  buttonId: _uiMenu.TOOLBAR_BUTTON.RECORD_VIDEO,
28
28
  onClick: function onClick() {
29
- var _api$analytics;
30
- return api === null || api === void 0 ? void 0 : api.core.actions.execute((0, _commands.recordVideo)({
29
+ var _api$core, _api$analytics;
30
+ return api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute((0, _commands.recordVideo)({
31
31
  inputMethod: _analytics.INPUT_METHOD.TOOLBAR,
32
32
  editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
33
33
  }));
@@ -66,7 +66,7 @@ export const createPlugin = api => {
66
66
  },
67
67
  view(editorView) {
68
68
  const setupLoom = async () => {
69
- var _api$analytics3;
69
+ var _api$core3, _api$analytics3;
70
70
  // Asynchronously check if the Loom SDK is supported
71
71
  // it hits a Loom API so could take a while
72
72
  const {
@@ -78,10 +78,10 @@ export const createPlugin = api => {
78
78
  error
79
79
  } = await isSupported();
80
80
  if (!supported) {
81
- var _api$analytics2;
81
+ var _api$core, _api$analytics2;
82
82
  // Keep plugin state update and analytics separate to avoid accidentally not updating
83
83
  // plugin state due to collab-edit filtering out transactions with steps
84
- api === null || api === void 0 ? void 0 : api.core.actions.execute(disableLoom({
84
+ api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(disableLoom({
85
85
  error
86
86
  }));
87
87
  logException(new Error(error), {
@@ -113,7 +113,7 @@ export const createPlugin = api => {
113
113
 
114
114
  // Attach insertion logic to the event handlers on the SDK
115
115
  sdkButton.on('insert-click', async video => {
116
- var _api$hyperlink;
116
+ var _api$hyperlink, _api$core2;
117
117
  const {
118
118
  state,
119
119
  dispatch
@@ -123,12 +123,12 @@ export const createPlugin = api => {
123
123
  // from === to, don't replace text to avoid accidental content loss
124
124
  pos, video.sharedUrl, video.title, undefined, undefined, undefined, 'embed' // Convert to embed card instead of inline
125
125
  )(state, dispatch);
126
- api === null || api === void 0 ? void 0 : api.core.actions.execute(insertVideo({
126
+ api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(insertVideo({
127
127
  editorAnalyticsAPI,
128
128
  video
129
129
  }));
130
130
  });
131
- api === null || api === void 0 ? void 0 : api.core.actions.execute(enableLoom({
131
+ api === null || api === void 0 ? void 0 : (_api$core3 = api.core) === null || _api$core3 === void 0 ? void 0 : _api$core3.actions.execute(enableLoom({
132
132
  loomButton
133
133
  }));
134
134
  // We're not combining the analytics steps into the enable / disable commands because the collab-edit plugin
@@ -23,8 +23,8 @@ const LoomToolbarButton = ({
23
23
  return /*#__PURE__*/React.createElement(ToolbarButton, {
24
24
  buttonId: TOOLBAR_BUTTON.RECORD_VIDEO,
25
25
  onClick: () => {
26
- var _api$analytics;
27
- return api === null || api === void 0 ? void 0 : api.core.actions.execute(recordVideo({
26
+ var _api$core, _api$analytics;
27
+ return api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(recordVideo({
28
28
  inputMethod: INPUT_METHOD.TOOLBAR,
29
29
  editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
30
30
  }));
@@ -68,8 +68,8 @@ export var createPlugin = function createPlugin(api) {
68
68
  view: function view(editorView) {
69
69
  var setupLoom = /*#__PURE__*/function () {
70
70
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
71
- var _api$analytics3;
72
- var _yield$import, isSupported, setup, _yield$isSupported, supported, error, _api$analytics2, _yield$setup, configureButton, loomButton, sdkButton;
71
+ var _api$core3, _api$analytics3;
72
+ var _yield$import, isSupported, setup, _yield$isSupported, supported, error, _api$core, _api$analytics2, _yield$setup, configureButton, loomButton, sdkButton;
73
73
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
74
74
  while (1) switch (_context2.prev = _context2.next) {
75
75
  case 0:
@@ -91,7 +91,7 @@ export var createPlugin = function createPlugin(api) {
91
91
  }
92
92
  // Keep plugin state update and analytics separate to avoid accidentally not updating
93
93
  // plugin state due to collab-edit filtering out transactions with steps
94
- api === null || api === void 0 || api.core.actions.execute(disableLoom({
94
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(disableLoom({
95
95
  error: error
96
96
  }));
97
97
  logException(new Error(error), {
@@ -123,7 +123,7 @@ export var createPlugin = function createPlugin(api) {
123
123
  }); // Attach insertion logic to the event handlers on the SDK
124
124
  sdkButton.on('insert-click', /*#__PURE__*/function () {
125
125
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(video) {
126
- var _api$hyperlink;
126
+ var _api$hyperlink, _api$core2;
127
127
  var state, dispatch, pos;
128
128
  return _regeneratorRuntime.wrap(function _callee$(_context) {
129
129
  while (1) switch (_context.prev = _context.next) {
@@ -134,7 +134,7 @@ export var createPlugin = function createPlugin(api) {
134
134
  // from === to, don't replace text to avoid accidental content loss
135
135
  pos, video.sharedUrl, video.title, undefined, undefined, undefined, 'embed' // Convert to embed card instead of inline
136
136
  )(state, dispatch);
137
- api === null || api === void 0 || api.core.actions.execute(insertVideo({
137
+ api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(insertVideo({
138
138
  editorAnalyticsAPI: editorAnalyticsAPI,
139
139
  video: video
140
140
  }));
@@ -148,7 +148,7 @@ export var createPlugin = function createPlugin(api) {
148
148
  return _ref2.apply(this, arguments);
149
149
  };
150
150
  }());
151
- api === null || api === void 0 || api.core.actions.execute(enableLoom({
151
+ api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(enableLoom({
152
152
  loomButton: loomButton
153
153
  }));
154
154
  // We're not combining the analytics steps into the enable / disable commands because the collab-edit plugin
@@ -19,8 +19,8 @@ var LoomToolbarButton = function LoomToolbarButton(_ref) {
19
19
  return /*#__PURE__*/React.createElement(ToolbarButton, {
20
20
  buttonId: TOOLBAR_BUTTON.RECORD_VIDEO,
21
21
  onClick: function onClick() {
22
- var _api$analytics;
23
- return api === null || api === void 0 ? void 0 : api.core.actions.execute(recordVideo({
22
+ var _api$core, _api$analytics;
23
+ return api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(recordVideo({
24
24
  inputMethod: INPUT_METHOD.TOOLBAR,
25
25
  editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
26
26
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-loom",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Loom plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "runReact18": false
19
19
  },
20
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
20
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
21
21
  "main": "dist/cjs/index.js",
22
22
  "module": "dist/esm/index.js",
23
23
  "module:es2019": "dist/es2019/index.js",
@@ -36,7 +36,7 @@
36
36
  ".": "./src/index.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@atlaskit/editor-common": "^76.37.0",
39
+ "@atlaskit/editor-common": "^76.39.0",
40
40
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
41
41
  "@atlaskit/editor-plugin-hyperlink": "^0.8.0",
42
42
  "@atlaskit/editor-prosemirror": "1.1.0",