@zydon/common 2.6.96 → 2.6.98
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/{chunk-IMVMHVIE.js → chunk-3IPWUPD7.js} +2 -2
- package/dist/{chunk-4UVACODQ.js → chunk-3X7KMUN3.js} +1 -1
- package/dist/{chunk-TLQJLUU3.js → chunk-AJYSAO5N.js} +1 -1
- package/dist/{chunk-JJM24URR.js → chunk-C2JZG45F.js} +1 -1
- package/dist/{chunk-ZQDQI4FF.js → chunk-DUFPX4QZ.js} +1 -1
- package/dist/{chunk-C6LHLY2U.js → chunk-DVVFB7RV.js} +1 -1
- package/dist/{chunk-DQ2CSCVM.js → chunk-FCBM4IGE.js} +1 -1
- package/dist/{chunk-BPY2UXIB.js → chunk-GZ4UBWZJ.js} +1 -1
- package/dist/chunk-IHAHXNLH.js +3 -0
- package/dist/{chunk-RQ4T6IDM.js → chunk-KA6PGKWV.js} +1 -1
- package/dist/{chunk-C6ZLQ63H.js → chunk-KVFE6S5N.js} +1 -1
- package/dist/{chunk-FHOVYGSG.js → chunk-LGYLZTOS.js} +2 -2
- package/dist/{chunk-GMZ3FKHN.js → chunk-NGCNTRMV.js} +1 -1
- package/dist/{chunk-G2EXNBOF.js → chunk-PF7OFL6X.js} +1 -1
- package/dist/{chunk-DSFPGTNS.js → chunk-PRCHWW24.js} +1 -1
- package/dist/{chunk-JJQI4255.js → chunk-PWWPKKXN.js} +3 -3
- package/dist/chunk-Q3ADZHO5.js +3 -0
- package/dist/{chunk-F5HXBPOO.js → chunk-SERSUUWD.js} +1 -1
- package/dist/{chunk-QAB3RH43.js → chunk-URVMF4MW.js} +1 -1
- package/dist/{chunk-EPSIFEA7.js → chunk-VGB7HPN6.js} +1 -1
- package/dist/{chunk-BFAYY2AM.js → chunk-WIJV4EHZ.js} +3 -3
- package/dist/{chunk-YSWCCN64.js → chunk-ZOUS7PT6.js} +2 -2
- package/dist/components/ActionButton/index.js +3 -3
- package/dist/components/Autocomplete/index.js +3 -3
- package/dist/components/AvatarButton/index.js +6 -6
- package/dist/components/BuilderLayout/index.js +3 -3
- package/dist/components/BuilderSidebar/index.js +2 -2
- package/dist/components/Common/index.js +4 -4
- package/dist/components/DataCards/index.js +1 -1
- package/dist/components/DataView/index.js +4 -4
- package/dist/components/DragButton/index.js +3 -3
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/EasyCropModal/index.js +4 -4
- package/dist/components/Error/index.js +2 -2
- package/dist/components/ExpandableGroup/index.js +2 -2
- package/dist/components/FileUpload/index.js +6 -6
- package/dist/components/FrameSkeleton/index.js +2 -2
- package/dist/components/HelpButton/index.js +3 -3
- package/dist/components/Icon/index.js +2 -2
- package/dist/components/IconButton/index.js +3 -3
- package/dist/components/ImageCropModal/index.js +4 -4
- package/dist/components/Incrementer/index.js +3 -3
- package/dist/components/InfoCircle/index.js +2 -2
- package/dist/components/ListBundles/index.js +3 -3
- package/dist/components/MenuItem/index.js +2 -2
- package/dist/components/Modal/index.js +3 -3
- package/dist/components/MoreMenu/index.js +2 -2
- package/dist/components/PasswordRules/index.js +2 -2
- package/dist/components/PopoverSelect/index.js +2 -2
- package/dist/components/SearchInput/index.js +3 -3
- package/dist/components/SelectableCards/index.js +4 -4
- package/dist/components/SeoPreview/index.js +2 -2
- package/dist/components/StateDisplay/index.js +3 -3
- package/dist/components/Steps/index.js +2 -2
- package/dist/components/StyledTab/index.js +2 -2
- package/dist/components/SwapList/index.js +3 -3
- package/dist/components/ToggleTheme/index.js +4 -4
- package/dist/components/WebhookCard/index.js +2 -2
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/form/Address/index.js +5 -5
- package/dist/components/form/Autocomplete/index.js +4 -4
- package/dist/components/form/Incrementer/index.js +3 -3
- package/dist/components/form/Password/index.js +2 -2
- package/dist/components/form/SelectableCards/index.js +4 -4
- package/dist/components/form/UploadAvatarWithCrop/index.js +5 -5
- package/dist/components/form/UploadWithCrop/index.js +6 -6
- package/dist/components/form/Webhook/index.js +5 -5
- package/dist/components/lightbox/index.js +2 -2
- package/dist/components/table/index.js +3 -3
- package/dist/components/upload/index.js +7 -7
- package/dist/contexts/pushNotifications.d.ts +8 -0
- package/dist/contexts/pushNotifications.js +8 -0
- package/dist/hooks/useThemeToggle.js +3 -3
- package/dist/index.js +3 -3
- package/dist/theme/theme-provider.js +2 -2
- package/dist/types/icon.d.ts +11 -1
- package/dist/types/icon.js +1 -1
- package/dist/types/pushNotifications.d.ts +76 -0
- package/dist/types/pushNotifications.js +1 -0
- package/dist/utils/urlBase64ToUint8Array.d.ts +3 -0
- package/dist/utils/urlBase64ToUint8Array.js +1 -0
- package/package.json +1 -1
- package/dist/{chunk-CASOITDH.js → chunk-L4KD6JF2.js} +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a } from '../../../chunk-NV2X5CYP.js';
|
|
2
|
-
import { a as a$2 } from '../../../chunk-
|
|
3
|
-
import
|
|
4
|
-
import '../../../chunk-
|
|
5
|
-
import { a as a$1 } from '../../../chunk-
|
|
6
|
-
import '../../../chunk-JJM24URR.js';
|
|
2
|
+
import { a as a$2 } from '../../../chunk-DVVFB7RV.js';
|
|
3
|
+
import '../../../chunk-KVFE6S5N.js';
|
|
4
|
+
import { a as a$3 } from '../../../chunk-SERSUUWD.js';
|
|
5
|
+
import { a as a$1 } from '../../../chunk-WIJV4EHZ.js';
|
|
7
6
|
import '../../../chunk-FO7JCJ76.js';
|
|
7
|
+
import '../../../chunk-C2JZG45F.js';
|
|
8
8
|
import { useFormContext, useFieldArray } from 'react-hook-form';
|
|
9
9
|
import D from '@mui/material/Divider';
|
|
10
10
|
import T from '@mui/material/IconButton';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a } from '../../chunk-
|
|
2
|
-
import '../../chunk-JJM24URR.js';
|
|
1
|
+
import { a } from '../../chunk-WIJV4EHZ.js';
|
|
3
2
|
import '../../chunk-FO7JCJ76.js';
|
|
3
|
+
import '../../chunk-C2JZG45F.js';
|
|
4
4
|
import w from '@mui/material/Box';
|
|
5
5
|
import C, { useLightboxState } from 'yet-another-react-lightbox';
|
|
6
6
|
import d from 'yet-another-react-lightbox/plugins/captions';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-JJM24URR.js';
|
|
1
|
+
import { a } from '../../chunk-FCBM4IGE.js';
|
|
2
|
+
import '../../chunk-WIJV4EHZ.js';
|
|
4
3
|
import '../../chunk-FO7JCJ76.js';
|
|
4
|
+
import '../../chunk-C2JZG45F.js';
|
|
5
5
|
import S from '@mui/material/TableCell';
|
|
6
6
|
import F from '@mui/material/TableRow';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-
|
|
2
|
-
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-
|
|
1
|
+
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-ZOUS7PT6.js';
|
|
2
|
+
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-PWWPKKXN.js';
|
|
3
3
|
import { o } from '../../chunk-3HJGN53F.js';
|
|
4
4
|
export { p as RejectionFiles } from '../../chunk-3HJGN53F.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-LGYLZTOS.js';
|
|
6
6
|
import '../../chunk-RQ5Q6X5Y.js';
|
|
7
7
|
import '../../chunk-H5L4ARDB.js';
|
|
8
8
|
import '../../chunk-ANAHA3L6.js';
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-GZ4UBWZJ.js';
|
|
10
|
+
import '../../chunk-DUFPX4QZ.js';
|
|
11
11
|
import '../../chunk-2P4CXK3O.js';
|
|
12
12
|
import '../../chunk-FK7DDO5L.js';
|
|
13
13
|
import '../../chunk-X24QANPC.js';
|
|
14
14
|
import '../../chunk-W3MYAMTH.js';
|
|
15
15
|
import '../../chunk-DMQW3LDF.js';
|
|
16
|
-
import '../../chunk-
|
|
17
|
-
import '../../chunk-JJM24URR.js';
|
|
16
|
+
import '../../chunk-WIJV4EHZ.js';
|
|
18
17
|
import '../../chunk-FO7JCJ76.js';
|
|
18
|
+
import '../../chunk-C2JZG45F.js';
|
|
19
19
|
import '../../chunk-ILHUUK4X.js';
|
|
20
20
|
import '../../chunk-KFZEM7KS.js';
|
|
21
21
|
import '../../chunk-7J53ZUIF.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { PushNotificationProviderProps, PushNotificationContextData } from '../types/pushNotifications.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare const PushNotificationProvider: <TMessage = unknown>({ children, originId, originType, bearerToken, vapidKey, serviceWorkerPath, serviceWorkerFile, pollingInterval, apiAdapters, onMessageReceived, onError, }: PushNotificationProviderProps<TMessage>) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function usePushNotifications<TMessage = unknown>(): PushNotificationContextData<TMessage>;
|
|
7
|
+
|
|
8
|
+
export { PushNotificationProvider, usePushNotifications };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a } from '../chunk-Q3ADZHO5.js';
|
|
2
|
+
import '../chunk-IHAHXNLH.js';
|
|
3
|
+
import { createContext, useState, useMemo, useEffect, useCallback, useContext } from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var j=createContext(void 0),ee=({children:l,originId:m,originType:M,bearerToken:p,vapidKey:C,serviceWorkerPath:S="/",serviceWorkerFile:T="service-worker.js",pollingInterval:N=5e3,apiAdapters:r,onMessageReceived:f,onError:i})=>{let[s,E]=useState(null),[x,k]=useState(null),[D,h]=useState(0),[L,b]=useState(!1),[B,v]=useState(!1),[I,F]=useState({subscriptions:[]}),[R,W]=useState(!1),z=useMemo(()=>!s||R,[s,R]);useEffect(()=>{if(!B||!s||!r.fetchMessages)return;let t=setInterval(async()=>{try{let a=(await r.fetchMessages(s))?.messages?.[0];a&&(k(a),h(o=>o+1),f?.(a));}catch(e){console.error("Erro ao buscar mensagens:",e);}},N);return ()=>clearInterval(t)},[B,s,r,N,f]);let y=useCallback(async t=>{try{let e=t?.toJSON().keys,a={origin_type:M,origin_id:m,endpoint:t?.endpoint??void 0,auth:e?.auth??void 0,p256dh:e?.p256dh??void 0},o=await r.registerClient(a);return E(o.id),b(!1),o.id}catch(e){return console.error("Erro ao registrar cliente:",e),b(!0),i?.(e),null}},[r,m,M,i]);useEffect(()=>{let t=!0,e=null;async function a$1(){if(!("serviceWorker"in navigator)||!("PushManager"in window)){console.warn("Push notifications n\xE3o suportadas, usando polling");let o=await y(null);t&&(E(o),v(!0));return}try{let o=await navigator.serviceWorker.register(`${S}${T}`);if(!t)return;e=async g=>{let P=g.data?.payload?.detail||g.data?.detail?.[0];if(P&&(k(P),h(d=>d+1),f?.(P)),g.data?.id?.value)try{await r.updateMessageStatus(g.data.id.value,{status:"DELIVERED"});}catch(d){console.error("Erro ao atualizar status da mensagem:",d),b(!0),i?.(d);}},navigator.serviceWorker.addEventListener("message",e);let K=await Notification.requestPermission(),H=null;K==="granted"?H=await o.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:a(C)}):(console.warn("Permiss\xE3o de notifica\xE7\xE3o negada, usando polling"),v(!0)),await y(H);}catch(o){console.error("Erro ao inicializar service worker:",o),v(!0),i?.(o);}}return p&&a$1(),()=>{t=!1,e&&"serviceWorker"in navigator&&navigator.serviceWorker.removeEventListener("message",e);}},[p,y,r,C,S,T,f,i]);let n=useCallback(async()=>{if(s){W(!0);try{let t=await r.listSubscriptions(s);F(t);}catch(t){console.error("Erro ao listar inscri\xE7\xF5es:",t),i?.(t);}finally{W(!1);}}},[s,r,i]);useEffect(()=>{s&&n();},[s]);let O=useCallback(async t=>{if(s)try{await r.subscribeTopic(s,t),await n();}catch(e){console.error("Erro ao inscrever em t\xF3pico:",e),i?.(e);}},[s,r,n,i]),V=useCallback(async t=>{if(s)try{await r.unsubscribeTopic(s,t),await n();}catch(e){console.error("Erro ao desinscrever de t\xF3pico:",e),i?.(e);}},[s,r,n,i]),_=useCallback(async t=>{if(!(!s||t.length===0))try{await r.subscribeTopicsBatch(s,t),await n();}catch(e){console.error("Erro ao inscrever em t\xF3picos:",e),i?.(e);}},[s,r,n,i]),$=useCallback(async t=>{if(!(!s||t.length===0))try{await r.unsubscribeTopicsBatch(s,t),await n();}catch(e){console.error("Erro ao desinscrever de t\xF3picos:",e),i?.(e);}},[s,r,n,i]),q=useCallback(()=>{h(0);},[]),G=useMemo(()=>({clientId:s,subscribedTopics:I,isRegisterError:L,isLoading:z,lastMessage:x,newMessageCount:D,subscribeToTopic:O,unsubscribeFromTopic:V,subscribeTopicsBatch:_,unsubscribeTopicsBatch:$,resetMessageCount:q}),[s,I,L,z,x,D,O,V,_,$,q]);return jsx(j.Provider,{value:G,children:l})};function se(){let l=useContext(j);if(!l)throw new Error("usePushNotifications precisa estar dentro de PushNotificationProvider");return l}
|
|
7
|
+
|
|
8
|
+
export { ee as PushNotificationProvider, se as usePushNotifications };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { a as useThemeToggle } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { a as useThemeToggle } from '../chunk-PF7OFL6X.js';
|
|
2
|
+
import '../chunk-L4KD6JF2.js';
|
|
3
3
|
import '../chunk-SO64ZYQB.js';
|
|
4
|
+
import '../chunk-GUFT6XPG.js';
|
|
4
5
|
import '../chunk-FT5VGKNM.js';
|
|
5
6
|
import '../chunk-KHS3U6GK.js';
|
|
6
7
|
import '../chunk-DXGMZFNS.js';
|
|
7
8
|
import '../chunk-CFVUZ4S5.js';
|
|
8
9
|
import '../chunk-7KH2T72T.js';
|
|
9
|
-
import '../chunk-GUFT6XPG.js';
|
|
10
10
|
import '../chunk-7J53ZUIF.js';
|
|
11
11
|
import '../chunk-S7QQBC4I.js';
|
|
12
12
|
import '../chunk-QQDMA4TE.js';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { a as useThemeToggle } from './chunk-
|
|
2
|
-
export { c as ThemeProvider, a as createTheme } from './chunk-
|
|
1
|
+
export { a as useThemeToggle } from './chunk-PF7OFL6X.js';
|
|
2
|
+
export { c as ThemeProvider, a as createTheme } from './chunk-L4KD6JF2.js';
|
|
3
3
|
import './chunk-SO64ZYQB.js';
|
|
4
|
+
import './chunk-GUFT6XPG.js';
|
|
4
5
|
export { c as SettingsProvider, b as useSettingsContext } from './chunk-FT5VGKNM.js';
|
|
5
6
|
export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-KHS3U6GK.js';
|
|
6
7
|
import './chunk-DXGMZFNS.js';
|
|
7
8
|
import './chunk-CFVUZ4S5.js';
|
|
8
9
|
export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-7KH2T72T.js';
|
|
9
|
-
import './chunk-GUFT6XPG.js';
|
|
10
10
|
export { q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha } from './chunk-7J53ZUIF.js';
|
|
11
11
|
import './chunk-S7QQBC4I.js';
|
|
12
12
|
import './chunk-QQDMA4TE.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { c as default, b as forceDataMuiColorScheme } from '../chunk-
|
|
1
|
+
export { c as default, b as forceDataMuiColorScheme } from '../chunk-L4KD6JF2.js';
|
|
2
2
|
import '../chunk-SO64ZYQB.js';
|
|
3
|
+
import '../chunk-GUFT6XPG.js';
|
|
3
4
|
export { b as useSettingsContext } from '../chunk-FT5VGKNM.js';
|
|
4
5
|
import '../chunk-KHS3U6GK.js';
|
|
5
6
|
import '../chunk-DXGMZFNS.js';
|
|
6
7
|
import '../chunk-CFVUZ4S5.js';
|
|
7
8
|
import '../chunk-7KH2T72T.js';
|
|
8
|
-
import '../chunk-GUFT6XPG.js';
|
|
9
9
|
export { a as schemeConfig } from '../chunk-7J53ZUIF.js';
|
|
10
10
|
import '../chunk-S7QQBC4I.js';
|
|
11
11
|
import '../chunk-QQDMA4TE.js';
|
package/dist/types/icon.d.ts
CHANGED
|
@@ -465,7 +465,17 @@ declare enum Icon {
|
|
|
465
465
|
UNIONPAY = "UNIONPAY",
|
|
466
466
|
MAESTRO = "MAESTRO",
|
|
467
467
|
HIPER = "HIPER",
|
|
468
|
-
DISCOVER = "DISCOVER"
|
|
468
|
+
DISCOVER = "DISCOVER",
|
|
469
|
+
AMERICANEXPRESS_BADGE = "AMERICANEXPRESS_BADGE",
|
|
470
|
+
APPLEPAY_BADGE = "APPLEPAY_BADGE",
|
|
471
|
+
BNB_BADGE = "BNB_BADGE",
|
|
472
|
+
BOLETO_BADGE = "BOLETO_BADGE",
|
|
473
|
+
CIELO_BADGE = "CIELO_BADGE",
|
|
474
|
+
ELO_BADGE = "ELO_BADGE",
|
|
475
|
+
MASTERCARD_BADGE = "MASTERCARD_BADGE",
|
|
476
|
+
PIX_BADGE = "PIX_BADGE",
|
|
477
|
+
SAMSUNGPAY_BADGE = "SAMSUNGPAY_BADGE",
|
|
478
|
+
VISA_BADGE = "VISA_BADGE"
|
|
469
479
|
}
|
|
470
480
|
|
|
471
481
|
export { Icon };
|
package/dist/types/icon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as Icon } from '../chunk-
|
|
1
|
+
export { a as Icon } from '../chunk-C2JZG45F.js';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PushMessage<TPayload = unknown> {
|
|
4
|
+
message: string;
|
|
5
|
+
topic: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
payload: TPayload;
|
|
9
|
+
id: {
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface SubscriptionItem {
|
|
14
|
+
topic: string;
|
|
15
|
+
}
|
|
16
|
+
interface SubscriptionsData {
|
|
17
|
+
subscriptions: SubscriptionItem[];
|
|
18
|
+
}
|
|
19
|
+
interface ClientRegistrationPayload {
|
|
20
|
+
origin_type: string;
|
|
21
|
+
origin_id: string;
|
|
22
|
+
endpoint?: string;
|
|
23
|
+
auth?: string;
|
|
24
|
+
p256dh?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ClientRegistrationResult {
|
|
27
|
+
id: string;
|
|
28
|
+
}
|
|
29
|
+
declare enum MessageStatus {
|
|
30
|
+
SENT = "SENT",
|
|
31
|
+
DELIVERED = "DELIVERED",
|
|
32
|
+
READ = "READ"
|
|
33
|
+
}
|
|
34
|
+
interface MessageStatusPayload {
|
|
35
|
+
status: MessageStatus;
|
|
36
|
+
}
|
|
37
|
+
interface PushNotificationApiAdapters<TMessage = unknown> {
|
|
38
|
+
registerClient: (payload: ClientRegistrationPayload) => Promise<ClientRegistrationResult>;
|
|
39
|
+
subscribeTopic: (clientId: string, topic: string) => Promise<void>;
|
|
40
|
+
unsubscribeTopic: (clientId: string, topic: string) => Promise<void>;
|
|
41
|
+
subscribeTopicsBatch: (clientId: string, topics: string[]) => Promise<void>;
|
|
42
|
+
unsubscribeTopicsBatch: (clientId: string, topics: string[]) => Promise<void>;
|
|
43
|
+
listSubscriptions: (clientId: string) => Promise<SubscriptionsData>;
|
|
44
|
+
fetchMessages?: (clientId: string) => Promise<{
|
|
45
|
+
messages: PushMessage<TMessage>[];
|
|
46
|
+
}>;
|
|
47
|
+
updateMessageStatus: (messageId: string, status: MessageStatusPayload) => Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
interface PushNotificationProviderProps<TMessage = unknown> {
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
bearerToken: string;
|
|
52
|
+
originId: string;
|
|
53
|
+
originType: string;
|
|
54
|
+
vapidKey: string;
|
|
55
|
+
serviceWorkerPath?: string;
|
|
56
|
+
serviceWorkerFile?: string;
|
|
57
|
+
pollingInterval?: number;
|
|
58
|
+
apiAdapters: PushNotificationApiAdapters<TMessage>;
|
|
59
|
+
onMessageReceived?: (message: PushMessage<TMessage>) => void;
|
|
60
|
+
onError?: (error: Error) => void;
|
|
61
|
+
}
|
|
62
|
+
interface PushNotificationContextData<TMessage = unknown> {
|
|
63
|
+
clientId: string | null;
|
|
64
|
+
subscribedTopics: SubscriptionsData;
|
|
65
|
+
isLoading: boolean;
|
|
66
|
+
lastMessage: PushMessage<TMessage> | null;
|
|
67
|
+
newMessageCount: number;
|
|
68
|
+
isRegisterError: boolean;
|
|
69
|
+
subscribeToTopic: (topic: string) => Promise<void>;
|
|
70
|
+
unsubscribeFromTopic: (topic: string) => Promise<void>;
|
|
71
|
+
subscribeTopicsBatch: (topics: string[]) => Promise<void>;
|
|
72
|
+
unsubscribeTopicsBatch: (topics: string[]) => Promise<void>;
|
|
73
|
+
resetMessageCount: () => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { ClientRegistrationPayload, ClientRegistrationResult, MessageStatus, MessageStatusPayload, PushMessage, PushNotificationApiAdapters, PushNotificationContextData, PushNotificationProviderProps, SubscriptionItem, SubscriptionsData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { a as MessageStatus } from '../chunk-IHAHXNLH.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { a as urlBase64ToUint8Array } from '../chunk-Q3ADZHO5.js';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a } from './chunk-SO64ZYQB.js';
|
|
2
|
+
import { a as a$7 } from './chunk-GUFT6XPG.js';
|
|
2
3
|
import { c, b as b$1 } from './chunk-FT5VGKNM.js';
|
|
3
4
|
import { a as a$1, e } from './chunk-KHS3U6GK.js';
|
|
4
5
|
import { a as a$3, b } from './chunk-DXGMZFNS.js';
|
|
5
6
|
import { p, r, a as a$2 } from './chunk-7KH2T72T.js';
|
|
6
|
-
import { a as a$7 } from './chunk-GUFT6XPG.js';
|
|
7
7
|
import { d, a as a$4 } from './chunk-7J53ZUIF.js';
|
|
8
8
|
import { a as a$6 } from './chunk-S7QQBC4I.js';
|
|
9
9
|
import { a as a$5 } from './chunk-QQDMA4TE.js';
|