@codeleap/mobile 4.2.9 → 4.2.10
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/Registry.js +28 -53
- package/dist/Registry.js.map +1 -1
- package/dist/components/ActionIcon/index.js +27 -67
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActionIcon/styles.js +1 -2
- package/dist/components/ActionIcon/types.js +1 -2
- package/dist/components/ActivityIndicator/index.js +22 -62
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/ActivityIndicator/styles.js +1 -2
- package/dist/components/ActivityIndicator/types.js +1 -2
- package/dist/components/Autocomplete/index.js +73 -121
- package/dist/components/Autocomplete/index.js.map +1 -1
- package/dist/components/Autocomplete/styles.js +1 -2
- package/dist/components/Autocomplete/types.js +1 -2
- package/dist/components/Avatar/index.js +49 -90
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Avatar/styles.js +1 -2
- package/dist/components/Avatar/types.js +1 -2
- package/dist/components/AvatarGroup/index.js +30 -75
- package/dist/components/AvatarGroup/index.js.map +1 -1
- package/dist/components/AvatarGroup/styles.js +1 -2
- package/dist/components/AvatarGroup/types.js +1 -2
- package/dist/components/Backdrop/index.js +26 -66
- package/dist/components/Backdrop/index.js.map +1 -1
- package/dist/components/Backdrop/styles.js +1 -2
- package/dist/components/Backdrop/types.js +1 -2
- package/dist/components/Badge/index.js +44 -85
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/styles.js +1 -2
- package/dist/components/Badge/types.js +1 -2
- package/dist/components/Button/index.js +49 -98
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.js +1 -2
- package/dist/components/Button/types.js +1 -2
- package/dist/components/Calendar/index.js +27 -68
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/types.d.ts +1 -2
- package/dist/components/Calendar/types.js +1 -2
- package/dist/components/Checkbox/index.js +52 -85
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.js +1 -2
- package/dist/components/Checkbox/types.js +1 -2
- package/dist/components/DatePickerModal/index.js +61 -113
- package/dist/components/DatePickerModal/index.js.map +1 -1
- package/dist/components/DatePickerModal/styles.js +1 -2
- package/dist/components/DatePickerModal/types.js +1 -2
- package/dist/components/EmptyPlaceholder/index.js +40 -69
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/styles.js +1 -2
- package/dist/components/EmptyPlaceholder/types.js +1 -2
- package/dist/components/FileInput/index.js +112 -178
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.js +1 -2
- package/dist/components/Grid/index.js +47 -97
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Grid/styles.js +1 -2
- package/dist/components/Grid/types.js +1 -2
- package/dist/components/Icon/index.js +34 -75
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/styles.js +1 -2
- package/dist/components/Icon/types.js +1 -2
- package/dist/components/Image/index.js +53 -96
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Image/styles.js +1 -2
- package/dist/components/Image/types.js +1 -2
- package/dist/components/ImageView/Spotlight.js +75 -131
- package/dist/components/ImageView/Spotlight.js.map +1 -1
- package/dist/components/ImageView/component.js +8 -15
- package/dist/components/ImageView/component.js.map +1 -1
- package/dist/components/ImageView/index.js +2 -18
- package/dist/components/ImageView/index.js.map +1 -1
- package/dist/components/InputBase/index.js +35 -75
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/styles.d.ts +3 -3
- package/dist/components/InputBase/styles.js +49 -50
- package/dist/components/InputBase/styles.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +1 -0
- package/dist/components/InputBase/types.js +1 -2
- package/dist/components/InputBase/utils.js +4 -19
- package/dist/components/InputBase/utils.js.map +1 -1
- package/dist/components/List/index.js +46 -86
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/styles.js +1 -2
- package/dist/components/List/types.js +1 -2
- package/dist/components/LoadingOverlay/index.js +28 -66
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/LoadingOverlay/styles.js +1 -2
- package/dist/components/LoadingOverlay/types.js +1 -2
- package/dist/components/Modal/index.js +77 -113
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.js +1 -2
- package/dist/components/Modal/types.js +1 -2
- package/dist/components/Navigation/Navigation.js +23 -66
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/constants.js +7 -10
- package/dist/components/Navigation/constants.js.map +1 -1
- package/dist/components/Navigation/index.js +3 -19
- package/dist/components/Navigation/index.js.map +1 -1
- package/dist/components/Navigation/types.js +1 -2
- package/dist/components/Navigation/utils.js +24 -59
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/NumberIncrement/index.js +132 -165
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/styles.js +1 -2
- package/dist/components/NumberIncrement/types.d.ts +2 -2
- package/dist/components/NumberIncrement/types.js +1 -2
- package/dist/components/NumberIncrement/utils.js +8 -12
- package/dist/components/NumberIncrement/utils.js.map +1 -1
- package/dist/components/Pager/PagerDots.js +17 -54
- package/dist/components/Pager/PagerDots.js.map +1 -1
- package/dist/components/Pager/index.js +43 -97
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.js +1 -2
- package/dist/components/Pager/types.js +1 -2
- package/dist/components/PaginationIndicator/index.js +23 -38
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/styles.js +1 -2
- package/dist/components/PaginationIndicator/types.js +1 -2
- package/dist/components/PlacesAutocomplete/index.js +55 -106
- package/dist/components/PlacesAutocomplete/index.js.map +1 -1
- package/dist/components/PlacesAutocomplete/styles.js +1 -2
- package/dist/components/PlacesAutocomplete/types.js +1 -2
- package/dist/components/RadioInput/index.js +46 -84
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.js +1 -2
- package/dist/components/RadioInput/types.js +1 -2
- package/dist/components/RefreshControl/index.js +22 -63
- package/dist/components/RefreshControl/index.js.map +1 -1
- package/dist/components/RefreshControl/styles.js +1 -2
- package/dist/components/RefreshControl/types.js +1 -2
- package/dist/components/Scroll/index.js +33 -81
- package/dist/components/Scroll/index.js.map +1 -1
- package/dist/components/Scroll/styles.js +1 -2
- package/dist/components/Scroll/types.js +1 -2
- package/dist/components/SearchInput/index.js +22 -69
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/context.d.ts +6 -0
- package/dist/components/SectionFilters/context.js +4 -8
- package/dist/components/SectionFilters/context.js.map +1 -1
- package/dist/components/SectionFilters/index.js +33 -76
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/types.js +1 -2
- package/dist/components/SectionFilters/useSectionFilters.d.ts +3 -0
- package/dist/components/SectionFilters/useSectionFilters.js +71 -73
- package/dist/components/SectionFilters/useSectionFilters.js.map +1 -1
- package/dist/components/Sections/index.d.ts +8 -8
- package/dist/components/Sections/index.js +61 -106
- package/dist/components/Sections/index.js.map +1 -1
- package/dist/components/Sections/styles.d.ts +1 -1
- package/dist/components/Sections/styles.js +1 -2
- package/dist/components/Sections/types.js +1 -2
- package/dist/components/SegmentedControl/Option.js +13 -31
- package/dist/components/SegmentedControl/Option.js.map +1 -1
- package/dist/components/SegmentedControl/index.js +71 -114
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.js +1 -2
- package/dist/components/SegmentedControl/types.js +1 -2
- package/dist/components/Select/index.js +94 -157
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +1 -2
- package/dist/components/Select/types.js +1 -2
- package/dist/components/Slider/index.js +89 -129
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +0 -6
- package/dist/components/Slider/styles.js +1 -2
- package/dist/components/Slider/types.js +1 -2
- package/dist/components/SortablePhotos/index.js +58 -91
- package/dist/components/SortablePhotos/index.js.map +1 -1
- package/dist/components/SortablePhotos/styles.js +1 -2
- package/dist/components/SortablePhotos/types.js +1 -2
- package/dist/components/SortablePhotos/useSortablePhotos.js +93 -157
- package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -1
- package/dist/components/Switch/index.js +51 -84
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/styles.js +1 -2
- package/dist/components/Switch/types.js +1 -2
- package/dist/components/Text/index.js +40 -88
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.js +1 -2
- package/dist/components/Text/types.js +1 -2
- package/dist/components/TextInput/index.js +83 -131
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/styles.js +1 -2
- package/dist/components/TextInput/types.js +1 -2
- package/dist/components/Touchable/index.js +69 -122
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/styles.js +1 -2
- package/dist/components/Touchable/types.js +1 -2
- package/dist/components/View/index.js +19 -51
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/styles.js +1 -2
- package/dist/components/View/types.js +1 -2
- package/dist/components/components.js +43 -59
- package/dist/components/components.js.map +1 -1
- package/dist/hooks/index.js +7 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +8 -43
- package/dist/index.js.map +1 -1
- package/dist/modules/PressableRipple/index.js +2 -8
- package/dist/modules/PressableRipple/index.js.map +1 -1
- package/dist/modules/PressableRipple/ripple.js +125 -163
- package/dist/modules/PressableRipple/ripple.js.map +1 -1
- package/dist/modules/PressableRipple/styles.js +9 -20
- package/dist/modules/PressableRipple/styles.js.map +1 -1
- package/dist/modules/PressableRipple/type.js +1 -2
- package/dist/modules/reactNavigation.js +10 -21
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.js +3 -20
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/modules/types/textInputMask.js +1 -2
- package/dist/types/index.js +1 -17
- package/dist/types/index.js.map +1 -1
- package/dist/types/utility.js +1 -2
- package/dist/utils/KeyboardAware/context.js +5 -14
- package/dist/utils/KeyboardAware/context.js.map +1 -1
- package/dist/utils/KeyboardAware/index.js +3 -19
- package/dist/utils/KeyboardAware/index.js.map +1 -1
- package/dist/utils/KeyboardAware/keyboardHooks.js +36 -41
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +1 -1
- package/dist/utils/KeyboardAware/types.js +1 -2
- package/dist/utils/KeyboardAware/types.js.map +1 -1
- package/dist/utils/ModalManager/components.js +24 -54
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.js +94 -89
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.js +7 -10
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/index.js +115 -245
- package/dist/utils/NotificationManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/types.js +1 -2
- package/dist/utils/OSAlert.js +32 -48
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +138 -255
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/PermissionManager/index.js +2 -8
- package/dist/utils/PermissionManager/index.js.map +1 -1
- package/dist/utils/PermissionManager/types.js +1 -2
- package/dist/utils/StorageManager.js +39 -46
- package/dist/utils/StorageManager.js.map +1 -1
- package/dist/utils/Subscription.js +30 -54
- package/dist/utils/Subscription.js.map +1 -1
- package/dist/utils/deprecated/notifications.js +143 -250
- package/dist/utils/deprecated/notifications.js.map +1 -1
- package/dist/utils/hooks.js +101 -120
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.js +14 -43
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/input.js +15 -19
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/locale.js +5 -9
- package/dist/utils/locale.js.map +1 -1
- package/dist/utils/misc.js +25 -40
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/theme.js +24 -33
- package/dist/utils/theme.js.map +1 -1
- package/dist/utils/useQueryListRefresh.js +16 -26
- package/dist/utils/useQueryListRefresh.js.map +1 -1
- package/package.json +6 -6
- package/package.json.bak +2 -2
- package/src/components/Calendar/types.ts +3 -3
- package/src/components/InputBase/styles.ts +35 -23
- package/src/components/InputBase/types.ts +1 -0
- package/src/components/NumberIncrement/index.tsx +8 -2
- package/src/components/NumberIncrement/types.ts +3 -3
- package/src/components/RadioInput/index.tsx +4 -0
- package/src/components/SectionFilters/useSectionFilters.tsx +31 -1
- package/src/components/Sections/index.tsx +3 -2
- package/src/components/Sections/styles.ts +2 -2
- package/src/components/Slider/index.tsx +9 -1
- package/src/components/Slider/styles.ts +0 -6
- package/src/components/TextInput/index.tsx +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/utils/ModalManager/context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/utils/ModalManager/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAe,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AA0BnD,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,EAAmB,CAAC,CAAA;AAE7D,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE;IACnC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAA;IAChE,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA;IAE3E,SAA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,SAAS,KAAK;QACZ,MAAM,CAAC,CAAC,CAAC,CAAA;IACX,CAAC;IAED,OAAO;QACL,KAAK;QACL,IAAI;QACJ,QAAQ;QACR,QAAQ,EAAE,MAAM;QAChB,IAAI;QACJ,UAAU,EAAE,GAAG;QACf,GAAG,KAAK;KAET,CAAA;AAEH,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Modal: components_1.Modal,
|
|
9
|
-
Provider: context_1.Provider,
|
|
10
|
-
useModalSequence: context_1.useModalSequence,
|
|
1
|
+
import { useModalContext, useModalSequence, Provider } from './context';
|
|
2
|
+
import { Modal } from './components';
|
|
3
|
+
export const ModalManager = {
|
|
4
|
+
useModalContext,
|
|
5
|
+
Modal,
|
|
6
|
+
Provider,
|
|
7
|
+
useModalSequence,
|
|
11
8
|
};
|
|
12
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/ModalManager/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/ModalManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACvE,OAAO,EAAE,KAAK,EAAqB,MAAM,cAAc,CAAA;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,eAAe;IACf,KAAK;IACL,QAAQ;IACR,gBAAgB;CACjB,CAAA"}
|
|
@@ -1,107 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
38
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
-
function step(op) {
|
|
41
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
-
switch (op[0]) {
|
|
46
|
-
case 0: case 1: t = op; break;
|
|
47
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
-
default:
|
|
51
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
-
if (t[2]) _.ops.pop();
|
|
56
|
-
_.trys.pop(); continue;
|
|
57
|
-
}
|
|
58
|
-
op = body.call(thisArg, _);
|
|
59
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
64
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
65
|
-
};
|
|
66
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
-
exports.NotificationManager = void 0;
|
|
68
|
-
var common_1 = require("@codeleap/common"); // @ts-ignore
|
|
69
|
-
var messaging_1 = __importDefault(require("@react-native-firebase/messaging"));
|
|
70
|
-
var Subscription_1 = require("../Subscription");
|
|
71
|
-
__exportStar(require("./types"), exports);
|
|
72
|
-
var MODULE = 'NotificationManager';
|
|
1
|
+
import { silentLogger } from '@codeleap/common'; // @ts-ignore
|
|
2
|
+
import messaging from '@react-native-firebase/messaging';
|
|
3
|
+
import { Subscription } from '../Subscription';
|
|
4
|
+
export * from './types';
|
|
5
|
+
const MODULE = 'NotificationManager';
|
|
73
6
|
/**
|
|
74
7
|
* Class responsible for the notification system
|
|
75
8
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
9
|
+
export class NotificationManager {
|
|
10
|
+
_logger;
|
|
11
|
+
parser = (message) => message;
|
|
12
|
+
currentOptions = {
|
|
13
|
+
handleInitialNotification: true,
|
|
14
|
+
debug: false,
|
|
15
|
+
slackDebug: false,
|
|
16
|
+
};
|
|
17
|
+
currentToken = null;
|
|
18
|
+
registeredUnsubscribers = {};
|
|
19
|
+
initialized = false;
|
|
20
|
+
events = new Subscription();
|
|
21
|
+
constructor(_logger = silentLogger, options = {}) {
|
|
80
22
|
this._logger = _logger;
|
|
81
|
-
|
|
23
|
+
if (typeof options?.parser == 'function') {
|
|
24
|
+
this.parser = options?.parser;
|
|
25
|
+
}
|
|
82
26
|
this.currentOptions = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
slackDebug: false,
|
|
27
|
+
...this.currentOptions,
|
|
28
|
+
...options
|
|
86
29
|
};
|
|
87
|
-
this.currentToken = null;
|
|
88
|
-
this.registeredUnsubscribers = {};
|
|
89
|
-
this.initialized = false;
|
|
90
|
-
this.events = new Subscription_1.Subscription();
|
|
91
|
-
if (typeof (options === null || options === void 0 ? void 0 : options.parser) == 'function') {
|
|
92
|
-
this.parser = options === null || options === void 0 ? void 0 : options.parser;
|
|
93
|
-
}
|
|
94
|
-
this.currentOptions = __assign(__assign({}, this.currentOptions), options);
|
|
95
30
|
}
|
|
96
|
-
|
|
31
|
+
invoke(args) {
|
|
97
32
|
this.log('Invoke this events:', this.events.getSubscribersKeys());
|
|
98
33
|
this.events.invoke({
|
|
99
|
-
data: this.parser(args
|
|
100
|
-
type: args
|
|
34
|
+
data: this.parser(args?.data),
|
|
35
|
+
type: args?.type
|
|
101
36
|
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (data === void 0) { data = {}; }
|
|
37
|
+
}
|
|
38
|
+
log(description, data = {}) {
|
|
105
39
|
if (!this._logger)
|
|
106
40
|
return;
|
|
107
41
|
if (this.currentOptions.debug) {
|
|
@@ -113,181 +47,119 @@ var NotificationManager = /** @class */ (function () {
|
|
|
113
47
|
'sendIn': ['release', 'debug']
|
|
114
48
|
});
|
|
115
49
|
}
|
|
116
|
-
}
|
|
50
|
+
}
|
|
117
51
|
/**
|
|
118
52
|
* Checks if you are authorized for notifications and returns the result
|
|
119
53
|
*
|
|
120
54
|
* @return hasAuthorization (boolean)
|
|
121
55
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
case 1:
|
|
129
|
-
authStatus = _a.sent();
|
|
130
|
-
hasAuthorization = authStatus === messaging_1.default.AuthorizationStatus.AUTHORIZED ||
|
|
131
|
-
authStatus === messaging_1.default.AuthorizationStatus.PROVISIONAL;
|
|
132
|
-
return [2 /*return*/, hasAuthorization];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
};
|
|
56
|
+
async getHasAuthorization() {
|
|
57
|
+
const authStatus = await messaging().hasPermission();
|
|
58
|
+
const hasAuthorization = authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
|
|
59
|
+
authStatus === messaging.AuthorizationStatus.PROVISIONAL;
|
|
60
|
+
return hasAuthorization;
|
|
61
|
+
}
|
|
137
62
|
/**
|
|
138
63
|
* Gets and returns the device token
|
|
139
64
|
*
|
|
140
65
|
* @return token (string) or null if an error occurs
|
|
141
66
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return [2 /*return*/, null];
|
|
159
|
-
case 3: return [2 /*return*/];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
NotificationManager.prototype.onTokenRefresh = function (cb) {
|
|
165
|
-
var _this = this;
|
|
166
|
-
var unsubscribe = (0, messaging_1.default)().onTokenRefresh(function (newToken) {
|
|
167
|
-
_this.log('Refreshed token', { newToken: newToken });
|
|
168
|
-
_this.currentToken = newToken;
|
|
67
|
+
async getToken() {
|
|
68
|
+
try {
|
|
69
|
+
const token = await messaging().getToken();
|
|
70
|
+
this.log('Get token', { token });
|
|
71
|
+
this.currentToken = token;
|
|
72
|
+
return token;
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
this.log('Get token error', err);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onTokenRefresh(cb) {
|
|
80
|
+
const unsubscribe = messaging().onTokenRefresh(newToken => {
|
|
81
|
+
this.log('Refreshed token', { newToken });
|
|
82
|
+
this.currentToken = newToken;
|
|
169
83
|
cb(newToken);
|
|
170
84
|
});
|
|
171
85
|
return unsubscribe;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
case 1:
|
|
183
|
-
initialNotification = _a.sent();
|
|
184
|
-
this.log('Initial Notification', initialNotification);
|
|
185
|
-
if (!!initialNotification && this.currentOptions.handleInitialNotification) {
|
|
186
|
-
this.invoke({
|
|
187
|
-
data: initialNotification,
|
|
188
|
-
type: 'initial'
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
return [2 /*return*/];
|
|
192
|
-
}
|
|
86
|
+
}
|
|
87
|
+
async invokeForInitialNotification() {
|
|
88
|
+
if (this.initialized)
|
|
89
|
+
return;
|
|
90
|
+
const initialNotification = await messaging().getInitialNotification();
|
|
91
|
+
this.log('Initial Notification', initialNotification);
|
|
92
|
+
if (!!initialNotification && this.currentOptions.handleInitialNotification) {
|
|
93
|
+
this.invoke({
|
|
94
|
+
data: initialNotification,
|
|
95
|
+
type: 'initial'
|
|
193
96
|
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
data: remoteMessage,
|
|
203
|
-
type: 'background'
|
|
204
|
-
});
|
|
205
|
-
return [2 /*return*/];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
onBackgroundMessage() {
|
|
100
|
+
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
|
|
101
|
+
this.log('Notification in background:', remoteMessage);
|
|
102
|
+
this.invoke({
|
|
103
|
+
data: remoteMessage,
|
|
104
|
+
type: 'background'
|
|
206
105
|
});
|
|
207
|
-
});
|
|
208
|
-
return
|
|
209
|
-
}
|
|
106
|
+
});
|
|
107
|
+
return () => messaging().setBackgroundMessageHandler(() => null);
|
|
108
|
+
}
|
|
210
109
|
/**
|
|
211
110
|
* Responsible for initializing all notification services: token refresh, background, foreground, press and initial notification
|
|
212
111
|
*
|
|
213
112
|
* @param {function} callback Callback that is executed when the services are initialized, returning the device token
|
|
214
113
|
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
token = _a.sent();
|
|
227
|
-
callback(token);
|
|
228
|
-
this.invokeForInitialNotification();
|
|
229
|
-
unsubscribeOnNotificationOpenedApp = (0, messaging_1.default)().onNotificationOpenedApp(function (remoteMessage) {
|
|
230
|
-
_this.log('Notification pressed:', remoteMessage);
|
|
231
|
-
_this.invoke({
|
|
232
|
-
data: remoteMessage,
|
|
233
|
-
type: 'press'
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
this.registeredUnsubscribers['openApp'] = unsubscribeOnNotificationOpenedApp;
|
|
237
|
-
unsubscribeOnBackgroundMessage = this.onBackgroundMessage();
|
|
238
|
-
this.registeredUnsubscribers['background'] = unsubscribeOnBackgroundMessage;
|
|
239
|
-
unsubscribeOnMessage = (0, messaging_1.default)().onMessage(function (remoteMessage) { return __awaiter(_this, void 0, void 0, function () {
|
|
240
|
-
return __generator(this, function (_a) {
|
|
241
|
-
this.log('Notification in foreground', remoteMessage);
|
|
242
|
-
this.invoke({
|
|
243
|
-
data: remoteMessage,
|
|
244
|
-
type: 'foreground'
|
|
245
|
-
});
|
|
246
|
-
return [2 /*return*/];
|
|
247
|
-
});
|
|
248
|
-
}); });
|
|
249
|
-
this.registeredUnsubscribers['foreground'] = unsubscribeOnMessage;
|
|
250
|
-
unsubscribeOnTokenRefresh = this.onTokenRefresh(callback);
|
|
251
|
-
this.registeredUnsubscribers['refreshToken'] = unsubscribeOnTokenRefresh;
|
|
252
|
-
this.initialized = true;
|
|
253
|
-
return [2 /*return*/];
|
|
254
|
-
}
|
|
114
|
+
async initialize(callback) {
|
|
115
|
+
this.log('Initialize', this.currentOptions);
|
|
116
|
+
this.unsubscribe();
|
|
117
|
+
const token = await this.getToken();
|
|
118
|
+
callback(token);
|
|
119
|
+
this.invokeForInitialNotification();
|
|
120
|
+
const unsubscribeOnNotificationOpenedApp = messaging().onNotificationOpenedApp(remoteMessage => {
|
|
121
|
+
this.log('Notification pressed:', remoteMessage);
|
|
122
|
+
this.invoke({
|
|
123
|
+
data: remoteMessage,
|
|
124
|
+
type: 'press'
|
|
255
125
|
});
|
|
256
126
|
});
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
delete this.registeredUnsubscribers[unsubscribeKey];
|
|
266
|
-
}
|
|
267
|
-
return [2 /*return*/];
|
|
127
|
+
this.registeredUnsubscribers['openApp'] = unsubscribeOnNotificationOpenedApp;
|
|
128
|
+
const unsubscribeOnBackgroundMessage = this.onBackgroundMessage();
|
|
129
|
+
this.registeredUnsubscribers['background'] = unsubscribeOnBackgroundMessage;
|
|
130
|
+
const unsubscribeOnMessage = messaging().onMessage(async (remoteMessage) => {
|
|
131
|
+
this.log('Notification in foreground', remoteMessage);
|
|
132
|
+
this.invoke({
|
|
133
|
+
data: remoteMessage,
|
|
134
|
+
type: 'foreground'
|
|
268
135
|
});
|
|
269
136
|
});
|
|
270
|
-
|
|
137
|
+
this.registeredUnsubscribers['foreground'] = unsubscribeOnMessage;
|
|
138
|
+
const unsubscribeOnTokenRefresh = this.onTokenRefresh(callback);
|
|
139
|
+
this.registeredUnsubscribers['refreshToken'] = unsubscribeOnTokenRefresh;
|
|
140
|
+
this.initialized = true;
|
|
141
|
+
}
|
|
142
|
+
async unsubscribe() {
|
|
143
|
+
this.log('Unsubscribe handlers', this.registeredUnsubscribers);
|
|
144
|
+
for (const unsubscribeKey in this.registeredUnsubscribers) {
|
|
145
|
+
this.registeredUnsubscribers[unsubscribeKey]();
|
|
146
|
+
delete this.registeredUnsubscribers[unsubscribeKey];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
271
149
|
/**
|
|
272
150
|
* Unsubscribe all services that have been started
|
|
273
151
|
*
|
|
274
152
|
* @param {function} callback Callback that is executed when the services are deinitialized
|
|
275
153
|
*/
|
|
276
|
-
|
|
277
|
-
if (
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
callback();
|
|
286
|
-
}
|
|
287
|
-
return [2 /*return*/];
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
};
|
|
154
|
+
async deinitialize(callback = null) {
|
|
155
|
+
if (!this.initialized)
|
|
156
|
+
return;
|
|
157
|
+
this.log('Deinitialize');
|
|
158
|
+
this.unsubscribe();
|
|
159
|
+
if (typeof callback == 'function') {
|
|
160
|
+
callback();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
291
163
|
/**
|
|
292
164
|
* Registers an event that will be called by all notification services that have been started
|
|
293
165
|
*
|
|
@@ -295,10 +167,8 @@ var NotificationManager = /** @class */ (function () {
|
|
|
295
167
|
* @param {string} handler Function that will be performed
|
|
296
168
|
* @return unsubscribe event (function)
|
|
297
169
|
*/
|
|
298
|
-
|
|
170
|
+
registerEvent(eventName, handler) {
|
|
299
171
|
return this.events.subscribe(eventName, handler);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
}());
|
|
303
|
-
exports.NotificationManager = NotificationManager;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
304
174
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/NotificationManager/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/NotificationManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAA,CAAC,aAAa;AAC1E,OAAO,SAAS,MAAM,kCAAkC,CAAA;AACxD,OAAO,EAAc,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAG1D,cAAc,SAAS,CAAA;AAEvB,MAAM,MAAM,GAAG,qBAAqB,CAAA;AAEpC;;EAEE;AACF,MAAM,OAAO,mBAAmB;IAkBpB;IAjBH,MAAM,GAA4C,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAY,CAAA;IAEpF,cAAc,GAAkC;QACrD,yBAAyB,EAAE,IAAI;QAC/B,KA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