@monetize.software/sdk 3.0.0-alpha.2 → 3.0.0-alpha.4

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/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core.cjs"),r=require("./chunks/PaywallUI-CbbcfXXZ.js");exports.ApiClient=e.ApiClient;exports.ApiGatewayClient=e.ApiGatewayClient;exports.AuthClient=e.AuthClient;exports.BillingClient=e.BillingClient;exports.EventTracker=e.EventTracker;exports.PaywallError=e.PaywallError;exports.QuotaExceededError=e.QuotaExceededError;exports.SDK_VERSION=e.SDK_VERSION;exports.STORAGE_KEYS=e.STORAGE_KEYS;exports.createStorage=e.createStorage;exports.ensureVisitorId=e.ensureVisitorId;exports.generateVisitorId=e.generateVisitorId;exports.PaywallUI=r.PaywallUI;exports.blockRegistry=r.blockRegistry;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core.cjs"),r=require("./chunks/PaywallUI-Bu51__PT.js");exports.ApiClient=e.ApiClient;exports.ApiGatewayClient=e.ApiGatewayClient;exports.AuthClient=e.AuthClient;exports.BillingClient=e.BillingClient;exports.EventTracker=e.EventTracker;exports.PaywallError=e.PaywallError;exports.QuotaExceededError=e.QuotaExceededError;exports.SDK_VERSION=e.SDK_VERSION;exports.STORAGE_KEYS=e.STORAGE_KEYS;exports.createStorage=e.createStorage;exports.ensureVisitorId=e.ensureVisitorId;exports.generateVisitorId=e.generateVisitorId;exports.PaywallUI=r.PaywallUI;exports.blockRegistry=r.blockRegistry;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -60,7 +60,9 @@ export declare class ApiGatewayClient {
60
60
 
61
61
  export declare interface ApiGatewayClientOptions {
62
62
  paywallId: string;
63
- apiOrigin?: string;
63
+ /** Origin серверного API SDK — обязательное поле, тот же `custom_domain`, что
64
+ * у BillingClient/AuthClient. См. {@link BillingClientOptions.apiOrigin}. */
65
+ apiOrigin: string;
64
66
  /** AuthClient — Bearer добавляется автоматически. На 401 от gateway клиент
65
67
  * не делает refresh: AuthClient уже сделал lazy-refresh в getAccessToken. */
66
68
  auth?: AuthClient;
@@ -80,7 +82,28 @@ export declare interface ApiGatewayClientOptions {
80
82
  onQuotaExceeded?: (err: QuotaExceededError) => void;
81
83
  }
82
84
 
83
- export declare type AuthChangeListener = (session: AuthSession | null) => void;
85
+ /** Дискриминатор для `onAuthChange`. Позволяет listener'у отличать первый
86
+ * callback (восстановление сессии из storage / синтетический snapshot для
87
+ * свежей подписки) от реальных переходов. Конвенция Supabase, минус события,
88
+ * которых у нас нет (MFA, EMAIL_VERIFIED).
89
+ *
90
+ * - INITIAL_SESSION — единственный гарантированный первый callback на каждую
91
+ * подписку. Дёргается через microtask после resolve hydrated-promise, даже
92
+ * если session=null. Listener'ы по этому event'у НЕ должны делать побочные
93
+ * эффекты типа force-refetch — это просто доставка стартового state'а.
94
+ * - SIGNED_IN — свежий вход: email/OAuth/anon, или появление session в этом
95
+ * инстансе из другого контекста (storage.watch), когда раньше был null.
96
+ * - SIGNED_OUT — signOut, revokeAllSessions, 401 на refresh, удаление session
97
+ * из другого контекста.
98
+ * - TOKEN_REFRESHED — тот же user, обновлённые токены: refresh(), либо
99
+ * storage.watch когда содержимое сменилось но user.id остался.
100
+ * - USER_UPDATED — изменился user.email / user.user_metadata (updatePassword,
101
+ * upgradeAnonymousToEmail) при том же user.id.
102
+ * - PASSWORD_RECOVERY — verifyOtp(type='recovery'). Listener знает, что надо
103
+ * показать «set new password» UI вместо обычного post-login flow'а. */
104
+ declare type AuthChangeEvent = 'INITIAL_SESSION' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | 'PASSWORD_RECOVERY';
105
+
106
+ export declare type AuthChangeListener = (event: AuthChangeEvent, session: AuthSession | null) => void;
84
107
 
85
108
  export declare class AuthClient {
86
109
  readonly paywallId: string;
@@ -399,8 +422,19 @@ export declare class AuthClient {
399
422
  }): Promise<void>;
400
423
  /**
401
424
  * Подписка на изменения session: signin/signup/refresh/signOut/expired-401.
402
- * Колбек вызывается с текущим snapshot через microtask (если session есть)
403
- * + на каждое реальное изменение. Возвращает unsubscribe.
425
+ *
426
+ * Гарантированный контракт: ПЕРВЫЙ callback каждому subscriber'у — всегда
427
+ * `event = 'INITIAL_SESSION'`, дёргается асинхронно после resolve hydrate'а
428
+ * (даже если session=null — listener получает explicit «нет сессии», а не
429
+ * молчание). Все последующие callback'и — реальные переходы с конкретным
430
+ * event'ом (SIGNED_IN / SIGNED_OUT / TOKEN_REFRESHED / USER_UPDATED /
431
+ * PASSWORD_RECOVERY).
432
+ *
433
+ * Это позволяет listener'у безопасно делать «only on real signin» побочные
434
+ * эффекты (force refetch balances и т.п.) через `event === 'SIGNED_IN'`,
435
+ * не путая их с восстановлением из storage.
436
+ *
437
+ * Возвращает unsubscribe.
404
438
  */
405
439
  onAuthChange(cb: AuthChangeListener): () => void;
406
440
  private isFresh;
@@ -438,7 +472,9 @@ export declare class AuthClient {
438
472
 
439
473
  export declare interface AuthClientOptions {
440
474
  paywallId: string;
441
- apiOrigin?: string;
475
+ /** Origin серверного API SDK — обязательное поле, тот же `custom_domain`, что
476
+ * у BillingClient. См. {@link BillingClientOptions.apiOrigin}. */
477
+ apiOrigin: string;
442
478
  storage?: StorageAdapter;
443
479
  fetch?: typeof fetch;
444
480
  openPopup?: (url: string, name: string) => Window | null;
@@ -816,7 +852,15 @@ export declare class BillingClient {
816
852
 
817
853
  export declare interface BillingClientOptions {
818
854
  paywallId: string;
819
- apiOrigin?: string;
855
+ /**
856
+ * Origin серверного API SDK — обязательное поле. Должно совпадать с
857
+ * `custom_domain`, заданным для пейвола в платформе (модерация привязывает
858
+ * домен к paywall_id). SDK сверяет это значение с `bootstrap.settings.custom_domain`
859
+ * на первом ответе и кидает `invalid_config` при расхождении — защита от
860
+ * опечаток интегратора. Промежуточный `appbox.space` в новом SDK НЕ
861
+ * используется (это только для legacy v2).
862
+ */
863
+ apiOrigin: string;
820
864
  identity?: Identity;
821
865
  storage?: StorageAdapter;
822
866
  capabilities?: string[];
@@ -1008,6 +1052,19 @@ export declare type LayoutBlock = {
1008
1052
  desc: string;
1009
1053
  count: number;
1010
1054
  }>;
1055
+ } | {
1056
+ /** Money-back guarantee badge под cta_button: иконка + жирный заголовок +
1057
+ * пояснение мелким шрифтом + bottom divider, который визуально стыкуется
1058
+ * с current_session ниже. v2-аналог inline-блока в `PaywallPricing`. */
1059
+ type: 'guarantee_badge';
1060
+ /** Заголовок жирным. По умолчанию "100% Money-Back Guarantee". */
1061
+ title?: string;
1062
+ /** Подзаголовок мелким серым. По умолчанию
1063
+ * "Not satisfied? We'll refund you — no questions asked.". */
1064
+ subtitle?: string;
1065
+ /** Иконка слева от заголовка. По умолчанию `dollar_shield` —
1066
+ * зелёный shield с долларом (legacy-вид). `none` — без иконки. */
1067
+ icon?: 'dollar_shield' | 'none';
1011
1068
  };
1012
1069
 
1013
1070
  /** Локализационные оверрайды для одного языка. Накатываются поверх дефолтного
@@ -1167,9 +1224,19 @@ declare interface PaywallEventPayloads {
1167
1224
  /** User-state изменился (bootstrap snapshot, getUser refresh, watcher tick).
1168
1225
  * Дёргается также сразу с last-known user после первой подписки. */
1169
1226
  userChange: PaywallUser;
1170
- /** Auth-session изменилась (signin / signup / refresh / signout / 401-revoke).
1171
- * null = разлогинен. Дёргается сразу с last-known session после первой подписки. */
1172
- authChange: AuthSession | null;
1227
+ /** Auth-session изменилась. Payload содержит `event` (см. AuthChangeEvent
1228
+ * INITIAL_SESSION / SIGNED_IN / SIGNED_OUT / TOKEN_REFRESHED / USER_UPDATED /
1229
+ * PASSWORD_RECOVERY) и `session` (null = разлогинен).
1230
+ *
1231
+ * Гарантированный контракт: первый callback каждому subscriber'у — всегда
1232
+ * INITIAL_SESSION с восстановленной из storage сессией (или null если нет).
1233
+ * Дальше — реальные переходы. Listener'у с побочными эффектами вроде
1234
+ * force-refetch balances ловить SIGNED_IN, а не любой truthy session,
1235
+ * иначе reload страницы будет триггерить лишний запрос. */
1236
+ authChange: {
1237
+ event: AuthChangeEvent;
1238
+ session: AuthSession | null;
1239
+ };
1173
1240
  /** Триал заблокировал показ модалки. payload содержит свежий статус (после
1174
1241
  * recordBlock). Для `mode: 'time'` — startedAt/expiresAt/remainingMs;
1175
1242
  * для `mode: 'opens'` — remainingActions/totalActions. Хост может
@@ -1239,6 +1306,14 @@ export declare interface PaywallSettings {
1239
1306
  brand_color?: string | null;
1240
1307
  custom_css?: string | null;
1241
1308
  locale_default?: string | null;
1309
+ /** Origin, на котором живёт бэк пейвола (тот же, что мерчант передаёт в
1310
+ * `BillingClientOptions.apiOrigin` при инициализации SDK). Бэк присылает
1311
+ * его на каждом bootstrap'е, SDK сверяет с init.apiOrigin — расхождение
1312
+ * даёт `invalid_config` (защита от опечатки интегратора). Без схемы:
1313
+ * "pay.your-domain.com" или "https://pay.your-domain.com" — оба валидны.
1314
+ * Для новых пейволов поле всегда заполнено (модерация требует custom_domain);
1315
+ * для legacy v2 может быть null/undefined. */
1316
+ custom_domain?: string | null;
1242
1317
  runtime_mode?: 'client' | 'hybrid' | 'server' | 'client-native' | 'hybrid-native';
1243
1318
  /** true, если эквайринг пейвола в test-mode — SDK рисует TEST MODE бейдж. */
1244
1319
  is_test_mode?: boolean;
@@ -1335,6 +1410,8 @@ export declare class PaywallUI {
1335
1410
  private lastVisibility;
1336
1411
  /** Поведение open() при холодном bootstrap'е. См. PaywallUIOptions.mountThenLoad. */
1337
1412
  private mountThenLoad;
1413
+ /** Inline-режим (live-preview редактора). См. PaywallUIOptions.inline. */
1414
+ private inline;
1338
1415
  /** Текущий snapshot UI state-machine. Обновляется PaywallRoot'ом через
1339
1416
  * `onState` prop; при close сбрасывается обратно в CLOSED_STATE. */
1340
1417
  private currentState;
@@ -1559,6 +1636,7 @@ export declare interface PaywallUIOptions extends Omit<BillingClientOptions, 'au
1559
1636
  * флеш на blocked-странах/устройствах хуже воспринимаемой латентности.
1560
1637
  */
1561
1638
  mountThenLoad?: boolean;
1639
+ /* Excluded from this release type: inline */
1562
1640
  }
1563
1641
 
1564
1642
  export declare interface PaywallUser {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ApiClient as t, ApiGatewayClient as a, AuthClient as i, BillingClient as l, EventTracker as o, PaywallError as n, QuotaExceededError as E, SDK_VERSION as s, STORAGE_KEYS as S, createStorage as c, ensureVisitorId as d, generateVisitorId as g } from "./core.js";
2
- import { P as y, b as A } from "./chunks/PaywallUI-CRTEPjJm.js";
2
+ import { P as y, b as A } from "./chunks/PaywallUI-2bwf2scV.js";
3
3
  export {
4
4
  t as ApiClient,
5
5
  a as ApiGatewayClient,
package/dist/ui.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/PaywallUI-CbbcfXXZ.js");exports.PaywallUI=e.PaywallUI;exports.blockRegistry=e.blockRegistry;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/PaywallUI-Bu51__PT.js");exports.PaywallUI=e.PaywallUI;exports.blockRegistry=e.blockRegistry;
2
2
  //# sourceMappingURL=ui.cjs.map
package/dist/ui.d.ts CHANGED
@@ -46,7 +46,9 @@ declare class ApiGatewayClient {
46
46
 
47
47
  declare interface ApiGatewayClientOptions {
48
48
  paywallId: string;
49
- apiOrigin?: string;
49
+ /** Origin серверного API SDK — обязательное поле, тот же `custom_domain`, что
50
+ * у BillingClient/AuthClient. См. {@link BillingClientOptions.apiOrigin}. */
51
+ apiOrigin: string;
50
52
  /** AuthClient — Bearer добавляется автоматически. На 401 от gateway клиент
51
53
  * не делает refresh: AuthClient уже сделал lazy-refresh в getAccessToken. */
52
54
  auth?: AuthClient;
@@ -66,7 +68,28 @@ declare interface ApiGatewayClientOptions {
66
68
  onQuotaExceeded?: (err: QuotaExceededError) => void;
67
69
  }
68
70
 
69
- declare type AuthChangeListener = (session: AuthSession | null) => void;
71
+ /** Дискриминатор для `onAuthChange`. Позволяет listener'у отличать первый
72
+ * callback (восстановление сессии из storage / синтетический snapshot для
73
+ * свежей подписки) от реальных переходов. Конвенция Supabase, минус события,
74
+ * которых у нас нет (MFA, EMAIL_VERIFIED).
75
+ *
76
+ * - INITIAL_SESSION — единственный гарантированный первый callback на каждую
77
+ * подписку. Дёргается через microtask после resolve hydrated-promise, даже
78
+ * если session=null. Listener'ы по этому event'у НЕ должны делать побочные
79
+ * эффекты типа force-refetch — это просто доставка стартового state'а.
80
+ * - SIGNED_IN — свежий вход: email/OAuth/anon, или появление session в этом
81
+ * инстансе из другого контекста (storage.watch), когда раньше был null.
82
+ * - SIGNED_OUT — signOut, revokeAllSessions, 401 на refresh, удаление session
83
+ * из другого контекста.
84
+ * - TOKEN_REFRESHED — тот же user, обновлённые токены: refresh(), либо
85
+ * storage.watch когда содержимое сменилось но user.id остался.
86
+ * - USER_UPDATED — изменился user.email / user.user_metadata (updatePassword,
87
+ * upgradeAnonymousToEmail) при том же user.id.
88
+ * - PASSWORD_RECOVERY — verifyOtp(type='recovery'). Listener знает, что надо
89
+ * показать «set new password» UI вместо обычного post-login flow'а. */
90
+ declare type AuthChangeEvent = 'INITIAL_SESSION' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | 'PASSWORD_RECOVERY';
91
+
92
+ declare type AuthChangeListener = (event: AuthChangeEvent, session: AuthSession | null) => void;
70
93
 
71
94
  declare class AuthClient {
72
95
  readonly paywallId: string;
@@ -385,8 +408,19 @@ declare class AuthClient {
385
408
  }): Promise<void>;
386
409
  /**
387
410
  * Подписка на изменения session: signin/signup/refresh/signOut/expired-401.
388
- * Колбек вызывается с текущим snapshot через microtask (если session есть)
389
- * + на каждое реальное изменение. Возвращает unsubscribe.
411
+ *
412
+ * Гарантированный контракт: ПЕРВЫЙ callback каждому subscriber'у — всегда
413
+ * `event = 'INITIAL_SESSION'`, дёргается асинхронно после resolve hydrate'а
414
+ * (даже если session=null — listener получает explicit «нет сессии», а не
415
+ * молчание). Все последующие callback'и — реальные переходы с конкретным
416
+ * event'ом (SIGNED_IN / SIGNED_OUT / TOKEN_REFRESHED / USER_UPDATED /
417
+ * PASSWORD_RECOVERY).
418
+ *
419
+ * Это позволяет listener'у безопасно делать «only on real signin» побочные
420
+ * эффекты (force refetch balances и т.п.) через `event === 'SIGNED_IN'`,
421
+ * не путая их с восстановлением из storage.
422
+ *
423
+ * Возвращает unsubscribe.
390
424
  */
391
425
  onAuthChange(cb: AuthChangeListener): () => void;
392
426
  private isFresh;
@@ -424,7 +458,9 @@ declare class AuthClient {
424
458
 
425
459
  declare interface AuthClientOptions {
426
460
  paywallId: string;
427
- apiOrigin?: string;
461
+ /** Origin серверного API SDK — обязательное поле, тот же `custom_domain`, что
462
+ * у BillingClient. См. {@link BillingClientOptions.apiOrigin}. */
463
+ apiOrigin: string;
428
464
  storage?: StorageAdapter;
429
465
  fetch?: typeof fetch;
430
466
  openPopup?: (url: string, name: string) => Window | null;
@@ -802,7 +838,15 @@ declare class BillingClient {
802
838
 
803
839
  declare interface BillingClientOptions {
804
840
  paywallId: string;
805
- apiOrigin?: string;
841
+ /**
842
+ * Origin серверного API SDK — обязательное поле. Должно совпадать с
843
+ * `custom_domain`, заданным для пейвола в платформе (модерация привязывает
844
+ * домен к paywall_id). SDK сверяет это значение с `bootstrap.settings.custom_domain`
845
+ * на первом ответе и кидает `invalid_config` при расхождении — защита от
846
+ * опечаток интегратора. Промежуточный `appbox.space` в новом SDK НЕ
847
+ * используется (это только для legacy v2).
848
+ */
849
+ apiOrigin: string;
806
850
  identity?: Identity;
807
851
  storage?: StorageAdapter;
808
852
  capabilities?: string[];
@@ -947,6 +991,19 @@ declare type LayoutBlock = {
947
991
  desc: string;
948
992
  count: number;
949
993
  }>;
994
+ } | {
995
+ /** Money-back guarantee badge под cta_button: иконка + жирный заголовок +
996
+ * пояснение мелким шрифтом + bottom divider, который визуально стыкуется
997
+ * с current_session ниже. v2-аналог inline-блока в `PaywallPricing`. */
998
+ type: 'guarantee_badge';
999
+ /** Заголовок жирным. По умолчанию "100% Money-Back Guarantee". */
1000
+ title?: string;
1001
+ /** Подзаголовок мелким серым. По умолчанию
1002
+ * "Not satisfied? We'll refund you — no questions asked.". */
1003
+ subtitle?: string;
1004
+ /** Иконка слева от заголовка. По умолчанию `dollar_shield` —
1005
+ * зелёный shield с долларом (legacy-вид). `none` — без иконки. */
1006
+ icon?: 'dollar_shield' | 'none';
950
1007
  };
951
1008
 
952
1009
  /** Локализационные оверрайды для одного языка. Накатываются поверх дефолтного
@@ -1106,9 +1163,19 @@ declare interface PaywallEventPayloads {
1106
1163
  /** User-state изменился (bootstrap snapshot, getUser refresh, watcher tick).
1107
1164
  * Дёргается также сразу с last-known user после первой подписки. */
1108
1165
  userChange: PaywallUser;
1109
- /** Auth-session изменилась (signin / signup / refresh / signout / 401-revoke).
1110
- * null = разлогинен. Дёргается сразу с last-known session после первой подписки. */
1111
- authChange: AuthSession | null;
1166
+ /** Auth-session изменилась. Payload содержит `event` (см. AuthChangeEvent
1167
+ * INITIAL_SESSION / SIGNED_IN / SIGNED_OUT / TOKEN_REFRESHED / USER_UPDATED /
1168
+ * PASSWORD_RECOVERY) и `session` (null = разлогинен).
1169
+ *
1170
+ * Гарантированный контракт: первый callback каждому subscriber'у — всегда
1171
+ * INITIAL_SESSION с восстановленной из storage сессией (или null если нет).
1172
+ * Дальше — реальные переходы. Listener'у с побочными эффектами вроде
1173
+ * force-refetch balances ловить SIGNED_IN, а не любой truthy session,
1174
+ * иначе reload страницы будет триггерить лишний запрос. */
1175
+ authChange: {
1176
+ event: AuthChangeEvent;
1177
+ session: AuthSession | null;
1178
+ };
1112
1179
  /** Триал заблокировал показ модалки. payload содержит свежий статус (после
1113
1180
  * recordBlock). Для `mode: 'time'` — startedAt/expiresAt/remainingMs;
1114
1181
  * для `mode: 'opens'` — remainingActions/totalActions. Хост может
@@ -1178,6 +1245,14 @@ declare interface PaywallSettings {
1178
1245
  brand_color?: string | null;
1179
1246
  custom_css?: string | null;
1180
1247
  locale_default?: string | null;
1248
+ /** Origin, на котором живёт бэк пейвола (тот же, что мерчант передаёт в
1249
+ * `BillingClientOptions.apiOrigin` при инициализации SDK). Бэк присылает
1250
+ * его на каждом bootstrap'е, SDK сверяет с init.apiOrigin — расхождение
1251
+ * даёт `invalid_config` (защита от опечатки интегратора). Без схемы:
1252
+ * "pay.your-domain.com" или "https://pay.your-domain.com" — оба валидны.
1253
+ * Для новых пейволов поле всегда заполнено (модерация требует custom_domain);
1254
+ * для legacy v2 может быть null/undefined. */
1255
+ custom_domain?: string | null;
1181
1256
  runtime_mode?: 'client' | 'hybrid' | 'server' | 'client-native' | 'hybrid-native';
1182
1257
  /** true, если эквайринг пейвола в test-mode — SDK рисует TEST MODE бейдж. */
1183
1258
  is_test_mode?: boolean;
@@ -1274,6 +1349,8 @@ export declare class PaywallUI {
1274
1349
  private lastVisibility;
1275
1350
  /** Поведение open() при холодном bootstrap'е. См. PaywallUIOptions.mountThenLoad. */
1276
1351
  private mountThenLoad;
1352
+ /** Inline-режим (live-preview редактора). См. PaywallUIOptions.inline. */
1353
+ private inline;
1277
1354
  /** Текущий snapshot UI state-machine. Обновляется PaywallRoot'ом через
1278
1355
  * `onState` prop; при close сбрасывается обратно в CLOSED_STATE. */
1279
1356
  private currentState;
@@ -1498,6 +1575,7 @@ export declare interface PaywallUIOptions extends Omit<BillingClientOptions, 'au
1498
1575
  * флеш на blocked-странах/устройствах хуже воспринимаемой латентности.
1499
1576
  */
1500
1577
  mountThenLoad?: boolean;
1578
+ /* Excluded from this release type: inline */
1501
1579
  }
1502
1580
 
1503
1581
  declare interface PaywallUser {
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as o, b as r } from "./chunks/PaywallUI-CRTEPjJm.js";
1
+ import { P as o, b as r } from "./chunks/PaywallUI-2bwf2scV.js";
2
2
  export {
3
3
  o as PaywallUI,
4
4
  r as blockRegistry
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@monetize.software/sdk",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.4",
4
4
  "description": "Monetize SDK — bundled billing client and paywall render engine for web and Chrome extensions",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/monetize-software/sdk.git"
10
+ "url": "git+https://github.com/monetize-software/sdk.git",
11
+ "directory": "sdk-packages/sdk"
11
12
  },
12
13
  "bugs": {
13
14
  "url": "https://github.com/monetize-software/sdk/issues"
14
15
  },
15
- "homepage": "https://github.com/monetize-software/sdk#readme",
16
+ "homepage": "https://github.com/monetize-software/sdk/tree/main/sdk-packages/sdk#readme",
16
17
  "files": [
17
18
  "dist"
18
19
  ],
@@ -33,32 +34,6 @@
33
34
  "require": "./dist/ui.cjs"
34
35
  }
35
36
  },
36
- "scripts": {
37
- "dev": "vite",
38
- "build": "vite build",
39
- "typecheck": "tsc --noEmit",
40
- "test": "vitest run",
41
- "test:watch": "vitest",
42
- "test:e2e": "pnpm ext:build && playwright test --project=extension",
43
- "test:e2e:demo": "playwright test --project=demo-stripe --project=demo-paddle --project=demo-freemius",
44
- "test:e2e:demo:stripe": "playwright test --project=demo-stripe",
45
- "test:e2e:demo:paddle": "playwright test --project=demo-paddle",
46
- "test:e2e:demo:freemius": "playwright test --project=demo-freemius",
47
- "test:e2e:checkout": "playwright test --project=checkout-stripe --project=checkout-paddle --project=checkout-freemius",
48
- "test:e2e:checkout:stripe": "playwright test --project=checkout-stripe",
49
- "test:e2e:checkout:paddle": "playwright test --project=checkout-paddle",
50
- "test:e2e:checkout:freemius": "playwright test --project=checkout-freemius",
51
- "test:e2e:all": "pnpm ext:build && playwright test",
52
- "ext:build": "vite build --config playgrounds/extension/vite.config.ts",
53
- "size": "size-limit",
54
- "prepublishOnly": "pnpm typecheck && pnpm build",
55
- "version:alpha": "npm version prerelease --preid=alpha --no-git-tag-version",
56
- "version:patch": "npm version patch --no-git-tag-version",
57
- "version:minor": "npm version minor --no-git-tag-version",
58
- "version:major": "npm version major --no-git-tag-version",
59
- "release:alpha": "npm publish --access public --tag alpha",
60
- "release:latest": "npm publish --access public"
61
- },
62
37
  "dependencies": {
63
38
  "preact": "^10.24.0"
64
39
  },
@@ -92,5 +67,31 @@
92
67
  "path": "dist/index.js",
93
68
  "limit": "70 KB"
94
69
  }
95
- ]
96
- }
70
+ ],
71
+ "scripts": {
72
+ "dev": "vite",
73
+ "build": "vite build",
74
+ "build:watch": "vite build --watch",
75
+ "typecheck": "tsc --noEmit",
76
+ "test": "vitest run",
77
+ "test:watch": "vitest",
78
+ "test:e2e": "pnpm ext:build && playwright test --project=extension",
79
+ "test:e2e:demo": "playwright test --project=demo-stripe --project=demo-paddle --project=demo-freemius",
80
+ "test:e2e:demo:stripe": "playwright test --project=demo-stripe",
81
+ "test:e2e:demo:paddle": "playwright test --project=demo-paddle",
82
+ "test:e2e:demo:freemius": "playwright test --project=demo-freemius",
83
+ "test:e2e:checkout": "playwright test --project=checkout-stripe --project=checkout-paddle --project=checkout-freemius",
84
+ "test:e2e:checkout:stripe": "playwright test --project=checkout-stripe",
85
+ "test:e2e:checkout:paddle": "playwright test --project=checkout-paddle",
86
+ "test:e2e:checkout:freemius": "playwright test --project=checkout-freemius",
87
+ "test:e2e:all": "pnpm ext:build && playwright test",
88
+ "ext:build": "vite build --config playgrounds/extension/vite.config.ts",
89
+ "size": "size-limit",
90
+ "version:alpha": "npm version prerelease --preid=alpha --no-git-tag-version",
91
+ "version:patch": "npm version patch --no-git-tag-version",
92
+ "version:minor": "npm version minor --no-git-tag-version",
93
+ "version:major": "npm version major --no-git-tag-version",
94
+ "release:alpha": "npm publish --access public --tag alpha",
95
+ "release:latest": "npm publish --access public"
96
+ }
97
+ }