@atlaskit/teams-public 1.4.1 → 1.4.2

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 (23) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/controllers/hooks/use-product-permission/index.js +1 -1
  3. package/dist/cjs/controllers/hooks/use-team-containers/index.js +81 -81
  4. package/dist/cjs/controllers/hooks/use-team-containers/multi-team.js +91 -91
  5. package/dist/cjs/controllers/hooks/use-team-links-and-containers/index.js +25 -25
  6. package/dist/cjs/controllers/hooks/use-team-web-links/index.js +65 -65
  7. package/dist/cjs/controllers/hooks/use-team-web-links/multi-team.js +73 -73
  8. package/dist/cjs/controllers/product-permission/main.js +19 -19
  9. package/dist/cjs/next/ui/team-containers/team-link-card/index.js +1 -23
  10. package/dist/cjs/ui/team-containers/disconnect-dialog/index.js +4 -4
  11. package/dist/cjs/ui/team-containers/main.js +9 -9
  12. package/dist/es2019/next/ui/team-containers/team-link-card/index.js +2 -24
  13. package/dist/esm/controllers/hooks/use-product-permission/index.js +1 -1
  14. package/dist/esm/controllers/hooks/use-team-containers/index.js +81 -81
  15. package/dist/esm/controllers/hooks/use-team-containers/multi-team.js +91 -91
  16. package/dist/esm/controllers/hooks/use-team-links-and-containers/index.js +25 -25
  17. package/dist/esm/controllers/hooks/use-team-web-links/index.js +65 -65
  18. package/dist/esm/controllers/hooks/use-team-web-links/multi-team.js +73 -73
  19. package/dist/esm/controllers/product-permission/main.js +19 -19
  20. package/dist/esm/next/ui/team-containers/team-link-card/index.js +2 -24
  21. package/dist/esm/ui/team-containers/disconnect-dialog/index.js +4 -4
  22. package/dist/esm/ui/team-containers/main.js +9 -9
  23. package/package.json +11 -13
