@fivelab/web-utils 1.0.5 → 1.0.6
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/browser/index.js
CHANGED
|
@@ -5,6 +5,4 @@ export { notifyByResponse, notifyError, notifyFetchError, notifyInfo, notifySucc
|
|
|
5
5
|
export { request } from './request.js';
|
|
6
6
|
export { observeElementVisibility } from './visibility.js';
|
|
7
7
|
export { registerNotificationAdapter } from './notifications/adapter.js';
|
|
8
|
-
export { createToastAdapter } from './notifications/toastr.js';
|
|
9
|
-
export { createNotyfAdapter } from './notifications/notyf.js';
|
|
10
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { registerNotificationAdapter } from './notifications/adapter';
|
|
2
|
-
export { createToastAdapter } from './notifications/toastr';
|
|
3
|
-
export { createNotyfAdapter } from './notifications/notyf';
|
|
4
2
|
export declare function notifySuccess(message: string): Promise<void>;
|
|
5
3
|
export declare function notifyError(message: string): Promise<void>;
|
|
6
4
|
export declare function notifyInfo(message: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sources":["../../src/browser/notifications.ts"],"sourcesContent":["import { getAdapter } from './notifications/adapter';\nexport { registerNotificationAdapter } from './notifications/adapter';\
|
|
1
|
+
{"version":3,"file":"notifications.js","sources":["../../src/browser/notifications.ts"],"sourcesContent":["import { getAdapter } from './notifications/adapter';\nexport { registerNotificationAdapter } from './notifications/adapter';\n\nexport async function notifySuccess(message: string) {\n await getAdapter().success(message);\n}\n\nexport async function notifyError(message: string) {\n await getAdapter().error(message);\n}\n\nexport async function notifyInfo(message: string) {\n await getAdapter().info(message);\n}\n\nexport async function notifyWarning(message: string) {\n await getAdapter().warning(message);\n}\n\nexport async function notifyFetchError() {\n await getAdapter().error('Network error: unable to fetch the API request.');\n}\n\nexport async function notifyByResponse(response: Response): Promise<void>;\nexport async function notifyByResponse(response: Response, message: string): Promise<void>\n\nexport async function notifyByResponse(response: Response, message?: string) {\n if ([200, 201, 204].includes(response.status)) {\n if (message) {\n await notifySuccess(message);\n }\n } else {\n await notifyError(`Receive wrong status - ${response.statusText}`);\n }\n}\n"],"names":[],"mappings":";;;AAGO,eAAe,aAAa,CAAC,OAAe,EAAA;AAC/C,IAAA,MAAM,UAAU,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;AACvC;AAEO,eAAe,WAAW,CAAC,OAAe,EAAA;AAC7C,IAAA,MAAM,UAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AACrC;AAEO,eAAe,UAAU,CAAC,OAAe,EAAA;AAC5C,IAAA,MAAM,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;AACpC;AAEO,eAAe,aAAa,CAAC,OAAe,EAAA;AAC/C,IAAA,MAAM,UAAU,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;AACvC;AAEO,eAAe,gBAAgB,GAAA;AAClC,IAAA,MAAM,UAAU,EAAE,CAAC,KAAK,CAAC,iDAAiD,CAAC;AAC/E;AAKO,eAAe,gBAAgB,CAAC,QAAkB,EAAE,OAAgB,EAAA;AACvE,IAAA,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC3C,IAAI,OAAO,EAAE;AACT,YAAA,MAAM,aAAa,CAAC,OAAO,CAAC;QAChC;IACJ;SAAO;QACH,MAAM,WAAW,CAAC,CAAA,uBAAA,EAA0B,QAAQ,CAAC,UAAU,CAAA,CAAE,CAAC;IACtE;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fivelab/web-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The helpers for easy manipulate with dom.",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./dist/browser/*.d.ts",
|
|
15
15
|
"import": "./dist/browser/*.js"
|
|
16
16
|
},
|
|
17
|
+
"./browser/notifications/*": {
|
|
18
|
+
"types": "./dist/browser/notifications/*.d.ts",
|
|
19
|
+
"import": "./dist/browser/notifications/*.js"
|
|
20
|
+
},
|
|
17
21
|
"./behaviors": {
|
|
18
22
|
"types": "./dist/behaviors/index.d.ts",
|
|
19
23
|
"import": "./dist/behaviors/index.js"
|