@wexio/messenger-widget-react 1.2.4 → 1.3.1

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 (28) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/README.md +15 -1
  3. package/dist/{widget-react-DubCiNev.js → widget-react--IUy5lNt.js} +21 -20
  4. package/dist/{widget-react-CIy9jXND.js → widget-react-B7es3n1-.js} +1 -1
  5. package/dist/{widget-react-2tTH7-bO.js → widget-react-BAUpSGhZ.js} +1 -1
  6. package/dist/widget-react-BS9kUSRS.js +255 -0
  7. package/dist/{widget-react-CtvdaJvy.js → widget-react-BXf2Ty8d.js} +4 -4
  8. package/dist/{widget-react-DDEFbIbU.js → widget-react-BfO-uP4o.js} +89 -139
  9. package/dist/{widget-react-faSyVXFQ.js → widget-react-BgALABDe.js} +1 -1
  10. package/dist/{widget-react-DXP6EOCM.js → widget-react-BkXA6ytR.js} +1 -1
  11. package/dist/{widget-react-yTVzOzaU.js → widget-react-Bop75Z1t.js} +87 -87
  12. package/dist/widget-react-BxEjM2it.js +118 -0
  13. package/dist/{widget-react-CK8xTxwO.js → widget-react-C6lzldez.js} +4936 -4455
  14. package/dist/widget-react-CN_FIvMD.js +834 -0
  15. package/dist/{widget-react-CAsPo1rw.js → widget-react-DRER1XF_.js} +112 -112
  16. package/dist/widget-react-DSAyUf2U.js +229 -0
  17. package/dist/{widget-react-B9XrHKqv.js → widget-react-DbOJZl9F.js} +1238 -2052
  18. package/dist/{widget-react-BlTmXnei.js → widget-react-DgIxSjv7.js} +1 -1
  19. package/dist/widget-react-Ds5J9FbQ.js +27 -0
  20. package/dist/{widget-react-DV3UnggB.js → widget-react-MXOCL3Mg.js} +148 -237
  21. package/dist/{widget-react-B8rXZyxg.js → widget-react-SI7deQTE.js} +1 -1
  22. package/dist/{widget-react-AwEaD0v2.js → widget-react-bPokx9L5.js} +169 -273
  23. package/dist/widget-react-wSc9gIfG.js +198 -0
  24. package/dist/widget-react.d.ts +2 -2
  25. package/dist/widget-react.js +9387 -4696
  26. package/package.json +1 -1
  27. package/dist/widget-react-B9X7Tn7t.js +0 -125
  28. package/dist/widget-react-DNFROpaS.js +0 -262
