@beworke/pixel 0.1.0-rc.6 → 0.1.0-rc.8

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 (166) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +71 -56
  3. package/RELEASE_CANDIDATE.md +47 -75
  4. package/dist/Pixel-CCgGk43j.d.ts +797 -0
  5. package/dist/Pixel-CqbgC_72.d.mts +797 -0
  6. package/dist/{StorageFactory-tjfzk57c.d.ts → StorageFactory-BRBsnnH7.d.ts} +2 -2
  7. package/dist/{StorageFactory-CPghDPBj.d.mts → StorageFactory-Dp19Wecr.d.mts} +2 -2
  8. package/dist/browser/index.cjs.js +3 -0
  9. package/dist/browser/index.cjs.js.map +1 -0
  10. package/dist/browser/index.d.mts +55 -0
  11. package/dist/browser/index.d.ts +55 -0
  12. package/dist/browser/index.esm.js +3 -0
  13. package/dist/browser/index.esm.js.map +1 -0
  14. package/dist/browser/pixel.global.js +4 -0
  15. package/dist/browser/pixel.global.js.map +1 -0
  16. package/dist/config/index.cjs.js +1 -1
  17. package/dist/config/index.cjs.js.map +1 -1
  18. package/dist/config/index.d.mts +16 -6
  19. package/dist/config/index.d.ts +16 -6
  20. package/dist/config/index.esm.js +1 -1
  21. package/dist/config/index.esm.js.map +1 -1
  22. package/dist/events/index.cjs.js.map +1 -1
  23. package/dist/events/index.d.mts +2 -2
  24. package/dist/events/index.d.ts +2 -2
  25. package/dist/events/index.esm.js.map +1 -1
  26. package/dist/examples/html-script/README.md +20 -76
  27. package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -21
  28. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +41 -48
  29. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +41 -48
  30. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +41 -48
  31. package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +41 -48
  32. package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +41 -48
  33. package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +41 -48
  34. package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +41 -48
  35. package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +41 -48
  36. package/dist/examples/html-script/add-to-cart/README.md +6 -3
  37. package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +43 -49
  38. package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +43 -49
  39. package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +43 -49
  40. package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +43 -49
  41. package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +590 -0
  42. package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +43 -49
  43. package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +43 -49
  44. package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +43 -49
  45. package/dist/examples/html-script/behavior/example-behavior-engagement.html +5 -5
  46. package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +5 -5
  47. package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +5 -5
  48. package/dist/examples/html-script/behavior/example-behavior-viewport.html +5 -5
  49. package/dist/examples/html-script/behavior/example-behavior.html +1 -1
  50. package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +83 -0
  51. package/dist/examples/html-script/example-basic.html +1 -1
  52. package/dist/examples/html-script/example-checkout-commerce.html +32 -31
  53. package/dist/examples/html-script/example-conversion.html +42 -49
  54. package/dist/examples/html-script/example-global-factory-classic.html +45 -0
  55. package/dist/examples/html-script/example-global-factory.html +40 -0
  56. package/dist/examples/html-script/example-integration.html +40 -46
  57. package/dist/examples/html-script/example-landing-commerce.html +45 -9
  58. package/dist/examples/html-script/example-runtime-diagnostics.html +5 -5
  59. package/dist/examples/html-script/example-transport.html +65 -58
  60. package/dist/examples/html-script/full-funnel/README.md +1 -1
  61. package/dist/examples/html-script/full-funnel/checkout.html +4 -2
  62. package/dist/examples/html-script/full-funnel/downsell.html +4 -2
  63. package/dist/examples/html-script/full-funnel/landing.html +57 -3
  64. package/dist/examples/html-script/full-funnel/thank-you.html +4 -2
  65. package/dist/examples/html-script/full-funnel/upsell.html +4 -2
  66. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +41 -48
  67. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +41 -48
  68. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +41 -48
  69. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +41 -48
  70. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +41 -48
  71. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +41 -48
  72. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +41 -48
  73. package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +41 -48
  74. package/dist/examples/html-script/lead/example-lead-trigger-auto.html +41 -48
  75. package/dist/examples/html-script/lead/example-lead-trigger-click.html +41 -48
  76. package/dist/examples/html-script/release-candidate.html +32 -31
  77. package/dist/examples/html-script/remove-from-cart/README.md +3 -3
  78. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +41 -48
  79. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +41 -48
  80. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +48 -55
  81. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +41 -48
  82. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +41 -48
  83. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +41 -48
  84. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +41 -48
  85. package/dist/examples/html-script/search/example-search-attribute.html +41 -48
  86. package/dist/examples/html-script/search/example-search-button-sync.html +41 -48
  87. package/dist/examples/html-script/search/example-search-dedupe.html +41 -48
  88. package/dist/examples/html-script/search/example-search-input.html +41 -48
  89. package/dist/examples/html-script/search/example-search-manual.html +41 -48
  90. package/dist/examples/html-script/search/example-search-submit.html +41 -48
  91. package/dist/examples/html-script/search/example-search-text.html +41 -48
  92. package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +38 -9
  93. package/dist/examples/html-script/url-context/example-url-context-landing.html +53 -13
  94. package/dist/examples/html-script/url-context/example-url-context-upsell.html +48 -10
  95. package/dist/examples/html-script/url-context/example-url-context.html +55 -21
  96. package/dist/examples/html-script/view-content/example-view-content-attribute.html +41 -48
  97. package/dist/examples/html-script/view-content/example-view-content-css.html +41 -48
  98. package/dist/examples/html-script/view-content/example-view-content-dedupe.html +41 -48
  99. package/dist/examples/html-script/view-content/example-view-content-empty.html +41 -48
  100. package/dist/examples/html-script/view-content/example-view-content-manual.html +41 -48
  101. package/dist/examples/html-script/view-content/example-view-content-product-card.html +41 -48
  102. package/dist/examples/html-script/view-content/example-view-content-text.html +41 -48
  103. package/dist/examples/release-candidate/README.md +2 -1
  104. package/dist/examples/v2/README.md +15 -15
  105. package/dist/{index-CQAyT5Od.d.ts → index-B8u_3PGG.d.ts} +21 -2
  106. package/dist/{index-JlKPz4pp.d.mts → index-BxT2d-TK.d.mts} +21 -2
  107. package/dist/index.cjs.js +1 -1
  108. package/dist/index.cjs.js.map +1 -1
  109. package/dist/index.d.mts +21 -782
  110. package/dist/index.d.ts +21 -782
  111. package/dist/index.esm.js +1 -1
  112. package/dist/index.esm.js.map +1 -1
  113. package/dist/{pixel-CKc4OQUx.d.mts → pixel-C93c-0M2.d.mts} +234 -101
  114. package/dist/{pixel-BxZZx8l5.d.ts → pixel-DVy4rzj8.d.ts} +234 -101
  115. package/dist/pixel-default-config-BkAjriVH.d.mts +21 -0
  116. package/dist/pixel-default-config-Co69vDP3.d.ts +21 -0
  117. package/dist/pixel-settings-BhfJqA92.d.mts +40 -0
  118. package/dist/pixel-settings-C0qPFTii.d.ts +40 -0
  119. package/dist/runtime/index.cjs.js +1 -1
  120. package/dist/runtime/index.cjs.js.map +1 -1
  121. package/dist/runtime/index.d.mts +6 -6
  122. package/dist/runtime/index.d.ts +6 -6
  123. package/dist/runtime/index.esm.js +1 -1
  124. package/dist/runtime/index.esm.js.map +1 -1
  125. package/dist/services/index.cjs.js +1 -1
  126. package/dist/services/index.cjs.js.map +1 -1
  127. package/dist/services/index.d.mts +7 -7
  128. package/dist/services/index.d.ts +7 -7
  129. package/dist/services/index.esm.js +1 -1
  130. package/dist/services/index.esm.js.map +1 -1
  131. package/dist/{types-C75pQP31.d.ts → types-B2aUNHb3.d.ts} +2 -2
  132. package/dist/{types-BP8dz1gP.d.mts → types-C0J9KUQg.d.mts} +2 -2
  133. package/dist/{types-DMhzHSVC.d.mts → types-C2dsBog1.d.mts} +2 -2
  134. package/dist/{types-D_SsCur9.d.ts → types-DcaBYgVI.d.ts} +2 -2
  135. package/dist/{url-context-BjAsQoVl.d.mts → url-context-Ck2LK18V.d.mts} +4 -2
  136. package/dist/{url-context-BjAsQoVl.d.ts → url-context-Ck2LK18V.d.ts} +4 -2
  137. package/dist/v2/global.global.js +1 -1
  138. package/dist/v2/global.global.js.map +1 -1
  139. package/dist/v2/index.cjs.js +1 -1
  140. package/dist/v2/index.cjs.js.map +1 -1
  141. package/dist/v2/index.d.mts +26 -8
  142. package/dist/v2/index.d.ts +26 -8
  143. package/dist/v2/index.esm.js +1 -1
  144. package/dist/v2/index.esm.js.map +1 -1
  145. package/docs/public/README.md +20 -15
  146. package/docs/public/api/exports.md +12 -8
  147. package/docs/public/api/pixel.md +28 -7
  148. package/docs/public/configuration/commerce.md +3 -3
  149. package/docs/public/configuration/modules.md +11 -14
  150. package/docs/public/configuration/overview.md +41 -25
  151. package/docs/public/configuration/transport.md +127 -0
  152. package/docs/public/events/catalog.md +3 -1
  153. package/docs/public/getting-started/installation.md +20 -15
  154. package/docs/public/getting-started/quick-start.md +95 -30
  155. package/docs/public/getting-started/react-nextjs.md +57 -34
  156. package/docs/public/getting-started/script-tag.md +55 -32
  157. package/docs/public/guides/funnel-checkout.md +2 -2
  158. package/docs/public/guides/funnel-full.md +3 -3
  159. package/docs/public/guides/funnel-landing.md +10 -8
  160. package/docs/public/limitations.md +6 -5
  161. package/docs/public/privacy/limitations.md +6 -6
  162. package/docs/public/release-candidate/validation.md +24 -19
  163. package/docs/public/troubleshooting.md +7 -6
  164. package/package.json +15 -14
  165. package/dist/pixel-default-config-CJl-eypl.d.mts +0 -5
  166. package/dist/pixel-default-config-aAOujzwp.d.ts +0 -5
