payload-subscribers-plugin 0.0.10 → 0.0.11
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/README.md +4 -4
- package/dist/exports/ui.d.ts +4 -0
- package/dist/exports/ui.js +4 -0
- package/dist/exports/ui.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -260,7 +260,7 @@ Use these hooks inside components that are descendants of **SubscriberProvider**
|
|
|
260
260
|
Requests a magic-login link by email (POST /api/emailToken). Exposes `sendMagicLink`, plus `result` and `status` for rendering messages and loading state.
|
|
261
261
|
|
|
262
262
|
```typescript
|
|
263
|
-
import { useRequestMagicLink } from 'payload-subscribers-plugin/
|
|
263
|
+
import { useRequestMagicLink } from 'payload-subscribers-plugin/ui'
|
|
264
264
|
|
|
265
265
|
function MySignInForm() {
|
|
266
266
|
const { result, sendMagicLink, status } = useRequestMagicLink({
|
|
@@ -292,7 +292,7 @@ Handles the verify step of the magic-link flow: reads `email` and `token` from U
|
|
|
292
292
|
|
|
293
293
|
```typescript
|
|
294
294
|
import { useEffect } from 'react'
|
|
295
|
-
import { useVerifyMagicLink } from 'payload-subscribers-plugin/
|
|
295
|
+
import { useVerifyMagicLink } from 'payload-subscribers-plugin/ui'
|
|
296
296
|
|
|
297
297
|
function VerifyPage() {
|
|
298
298
|
const { isError, isLoading, result, verify } = useVerifyMagicLink()
|
|
@@ -311,7 +311,7 @@ function VerifyPage() {
|
|
|
311
311
|
Updates the current subscriber’s opt-in channels (POST /api/subscribe). Exposes `updateSubscriptions`, plus `subscriber`, `result`, and `status`. Use with **SubscriberProvider** so `subscriber` and refresh are available.
|
|
312
312
|
|
|
313
313
|
```typescript
|
|
314
|
-
import { useSubscribe } from 'payload-subscribers-plugin/
|
|
314
|
+
import { useSubscribe } from 'payload-subscribers-plugin/ui'
|
|
315
315
|
|
|
316
316
|
function MyPreferencesForm() {
|
|
317
317
|
const { result, status, subscriber, updateSubscriptions } = useSubscribe({
|
|
@@ -344,7 +344,7 @@ Calls POST /api/unsubscribe with email and token (from the hook args or from sub
|
|
|
344
344
|
```typescript
|
|
345
345
|
import { useEffect } from 'react'
|
|
346
346
|
import { useSearchParams } from 'next/navigation'
|
|
347
|
-
import { useUnsubscribe } from 'payload-subscribers-plugin/
|
|
347
|
+
import { useUnsubscribe } from 'payload-subscribers-plugin/ui'
|
|
348
348
|
|
|
349
349
|
function UnsubscribePage() {
|
|
350
350
|
const searchParams = useSearchParams()
|
package/dist/exports/ui.d.ts
CHANGED
|
@@ -10,4 +10,8 @@ export type { VerifyMagicLinkResponse } from '../components/app/VerifyMagicLink.
|
|
|
10
10
|
export { VerifyMagicLink } from '../components/app/VerifyMagicLink.js';
|
|
11
11
|
export type { SubscriberContextType } from '../contexts/SubscriberProvider.js';
|
|
12
12
|
export { SubscriberProvider, useSubscriber } from '../contexts/SubscriberProvider.js';
|
|
13
|
+
export { useRequestMagicLink } from '../hooks/useRequestMagicLink.js';
|
|
14
|
+
export { useSubscribe } from '../hooks/useSubscribe.js';
|
|
15
|
+
export { useUnsubscribe } from '../hooks/useUnsubscribe.js';
|
|
16
|
+
export { useVerifyMagicLink } from '../hooks/useVerifyMagicLink.js';
|
|
13
17
|
export { getServerUrl } from '../server-functions/serverUrl.js';
|
package/dist/exports/ui.js
CHANGED
|
@@ -5,6 +5,10 @@ export { SubscriberMenu } from '../components/app/SubscriberMenu.js';
|
|
|
5
5
|
export { Unsubscribe } from '../components/app/Unsubscribe.js';
|
|
6
6
|
export { VerifyMagicLink } from '../components/app/VerifyMagicLink.js';
|
|
7
7
|
export { SubscriberProvider, useSubscriber } from '../contexts/SubscriberProvider.js';
|
|
8
|
+
export { useRequestMagicLink } from '../hooks/useRequestMagicLink.js';
|
|
9
|
+
export { useSubscribe } from '../hooks/useSubscribe.js';
|
|
10
|
+
export { useUnsubscribe } from '../hooks/useUnsubscribe.js';
|
|
11
|
+
export { useVerifyMagicLink } from '../hooks/useVerifyMagicLink.js';
|
|
8
12
|
export { getServerUrl } from '../server-functions/serverUrl.js';
|
|
9
13
|
|
|
10
14
|
//# sourceMappingURL=ui.js.map
|
package/dist/exports/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/ui.ts"],"sourcesContent":["export type { RequestMagicLinkResponse } from '../components/app/RequestMagicLink.js'\nexport { RequestMagicLink } from '../components/app/RequestMagicLink.js'\n\nexport { RequestOrSubscribe } from '../components/app/RequestOrSubscribe.js'\n\nexport type { SubscribeResponse } from '../components/app/Subscribe.js'\nexport { Subscribe } from '../components/app/Subscribe.js'\n\nexport { SubscriberMenu } from '../components/app/SubscriberMenu.js'\n\nexport type { UnsubscribeResponse } from '../components/app/Unsubscribe.js'\nexport { Unsubscribe } from '../components/app/Unsubscribe.js'\n\nexport type { VerifyMagicLinkResponse } from '../components/app/VerifyMagicLink.js'\nexport { VerifyMagicLink } from '../components/app/VerifyMagicLink.js'\n\nexport type { SubscriberContextType } from '../contexts/SubscriberProvider.js'\nexport { SubscriberProvider, useSubscriber } from '../contexts/SubscriberProvider.js'\n\nexport { getServerUrl } from '../server-functions/serverUrl.js'\n"],"names":["RequestMagicLink","RequestOrSubscribe","Subscribe","SubscriberMenu","Unsubscribe","VerifyMagicLink","SubscriberProvider","useSubscriber","getServerUrl"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,wCAAuC;AAExE,SAASC,kBAAkB,QAAQ,0CAAyC;AAG5E,SAASC,SAAS,QAAQ,iCAAgC;AAE1D,SAASC,cAAc,QAAQ,sCAAqC;AAGpE,SAASC,WAAW,QAAQ,mCAAkC;AAG9D,SAASC,eAAe,QAAQ,uCAAsC;AAGtE,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,oCAAmC;AAErF,SAASC,YAAY,QAAQ,mCAAkC"}
|
|
1
|
+
{"version":3,"sources":["../../src/exports/ui.ts"],"sourcesContent":["export type { RequestMagicLinkResponse } from '../components/app/RequestMagicLink.js'\nexport { RequestMagicLink } from '../components/app/RequestMagicLink.js'\n\nexport { RequestOrSubscribe } from '../components/app/RequestOrSubscribe.js'\n\nexport type { SubscribeResponse } from '../components/app/Subscribe.js'\nexport { Subscribe } from '../components/app/Subscribe.js'\n\nexport { SubscriberMenu } from '../components/app/SubscriberMenu.js'\n\nexport type { UnsubscribeResponse } from '../components/app/Unsubscribe.js'\nexport { Unsubscribe } from '../components/app/Unsubscribe.js'\n\nexport type { VerifyMagicLinkResponse } from '../components/app/VerifyMagicLink.js'\nexport { VerifyMagicLink } from '../components/app/VerifyMagicLink.js'\n\nexport type { SubscriberContextType } from '../contexts/SubscriberProvider.js'\nexport { SubscriberProvider, useSubscriber } from '../contexts/SubscriberProvider.js'\n\nexport { useRequestMagicLink } from '../hooks/useRequestMagicLink.js'\nexport { useSubscribe } from '../hooks/useSubscribe.js'\nexport { useUnsubscribe } from '../hooks/useUnsubscribe.js'\nexport { useVerifyMagicLink } from '../hooks/useVerifyMagicLink.js'\n\nexport { getServerUrl } from '../server-functions/serverUrl.js'\n"],"names":["RequestMagicLink","RequestOrSubscribe","Subscribe","SubscriberMenu","Unsubscribe","VerifyMagicLink","SubscriberProvider","useSubscriber","useRequestMagicLink","useSubscribe","useUnsubscribe","useVerifyMagicLink","getServerUrl"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,wCAAuC;AAExE,SAASC,kBAAkB,QAAQ,0CAAyC;AAG5E,SAASC,SAAS,QAAQ,iCAAgC;AAE1D,SAASC,cAAc,QAAQ,sCAAqC;AAGpE,SAASC,WAAW,QAAQ,mCAAkC;AAG9D,SAASC,eAAe,QAAQ,uCAAsC;AAGtE,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,oCAAmC;AAErF,SAASC,mBAAmB,QAAQ,kCAAiC;AACrE,SAASC,YAAY,QAAQ,2BAA0B;AACvD,SAASC,cAAc,QAAQ,6BAA4B;AAC3D,SAASC,kBAAkB,QAAQ,iCAAgC;AAEnE,SAASC,YAAY,QAAQ,mCAAkC"}
|
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"registry": "https://registry.npmjs.org/",
|
|
71
71
|
"dependencies": {},
|
|
72
|
-
"version": "0.0.
|
|
72
|
+
"version": "0.0.11",
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
|
|
75
75
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|