@sesamy/sesamy-components 2.29.0 → 2.30.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 +63 -8
- package/dist/lib/phone-lib.js +16 -0
- package/dist/lib/sesamy-components.es.js +5619 -8514
- package/dist/lib/sesamy-components.umd.js +35 -31
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -268,7 +268,7 @@ The container also emits the `viewArticle` and `content_unlocked` interactions t
|
|
|
268
268
|
|
|
269
269
|
**When access cannot be resolved:**
|
|
270
270
|
|
|
271
|
-
The container only removes the `content` slot on a definite denial. If the access check fails (no token, a network error) or does not answer within 10 seconds, the state is unknown and the `preview` slot is shown, with the article left in place. The container then checks again by itself after 1s, 3s and 10s, then every 30s, and straight away when the browser comes back online or the tab becomes visible again, until it gets an answer. A slow answer that arrives after its check timed out is still used. Once an article is shown, a later check that cannot be resolved does not hide it. `content_access_unresolved` and `content_access_recovered` report how often this happens.
|
|
271
|
+
The container only removes the `content` slot on a definite denial. If the access check fails (no token, a network error) or does not answer within 10 seconds, the state is unknown and the `preview` slot is shown, with the article left in place. The container then checks again by itself after 1s, 3s and 10s, then every 30s, and straight away when the browser comes back online or the tab becomes visible again, until it gets an answer. A slow answer that arrives after its check timed out is still used. Once an article is shown, a later check that cannot be resolved does not hide it. `content_access_unresolved` and `content_access_recovered` report how often this happens. With a sesamy-js that provides `sesamy.errors.report`, the same two moments are also sent to Sesamy's error reporting (category `component`, with the reason, attempts and elapsed time), alongside the auth and API failures sesamy-js reports itself.
|
|
272
272
|
|
|
273
273
|
```js
|
|
274
274
|
const el = document.querySelector('sesamy-content-container');
|
|
@@ -295,7 +295,7 @@ el.addEventListener('sesamy:content-unlocked', (e) => {
|
|
|
295
295
|
|
|
296
296
|
### sesamy-paywall
|
|
297
297
|
|
|
298
|
-
A web component that displays a paywall for content, loading paywall settings from a remote URL and supporting different templates (Article, Boxes, Login).
|
|
298
|
+
A web component that displays a paywall for content, loading paywall settings from a remote URL and supporting different templates (Article, Boxes, Login, Email).
|
|
299
299
|
|
|
300
300
|
**Props/Attributes:**
|
|
301
301
|
|
|
@@ -339,6 +339,48 @@ It is plain text and not translated. Blank values fall through. With none set,
|
|
|
339
339
|
no label is sent and the checkout keeps its default. This needs an api2 that
|
|
340
340
|
accepts `redirectLabel` on `POST /checkouts`. Older api2 versions ignore it.
|
|
341
341
|
|
|
342
|
+
**Email template:**
|
|
343
|
+
|
|
344
|
+
With `settings.template` set to `EMAIL`, the paywall sells one offer and asks
|
|
345
|
+
only for an email address, then sends the reader to checkout with the address
|
|
346
|
+
filled in. Everything it shows comes from the paywall settings, so each
|
|
347
|
+
publisher configures their own copy and branding:
|
|
348
|
+
|
|
349
|
+
| Shown | Taken from |
|
|
350
|
+
| -------------------------- | ------------------------------------------------------------ |
|
|
351
|
+
| Logo | `logoUrl`, when `settings.useDefaultLogo` is on |
|
|
352
|
+
| Headline | `headline` |
|
|
353
|
+
| Text below the headline | `description` of the offer |
|
|
354
|
+
| Benefits list | `features` of the offer, else the paywall-wide `features` |
|
|
355
|
+
| Button text | `buttonText` of the offer, else the translated "Continue" |
|
|
356
|
+
| "Already subscribing?" row | shown to logged-out readers when `showLoginButton` is on |
|
|
357
|
+
| Colors and background | `mainColor` and `settings.styling`, like the other templates |
|
|
358
|
+
|
|
359
|
+
The offer is the subscription option marked `selected`, or the first one. With
|
|
360
|
+
no options the paywall renders nothing. The checkout is created with the
|
|
361
|
+
option's discount code, the same redirect and redirect label resolution as the
|
|
362
|
+
other templates, and `email` set to the address. A reader who is logged in but
|
|
363
|
+
has no access gets their account's address filled in. An option of type URL
|
|
364
|
+
links straight out, as in the other templates.
|
|
365
|
+
|
|
366
|
+
The address is part of the `payload` of the cancelable
|
|
367
|
+
`sesamyPaywallCreateCheckout` event. A listener that forwards that payload to an
|
|
368
|
+
analytics or tag manager is sending personal data, so pick the fields it sends.
|
|
369
|
+
|
|
370
|
+
It renders as a compact, centered card. On top of the shared paywall tokens
|
|
371
|
+
(`--sesamy-paywall-primary-color`, `--sesamy-paywall-bg-color`,
|
|
372
|
+
`--sesamy-paywall-border-radius`, `--sesamy-paywall-btn-bg-color`, …) it reads:
|
|
373
|
+
|
|
374
|
+
```css
|
|
375
|
+
sesamy-paywall {
|
|
376
|
+
--sesamy-paywall-headline-font-family: Georgia, serif; /* default: --sesamy-font-family */
|
|
377
|
+
--sesamy-paywall-headline-font-weight: 500; /* default 700 */
|
|
378
|
+
--sesamy-paywall-max-width: 560px; /* default 490px at a 16px base size */
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
The payment method logos are shown only when `footerPaymentMethods` is set.
|
|
383
|
+
|
|
342
384
|
**Events:**
|
|
343
385
|
|
|
344
386
|
Per-element events dispatched directly on the `<sesamy-paywall>` element (bubble, composed):
|
|
@@ -372,6 +414,7 @@ The paywall also emits the `addToCart` interaction through sesamy-js when the us
|
|
|
372
414
|
- `features`: Content rendered in the features section of the paywall (e.g., feature list, benefits)
|
|
373
415
|
- `login-button-text`: Replaces the text of the "already subscribing" login button
|
|
374
416
|
- `logout-button-text`: Replaces the "Log out" text in the row a logged-in reader without access sees
|
|
417
|
+
- `below-button`: Content rendered below the continue button, for example terms or a privacy notice (`EMAIL` template only)
|
|
375
418
|
|
|
376
419
|
**Basic Usage Example:**
|
|
377
420
|
|
|
@@ -394,13 +437,13 @@ The paywall also emits the `addToCart` interaction through sesamy-js when the us
|
|
|
394
437
|
|
|
395
438
|
#### Slots
|
|
396
439
|
|
|
397
|
-
The `sesamy-paywall` component provides
|
|
440
|
+
The `sesamy-paywall` component provides six slots for customization:
|
|
398
441
|
|
|
399
442
|
##### headline
|
|
400
443
|
|
|
401
444
|
- **Purpose:** Replaces the headline configured in the paywall settings.
|
|
402
445
|
- **Behavior:** When you provide content in the `headline` slot, it is rendered in place of the stored headline, with the headline's own styling (size, weight, max width). When you leave it empty, the headline from the paywall settings is shown. Use this to vary the copy per placement (e.g., article vs. front page) while reusing one paywall configuration.
|
|
403
|
-
- **Availability:** All templates (`ARTICLE`, `BOXES`, `LOGIN`).
|
|
446
|
+
- **Availability:** All templates (`ARTICLE`, `BOXES`, `LOGIN`, `EMAIL`).
|
|
404
447
|
- **Example:**
|
|
405
448
|
```html
|
|
406
449
|
<sesamy-paywall settings-url="https://api.example.com/paywall/settings">
|
|
@@ -411,7 +454,7 @@ The `sesamy-paywall` component provides five slots for customization:
|
|
|
411
454
|
##### below-headline
|
|
412
455
|
|
|
413
456
|
- **Purpose:** Inserts custom content directly below the paywall headline.
|
|
414
|
-
- **Behavior:** The content you provide in this slot will be rendered in addition to the default paywall content, immediately below the headline. Use this for adding extra information, banners, or custom elements.
|
|
457
|
+
- **Behavior:** The content you provide in this slot will be rendered in addition to the default paywall content, immediately below the headline. Use this for adding extra information, banners, or custom elements. In the `EMAIL` template the slot replaces the offer's description, which is rendered there by default.
|
|
415
458
|
- **Example:**
|
|
416
459
|
```html
|
|
417
460
|
<sesamy-paywall settings-url="https://api.example.com/paywall/login-settings">
|
|
@@ -423,7 +466,7 @@ The `sesamy-paywall` component provides five slots for customization:
|
|
|
423
466
|
|
|
424
467
|
- **Purpose:** Replaces the default features section of the paywall.
|
|
425
468
|
- **Behavior:** When you provide content in the `features` slot, it will completely replace the built-in features list or section. Use this slot to fully customize the list of benefits, features, or selling points shown to the user. Slotted content is static: it does not switch when the visitor selects a different subscription option the way the built-in list does.
|
|
426
|
-
- **Availability:**
|
|
469
|
+
- **Availability:** The `ARTICLE` and `EMAIL` templates render a features list. The `BOXES` template shows features inside each box, so the slot has no effect there.
|
|
427
470
|
- **Example:**
|
|
428
471
|
```html
|
|
429
472
|
<sesamy-paywall settings-url="https://api.example.com/paywall/settings">
|
|
@@ -441,7 +484,7 @@ The `sesamy-paywall` component provides five slots for customization:
|
|
|
441
484
|
|
|
442
485
|
- **Purpose:** Replaces the text of the "already subscribing" login button the paywall renders above the headline.
|
|
443
486
|
- **Behavior:** The paywall embeds a nested `sesamy-login` component and forwards this slot into that component's own `button-text` slot. When you leave it empty, the default translated text (`Already subscribing? Login`) is used.
|
|
444
|
-
- **Availability:**
|
|
487
|
+
- **Availability:** The `ARTICLE` and `EMAIL` templates render this login button (the `EMAIL` template below the form). The `BOXES` template hides it, and the `LOGIN` template doesn't embed a `sesamy-login` at all, so the slot has no effect there.
|
|
445
488
|
- **Styling:** Inside the paywall this button is rendered borderless and underlined (4px offset), at the base font size (16px by default) rather than the 14px a standalone `sesamy-login` uses, and it fades to 80% opacity on hover. Set `--sesamy-login-button-text-size` on the paywall to override the size; the other `--sesamy-login-button-*` variables apply as usual.
|
|
446
489
|
- **Example:**
|
|
447
490
|
```html
|
|
@@ -462,9 +505,21 @@ The `sesamy-paywall` component provides five slots for customization:
|
|
|
462
505
|
</sesamy-paywall>
|
|
463
506
|
```
|
|
464
507
|
|
|
508
|
+
##### below-button
|
|
509
|
+
|
|
510
|
+
- **Purpose:** Inserts custom content directly below the continue button.
|
|
511
|
+
- **Behavior:** Rendered in addition to the default content. Use it for terms, a privacy notice or other small print that belongs next to the button.
|
|
512
|
+
- **Availability:** Only the `EMAIL` template.
|
|
513
|
+
- **Example:**
|
|
514
|
+
```html
|
|
515
|
+
<sesamy-paywall settings-url="https://api.example.com/paywall/email-settings">
|
|
516
|
+
<small slot="below-button">By continuing you accept our terms.</small>
|
|
517
|
+
</sesamy-paywall>
|
|
518
|
+
```
|
|
519
|
+
|
|
465
520
|
**Note:**
|
|
466
521
|
|
|
467
|
-
- The `below-headline`
|
|
522
|
+
- The `below-headline` and `below-button` slots add 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.
|
|
468
523
|
|
|
469
524
|
### sesamy-visibility
|
|
470
525
|
|