@extenshi/pay 0.8.0 → 0.9.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.
Files changed (43) hide show
  1. package/README.md +6 -2
  2. package/dist/core/extenshi-pay.d.ts +1 -1
  3. package/dist/core.d.mts +14 -3
  4. package/dist/core.d.ts +14 -3
  5. package/dist/core.js +3 -3
  6. package/dist/core.js.map +1 -1
  7. package/dist/core.mjs +3 -3
  8. package/dist/core.mjs.map +1 -1
  9. package/dist/extenshi-pay-lite.js +3 -3
  10. package/dist/extenshi-pay-lite.js.map +1 -1
  11. package/dist/extenshi-pay-lite.min.js +3 -3
  12. package/dist/extenshi-pay-lite.min.js.map +1 -1
  13. package/dist/extenshi-pay-lite.mjs +3 -3
  14. package/dist/extenshi-pay-lite.mjs.map +1 -1
  15. package/dist/extenshi-pay.cjs.js +156 -15
  16. package/dist/extenshi-pay.cjs.js.map +1 -1
  17. package/dist/extenshi-pay.d.ts.map +1 -1
  18. package/dist/extenshi-pay.js +156 -15
  19. package/dist/extenshi-pay.js.map +1 -1
  20. package/dist/extenshi-pay.min.js +3 -3
  21. package/dist/extenshi-pay.min.js.map +1 -1
  22. package/dist/extenshi-pay.min.mjs +3 -3
  23. package/dist/extenshi-pay.min.mjs.map +1 -1
  24. package/dist/extenshi-pay.mjs +156 -15
  25. package/dist/extenshi-pay.mjs.map +1 -1
  26. package/dist/index.d.mts +22 -3
  27. package/dist/index.d.ts +22 -3
  28. package/dist/lite.d.mts +14 -3
  29. package/dist/lite.d.ts +14 -3
  30. package/dist/paywall/icon.d.ts +18 -0
  31. package/dist/paywall/icon.d.ts.map +1 -0
  32. package/dist/paywall/renderer.d.ts +8 -0
  33. package/dist/paywall/renderer.d.ts.map +1 -1
  34. package/dist/paywall.d.mts +20 -1
  35. package/dist/paywall.d.ts +20 -1
  36. package/dist/paywall.js +79 -13
  37. package/dist/paywall.js.map +1 -1
  38. package/dist/paywall.mjs +79 -13
  39. package/dist/paywall.mjs.map +1 -1
  40. package/dist/types/paywall.d.ts +12 -1
  41. package/dist/types/paywall.d.ts.map +1 -1
  42. package/dist/version.d.ts +1 -1
  43. package/package.json +2 -2
package/README.md CHANGED
@@ -101,13 +101,17 @@ await pay.showPaywall({
101
101
  mode: 'modal', // 'modal' | 'inline' | 'sidebar' | 'fullscreen' | 'minimal'
102
102
  sku: 'pro', // which offer to feature (default: first)
103
103
  title: 'Go Pro',
104
- features: ['Unlimited exports', 'Sync'],
104
+ description: 'Every export format in one plan.', // default: the offer's description
105
+ features: ['Unlimited exports', 'Sync'], // bullet points (modal: up to 6, minimal: up to 3); omit for no feature list
106
+ icon: 'icons/icon128.png', // default: the largest manifest icon; false keeps the glyph
105
107
  theme: { mode: 'auto', primaryColor: '#0ea5e9' },
106
108
  container: document.querySelector('#upsell'), // for inline mode
107
109
  })
