@sesamy/sesamy-components 2.27.1 → 2.27.3

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
@@ -70,11 +70,13 @@ import type {
70
70
 
71
71
  In addition to the DOM events above, the components emit first-party interactions through `sesamy-js` (`window.sesamy.analytics.track`), so they arrive with the sesamy-js context (anonymous id, user id, vendor, page) attached. This is additive: the DOM events keep firing exactly as before, and page views stay `sesamy-js`'s responsibility — the components never emit them.
72
72
 
73
- | Event | Emitted by | When | Properties |
74
- | ------------------ | -------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
75
- | `viewArticle` | `sesamy-content-container` | Once per element, as soon as the container has resolved an article and knows its access state | `itemSrc`, `publisherContentId`, `state` (`public`/`logged-in`/`unlocked`/`locked`) |
76
- | `content_unlocked` | `sesamy-content-container` | Alongside the `sesamy:content-unlocked` DOM event | `itemSrc`, `publisherContentId`, `contentName` |
77
- | `addToCart` | `sesamy-paywall` | When the user picks a product and continues to checkout | `itemSrc`, `publisherContentId`, `sku`, `purchaseOptionId`, `price`, `currency`, `paywallId` |
73
+ | Event | Emitted by | When | Properties |
74
+ | --------------------------- | -------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
75
+ | `viewArticle` | `sesamy-content-container` | Once per element, as soon as the container has resolved an article and knows its access state | `itemSrc`, `publisherContentId`, `state` (`public`/`logged-in`/`unlocked`/`locked`) |
76
+ | `content_unlocked` | `sesamy-content-container` | Alongside the `sesamy:content-unlocked` DOM event | `itemSrc`, `publisherContentId`, `contentName` |
77
+ | `content_access_unresolved` | `sesamy-content-container` | Once per element, the first time an access check fails or runs past its timeout | `itemSrc`, `publisherContentId`, `reason` (`timeout`, or the error) |
78
+ | `content_access_recovered` | `sesamy-content-container` | Once per element, when a definite answer arrives after an unresolved check | `itemSrc`, `publisherContentId`, `state` (`granted`/`denied`), `attempts`, `elapsedMs` |
79
+ | `addToCart` | `sesamy-paywall` | When the user picks a product and continues to checkout | `itemSrc`, `publisherContentId`, `sku`, `purchaseOptionId`, `price`, `currency`, `paywallId` |
78
80
 
79
81
  Event and property names match the ones `@sesamy/web-components` produced, so consumers of the interactions index keep working unchanged — only `context.library` differs (`@sesamy/sesamy-js` instead of `@sesamy/web-components`). Each event also repeats its own name in `properties.name`, as the legacy library did.
80
82
 
@@ -264,6 +266,10 @@ All per-element events bubble and are composed (cross shadow roots).
264
266
 
265
267
  The container also emits the `viewArticle` and `content_unlocked` interactions through sesamy-js — see [Interaction tracking](#interaction-tracking).
266
268
 
269
+ **When access cannot be resolved:**
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.
272
+
267
273
  ```js
268
274
  const el = document.querySelector('sesamy-content-container');
269
275
  el.addEventListener('sesamy:content-unlocked', (e) => {
@@ -547,16 +553,16 @@ You can add additional components by adding them to the `packages/lib/src` folde
547
553
 
548
554
  ### Available Scripts
549
555
 
550
- | Command | Description |
551
- | ---------------------- | -------------------------------------------------- |
552
- | `yarn dev` | Start the development server |
553
- | `yarn build` | Build both library and demo |
554
- | `yarn build:lib` | Build the library only |
555
- | `yarn storybook` | Start Storybook for component development |
556
- | `yarn build:storybook` | Build Storybook for deployment |
557
- | `yarn test` | Run Playwright tests |
558
- | `yarn check` | Run Svelte type checking |
559
- | `yarn pull-translations` | Pull latest translations from i18nexus |
556
+ | Command | Description |
557
+ | ------------------------ | ----------------------------------------- |
558
+ | `yarn dev` | Start the development server |
559
+ | `yarn build` | Build both library and demo |
560
+ | `yarn build:lib` | Build the library only |
561
+ | `yarn storybook` | Start Storybook for component development |
562
+ | `yarn build:storybook` | Build Storybook for deployment |
563
+ | `yarn test` | Run Playwright tests |
564
+ | `yarn check` | Run Svelte type checking |
565
+ | `yarn pull-translations` | Pull latest translations from i18nexus |
560
566
 
561
567
  ## Testing your components
562
568