@@ -25,18 +25,18 @@ export var actions = {
25
25
  getTeamWebLinks: function getTeamWebLinks(teamId) {
26
26
  return /*#__PURE__*/function () {
27
27
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
28
- var getState, setState, dispatch, _getState, links, currentTeamId, hasLoaded, isLoading, initialLinks, _yield$teamsClient$ge, entities;
29
- return _regeneratorRuntime.wrap(function _callee$(_context) {
28
+ var getState, setState, dispatch, _getState, links, currentTeamId, hasLoaded, isLoading, initialLinks, _yield$teamsClient$ge, entities, _t;
29
+ return _regeneratorRuntime.wrap(function (_context) {
30
30
  while (1) switch (_context.prev = _context.next) {
31
31
  case 0:
32
32
  getState = _ref.getState, setState = _ref.setState, dispatch = _ref.dispatch;
33
33
  _getState = getState(), links = _getState.links, currentTeamId = _getState.teamId, hasLoaded = _getState.hasLoaded, isLoading = _getState.isLoading;
34
34
  if (!(isLoading || teamId === currentTeamId && hasLoaded && links.length > 0)) {
35
- _context.next = 4;
35
+ _context.next = 1;
36
36
  break;
37
37
  }
38
38
  return _context.abrupt("return");
39
- case 4:
39
+ case 1:
40
40
  initialLinks = teamId === currentTeamId ? links : [];
41
41
  setState({
42
42
  teamId: teamId,
@@ -46,18 +46,18 @@ export var actions = {
46
46
  shouldReload: false,
47
47
  links: initialLinks
48
48
  });
49
- _context.prev = 6;
50
- _context.next = 9;
49
+ _context.prev = 2;
50
+ _context.next = 3;
51
51
  return teamsClient.getTeamLinksByTeamId(teamId);
52
- case 9:
52
+ case 3:
53
53
  _yield$teamsClient$ge = _context.sent;
54
54
  entities = _yield$teamsClient$ge.entities;
55
55
  if (!(getState().teamId !== teamId)) {
56
- _context.next = 13;
56
+ _context.next = 4;
57
57
  break;
58
58
  }
59
59
  return _context.abrupt("return");
60
- case 13:
60
+ case 4:
61
61
  setState({
62
62
  isLoading: false,
63
63
  hasLoaded: true,
@@ -68,30 +68,30 @@ export var actions = {
68
68
  if (entities.length > 0) {
69
69
  dispatch(actions.getTeamWebLinkIcons(teamId));
70
70
  }
71
- _context.next = 22;
71
+ _context.next = 7;
72
72
  break;
73
- case 17:
74
- _context.prev = 17;
75
- _context.t0 = _context["catch"](6);
73
+ case 5:
74
+ _context.prev = 5;
75
+ _t = _context["catch"](2);
76
76
  if (!(getState().teamId !== teamId)) {
77
- _context.next = 21;
77
+ _context.next = 6;
78
78
  break;
79
79
  }
80
80
  return _context.abrupt("return");
81
- case 21:
81
+ case 6:
82
82
  setState({
83
83
  isLoading: false,
84
84
  hasLoaded: true,
85
85
  hasError: true,
86
- errorType: _context.t0 instanceof Error ? _context.t0 : undefined,
86
+ errorType: _t instanceof Error ? _t : undefined,
87
87
  shouldReload: false,
88
88
  links: []
89
89
  });
90
- case 22:
90
+ case 7:
91
91
  case "end":
92
92
  return _context.stop();
93
93
  }
94
- }, _callee, null, [[6, 17]]);
94
+ }, _callee, null, [[2, 5]]);
95
95
  }));
96
96
  return function (_x) {
97
97
  return _ref2.apply(this, arguments);
@@ -101,18 +101,18 @@ export var actions = {
101
101
  getTeamWebLinkIcons: function getTeamWebLinkIcons(teamId) {
102
102
  return /*#__PURE__*/function () {
103
103
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
104
- var getState, setState, _getState2, links, currentIcons, linkUrls, uncachedUrls, newIconData;
105
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
104
+ var getState, setState, _getState2, links, currentIcons, linkUrls, uncachedUrls, newIconData, _t2;
105
+ return _regeneratorRuntime.wrap(function (_context2) {
106
106
  while (1) switch (_context2.prev = _context2.next) {
107
107
  case 0:
108
108
  getState = _ref3.getState, setState = _ref3.setState;
109
109
  _getState2 = getState(), links = _getState2.links, currentIcons = _getState2.linkIcons;
110
110
  if (!(links.length === 0)) {
111
- _context2.next = 4;
111
+ _context2.next = 1;
112
112
  break;
113
113
  }
114
114
  return _context2.abrupt("return");
115
- case 4:
115
+ case 1:
116
116
  linkUrls = links.map(function (link) {
117
117
  return link.linkUri;
118
118
  });
@@ -122,17 +122,17 @@ export var actions = {
122
122
  });
123
123
  });
124
124
  if (!(uncachedUrls.length > 0)) {
125
- _context2.next = 20;
125
+ _context2.next = 6;
126
126
  break;
127
127
  }
128
- _context2.prev = 7;
128
+ _context2.prev = 2;
129
129
  setState({
130
130
  iconsLoading: true,
131
131
  iconsError: false
132
132
  });
133
- _context2.next = 11;
133
+ _context2.next = 3;
134
134
  return teamsClient.getTeamLinkIcons(uncachedUrls);
135
- case 11:
135
+ case 3:
136
136
  newIconData = _context2.sent;
137
137
  if (getState().teamId === teamId) {
138
138
  setState({
@@ -142,11 +142,11 @@ export var actions = {
142
142
  iconHasLoaded: true
143
143
  });
144
144
  }
145
- _context2.next = 18;
145
+ _context2.next = 5;
146
146
  break;
147
- case 15:
148
- _context2.prev = 15;
149
- _context2.t0 = _context2["catch"](7);
147
+ case 4:
148
+ _context2.prev = 4;
149
+ _t2 = _context2["catch"](2);
150
150
  if (getState().teamId === teamId) {
151
151
  setState({
152
152
  iconsLoading: false,
@@ -154,20 +154,20 @@ export var actions = {
154
154
  iconHasLoaded: true
155
155
  });
156
156
  }
157
- case 18:
158
- _context2.next = 21;
157
+ case 5:
158
+ _context2.next = 7;
159
159
  break;
160
- case 20:
160
+ case 6:
161
161
  setState({
162
162
  iconsLoading: false,
163
163
  iconsError: false,
164
164
  iconHasLoaded: true
165
165
  });
166
- case 21:
166
+ case 7:
167
167
  case "end":
168
168
  return _context2.stop();
169
169
  }
170
- }, _callee2, null, [[7, 15]]);
170
+ }, _callee2, null, [[2, 4]]);
171
171
  }));
172
172
  return function (_x2) {
173
173
  return _ref4.apply(this, arguments);
@@ -178,27 +178,27 @@ export var actions = {
178
178
  return /*#__PURE__*/function () {
179
179
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
180
180
  var getState, setState, dispatch, result, currentState;
181
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
181
+ return _regeneratorRuntime.wrap(function (_context3) {
182
182
  while (1) switch (_context3.prev = _context3.next) {
183
183
  case 0:
184
184
  getState = _ref5.getState, setState = _ref5.setState, dispatch = _ref5.dispatch;
185
- _context3.next = 3;
185
+ _context3.next = 1;
186
186
  return teamsClient.createTeamLink(teamId, newLink);
187
- case 3:
187
+ case 1:
188
188
  result = _context3.sent;
189
189
  currentState = getState();
190
190
  if (!(currentState.teamId !== teamId)) {
191
- _context3.next = 7;
191
+ _context3.next = 2;
192
192
  break;
193
193
  }
194
194
  return _context3.abrupt("return", result);
195
- case 7:
195
+ case 2:
196
196
  setState({
197
197
  links: [].concat(_toConsumableArray(currentState.links), [result])
198
198
  });
199
199
  dispatch(actions.getTeamWebLinkIcons(teamId));
200
200
  return _context3.abrupt("return", result);
201
- case 10:
201
+ case 3:
202
202
  case "end":
203
203
  return _context3.stop();
204
204
  }
@@ -213,21 +213,21 @@ export var actions = {
213
213
  return /*#__PURE__*/function () {
214
214
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
215
215
  var getState, setState, dispatch, result, currentState, oldLink, urlChanged, updatedIcons;
216
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
216
+ return _regeneratorRuntime.wrap(function (_context4) {
217
217
  while (1) switch (_context4.prev = _context4.next) {
218
218
  case 0:
219
219
  getState = _ref7.getState, setState = _ref7.setState, dispatch = _ref7.dispatch;
220
- _context4.next = 3;
220
+ _context4.next = 1;
221
221
  return teamsClient.updateTeamLink(teamId, linkId, newLink);
222
- case 3:
222
+ case 1:
223
223
  result = _context4.sent;
224
224
  currentState = getState();
225
225
  if (!(currentState.teamId !== teamId)) {
226
- _context4.next = 7;
226
+ _context4.next = 2;
227
227
  break;
228
228
  }
229
229
  return _context4.abrupt("return", result);
230
- case 7:
230
+ case 2:
231
231
  oldLink = currentState.links.find(function (link) {
232
232
  return link.linkId === linkId;
233
233
  });
@@ -247,7 +247,7 @@ export var actions = {
247
247
  dispatch(actions.getTeamWebLinkIcons(teamId));
248
248
  }
249
249
  return _context4.abrupt("return", result);
250
- case 12:
250
+ case 3:
251
251
  case "end":
252
252
  return _context4.stop();
253
253
  }
@@ -262,26 +262,26 @@ export var actions = {
262
262
  return /*#__PURE__*/function () {
263
263
  var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
264
264
  var getState, setState, currentState;
265
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
265
+ return _regeneratorRuntime.wrap(function (_context5) {
266
266
  while (1) switch (_context5.prev = _context5.next) {
267
267
  case 0:
268
268
  getState = _ref9.getState, setState = _ref9.setState;
269
269
  currentState = getState();
270
270
  if (!(currentState.teamId !== teamId)) {
271
- _context5.next = 4;
271
+ _context5.next = 1;
272
272
  break;
273
273
  }
274
274
  return _context5.abrupt("return");
275
- case 4:
276
- _context5.next = 6;
275
+ case 1:
276
+ _context5.next = 2;
277
277
  return teamsClient.deleteTeamLink(teamId, linkId);
278
- case 6:
278
+ case 2:
279
279
  setState({
280
280
  links: currentState.links.filter(function (link) {
281
281
  return link.linkId !== linkId;
282
282
  })
283
283
  });
284
- case 7:
284
+ case 3:
285
285
  case "end":
286
286
  return _context5.stop();
287
287
  }
@@ -295,32 +295,32 @@ export var actions = {
295
295
  fetchWebLinkTitle: function fetchWebLinkTitle(url) {
296
296
  return /*#__PURE__*/function () {
297
297
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
298
- var setState, title;
299
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
298
+ var setState, title, _t3;
299
+ return _regeneratorRuntime.wrap(function (_context6) {
300
300
  while (1) switch (_context6.prev = _context6.next) {
301
301
  case 0:
302
302
  setState = _ref1.setState;
303
303
  if (url) {
304
- _context6.next = 3;
304
+ _context6.next = 1;
305
305
  break;
306
306
  }
307
307
  return _context6.abrupt("return", undefined);
308
- case 3:
309
- _context6.prev = 3;
310
- _context6.next = 6;
308
+ case 1:
309
+ _context6.prev = 1;
310
+ _context6.next = 2;
311
311
  return teamsClient.getWebLinkTitle(url);
312
- case 6:
312
+ case 2:
313
313
  title = _context6.sent;
314
314
  return _context6.abrupt("return", title);
315
- case 10:
316
- _context6.prev = 10;
317
- _context6.t0 = _context6["catch"](3);
315
+ case 3:
316
+ _context6.prev = 3;
317
+ _t3 = _context6["catch"](1);
318
318
  return _context6.abrupt("return", undefined);
319
- case 13:
319
+ case 4:
320
320
  case "end":
321
321
  return _context6.stop();
322
322
  }
323
- }, _callee6, null, [[3, 10]]);
323
+ }, _callee6, null, [[1, 3]]);
324
324
  }));
325
325
  return function (_x6) {
326
326
  return _ref10.apply(this, arguments);