@trycourier/react-hooks 5.0.1-internal.c229fad.0 → 5.1.0
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/dist/inbox/actions/add-tag.js +20 -0
- package/dist/inbox/actions/remove-tag.js +20 -0
- package/dist/inbox/reducer.js +83 -18
- package/dist/inbox/use-inbox-actions.js +102 -6
- package/package.json +3 -3
- package/typings/inbox/actions/add-tag.d.ts +10 -0
- package/typings/inbox/actions/add-tag.d.ts.map +1 -0
- package/typings/inbox/actions/remove-tag.d.ts +10 -0
- package/typings/inbox/actions/remove-tag.d.ts.map +1 -0
- package/typings/inbox/reducer.d.ts +3 -1
- package/typings/inbox/reducer.d.ts.map +1 -1
- package/typings/inbox/use-inbox-actions.d.ts +2 -0
- package/typings/inbox/use-inbox-actions.d.ts.map +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addTag = exports.INBOX_ADD_TAG = void 0;
|
|
7
|
+
var INBOX_ADD_TAG = "inbox/ADD_TAG";
|
|
8
|
+
exports.INBOX_ADD_TAG = INBOX_ADD_TAG;
|
|
9
|
+
|
|
10
|
+
var addTag = function addTag(messageId, tag) {
|
|
11
|
+
return {
|
|
12
|
+
type: INBOX_ADD_TAG,
|
|
13
|
+
payload: {
|
|
14
|
+
tag: tag,
|
|
15
|
+
messageId: messageId
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.addTag = addTag;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.removeTag = exports.INBOX_REMOVE_TAG = void 0;
|
|
7
|
+
var INBOX_REMOVE_TAG = "inbox/REMOVE_TAG";
|
|
8
|
+
exports.INBOX_REMOVE_TAG = INBOX_REMOVE_TAG;
|
|
9
|
+
|
|
10
|
+
var removeTag = function removeTag(messageId, tag) {
|
|
11
|
+
return {
|
|
12
|
+
type: INBOX_REMOVE_TAG,
|
|
13
|
+
payload: {
|
|
14
|
+
tag: tag,
|
|
15
|
+
messageId: messageId
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.removeTag = removeTag;
|
package/dist/inbox/reducer.js
CHANGED
|
@@ -25,6 +25,10 @@ var _unpinMessage = require("./actions/unpin-message");
|
|
|
25
25
|
|
|
26
26
|
var _resetLastFetched = require("./actions/reset-last-fetched");
|
|
27
27
|
|
|
28
|
+
var _addTag = require("./actions/add-tag");
|
|
29
|
+
|
|
30
|
+
var _removeTag = require("./actions/remove-tag");
|
|
31
|
+
|
|
28
32
|
var _markMessageArchived = require("./actions/mark-message-archived");
|
|
29
33
|
|
|
30
34
|
var _markMessageRead = require("./actions/mark-message-read");
|
|
@@ -235,11 +239,72 @@ var _default = function _default() {
|
|
|
235
239
|
});
|
|
236
240
|
}
|
|
237
241
|
|
|
238
|
-
case
|
|
242
|
+
case _addTag.INBOX_ADD_TAG:
|
|
239
243
|
{
|
|
240
244
|
var _state$pinned4, _state$messages5;
|
|
241
245
|
|
|
242
|
-
var
|
|
246
|
+
var handleAddTag = function handleAddTag(message) {
|
|
247
|
+
if (message.messageId === action.payload.messageId) {
|
|
248
|
+
var _message$tags;
|
|
249
|
+
|
|
250
|
+
var tags = (_message$tags = message.tags) !== null && _message$tags !== void 0 ? _message$tags : [];
|
|
251
|
+
|
|
252
|
+
if (!tags.includes(action.payload.tag)) {
|
|
253
|
+
tags.push(action.payload.tag);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return _objectSpread(_objectSpread({}, message), {}, {
|
|
257
|
+
tags: tags
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return message;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
var _newPinned3 = (_state$pinned4 = state.pinned) === null || _state$pinned4 === void 0 ? void 0 : _state$pinned4.map(handleAddTag);
|
|
265
|
+
|
|
266
|
+
var _newMessages4 = (_state$messages5 = state.messages) === null || _state$messages5 === void 0 ? void 0 : _state$messages5.map(handleAddTag);
|
|
267
|
+
|
|
268
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
269
|
+
pinned: _newPinned3,
|
|
270
|
+
messages: _newMessages4
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
case _removeTag.INBOX_REMOVE_TAG:
|
|
275
|
+
{
|
|
276
|
+
var _state$pinned5, _state$messages6;
|
|
277
|
+
|
|
278
|
+
var handleRemoveTag = function handleRemoveTag(message) {
|
|
279
|
+
if (message.messageId === action.payload.messageId) {
|
|
280
|
+
var _message$tags2;
|
|
281
|
+
|
|
282
|
+
var tags = message === null || message === void 0 ? void 0 : (_message$tags2 = message.tags) === null || _message$tags2 === void 0 ? void 0 : _message$tags2.filter(function (t) {
|
|
283
|
+
return t !== action.payload.tag;
|
|
284
|
+
});
|
|
285
|
+
return _objectSpread(_objectSpread({}, message), {}, {
|
|
286
|
+
tags: tags
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return message;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
var _newPinned4 = (_state$pinned5 = state.pinned) === null || _state$pinned5 === void 0 ? void 0 : _state$pinned5.map(handleRemoveTag);
|
|
294
|
+
|
|
295
|
+
var _newMessages5 = (_state$messages6 = state.messages) === null || _state$messages6 === void 0 ? void 0 : _state$messages6.map(handleRemoveTag);
|
|
296
|
+
|
|
297
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
298
|
+
pinned: _newPinned4,
|
|
299
|
+
messages: _newMessages5
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
case _unpinMessage.INBOX_UNPIN_MESSAGE:
|
|
304
|
+
{
|
|
305
|
+
var _state$pinned6, _state$messages7;
|
|
306
|
+
|
|
307
|
+
var pinned = (_state$pinned6 = state.pinned) !== null && _state$pinned6 !== void 0 ? _state$pinned6 : [];
|
|
243
308
|
var messageToUnpin = pinned === null || pinned === void 0 ? void 0 : pinned.find(function (p) {
|
|
244
309
|
return p.messageId === action.payload.messageId;
|
|
245
310
|
});
|
|
@@ -252,7 +317,7 @@ var _default = function _default() {
|
|
|
252
317
|
pinned: pinned.filter(function (p) {
|
|
253
318
|
return p.messageId !== action.payload.messageId;
|
|
254
319
|
}),
|
|
255
|
-
messages: [].concat((0, _toConsumableArray2["default"])((_state$
|
|
320
|
+
messages: [].concat((0, _toConsumableArray2["default"])((_state$messages7 = state.messages) !== null && _state$messages7 !== void 0 ? _state$messages7 : []), [_objectSpread(_objectSpread({}, messageToUnpin), {}, {
|
|
256
321
|
pinned: undefined
|
|
257
322
|
})]).sort(sortMessages)
|
|
258
323
|
});
|
|
@@ -260,7 +325,7 @@ var _default = function _default() {
|
|
|
260
325
|
|
|
261
326
|
case _markMessageArchived.INBOX_MARK_MESSAGE_ARCHIVED:
|
|
262
327
|
{
|
|
263
|
-
var _state$unreadMessageC3, _state$
|
|
328
|
+
var _state$unreadMessageC3, _state$pinned7, _state$messages8;
|
|
264
329
|
|
|
265
330
|
var _unreadMessageCount2 = (_state$unreadMessageC3 = state.unreadMessageCount) !== null && _state$unreadMessageC3 !== void 0 ? _state$unreadMessageC3 : 0;
|
|
266
331
|
|
|
@@ -274,45 +339,45 @@ var _default = function _default() {
|
|
|
274
339
|
return !isMatching;
|
|
275
340
|
};
|
|
276
341
|
|
|
277
|
-
var
|
|
342
|
+
var _newPinned5 = (_state$pinned7 = state.pinned) === null || _state$pinned7 === void 0 ? void 0 : _state$pinned7.filter(handleArchived);
|
|
278
343
|
|
|
279
|
-
var
|
|
344
|
+
var _newMessages6 = (_state$messages8 = state.messages) === null || _state$messages8 === void 0 ? void 0 : _state$messages8.filter(handleArchived);
|
|
280
345
|
|
|
281
346
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
282
|
-
pinned:
|
|
283
|
-
messages:
|
|
347
|
+
pinned: _newPinned5,
|
|
348
|
+
messages: _newMessages6,
|
|
284
349
|
unreadMessageCount: _unreadMessageCount2
|
|
285
350
|
});
|
|
286
351
|
}
|
|
287
352
|
|
|
288
353
|
case _newMessage.INBOX_NEW_MESSAGE:
|
|
289
354
|
{
|
|
290
|
-
var _newMessage$pinned, _state$unreadMessageC5, _state$
|
|
355
|
+
var _newMessage$pinned, _state$unreadMessageC5, _state$messages9;
|
|
291
356
|
|
|
292
357
|
var newMessage = _objectSpread(_objectSpread({}, action.payload), {}, {
|
|
293
358
|
created: new Date().toISOString()
|
|
294
359
|
});
|
|
295
360
|
|
|
296
361
|
if (newMessage !== null && newMessage !== void 0 && (_newMessage$pinned = newMessage.pinned) !== null && _newMessage$pinned !== void 0 && _newMessage$pinned.slotId) {
|
|
297
|
-
var _state$
|
|
362
|
+
var _state$pinned8, _state$unreadMessageC4;
|
|
298
363
|
|
|
299
|
-
var
|
|
364
|
+
var _newPinned6 = sortPinned([newMessage].concat((0, _toConsumableArray2["default"])((_state$pinned8 = state.pinned) !== null && _state$pinned8 !== void 0 ? _state$pinned8 : [])), state.brand);
|
|
300
365
|
|
|
301
366
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
302
367
|
unreadMessageCount: ((_state$unreadMessageC4 = state.unreadMessageCount) !== null && _state$unreadMessageC4 !== void 0 ? _state$unreadMessageC4 : 0) + 1,
|
|
303
|
-
pinned:
|
|
368
|
+
pinned: _newPinned6
|
|
304
369
|
});
|
|
305
370
|
}
|
|
306
371
|
|
|
307
372
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
308
373
|
unreadMessageCount: ((_state$unreadMessageC5 = state.unreadMessageCount) !== null && _state$unreadMessageC5 !== void 0 ? _state$unreadMessageC5 : 0) + 1,
|
|
309
|
-
messages: [newMessage].concat((0, _toConsumableArray2["default"])((_state$
|
|
374
|
+
messages: [newMessage].concat((0, _toConsumableArray2["default"])((_state$messages9 = state.messages) !== null && _state$messages9 !== void 0 ? _state$messages9 : []))
|
|
310
375
|
});
|
|
311
376
|
}
|
|
312
377
|
|
|
313
378
|
case _markAllRead.INBOX_MARK_ALL_READ:
|
|
314
379
|
{
|
|
315
|
-
var _state$
|
|
380
|
+
var _state$pinned9, _state$messages10;
|
|
316
381
|
|
|
317
382
|
var _unreadMessageCount3 = 0;
|
|
318
383
|
|
|
@@ -322,14 +387,14 @@ var _default = function _default() {
|
|
|
322
387
|
});
|
|
323
388
|
};
|
|
324
389
|
|
|
325
|
-
var
|
|
390
|
+
var _newPinned7 = (_state$pinned9 = state.pinned) === null || _state$pinned9 === void 0 ? void 0 : _state$pinned9.map(_handleMarkRead);
|
|
326
391
|
|
|
327
|
-
var
|
|
392
|
+
var _newMessages7 = (_state$messages10 = state.messages) === null || _state$messages10 === void 0 ? void 0 : _state$messages10.map(_handleMarkRead);
|
|
328
393
|
|
|
329
394
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
330
395
|
lastMarkedAllRead: new Date().getTime(),
|
|
331
|
-
messages:
|
|
332
|
-
pinned:
|
|
396
|
+
messages: _newMessages7,
|
|
397
|
+
pinned: _newPinned7,
|
|
333
398
|
unreadMessageCount: _unreadMessageCount3
|
|
334
399
|
});
|
|
335
400
|
}
|
|
@@ -37,6 +37,10 @@ var _toggleInbox2 = require("./actions/toggle-inbox");
|
|
|
37
37
|
|
|
38
38
|
var _unpinMessage3 = require("./actions/unpin-message");
|
|
39
39
|
|
|
40
|
+
var _addTag3 = require("./actions/add-tag");
|
|
41
|
+
|
|
42
|
+
var _removeTag3 = require("./actions/remove-tag");
|
|
43
|
+
|
|
40
44
|
var _react = require("react");
|
|
41
45
|
|
|
42
46
|
var _markMessageOpened3 = require("./actions/mark-message-opened");
|
|
@@ -410,13 +414,13 @@ var useInboxActions = function useInboxActions() {
|
|
|
410
414
|
|
|
411
415
|
return markMessageArchived;
|
|
412
416
|
}(),
|
|
413
|
-
|
|
414
|
-
var
|
|
417
|
+
addTag: function () {
|
|
418
|
+
var _addTag2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(messageId, tag, fromWS) {
|
|
415
419
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
416
420
|
while (1) {
|
|
417
421
|
switch (_context8.prev = _context8.next) {
|
|
418
422
|
case 0:
|
|
419
|
-
dispatch((0,
|
|
423
|
+
dispatch((0, _addTag3.addTag)(messageId, tag));
|
|
420
424
|
|
|
421
425
|
if (fromWS) {
|
|
422
426
|
_context8.next = 4;
|
|
@@ -424,6 +428,98 @@ var useInboxActions = function useInboxActions() {
|
|
|
424
428
|
}
|
|
425
429
|
|
|
426
430
|
_context8.next = 4;
|
|
431
|
+
return inboxClient.addTag(messageId, {
|
|
432
|
+
tag: tag
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
case 4:
|
|
436
|
+
if (onEvent) {
|
|
437
|
+
onEvent({
|
|
438
|
+
event: "add-tag",
|
|
439
|
+
message: allMessages.find(function (m) {
|
|
440
|
+
return m.messageId === messageId;
|
|
441
|
+
}),
|
|
442
|
+
messageId: messageId,
|
|
443
|
+
data: {
|
|
444
|
+
tag: tag
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
case 5:
|
|
450
|
+
case "end":
|
|
451
|
+
return _context8.stop();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}, _callee8);
|
|
455
|
+
}));
|
|
456
|
+
|
|
457
|
+
function addTag(_x13, _x14, _x15) {
|
|
458
|
+
return _addTag2.apply(this, arguments);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return addTag;
|
|
462
|
+
}(),
|
|
463
|
+
removeTag: function () {
|
|
464
|
+
var _removeTag2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(messageId, tag, fromWS) {
|
|
465
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
466
|
+
while (1) {
|
|
467
|
+
switch (_context9.prev = _context9.next) {
|
|
468
|
+
case 0:
|
|
469
|
+
dispatch((0, _removeTag3.removeTag)(messageId, tag));
|
|
470
|
+
|
|
471
|
+
if (fromWS) {
|
|
472
|
+
_context9.next = 4;
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
_context9.next = 4;
|
|
477
|
+
return inboxClient.removeTag(messageId, {
|
|
478
|
+
tag: tag
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
case 4:
|
|
482
|
+
if (onEvent) {
|
|
483
|
+
onEvent({
|
|
484
|
+
event: "remove-tag",
|
|
485
|
+
message: allMessages.find(function (m) {
|
|
486
|
+
return m.messageId === messageId;
|
|
487
|
+
}),
|
|
488
|
+
messageId: messageId,
|
|
489
|
+
data: {
|
|
490
|
+
tag: tag
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
case 5:
|
|
496
|
+
case "end":
|
|
497
|
+
return _context9.stop();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}, _callee9);
|
|
501
|
+
}));
|
|
502
|
+
|
|
503
|
+
function removeTag(_x16, _x17, _x18) {
|
|
504
|
+
return _removeTag2.apply(this, arguments);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
return removeTag;
|
|
508
|
+
}(),
|
|
509
|
+
unpinMessage: function () {
|
|
510
|
+
var _unpinMessage2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(messageId, fromWS) {
|
|
511
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
512
|
+
while (1) {
|
|
513
|
+
switch (_context10.prev = _context10.next) {
|
|
514
|
+
case 0:
|
|
515
|
+
dispatch((0, _unpinMessage3.unpinMessage)(messageId));
|
|
516
|
+
|
|
517
|
+
if (fromWS) {
|
|
518
|
+
_context10.next = 4;
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
_context10.next = 4;
|
|
427
523
|
return inboxClient.unpinMessage(messageId);
|
|
428
524
|
|
|
429
525
|
case 4:
|
|
@@ -439,13 +535,13 @@ var useInboxActions = function useInboxActions() {
|
|
|
439
535
|
|
|
440
536
|
case 5:
|
|
441
537
|
case "end":
|
|
442
|
-
return
|
|
538
|
+
return _context10.stop();
|
|
443
539
|
}
|
|
444
540
|
}
|
|
445
|
-
},
|
|
541
|
+
}, _callee10);
|
|
446
542
|
}));
|
|
447
543
|
|
|
448
|
-
function unpinMessage(
|
|
544
|
+
function unpinMessage(_x19, _x20) {
|
|
449
545
|
return _unpinMessage2.apply(this, arguments);
|
|
450
546
|
}
|
|
451
547
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/react-hooks",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "typings/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"concat-md": "^0.3.5"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@trycourier/client-graphql": "^5.
|
|
23
|
+
"@trycourier/client-graphql": "^5.1.0",
|
|
24
24
|
"deep-extend": "^0.6.0",
|
|
25
25
|
"rimraf": "^3.0.2"
|
|
26
26
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
".": "./dist/index.js",
|
|
37
37
|
"./use-inbox": "./dist/inbox/use-inbox.js"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "c05d7c09bf7864cfc392ca0affa98e709808f610"
|
|
40
40
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type AddTag = {
|
|
2
|
+
type: "inbox/ADD_TAG";
|
|
3
|
+
payload: {
|
|
4
|
+
tag: string;
|
|
5
|
+
messageId: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const INBOX_ADD_TAG = "inbox/ADD_TAG";
|
|
9
|
+
export declare const addTag: (messageId: string, tag: string) => AddTag;
|
|
10
|
+
//# sourceMappingURL=add-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-tag.d.ts","sourceRoot":"","sources":["../../../src/inbox/actions/add-tag.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM,GAAG;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,eAAO,MAAM,MAAM,cAAe,MAAM,OAAO,MAAM,KAAG,MAMtD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type RemoveTag = {
|
|
2
|
+
type: "inbox/REMOVE_TAG";
|
|
3
|
+
payload: {
|
|
4
|
+
tag: string;
|
|
5
|
+
messageId: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const INBOX_REMOVE_TAG = "inbox/REMOVE_TAG";
|
|
9
|
+
export declare const removeTag: (messageId: string, tag: string) => RemoveTag;
|
|
10
|
+
//# sourceMappingURL=remove-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-tag.d.ts","sourceRoot":"","sources":["../../../src/inbox/actions/remove-tag.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,SAAS,cAAe,MAAM,OAAO,MAAM,KAAG,SAMzD,CAAC"}
|
|
@@ -6,6 +6,8 @@ import { MarkAllRead } from "./actions/mark-all-read";
|
|
|
6
6
|
import { NewMessage } from "./actions/new-message";
|
|
7
7
|
import { UnpinMessage } from "./actions/unpin-message";
|
|
8
8
|
import { ResetLastFetched } from "./actions/reset-last-fetched";
|
|
9
|
+
import { AddTag } from "./actions/add-tag";
|
|
10
|
+
import { RemoveTag } from "./actions/remove-tag";
|
|
9
11
|
import { MarkMessageArchived } from "./actions/mark-message-archived";
|
|
10
12
|
import { MarkMessageRead } from "./actions/mark-message-read";
|
|
11
13
|
import { MarkMessageOpened } from "./actions/mark-message-opened";
|
|
@@ -13,7 +15,7 @@ import { MarkMessageUnread } from "./actions/mark-message-unread";
|
|
|
13
15
|
import { FetchUnreadMessageCountDone } from "./actions/fetch-unread-message-count";
|
|
14
16
|
import { FetchMessagesDone, FetchMessagesError, FetchMessagesPending } from "./actions/fetch-messages";
|
|
15
17
|
export declare const initialState: IInbox;
|
|
16
|
-
declare type InboxAction = FetchMessagesDone | FetchMessagesError | FetchMessagesPending | FetchUnreadMessageCountDone | InboxInit | InboxSetView | MarkAllRead | MarkMessageArchived | MarkMessageOpened | MarkMessageRead | MarkMessageUnread | NewMessage | ResetLastFetched | ToggleInbox | UnpinMessage;
|
|
18
|
+
declare type InboxAction = AddTag | FetchMessagesDone | FetchMessagesError | FetchMessagesPending | FetchUnreadMessageCountDone | InboxInit | InboxSetView | MarkAllRead | MarkMessageArchived | MarkMessageOpened | MarkMessageRead | MarkMessageUnread | NewMessage | RemoveTag | ResetLastFetched | ToggleInbox | UnpinMessage;
|
|
17
19
|
declare const _default: (state?: IInbox, action?: InboxAction | undefined) => IInbox;
|
|
18
20
|
export default _default;
|
|
19
21
|
//# sourceMappingURL=reducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/inbox/reducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAc,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAgB,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAuB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAqB,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAuB,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EACL,gBAAgB,EAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,eAAe,EAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,EAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,2BAA2B,EAE5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EAIrB,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,YAAY,EAAE,MAK1B,CAAC;AAEF,aAAK,WAAW,GACZ,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,2BAA2B,GAC3B,SAAS,GACT,YAAY,GACZ,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,UAAU,GACV,gBAAgB,GAChB,WAAW,GACX,YAAY,CAAC;iCAwCM,MAAM,uCAAwC,MAAM;AAA3E,
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/inbox/reducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,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
|
toggleInbox: (isOpen?: boolean) => void;
|
|
21
21
|
unpinMessage: (messageId: string, fromWS?: boolean) => Promise<void>;
|
|
22
|
+
addTag: (messageId: string, tag: string, fromWS?: boolean) => Promise<void>;
|
|
23
|
+
removeTag: (messageId: string, tag: string, fromWS?: boolean) => Promise<void>;
|
|
22
24
|
trackClick: (messageId: string, trackingId: string) => Promise<void>;
|
|
23
25
|
}
|
|
24
26
|
declare const useInboxActions: () => IInboxActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-inbox-actions.d.ts","sourceRoot":"","sources":["../../src/inbox/use-inbox-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAKrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"use-inbox-actions.d.ts","sourceRoot":"","sources":["../../src/inbox/use-inbox-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAKrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAmBhE,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7D,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,mBAA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