@widgetic/embed-sdk 2.0.9 → 2.0.10

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
@@ -80,20 +80,18 @@ export function WidgeticEmbed({ compositionId }) {
80
80
 
81
81
  The tag has more attributes: `embed-target`, and the ones for an overlay, a pop-up and for when a widget shows (`overlay-*`, `popup-*`, `trigger-*`). They are described in the Widgetic Partner integration guide, page 8, "Embed widgets on your pages".
82
82
 
83
- ### Host context, theme, and partner media (host bridge)
83
+ ### Host context and partner media (host bridge)
84
84
 
85
85
  Optional attributes on `<widgetic>` are sent to the published frame as a `widgetic:host` message and kept in sync while the widget is visible:
86
86
 
87
- | Attribute | Purpose |
88
- | --------------- | ------------------------------------------------------------------------------------ |
89
- | `context` | JSON object (≤20 keys) stored on entries and returned on reads |
90
- | `values` | JSON object that pre-fills fields by name |
91
- | `lang` | BCP 47 language tag (for example `fr`, `pt-BR`) |
92
- | `dir` | `ltr` or `rtl` |
93
- | `mode` | `light` or `dark` |
94
- | `colors` | JSON theme colours (`primary`, `background`, …) |
87
+ | Attribute | Purpose |
88
+ | ---------------- | ------------------------------------------------------------------------------------ |
89
+ | `context` | JSON object (≤20 keys) stored on entries and returned on reads |
90
+ | `values` | JSON object that pre-fills fields by name |
95
91
  | `media-resolver` | HTTPS URL of a partner function that turns stored media addresses into playable URLs |
96
92
 
93
+ A widget keeps the language and the colours its author gave it, whatever page it sits in, so there is no attribute that changes either. Your own language and colours belong to Widgetic's editors (`@widgetic/ui-sdk`): each module takes `locale`, `messages` and `theme`. Versions 2.0.8 and 2.0.9 of this package also passed `lang`, `dir`, `mode` and `colors` on to the frame; they no longer do, and a tag that still carries them is drawn as any other.
94
+
97
95
  The element fires DOM events (bubbling, composed) that match the frame protocol: `widgetic:ready`, `widgetic:error`, `widgetic:submitted`, `widgetic:resize`, `widgetic:data`, `widgetic:interaction`, `widgetic:form-submit`. Lookup failures use `widgetic:error` with `detail.code` in lower case (`not_found`, `domain_not_allowed`, `device_restricted`, …).
98
96
 
99
97
  Markers the script writes: `data-widgetic-mounting`, `data-widgetic-mounted`, `data-device-restricted`, `data-widgetic-refused="CODE"`, `data-widgetic-context-invalid`. See `docs/host-contract.md` for the full contract.
@@ -157,11 +155,11 @@ When the GitLab job fails with `ci_quota_exceeded`, publish from a laptop. That
157
155
  npm ci
158
156
  npm run build
159
157
  npm publish --access public
160
- npm run publish:cdn:dry-run
161
- npm run publish:cdn -- --purge
158
+ npm run publish:cdn:dry-run -- --env-file .env
159
+ npm run publish:cdn -- --purge --allow-dirty --env-file .env
162
160
  ```
163
161
 
164
- `npm publish` needs the token in `~/.npmrc`. Do not commit that file. The dry run changes nothing. The last command asks you to type `publish`, uploads the file, and purges the cache. Check `npm view @widgetic/embed-sdk version` and the `last-modified` header of `https://cdn.widgetic.com/sdks/browser/embed-sdk.js`. What the upload checks, and how to roll back, is in `__docs/05-advanced/06-publishing-to-cdn.md`.
162
+ `npm publish` needs the token in `~/.npmrc`. Do not commit that file. The R2 settings named above have to be in that `.env`, or already in the environment. The dry run changes nothing. The upload stops when the built `dist/` differs from the committed one, so the laptop command passes `--allow-dirty`. The last command asks you to type `publish`, uploads the file, and purges the cache. Check `npm view @widgetic/embed-sdk version` and the `last-modified` header of `https://cdn.widgetic.com/sdks/browser/embed-sdk.js`. What the upload checks, and how to roll back, is in `__docs/05-advanced/06-publishing-to-cdn.md`.
165
163
 
166
164
  ## License
167
165