108
110
  ```
109
111
 
110
- Templates come from `@extenshi/paywall-templates` and are inlined at build time. The paywall, the license dialog and the billing-profile picker are translated into English, Spanish, Brazilian Portuguese, French, German, Italian, Russian, Japanese, Korean, Simplified Chinese and Arabic (right to left); the language follows `locale`, which defaults to the browser UI language. Any string can still be overridden per call (`strings: { upgrade: 'Kaufen' }`). Offer titles, descriptions and features come from the server in the buyer's language when you translated them in dojo (Monetization → Languages) or with `set_pay_offer_translations`. Prices are formatted with `Intl.NumberFormat` in the user's locale.
112
+ The offer's description is shown next to the price, once: when the header falls back to it, the price card leaves it out. `icon` takes a path inside the extension or a `data:image/` URL; remote URLs are ignored. On the extension's own pages the largest `manifest.icons` entry is the default; content scripts keep the template's glyph unless given a `data:image/` URL, since package files load on a site only through `web_accessible_resources`. `primaryColor` also sets the tints and shades (via `color-mix()`) the price card and links use.
113
+
114
+ Templates come from `@extenshi/paywall-templates` and are inlined at build time. The paywall, the license dialog and the billing-profile picker are translated into English, Spanish, Brazilian Portuguese, French, German, Italian, Russian, Japanese, Korean, Simplified Chinese and Arabic (right to left); the language follows `locale`, which defaults to the browser UI language. Any string can still be overridden per call (`strings: { upgrade: 'Kaufen' }`). Offer titles and descriptions come from the server in the buyer's language when you translated them in dojo (Monetization → Languages) or with `set_pay_offer_translations`. An offer's `features` are entitlement keys (`hasFeature('full')`, `offer.features.includes('full')`): they are never translated and never shown on the paywall. Its bullet points come only from the `features` option, so pass them from your own `_locales`: `showPaywall({ features: [chrome.i18n.getMessage('paywallSync')] })`. Without that option the paywall has no feature list. Prices are formatted with `Intl.NumberFormat` in the user's locale.
111
115
 
112
116
  ### Restore a purchase in another browser
113
117
 
@@ -30,7 +30,7 @@ export interface ExtenshiPayDeps {
30
30
  now?: () => number;
31
31
  }
32
32
  export declare class ExtenshiPayLite {
33
- static readonly version = "0.8.0";
33
+ static readonly version = "0.9.0";
34
34
  protected readonly config: ResolvedConfig;
35
35
  protected readonly emitter: EventEmitter<ExtenshiPayEvents>;
36
36
  protected readonly storage: StorageAdapter;
package/dist/core.d.mts CHANGED
@@ -327,10 +327,21 @@ interface PaywallOptions {
327
327
  sku?: string;
328
328
  title?: string;
329
329
  description?: string;
330
- /** Overrides the offer's `features[]`. */
330
+ /**
331
+ * Bullet points, in the user's language (`chrome.i18n.getMessage`). The
332
+ * offer's `features[]` are entitlement keys and are never shown: without
333
+ * this option the paywall has no feature list.
334
+ */
331
335
  features?: string[];
332
336
  /** Free-tier bullets for the comparison templates (`inline`, `fullscreen`). */
333
337
  freeFeatures?: string[];
338
+ /**
339
+ * Header image in place of the template's glyph: a path inside the
340
+ * extension (`icons/icon128.png`) or a `data:image/` URL. Defaults to the
341
+ * largest `manifest.icons` entry on the extension's own pages (popup,
342
+ * options); `false` keeps the glyph. Remote URLs are ignored.
343
+ */
344
+ icon?: string | false;
334
345
  theme?: ThemeConfig;
335
346
  /** Mount point for `inline` mode (default `document.body`). */
336
347
  container?: HTMLElement;
@@ -785,7 +796,7 @@ declare class Logger {
785
796
  declare const logger: Logger;
786
797
 
787
798
  /** Kept in sync with package.json by tests/unit/version.test.ts. */
788
- declare const VERSION = "0.8.0";
799
+ declare const VERSION = "0.9.0";
789
800
 
790
801
  /** Same shape the BFF accepts (`en`, `de-DE`, `zh-Hant`). */
791
802
  declare const LOCALE_RE: RegExp;
@@ -822,7 +833,7 @@ interface ExtenshiPayDeps {
822
833
  now?: () => number;
823
834
  }
824
835
  declare class ExtenshiPayLite {
825
- static readonly version = "0.8.0";
836
+ static readonly version = "0.9.0";
826
837
  protected readonly config: ResolvedConfig;
827
838
  protected readonly emitter: EventEmitter<ExtenshiPayEvents>;
828
839
  protected readonly storage: StorageAdapter;
package/dist/core.d.ts CHANGED
@@ -327,10 +327,21 @@ interface PaywallOptions {
327
327
  sku?: string;
328
328
  title?: string;
329
329
  description?: string;
330
- /** Overrides the offer's `features[]`. */
330
+ /**
331
+ * Bullet points, in the user's language (`chrome.i18n.getMessage`). The
332
+ * offer's `features[]` are entitlement keys and are never shown: without
333
+ * this option the paywall has no feature list.
334
+ */
331
335
  features?: string[];
332
336
  /** Free-tier bullets for the comparison templates (`inline`, `fullscreen`). */
333
337
  freeFeatures?: string[];
338
+ /**
339
+ * Header image in place of the template's glyph: a path inside the
340
+ * extension (`icons/icon128.png`) or a `data:image/` URL. Defaults to the
341
+ * largest `manifest.icons` entry on the extension's own pages (popup,
342
+ * options); `false` keeps the glyph. Remote URLs are ignored.
343
+ */
344
+ icon?: string | false;
334
345
  theme?: ThemeConfig;
335
346
  /** Mount point for `inline` mode (default `document.body`). */
336
347
  container?: HTMLElement;
@@ -785,7 +796,7 @@ declare class Logger {
785
796
  declare const logger: Logger;
786
797
 
787
798
  /** Kept in sync with package.json by tests/unit/version.test.ts. */
788
- declare const VERSION = "0.8.0";
799
+ declare const VERSION = "0.9.0";
789
800
 
790
801
  /** Same shape the BFF accepts (`en`, `de-DE`, `zh-Hant`). */
791
802
  declare const LOCALE_RE: RegExp;
@@ -822,7 +833,7 @@ interface ExtenshiPayDeps {
822
833
  now?: () => number;
823
834
  }
824
835
  declare class ExtenshiPayLite {
825
- static readonly version = "0.8.0";
836
+ static readonly version = "0.9.0";
826
837
  protected readonly config: ResolvedConfig;
827
838
  protected readonly emitter: EventEmitter<ExtenshiPayEvents>;
828
839
  protected readonly storage: StorageAdapter;
package/dist/core.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * ExtenshiPay SDK v0.8.0
2
+ * ExtenshiPay SDK v0.9.0
3
3
  * (c) 2026 Extenshi.io
4
4
  * Released under the MIT License.
5
- * commit c6d87d374d371c8ddcb3345a25c72926538c5c05 · built by `rollup -c`
5
+ * commit bd166bf9b687f60e965d03acec7a648b42226652 · built by `rollup -c`
6
6
  */
7
7
  (function (global, factory) {
8
8
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -1364,7 +1364,7 @@
1364
1364
  const MAX_CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1000;
1365
1365
 
1366
1366
  /** Kept in sync with package.json by tests/unit/version.test.ts. */
1367
- const VERSION = '0.8.0';
1367
+ const VERSION = '0.9.0';
1368
1368
 
1369
1369
  /**
1370
1370
  * The user's language as the SDK sends it. Kept apart from the paywall