@brandlab-digital/site-next 3.2.0 → 3.3.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 (54) hide show
  1. package/dist/analytics.d.ts +2 -0
  2. package/dist/analytics.d.ts.map +1 -1
  3. package/dist/analytics.js +5 -1
  4. package/dist/analytics.js.map +1 -1
  5. package/dist/contact/form-client.d.ts +1 -1
  6. package/dist/contact/form-client.d.ts.map +1 -1
  7. package/dist/contact/form-client.js +1 -1
  8. package/dist/contact/form-client.js.map +1 -1
  9. package/dist/contact/resend.d.ts +25 -3
  10. package/dist/contact/resend.d.ts.map +1 -1
  11. package/dist/contact/resend.js +54 -8
  12. package/dist/contact/resend.js.map +1 -1
  13. package/dist/contact/server.d.ts +11 -1
  14. package/dist/contact/server.d.ts.map +1 -1
  15. package/dist/contact/server.js +50 -2
  16. package/dist/contact/server.js.map +1 -1
  17. package/dist/contact/testing.js +1 -1
  18. package/dist/contact/testing.js.map +1 -1
  19. package/dist/google-reviews-client.d.ts +9 -4
  20. package/dist/google-reviews-client.d.ts.map +1 -1
  21. package/dist/google-reviews-client.js +60 -13
  22. package/dist/google-reviews-client.js.map +1 -1
  23. package/dist/google-reviews-server.d.ts +11 -2
  24. package/dist/google-reviews-server.d.ts.map +1 -1
  25. package/dist/google-reviews-server.js +52 -18
  26. package/dist/google-reviews-server.js.map +1 -1
  27. package/dist/google-tag-plan.d.ts +5 -0
  28. package/dist/google-tag-plan.d.ts.map +1 -1
  29. package/dist/google-tag-plan.js +16 -1
  30. package/dist/google-tag-plan.js.map +1 -1
  31. package/dist/headers.d.ts +22 -1
  32. package/dist/headers.d.ts.map +1 -1
  33. package/dist/headers.js +34 -1
  34. package/dist/headers.js.map +1 -1
  35. package/dist/lead-registry.d.ts +2 -0
  36. package/dist/lead-registry.d.ts.map +1 -1
  37. package/dist/lead-registry.js.map +1 -1
  38. package/dist/lead-reporting.d.ts +7 -3
  39. package/dist/lead-reporting.d.ts.map +1 -1
  40. package/dist/lead-reporting.js +5 -2
  41. package/dist/lead-reporting.js.map +1 -1
  42. package/dist/next-config.d.ts +15 -0
  43. package/dist/next-config.d.ts.map +1 -1
  44. package/dist/next-config.js +29 -4
  45. package/dist/next-config.js.map +1 -1
  46. package/dist/robots.d.ts +4 -2
  47. package/dist/robots.d.ts.map +1 -1
  48. package/dist/robots.js +12 -2
  49. package/dist/robots.js.map +1 -1
  50. package/dist/user-interaction.d.ts +14 -0
  51. package/dist/user-interaction.d.ts.map +1 -0
  52. package/dist/user-interaction.js +53 -0
  53. package/dist/user-interaction.js.map +1 -0
  54. package/package.json +2 -2
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Inputs only a person makes. A renderer that just loads the page (most bots, and
3
+ * Googlebot) sends none of them. `scroll` is not one: a script's own scrolling
4
+ * fires trusted scroll events too.
5
+ */
6
+ export declare const USER_INTERACTION_EVENTS: readonly ["pointerdown", "pointermove", "touchstart", "keydown", "wheel"];
7
+ /**
8
+ * Runs `waiter` once, after the page's first trusted user interaction, or straight
9
+ * away when there has been one. The listeners are registered once for the page,
10
+ * passive, and removed after that first interaction (or when no waiter is left).
11
+ * Returns a function that cancels the wait.
12
+ */
13
+ export declare function afterUserInteraction(waiter: () => void): () => void;
14
+ //# sourceMappingURL=user-interaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-interaction.d.ts","sourceRoot":"","sources":["../src/user-interaction.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,2EAA4E,CAAA;AAuBhH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAcnE"}
@@ -0,0 +1,53 @@
1
+ // Internal module (not in the package exports): the page's first trusted user
2
+ // interaction, which gates the live Google reviews lookup (a paid Places call).
3
+ /**
4
+ * Inputs only a person makes. A renderer that just loads the page (most bots, and
5
+ * Googlebot) sends none of them. `scroll` is not one: a script's own scrolling
6
+ * fires trusted scroll events too.
7
+ */
8
+ export const USER_INTERACTION_EVENTS = ['pointerdown', 'pointermove', 'touchstart', 'keydown', 'wheel'];
9
+ const LISTENER_OPTIONS = { capture: true, passive: true };
10
+ let interacted = false;
11
+ let listening = false;
12
+ const waiters = new Set();
13
+ function stopListening() {
14
+ if (!listening)
15
+ return;
16
+ listening = false;
17
+ for (const type of USER_INTERACTION_EVENTS)
18
+ window.removeEventListener(type, onInteraction, LISTENER_OPTIONS);
19
+ }
20
+ function onInteraction(event) {
21
+ // Synthetic events (dispatchEvent, el.click()) are not a person.
22
+ if (event.isTrusted !== true)
23
+ return;
24
+ interacted = true;
25
+ stopListening();
26
+ const ready = [...waiters];
27
+ waiters.clear();
28
+ ready.forEach((waiter) => waiter());
29
+ }
30
+ /**
31
+ * Runs `waiter` once, after the page's first trusted user interaction, or straight
32
+ * away when there has been one. The listeners are registered once for the page,
33
+ * passive, and removed after that first interaction (or when no waiter is left).
34
+ * Returns a function that cancels the wait.
35
+ */
36
+ export function afterUserInteraction(waiter) {
37
+ if (interacted) {
38
+ waiter();
39
+ return () => { };
40
+ }
41
+ waiters.add(waiter);
42
+ if (!listening && typeof window !== 'undefined') {
43
+ listening = true;
44
+ for (const type of USER_INTERACTION_EVENTS)
45
+ window.addEventListener(type, onInteraction, LISTENER_OPTIONS);
46
+ }
47
+ return () => {
48
+ waiters.delete(waiter);
49
+ if (waiters.size === 0)
50
+ stopListening();
51
+ };
52
+ }
53
+ //# sourceMappingURL=user-interaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-interaction.js","sourceRoot":"","sources":["../src/user-interaction.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,CAAU,CAAA;AAEhH,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,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CAAC,IAAI,KAAK,CAAC;YAAE,aAAa,EAAE,CAAA;IACzC,CAAC,CAAA;AACH,CAAC","sourcesContent":["// Internal module (not in the package exports): the page's first trusted user\n// interaction, which gates the live Google reviews lookup (a paid Places call).\n\n/**\n * Inputs only a person makes. A renderer that just loads the page (most bots, and\n * Googlebot) sends none of them. `scroll` is not one: a script's own scrolling\n * fires trusted scroll events too.\n */\nexport const USER_INTERACTION_EVENTS = ['pointerdown', 'pointermove', 'touchstart', 'keydown', 'wheel'] as const\n\nconst LISTENER_OPTIONS = { capture: true, passive: true } as const\nlet interacted = false\nlet listening = false\nconst waiters = new Set<() => void>()\n\nfunction stopListening() {\n if (!listening) return\n listening = false\n for (const type of USER_INTERACTION_EVENTS) window.removeEventListener(type, onInteraction, LISTENER_OPTIONS)\n}\n\nfunction onInteraction(event: Event) {\n // Synthetic events (dispatchEvent, el.click()) are not a person.\n if (event.isTrusted !== true) return\n interacted = true\n stopListening()\n const ready = [...waiters]\n waiters.clear()\n ready.forEach((waiter) => waiter())\n}\n\n/**\n * Runs `waiter` once, after the page's first trusted user interaction, or straight\n * away when there has been one. The listeners are registered once for the page,\n * passive, and removed after that first interaction (or when no waiter is left).\n * Returns a function that cancels the wait.\n */\nexport function afterUserInteraction(waiter: () => void): () => void {\n if (interacted) {\n waiter()\n return () => {}\n }\n waiters.add(waiter)\n if (!listening && typeof window !== 'undefined') {\n listening = true\n for (const type of USER_INTERACTION_EVENTS) window.addEventListener(type, onInteraction, LISTENER_OPTIONS)\n }\n return () => {\n waiters.delete(waiter)\n if (waiters.size === 0) stopListening()\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandlab-digital/site-next",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/RomieDandan/brandlab.git",
@@ -20,7 +20,7 @@
20
20
  "typecheck": "tsc --noEmit -p tsconfig.json"
21
21
  },
22
22
  "dependencies": {
23
- "@brandlab-digital/site-core": "3.2.0",
23
+ "@brandlab-digital/site-core": "3.3.0",
24
24
  "browser-image-compression": "2.0.2",
25
25
  "pdf-lib": "1.17.1",
26
26
  "server-only": "0.0.1",