@@ -0,0 +1,198 @@
1
+ globalThis.process === void 0 && (globalThis.process = {
2
+ env: {},
3
+ nextTick: function(e) {
4
+ setTimeout(e, 0);
5
+ },
6
+ emit: function() {
7
+ return !1;
8
+ }
9
+ });
10
+ import "react";
11
+ import "react-dom";
12
+ import "react/jsx-runtime";
13
+ import "react-dom/client";
14
+ import { c as e, d as t, i as n, l as r, n as i, r as a, u as o } from "./widget-react-DbOJZl9F.js";
15
+ import { t as s } from "./widget-react-krPPnv02.js";
16
+ import * as c from "react";
17
+ import { Children as l, isValidElement as u, useContext as d, useId as f, useInsertionEffect as p, useMemo as m, useRef as h, useState as g } from "react";
18
+ import { Fragment as _, jsx as v } from "react/jsx-runtime";
19
+ //#region node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs
20
+ function y(e, t) {
21
+ if (typeof e == "function") return e(t);
22
+ e != null && (e.current = t);
23
+ }
24
+ function b(...e) {
25
+ return (t) => {
26
+ let n = !1, r = e.map((e) => {
27
+ let r = y(e, t);
28
+ return !n && typeof r == "function" && (n = !0), r;
29
+ });
30
+ if (n) return () => {
31
+ for (let t = 0; t < r.length; t++) {
32
+ let n = r[t];
33
+ typeof n == "function" ? n() : y(e[t], null);
34
+ }
35
+ };
36
+ };
37
+ }
38
+ function x(...e) {
39
+ return c.useCallback(b(...e), e);
40
+ }
41
+ //#endregion
42
+ //#region node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
43
+ var S = class extends c.Component {
44
+ getSnapshotBeforeUpdate(e) {
45
+ let t = this.props.childRef.current;
46
+ if (n(t) && e.isPresent && !this.props.isPresent && this.props.pop !== !1) {
47
+ let e = t.offsetParent, r = n(e) && e.offsetWidth || 0, i = n(e) && e.offsetHeight || 0, a = getComputedStyle(t), o = this.props.sizeRef.current;
48
+ o.height = parseFloat(a.height), o.width = parseFloat(a.width), o.top = t.offsetTop, o.left = t.offsetLeft, o.right = r - o.width - o.left, o.bottom = i - o.height - o.top;
49
+ }
50
+ return null;
51
+ }
52
+ componentDidUpdate() {}
53
+ render() {
54
+ return this.props.children;
55
+ }
56
+ };
57
+ function C({ children: e, isPresent: t, anchorX: n, anchorY: r, root: i, pop: o }) {
58
+ let s = f(), l = h(null), u = h({
59
+ width: 0,
60
+ height: 0,
61
+ top: 0,
62
+ left: 0,
63
+ right: 0,
64
+ bottom: 0
65
+ }), { nonce: m } = d(a), g = x(l, e.props?.ref ?? e?.ref);
66
+ return p(() => {
67
+ let { width: e, height: a, top: c, left: d, right: f, bottom: p } = u.current;
68
+ if (t || o === !1 || !l.current || !e || !a) return;
69
+ let h = n === "left" ? `left: ${d}` : `right: ${f}`, g = r === "bottom" ? `bottom: ${p}` : `top: ${c}`;
70
+ l.current.dataset.motionPopId = s;
71
+ let _ = document.createElement("style");
72
+ m && (_.nonce = m);
73
+ let v = i ?? document.head;
74
+ return v.appendChild(_), _.sheet && _.sheet.insertRule(`
75
+ [data-motion-pop-id="${s}"] {
76
+ position: absolute !important;
77
+ width: ${e}px !important;
78
+ height: ${a}px !important;
79
+ ${h}px !important;
80
+ ${g}px !important;
81
+ }
82
+ `), () => {
83
+ l.current?.removeAttribute("data-motion-pop-id"), v.contains(_) && v.removeChild(_);
84
+ };
85
+ }, [t]), v(S, {
86
+ isPresent: t,
87
+ childRef: l,
88
+ sizeRef: u,
89
+ pop: o,
90
+ children: o === !1 ? e : c.cloneElement(e, { ref: g })
91
+ });
92
+ }
93
+ //#endregion
94
+ //#region node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
95
+ var w = ({ children: t, initial: n, isPresent: r, onExitComplete: i, custom: a, presenceAffectsLayout: s, mode: l, anchorX: u, anchorY: d, root: p }) => {
96
+ let h = o(T), g = f(), _ = !0, y = m(() => (_ = !1, {
97
+ id: g,
98
+ initial: n,
99
+ isPresent: r,
100
+ custom: a,
101
+ onExitComplete: (e) => {
102
+ h.set(e, !0);
103
+ for (let e of h.values()) if (!e) return;
104
+ i && i();
105
+ },
106
+ register: (e) => (h.set(e, !1), () => h.delete(e))
107
+ }), [
108
+ r,
109
+ h,
110
+ i
111
+ ]);
112
+ return s && _ && (y = { ...y }), m(() => {
113
+ h.forEach((e, t) => h.set(t, !1));
114
+ }, [r]), c.useEffect(() => {
115
+ !r && !h.size && i && i();
116
+ }, [r]), t = v(C, {
117
+ pop: l === "popLayout",
118
+ isPresent: r,
119
+ anchorX: u,
120
+ anchorY: d,
121
+ root: p,
122
+ children: t
123
+ }), v(e.Provider, {
124
+ value: y,
125
+ children: t
126
+ });
127
+ };
128
+ function T() {
129
+ return /* @__PURE__ */ new Map();
130
+ }
131
+ //#endregion
132
+ //#region node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
133
+ var E = (e) => e.key || "";
134
+ function D(e) {
135
+ let t = [];
136
+ return l.forEach(e, (e) => {
137
+ u(e) && t.push(e);
138
+ }), t;
139
+ }
140
+ //#endregion
141
+ //#region node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
142
+ var O = ({ children: e, custom: n, initial: a = !0, onExitComplete: s, presenceAffectsLayout: c = !0, mode: l = "sync", propagate: u = !1, anchorX: f = "left", anchorY: p = "top", root: y }) => {
143
+ let [b, x] = i(u), S = m(() => D(e), [e]), C = u && !b ? [] : S.map(E), T = h(!0), O = h(S), k = o(() => /* @__PURE__ */ new Map()), A = h(/* @__PURE__ */ new Set()), [j, M] = g(S), [N, P] = g(S);
144
+ r(() => {
145
+ T.current = !1, O.current = S;
146
+ for (let e = 0; e < N.length; e++) {
147
+ let t = E(N[e]);
148
+ C.includes(t) ? (k.delete(t), A.current.delete(t)) : k.get(t) !== !0 && k.set(t, !1);
149
+ }
150
+ }, [
151
+ N,
152
+ C.length,
153
+ C.join("-")
154
+ ]);
155
+ let F = [];
156
+ if (S !== j) {
157
+ let e = [...S];
158
+ for (let t = 0; t < N.length; t++) {
159
+ let n = N[t], r = E(n);
160
+ C.includes(r) || (e.splice(t, 0, n), F.push(n));
161
+ }
162
+ return l === "wait" && F.length && (e = F), P(D(e)), M(S), null;
163
+ }
164
+ let { forceRender: I } = d(t);
165
+ return v(_, { children: N.map((e) => {
166
+ let t = E(e), r = u && !b ? !1 : S === N || C.includes(t);
167
+ return v(w, {
168
+ isPresent: r,
169
+ initial: !T.current || a ? void 0 : !1,
170
+ custom: n,
171
+ presenceAffectsLayout: c,
172
+ mode: l,
173
+ root: y,
174
+ onExitComplete: r ? void 0 : () => {
175
+ if (A.current.has(t)) return;
176
+ if (k.has(t)) A.current.add(t), k.set(t, !0);
177
+ else return;
178
+ let e = !0;
179
+ k.forEach((t) => {
180
+ t || (e = !1);
181
+ }), e && (I?.(), P(O.current), u && x?.(), s && s());
182
+ },
183
+ anchorX: f,
184
+ anchorY: p,
185
+ children: e
186
+ }, t);
187
+ }) });
188
+ }, k = s("x", [["path", {
189
+ d: "M18 6 6 18",
190
+ key: "1bl5f8"
191
+ }], ["path", {
192
+ d: "m6 6 12 12",
193
+ key: "d8bk6v"
194
+ }]]);
195
+ //#endregion
196
+ export { O as n, k as t };
197
+
198
+ //# sourceMappingURL=widget-react-wSc9gIfG.js.map
@@ -241,8 +241,8 @@ export interface VisitorIdentity {
241
241
  export interface WexioWidgetProps {
242
242
  publicKey?: string;
243
243
  /**
244
- * Log a known user into the widget (the React equivalent of
245
- * Intercom's `boot({ user_id, ... })`). Provide ONE proof:
244
+ * Log a known user into the widget (a known-user login / boot).
245
+ * Provide ONE proof:
246
246
  * `googleIdToken`, `jwt`, or the legacy `userId` + `userHash` pair.
247
247
  * `name` / `email` / `phone` populate the People profile;
248
248
  * `attributes` is an open bag of extra fields.