@beworke/pixel 0.1.0-rc.1 → 0.1.0-rc.11

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 (191) hide show
  1. package/CHANGELOG.md +311 -4
  2. package/README.md +90 -128
  3. package/RELEASE_CANDIDATE.md +218 -101
  4. package/dist/Pixel-BnN86r4X.d.ts +797 -0
  5. package/dist/Pixel-BoUGqCbP.d.mts +797 -0
  6. package/dist/{StorageFactory-CAkJJqVD.d.ts → StorageFactory-BfCArzMM.d.ts} +2 -2
  7. package/dist/{StorageFactory-BhpbB6Jj.d.mts → StorageFactory-C0prtNR7.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 +77 -0
  11. package/dist/browser/index.d.ts +77 -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.buygoods-checkout.global.js +4 -0
  15. package/dist/browser/pixel.buygoods-checkout.global.js.map +1 -0
  16. package/dist/browser/pixel.buygoods-landing.global.js +4 -0
  17. package/dist/browser/pixel.buygoods-landing.global.js.map +1 -0
  18. package/dist/browser/pixel.global.js +4 -0
  19. package/dist/browser/pixel.global.js.map +1 -0
  20. package/dist/browser/pixel.internal-checkout.global.js +4 -0
  21. package/dist/browser/pixel.internal-checkout.global.js.map +1 -0
  22. package/dist/config/index.cjs.js +1 -1
  23. package/dist/config/index.cjs.js.map +1 -1
  24. package/dist/config/index.d.mts +16 -5
  25. package/dist/config/index.d.ts +16 -5
  26. package/dist/config/index.esm.js +1 -1
  27. package/dist/config/index.esm.js.map +1 -1
  28. package/dist/events/index.cjs.js +1 -1
  29. package/dist/events/index.cjs.js.map +1 -1
  30. package/dist/events/index.d.mts +2 -1
  31. package/dist/events/index.d.ts +2 -1
  32. package/dist/events/index.esm.js +1 -1
  33. package/dist/events/index.esm.js.map +1 -1
  34. package/dist/examples/html-script/README.md +21 -55
  35. package/dist/examples/html-script/RELEASE_CANDIDATE.md +39 -26
  36. package/dist/examples/html-script/add-payment-info/README.md +3 -3
  37. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +107 -96
  38. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +107 -96
  39. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +106 -95
  40. package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +114 -95
  41. package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +106 -95
  42. package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +97 -95
  43. package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +106 -95
  44. package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +106 -95
  45. package/dist/examples/html-script/add-to-cart/README.md +9 -6
  46. package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +133 -119
  47. package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +146 -130
  48. package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +144 -127
  49. package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +133 -119
  50. package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +590 -0
  51. package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +124 -116
  52. package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +133 -119
  53. package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +147 -130
  54. package/dist/examples/html-script/behavior/example-behavior-engagement.html +489 -0
  55. package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +350 -0
  56. package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +433 -0
  57. package/dist/examples/html-script/behavior/example-behavior-viewport.html +397 -0
  58. package/dist/examples/html-script/{example-behavior.html → behavior/example-behavior.html} +23 -17
  59. package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +50 -0
  60. package/dist/examples/html-script/buygoods/ladding.html +184 -0
  61. package/dist/examples/html-script/example-basic.html +1 -1
  62. package/dist/examples/html-script/example-checkout-commerce.html +826 -0
  63. package/dist/examples/html-script/example-conversion.html +42 -49
  64. package/dist/examples/html-script/example-global-factory-classic.html +45 -0
  65. package/dist/examples/html-script/example-global-factory.html +40 -0
  66. package/dist/examples/html-script/example-integration.html +45 -51
  67. package/dist/examples/html-script/example-landing-commerce.html +416 -0
  68. package/dist/examples/html-script/example-runtime-diagnostics.html +108 -0
  69. package/dist/examples/html-script/example-transport.html +70 -63
  70. package/dist/examples/html-script/full-funnel/README.md +64 -0
  71. package/dist/examples/html-script/full-funnel/checkout.html +118 -0
  72. package/dist/examples/html-script/full-funnel/downsell.html +60 -0
  73. package/dist/examples/html-script/full-funnel/landing.html +153 -0
  74. package/dist/examples/html-script/full-funnel/thank-you.html +87 -0
  75. package/dist/examples/html-script/full-funnel/upsell.html +66 -0
  76. package/dist/examples/html-script/initiate-checkout/README.md +6 -6
  77. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +135 -122
  78. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +143 -128
  79. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +144 -128
  80. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +127 -120
  81. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +136 -123
  82. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +144 -131
  83. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +146 -130
  84. package/dist/examples/html-script/internal-checkout/example-cardioclear-checkout.html +57 -0
  85. package/dist/examples/html-script/internal-checkout/example-slimsoda-checkout.html +53 -0
  86. package/dist/examples/html-script/lead/README.md +9 -7
  87. package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +107 -94
  88. package/dist/examples/html-script/lead/example-lead-trigger-auto.html +118 -103
  89. package/dist/examples/html-script/lead/example-lead-trigger-click.html +118 -102
  90. package/dist/examples/html-script/release-candidate.html +219 -107
  91. package/dist/examples/html-script/remove-from-cart/README.md +4 -4
  92. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +134 -121
  93. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +134 -121
  94. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +141 -128
  95. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +125 -118
  96. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +135 -122
  97. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +136 -123
  98. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +139 -124
  99. package/dist/examples/html-script/search/README.md +1 -1
  100. package/dist/examples/html-script/search/example-search-attribute.html +107 -99
  101. package/dist/examples/html-script/search/example-search-button-sync.html +107 -99
  102. package/dist/examples/html-script/search/example-search-dedupe.html +107 -99
  103. package/dist/examples/html-script/search/example-search-input.html +108 -99
  104. package/dist/examples/html-script/search/example-search-manual.html +98 -96
  105. package/dist/examples/html-script/search/example-search-submit.html +107 -99
  106. package/dist/examples/html-script/search/example-search-text.html +112 -99
  107. package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +92 -0
  108. package/dist/examples/html-script/url-context/example-url-context-landing.html +110 -0
  109. package/dist/examples/html-script/url-context/example-url-context-upsell.html +105 -0
  110. package/dist/examples/html-script/url-context/example-url-context.html +205 -0
  111. package/dist/examples/html-script/view-content/README.md +1 -1
  112. package/dist/examples/html-script/view-content/example-view-content-attribute.html +126 -118
  113. package/dist/examples/html-script/view-content/example-view-content-css.html +126 -118
  114. package/dist/examples/html-script/view-content/example-view-content-dedupe.html +126 -118
  115. package/dist/examples/html-script/view-content/example-view-content-empty.html +126 -118
  116. package/dist/examples/html-script/view-content/example-view-content-manual.html +117 -115
  117. package/dist/examples/html-script/view-content/example-view-content-product-card.html +126 -118
  118. package/dist/examples/html-script/view-content/example-view-content-text.html +131 -121
  119. package/dist/examples/release-candidate/README.md +2 -1
  120. package/dist/examples/v2/README.md +16 -13
  121. package/dist/index-B8u_3PGG.d.ts +460 -0
  122. package/dist/index-BxT2d-TK.d.mts +460 -0
  123. package/dist/index.cjs.js +1 -1
  124. package/dist/index.cjs.js.map +1 -1
  125. package/dist/index.d.mts +23 -361
  126. package/dist/index.d.ts +23 -361
  127. package/dist/index.esm.js +1 -1
  128. package/dist/index.esm.js.map +1 -1
  129. package/dist/pixel-DNGbAN5C.d.ts +871 -0
  130. package/dist/pixel-_BSDpx4M.d.mts +871 -0
  131. package/dist/pixel-default-config-BMYaqs7i.d.ts +21 -0
  132. package/dist/pixel-default-config-DLRya1tl.d.mts +21 -0
  133. package/dist/pixel-settings-D-t9zQb4.d.ts +40 -0
  134. package/dist/pixel-settings-DGxl0MVm.d.mts +40 -0
  135. package/dist/runtime/index.cjs.js +1 -1
  136. package/dist/runtime/index.cjs.js.map +1 -1
  137. package/dist/runtime/index.d.mts +19 -26
  138. package/dist/runtime/index.d.ts +19 -26
  139. package/dist/runtime/index.esm.js +1 -1
  140. package/dist/runtime/index.esm.js.map +1 -1
  141. package/dist/services/index.cjs.js +1 -1
  142. package/dist/services/index.cjs.js.map +1 -1
  143. package/dist/services/index.d.mts +14 -6
  144. package/dist/services/index.d.ts +14 -6
  145. package/dist/services/index.esm.js +1 -1
  146. package/dist/services/index.esm.js.map +1 -1
  147. package/dist/types-B-Nzagpk.d.mts +19 -0
  148. package/dist/types-D0KVsgzs.d.mts +293 -0
  149. package/dist/types-D3kJ9bfT.d.ts +293 -0
  150. package/dist/types-Dfi9C49l.d.ts +19 -0
  151. package/dist/url-context-Ck2LK18V.d.mts +87 -0
  152. package/dist/url-context-Ck2LK18V.d.ts +87 -0
  153. package/dist/v2/global.global.js +1 -1
  154. package/dist/v2/global.global.js.map +1 -1
  155. package/dist/v2/index.cjs.js +1 -1
  156. package/dist/v2/index.cjs.js.map +1 -1
  157. package/dist/v2/index.d.mts +26 -6
  158. package/dist/v2/index.d.ts +26 -6
  159. package/dist/v2/index.esm.js +1 -1
  160. package/dist/v2/index.esm.js.map +1 -1
  161. package/docs/public/README.md +80 -0
  162. package/docs/public/api/exports.md +56 -0
  163. package/docs/public/api/pixel.md +86 -0
  164. package/docs/public/configuration/commerce.md +44 -0
  165. package/docs/public/configuration/modules.md +63 -0
  166. package/docs/public/configuration/overview.md +85 -0
  167. package/docs/public/configuration/transport.md +127 -0
  168. package/docs/public/events/catalog.md +67 -0
  169. package/docs/public/getting-started/installation.md +88 -0
  170. package/docs/public/getting-started/quick-start.md +142 -0
  171. package/docs/public/getting-started/react-nextjs.md +78 -0
  172. package/docs/public/getting-started/script-tag.md +102 -0
  173. package/docs/public/guides/funnel-checkout.md +52 -0
  174. package/docs/public/guides/funnel-downsell.md +53 -0
  175. package/docs/public/guides/funnel-full.md +64 -0
  176. package/docs/public/guides/funnel-landing.md +70 -0
  177. package/docs/public/guides/funnel-thank-you.md +48 -0
  178. package/docs/public/guides/funnel-upsell.md +72 -0
  179. package/docs/public/limitations.md +33 -0
  180. package/docs/public/privacy/limitations.md +33 -0
  181. package/docs/public/release-candidate/validation.md +42 -0
  182. package/docs/public/troubleshooting.md +56 -0
  183. package/package.json +41 -20
  184. package/dist/index-DUfFzniE.d.mts +0 -274
  185. package/dist/index-DUfFzniE.d.ts +0 -274
  186. package/dist/pixel-CbeF25mD.d.mts +0 -555
  187. package/dist/pixel-CbeF25mD.d.ts +0 -555
  188. package/dist/pixel-default-config-1VgLFOiL.d.mts +0 -5
  189. package/dist/pixel-default-config-Bxb-Vdd8.d.ts +0 -5
  190. package/dist/types-CTpRvFKZ.d.ts +0 -71
  191. package/dist/types-DGlBdsAy.d.mts +0 -71
@@ -0,0 +1,77 @@
1
+ import { P as PixelSettings } from '../pixel-settings-DGxl0MVm.mjs';
2
+ import { P as Pixel } from '../Pixel-BoUGqCbP.mjs';
3
+ import { P as PixelConfig } from '../pixel-_BSDpx4M.mjs';
4
+ import '../index-BxT2d-TK.mjs';
5
+ import '../url-context-Ck2LK18V.mjs';
6
+ import '../PixelLogger-B21lEjep.mjs';
7
+ import '../types-D0KVsgzs.mjs';
8
+ import '../types-B-Nzagpk.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
+ /**
56
+ * Identidade embutida nos presets BuyGoods.
57
+ * O script tag não aceita pixelId nem settings do integrador.
58
+ */
59
+ declare const BUYGOODS_PIXEL_ID = "pix_7704308";
60
+ /**
61
+ * Landing: gera `subid4`, escreve na URL e decora todos os links com
62
+ * `subid4` + UTMs / params da query de entrada.
63
+ */
64
+ declare const BUYGOODS_LANDING_SETTINGS: PixelSettings;
65
+ /**
66
+ * Checkout: lê `subid4` da URL (sem escrever). PAGE_VIEW, ATC em
67
+ * email+phone, ADD_PAYMENT_INFO em `#submit`, HEARTBEAT.
68
+ */
69
+ declare const BUYGOODS_CHECKOUT_SETTINGS: PixelSettings;
70
+
71
+ /**
72
+ * Checkout interno (CardioClear, SlimSoda, …).
73
+ * Só o `pixelId` vem de fora — query do script: `?pixelId=pix_…`.
74
+ */
75
+ declare function createInternalCheckoutSettings(pixelId: string): PixelSettings;
76
+
77
+ export { BUYGOODS_CHECKOUT_SETTINGS, BUYGOODS_LANDING_SETTINGS, BUYGOODS_PIXEL_ID, type BootstrapPixelControls, PixelBootstrapError, type PixelBootstrapErrorCode, type PixelBrowserFactory, bootstrapPixel, createInternalCheckoutSettings, destroyBootstrappedPixel, getBootstrappedPixel, getBootstrappedPixelPending };
@@ -0,0 +1,77 @@
1
+ import { P as PixelSettings } from '../pixel-settings-D-t9zQb4.js';
2
+ import { P as Pixel } from '../Pixel-BnN86r4X.js';
3
+ import { P as PixelConfig } from '../pixel-DNGbAN5C.js';
4
+ import '../index-B8u_3PGG.js';
5
+ import '../url-context-Ck2LK18V.js';
6
+ import '../PixelLogger-B21lEjep.js';
7
+ import '../types-D3kJ9bfT.js';
8
+ import '../types-Dfi9C49l.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
+ /**
56
+ * Identidade embutida nos presets BuyGoods.
57
+ * O script tag não aceita pixelId nem settings do integrador.
58
+ */
59
+ declare const BUYGOODS_PIXEL_ID = "pix_7704308";
60
+ /**
61
+ * Landing: gera `subid4`, escreve na URL e decora todos os links com
62
+ * `subid4` + UTMs / params da query de entrada.
63
+ */
64
+ declare const BUYGOODS_LANDING_SETTINGS: PixelSettings;
65
+ /**
66
+ * Checkout: lê `subid4` da URL (sem escrever). PAGE_VIEW, ATC em
67
+ * email+phone, ADD_PAYMENT_INFO em `#submit`, HEARTBEAT.
68
+ */
69
+ declare const BUYGOODS_CHECKOUT_SETTINGS: PixelSettings;
70
+
71
+ /**
72
+ * Checkout interno (CardioClear, SlimSoda, …).
73
+ * Só o `pixelId` vem de fora — query do script: `?pixelId=pix_…`.
74
+ */
75
+ declare function createInternalCheckoutSettings(pixelId: string): PixelSettings;
76
+
77
+ export { BUYGOODS_CHECKOUT_SETTINGS, BUYGOODS_LANDING_SETTINGS, BUYGOODS_PIXEL_ID, type BootstrapPixelControls, PixelBootstrapError, type PixelBootstrapErrorCode, type PixelBrowserFactory, bootstrapPixel, createInternalCheckoutSettings, destroyBootstrappedPixel, getBootstrappedPixel, getBootstrappedPixelPending };