@sesamy/sesamy-components 2.27.5 → 2.29.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/README.md CHANGED
@@ -299,11 +299,12 @@ A web component that displays a paywall for content, loading paywall settings fr
299
299
 
300
300
  **Props/Attributes:**
301
301
 
302
- - `settings-url`: URL to fetch paywall settings (required)
302
+ - `settings-url`: URL to fetch paywall settings (required). Path-like relative URLs — starting with `/`, `./` or `../`, or containing `/` (e.g. `/paywall/settings.json`) — are supported and resolved against the page. A value with no slash is treated as a paywall id, so use `./settings.json` for a same-directory file.
303
303
  - `item-src`: URL of the content item
304
304
  - `price`: Price of the content
305
305
  - `currency`: Currency code for the price
306
306
  - `redirect-url`: URL to redirect after purchase
307
+ - `redirect-label`: Label for the button back to the redirect URL on the checkout confirmation page and in the order confirmation email
307
308
  - `utm-source`, `utm-medium`, `utm-campaign`, `utm-term`, `utm-content`: UTM parameters for tracking
308
309
  - `pass`: Pass ID for access
309
310
 
@@ -323,6 +324,21 @@ of sending a broken `redirect-url` to checkout. Single purchases have no
323
324
  per-option redirect, so they start at level 2; subscription options of type URL
324
325
  link straight out and never reach checkout at all.
325
326
 
327
+ **Redirect button label:**
328
+
329
+ The checkout confirmation page and the order confirmation email have a button
330
+ that takes the buyer back to the redirect URL. It reads "Go to {vendor}" unless
331
+ a label is set. The label resolves through the same levels as the redirect,
332
+ first non-blank value winning:
333
+
334
+ 1. `redirectLabel` on the chosen subscription option
335
+ 2. `settings.redirectLabel` on the paywall
336
+ 3. the `redirect-label` attribute on the element
337
+
338
+ It is plain text and not translated. Blank values fall through. With none set,
339
+ no label is sent and the checkout keeps its default. This needs an api2 that
340
+ accepts `redirectLabel` on `POST /checkouts`. Older api2 versions ignore it.
341
+
326
342
  **Events:**
327
343
 
328
344
  Per-element events dispatched directly on the `<sesamy-paywall>` element (bubble, composed):
@@ -355,6 +371,7 @@ The paywall also emits the `addToCart` interaction through sesamy-js when the us
355
371
  - `below-headline`: Content rendered below the paywall headline (e.g., additional info, custom elements)
356
372
  - `features`: Content rendered in the features section of the paywall (e.g., feature list, benefits)
357
373
  - `login-button-text`: Replaces the text of the "already subscribing" login button
374
+ - `logout-button-text`: Replaces the "Log out" text in the row a logged-in reader without access sees
358
375
 
359
376
  **Basic Usage Example:**
360
377
 
@@ -377,7 +394,7 @@ The paywall also emits the `addToCart` interaction through sesamy-js when the us
377
394
 
378
395
  #### Slots
379
396
 
380
- The `sesamy-paywall` component provides four slots for customization:
397
+ The `sesamy-paywall` component provides five slots for customization:
381
398
 
382
399
  ##### headline
383
400
 
@@ -433,9 +450,21 @@ The `sesamy-paywall` component provides four slots for customization:
433
450
  </sesamy-paywall>
434
451
  ```
435
452
 
453
+ ##### logout-button-text
454
+
455
+ - **Purpose:** Replaces the "Log out" label in the row a logged-in reader without access sees.
456
+ - **Behavior:** When the reader is logged in but has no access and `showLoginButton` is on, the paywall shows "Logged in as {email} · Log out" in place of the login button. This slot replaces only the "Log out" label; the "Logged in as {email}" prefix is translated and can't be slotted. When you leave it empty, the default translated text is used. After the reader logs out, the paywall switches back to the login row without a page reload.
457
+ - **Availability:** Only the `ARTICLE` template renders this row, so the slot has no effect in the `BOXES` and `LOGIN` templates.
458
+ - **Example:**
459
+ ```html
460
+ <sesamy-paywall settings-url="https://api.example.com/paywall/settings">
461
+ <span slot="logout-button-text">Sign out</span>
462
+ </sesamy-paywall>
463
+ ```
464
+
436
465
  **Note:**
437
466
 
438
- - The `below-headline` slot adds to the paywall, while the `headline`, `features` and `login-button-text` slots replace the default content entirely.
467
+ - The `below-headline` slot adds to the paywall, while the `headline`, `features` and `login-button-text` slots replace the default content entirely. The `logout-button-text` slot replaces only the "Log out" label.
439
468
 
440
469
  ### sesamy-visibility
441
470