@@ -0,0 +1,55 @@
1
+ import { P as PixelSettings } from '../pixel-settings-BhfJqA92.mjs';
2
+ import { P as Pixel } from '../Pixel-CqbgC_72.mjs';
3
+ import { P as PixelConfig } from '../pixel-C93c-0M2.mjs';
4
+ import '../index-BxT2d-TK.mjs';
5
+ import '../url-context-Ck2LK18V.mjs';
6
+ import '../PixelLogger-B21lEjep.mjs';
7
+ import '../types-C2dsBog1.mjs';
8
+ import '../types-C0J9KUQg.mjs';
9
+
10
+ type BootstrapPixelControls = {
11
+ /**
12
+ * Destrói a instância bootstrapada (se houver) e cria outra.
13
+ * A primeira chamada sem `force` é dona da instância na `window`.
14
+ */
15
+ force?: boolean;
16
+ /**
17
+ * Gate de consentimento. Executado antes de criar a instância.
18
+ * Se retornar `false`, o bootstrap aborta com `CONSENT_DENIED`.
19
+ */
20
+ waitForConsent?: () => boolean | Promise<boolean>;
21
+ };
22
+ type PixelBrowserFactory = {
23
+ (settings: PixelSettings): Promise<Pixel>;
24
+ create(settings: PixelSettings): Promise<Pixel>;
25
+ bootstrap(settings: PixelSettings, controls?: BootstrapPixelControls): Promise<Pixel>;
26
+ getInstance(): Pixel | null;
27
+ getPending(): Promise<Pixel> | null;
28
+ destroy(): Promise<void>;
29
+ readonly Client: typeof Pixel;
30
+ readonly DEFAULT_PIXEL_CONFIG: PixelConfig;
31
+ };
32
+
33
+ /**
34
+ * Uma instância por `window`. Sem `force`, a primeira chamada é dona da
35
+ * configuração; chamadas posteriores reutilizam pending/instância.
36
+ *
37
+ * Não é `async`: o retorno é a Promise do store para chamadas concorrentes
38
+ * compartilharem a mesma referência.
39
+ *
40
+ * Para trocar a configuração, use `force: true` ou `destroyBootstrappedPixel()`.
41
+ * Chamadas concorrentes compartilham a configuração da primeira que iniciou.
42
+ */
43
+ declare function bootstrapPixel(settings: PixelSettings, controls?: BootstrapPixelControls): Promise<Pixel>;
44
+ declare function getBootstrappedPixel(): Pixel | null;
45
+ declare function getBootstrappedPixelPending(): Promise<Pixel> | null;
46
+ declare function destroyBootstrappedPixel(): Promise<void>;
47
+
48
+ type PixelBootstrapErrorCode = 'NOT_BROWSER' | 'CONSENT_DENIED' | 'INIT_FAILED';
49
+ declare class PixelBootstrapError extends Error {
50
+ readonly code: PixelBootstrapErrorCode;
51
+ readonly cause?: unknown;
52
+ constructor(message: string, code: PixelBootstrapErrorCode, cause?: unknown);
53
+ }
54
+
55
+ export { type BootstrapPixelControls, PixelBootstrapError, type PixelBootstrapErrorCode, type PixelBrowserFactory, bootstrapPixel, destroyBootstrappedPixel, getBootstrappedPixel, getBootstrappedPixelPending };
@@ -0,0 +1,55 @@
1
+ import { P as PixelSettings } from '../pixel-settings-C0qPFTii.js';
2
+ import { P as Pixel } from '../Pixel-CCgGk43j.js';
3
+ import { P as PixelConfig } from '../pixel-DVy4rzj8.js';
4
+ import '../index-B8u_3PGG.js';
5
+ import '../url-context-Ck2LK18V.js';
6
+ import '../PixelLogger-B21lEjep.js';
7
+ import '../types-DcaBYgVI.js';
8
+ import '../types-B2aUNHb3.js';
9
+
10
+ type BootstrapPixelControls = {
11
+ /**
12
+ * Destrói a instância bootstrapada (se houver) e cria outra.
13
+ * A primeira chamada sem `force` é dona da instância na `window`.
14
+ */
15
+ force?: boolean;
16
+ /**
17
+ * Gate de consentimento. Executado antes de criar a instância.
18
+ * Se retornar `false`, o bootstrap aborta com `CONSENT_DENIED`.
19
+ */
20
+ waitForConsent?: () => boolean | Promise<boolean>;
21
+ };
22
+ type PixelBrowserFactory = {
23
+ (settings: PixelSettings): Promise<Pixel>;
24
+ create(settings: PixelSettings): Promise<Pixel>;
25
+ bootstrap(settings: PixelSettings, controls?: BootstrapPixelControls): Promise<Pixel>;
26
+ getInstance(): Pixel | null;
27
+ getPending(): Promise<Pixel> | null;
28
+ destroy(): Promise<void>;
29
+ readonly Client: typeof Pixel;
30
+ readonly DEFAULT_PIXEL_CONFIG: PixelConfig;
31
+ };
32
+
33
+ /**
34
+ * Uma instância por `window`. Sem `force`, a primeira chamada é dona da
35
+ * configuração; chamadas posteriores reutilizam pending/instância.
36
+ *
37
+ * Não é `async`: o retorno é a Promise do store para chamadas concorrentes
38
+ * compartilharem a mesma referência.
39
+ *
40
+ * Para trocar a configuração, use `force: true` ou `destroyBootstrappedPixel()`.
41
+ * Chamadas concorrentes compartilham a configuração da primeira que iniciou.
42
+ */
43
+ declare function bootstrapPixel(settings: PixelSettings, controls?: BootstrapPixelControls): Promise<Pixel>;
44
+ declare function getBootstrappedPixel(): Pixel | null;
45
+ declare function getBootstrappedPixelPending(): Promise<Pixel> | null;
46
+ declare function destroyBootstrappedPixel(): Promise<void>;
47
+
48
+ type PixelBootstrapErrorCode = 'NOT_BROWSER' | 'CONSENT_DENIED' | 'INIT_FAILED';
49
+ declare class PixelBootstrapError extends Error {
50
+ readonly code: PixelBootstrapErrorCode;
51
+ readonly cause?: unknown;
52
+ constructor(message: string, code: PixelBootstrapErrorCode, cause?: unknown);
53
+ }
54
+
55
+ export { type BootstrapPixelControls, PixelBootstrapError, type PixelBootstrapErrorCode, type PixelBrowserFactory, bootstrapPixel, destroyBootstrappedPixel, getBootstrappedPixel, getBootstrappedPixelPending };