@journeeze/sdk 0.0.0-stage → 0.1.0-rc.2

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 (60) hide show
  1. package/AGENTS.md +67 -0
  2. package/CHANGELOG.md +30 -0
  3. package/LICENSE.md +27 -0
  4. package/README.md +164 -2
  5. package/dist/THIRD_PARTY_LICENSES.txt +246 -0
  6. package/dist/consent-CoKD33Rm.js +170 -0
  7. package/dist/context-UnG6_X61.js +17 -0
  8. package/dist/contract.js +10 -0
  9. package/dist/feedback-C4CYtS2A.js +196 -0
  10. package/dist/help-C1x-y2f9.js +878 -0
  11. package/dist/hook-BdG4UL4k.js +91 -0
  12. package/dist/index-B_nob8S0.js +2091 -0
  13. package/dist/index-CfCbJJXa.js +20 -0
  14. package/dist/index.js +10 -0
  15. package/dist/loader-Ba4X-WNl.js +95 -0
  16. package/dist/react.js +70 -0
  17. package/dist/resolve-BfWByuTp.js +97 -0
  18. package/dist/script.js +13 -0
  19. package/dist/signals-E3VEdmWH.js +477 -0
  20. package/dist/telemetry-Cik-cYzw.js +140 -0
  21. package/dist/transport-B5YJFQEF.js +60 -0
  22. package/dist/types/config.d.ts +17 -0
  23. package/dist/types/context.d.ts +6 -0
  24. package/dist/types/contract.d.ts +13 -0
  25. package/dist/types/help/core/client.d.ts +26 -0
  26. package/dist/types/help/core/controller.d.ts +175 -0
  27. package/dist/types/help/core/events.d.ts +8 -0
  28. package/dist/types/help/core/help.d.ts +24 -0
  29. package/dist/types/help/core/highlight.d.ts +38 -0
  30. package/dist/types/help/core/panel.d.ts +11 -0
  31. package/dist/types/help/core/search.d.ts +7 -0
  32. package/dist/types/help/ui/callout.d.ts +2 -0
  33. package/dist/types/help/ui/panel.d.ts +3 -0
  34. package/dist/types/help/ui/request.d.ts +2 -0
  35. package/dist/types/help/ui/styles.d.ts +1 -0
  36. package/dist/types/index.d.ts +7 -0
  37. package/dist/types/invite.d.ts +4 -0
  38. package/dist/types/loader.d.ts +57 -0
  39. package/dist/types/mask.d.ts +10 -0
  40. package/dist/types/react.d.ts +9 -0
  41. package/dist/types/resolve/resolve.d.ts +12 -0
  42. package/dist/types/script.d.ts +6 -0
  43. package/dist/types/signals/cel.d.ts +8 -0
  44. package/dist/types/signals/hook.d.ts +10 -0
  45. package/dist/types/signals/signals.conformance.d.ts +2 -0
  46. package/dist/types/signals/signals.d.ts +145 -0
  47. package/dist/types/telemetry/telemetry.d.ts +63 -0
  48. package/dist/types/transport.d.ts +30 -0
  49. package/dist/types/types.d.ts +391 -0
  50. package/dist/types/widget/anchor.d.ts +11 -0
  51. package/dist/types/widget/capture.d.ts +28 -0
  52. package/dist/types/widget/consent.d.ts +25 -0
  53. package/dist/types/widget/feedback.d.ts +36 -0
  54. package/dist/types/widget/icons.d.ts +14 -0
  55. package/dist/types/widget/outbox.d.ts +69 -0
  56. package/dist/types/widget/styles.d.ts +1 -0
  57. package/dist/types/widget.d.ts +27 -0
  58. package/dist/types/wire.d.ts +66 -0
  59. package/dist/widget-DQZm8sAC.js +1599 -0
  60. package/package.json +68 -4
@@ -0,0 +1,91 @@
1
+ import { t as c } from "./context-UnG6_X61.js";
2
+ const N = {
3
+ like: "REACTION_LIKE",
4
+ dislike: "REACTION_DISLIKE",
5
+ understood: "REACTION_UNDERSTOOD",
6
+ confused: "REACTION_CONFUSED"
7
+ }, R = {
8
+ request: "FEEDBACK_KIND_REQUEST",
9
+ callout: "FEEDBACK_KIND_CALLOUT"
10
+ }, m = 512, C = 12;
11
+ function I(t) {
12
+ const i = [];
13
+ let r = t, n = !1;
14
+ for (let s = 0; r && s < C; s++) {
15
+ const o = r.hasAttribute("data-tflow-id") ? c(r) : void 0;
16
+ if (o !== void 0 && r.getAttribute("data-tflow-id") === o) {
17
+ i.unshift(`[data-tflow-id="${o}"]`), n = !0;
18
+ break;
19
+ }
20
+ const a = r.tagName.toLowerCase();
21
+ if (a === "body" || a === "html") {
22
+ i.unshift(a), n = !0;
23
+ break;
24
+ }
25
+ const l = r, d = l.parentElement;
26
+ let u = a;
27
+ if (d) {
28
+ const f = Array.from(d.children).filter((g) => g.tagName === l.tagName);
29
+ f.length > 1 && (u += `:nth-of-type(${f.indexOf(l) + 1})`);
30
+ }
31
+ i.unshift(u), r = d;
32
+ }
33
+ const e = i.join(" > ");
34
+ return n && e.length <= m ? e : void 0;
35
+ }
36
+ const h = (t) => Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 0.5;
37
+ function v(t, i, r) {
38
+ const n = t.getBoundingClientRect(), e = {
39
+ xRatio: h(n.width > 0 ? (i - n.left) / n.width : 0.5),
40
+ yRatio: h(n.height > 0 ? (r - n.top) / n.height : 0.5)
41
+ }, s = c(t);
42
+ s !== void 0 && (e.tflowId = s);
43
+ const o = I(t);
44
+ return o !== void 0 && (e.cssSelector = o), e;
45
+ }
46
+ function _(t) {
47
+ return c(t) ?? t.tagName.toLowerCase();
48
+ }
49
+ function b(t) {
50
+ return t.closest("[data-jz-block]") !== null;
51
+ }
52
+ function p(t) {
53
+ return t < 768 ? "mobile" : t < 1024 ? "tablet" : "desktop";
54
+ }
55
+ const E = /* @__PURE__ */ new WeakMap();
56
+ function w(t, i, r) {
57
+ let n = E.get(t);
58
+ n || E.set(t, n = { holders: 0 });
59
+ const e = n;
60
+ let s = !1;
61
+ return {
62
+ start(o) {
63
+ s || t.signals?.enabled !== !0 || t.noTelemetry || (s = !0, e.holders++, e.running ?? (e.running = Promise.resolve(o).then((a) => {
64
+ if (a?.signalsEnabled === !0)
65
+ return import("./signals-E3VEdmWH.js").then(
66
+ (l) => l.startSignals({ options: t, endpoint: i, getContext: r, site: a }),
67
+ () => {
68
+ e.running = void 0;
69
+ }
70
+ );
71
+ })));
72
+ },
73
+ stop(o) {
74
+ if (!s || (s = !1, --e.holders > 0)) return;
75
+ const a = e.running;
76
+ e.running = void 0, a?.then((l) => l?.stop(o));
77
+ },
78
+ contextChanged() {
79
+ s && e.running?.then((o) => o?.contextChanged());
80
+ }
81
+ };
82
+ }
83
+ export {
84
+ R as F,
85
+ N as R,
86
+ v as a,
87
+ p as d,
88
+ _ as e,
89
+ b as i,
90
+ w as s
91
+ };