@askdepth/react 0.1.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.
- package/README.md +133 -0
- package/dist/index.cjs +357 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.mjs +351 -0
- package/dist/index.mjs.map +1 -0
- package/dist/jsx-attribute-Dl6s88lp.d.cts +14 -0
- package/dist/jsx-attribute-Dl6s88lp.d.ts +14 -0
- package/dist/plugin/index.cjs +252 -0
- package/dist/plugin/index.cjs.map +1 -0
- package/dist/plugin/index.d.cts +53 -0
- package/dist/plugin/index.d.ts +53 -0
- package/dist/plugin/index.mjs +219 -0
- package/dist/plugin/index.mjs.map +1 -0
- package/dist/turbopack-loader.cjs +212 -0
- package/dist/turbopack-loader.cjs.map +1 -0
- package/dist/turbopack-loader.d.cts +10 -0
- package/dist/turbopack-loader.d.ts +10 -0
- package/dist/turbopack-loader.mjs +186 -0
- package/dist/turbopack-loader.mjs.map +1 -0
- package/package.json +97 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { ReactNode, Component, ErrorInfo } from 'react';
|
|
2
|
+
import { AskdepthInitOptions } from '@askdepth/core';
|
|
3
|
+
export { AskdepthInitOptions, ConsentState } from '@askdepth/core';
|
|
4
|
+
|
|
5
|
+
interface AskdepthContextValue {
|
|
6
|
+
track: (name: string, properties?: Record<string, unknown>) => void;
|
|
7
|
+
identify: (userId: string, traits?: Record<string, unknown>) => void;
|
|
8
|
+
getTraceparent: () => string | null;
|
|
9
|
+
isReady: () => boolean;
|
|
10
|
+
getSessionId: () => string | null;
|
|
11
|
+
}
|
|
12
|
+
type BaseProviderProps = Omit<AskdepthInitOptions, 'writeKey'> & {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
type ProviderWithWriteKey = BaseProviderProps & {
|
|
16
|
+
/** Project write key */
|
|
17
|
+
writeKey: string;
|
|
18
|
+
/** Alias for writeKey */
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
};
|
|
21
|
+
type ProviderWithApiKey = BaseProviderProps & {
|
|
22
|
+
/** Project write key */
|
|
23
|
+
writeKey?: string;
|
|
24
|
+
/** Alias for writeKey */
|
|
25
|
+
apiKey: string;
|
|
26
|
+
};
|
|
27
|
+
type AskdepthProviderProps = ProviderWithWriteKey | ProviderWithApiKey;
|
|
28
|
+
interface ResolvedComponentLocation {
|
|
29
|
+
componentName: string;
|
|
30
|
+
/** Innermost composite component first. */
|
|
31
|
+
componentStack: string[];
|
|
32
|
+
sourceAttr?: string;
|
|
33
|
+
hashId?: string;
|
|
34
|
+
}
|
|
35
|
+
type AskdepthFallback = ReactNode | ((error: Error, reset: () => void) => ReactNode);
|
|
36
|
+
|
|
37
|
+
declare const AskdepthContext: React.Context<AskdepthContextValue | null>;
|
|
38
|
+
declare const AskdepthProvider: React.FC<AskdepthProviderProps>;
|
|
39
|
+
|
|
40
|
+
declare function useAskdepth(): AskdepthContextValue;
|
|
41
|
+
|
|
42
|
+
interface Props {
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
fallback?: AskdepthFallback;
|
|
45
|
+
}
|
|
46
|
+
interface State {
|
|
47
|
+
hasError: boolean;
|
|
48
|
+
error: Error | null;
|
|
49
|
+
}
|
|
50
|
+
declare class AskdepthCatch extends Component<Props, State> {
|
|
51
|
+
static displayName: string;
|
|
52
|
+
private reportTimer;
|
|
53
|
+
state: State;
|
|
54
|
+
static getDerivedStateFromError(error: Error): State;
|
|
55
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
56
|
+
componentWillUnmount(): void;
|
|
57
|
+
private resetErrorBoundary;
|
|
58
|
+
render(): ReactNode;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare function resolveComponentLocation(target: Element): ResolvedComponentLocation | null;
|
|
62
|
+
|
|
63
|
+
export { AskdepthCatch, AskdepthContext, type AskdepthContextValue, type AskdepthFallback, AskdepthProvider, type AskdepthProviderProps, type ResolvedComponentLocation, resolveComponentLocation, useAskdepth };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Askdepth } from '@askdepth/core';
|
|
3
|
+
import { createContext, useMemo, useRef, useState, useEffect, useContext, Component } from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/constants.ts
|
|
7
|
+
var ASKDEPTH_SRC_ATTR = "data-askdepth-src";
|
|
8
|
+
var ASKDEPTH_ID_ATTR = "data-askdepth-id";
|
|
9
|
+
var FIBER_KEY_PREFIX = "__reactFiber$";
|
|
10
|
+
var LEGACY_FIBER_KEY_PREFIX = "__reactInternalInstance$";
|
|
11
|
+
var PAGE_VIEW_EVENT = "page_view";
|
|
12
|
+
var COMPOSITE_FIBER_TAGS = /* @__PURE__ */ new Set([0, 1, 2, 11, 14, 15, 16]);
|
|
13
|
+
|
|
14
|
+
// src/fiber.ts
|
|
15
|
+
var MAX_FIBER_DEPTH = 64;
|
|
16
|
+
function componentNameOf(type, seen) {
|
|
17
|
+
if (!type || typeof type === "string" || typeof type === "symbol") return null;
|
|
18
|
+
if (typeof type === "function") {
|
|
19
|
+
const fn = type;
|
|
20
|
+
return fn.displayName || fn.name || null;
|
|
21
|
+
}
|
|
22
|
+
if (typeof type !== "object" || seen.has(type)) return null;
|
|
23
|
+
seen.add(type);
|
|
24
|
+
return type.displayName || type.name || componentNameOf(type.render, seen) || componentNameOf(type.type, seen) || type._payload?._result?.displayName || type._payload?._result?.name || null;
|
|
25
|
+
}
|
|
26
|
+
function readAttr(props, key) {
|
|
27
|
+
const value = props?.[key];
|
|
28
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
29
|
+
}
|
|
30
|
+
function fiberKey(target) {
|
|
31
|
+
return Object.getOwnPropertyNames(target).find(
|
|
32
|
+
(name) => name.startsWith(FIBER_KEY_PREFIX) || name.startsWith(LEGACY_FIBER_KEY_PREFIX)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function locationFrom(componentName, componentStack, sourceAttr, hashId) {
|
|
36
|
+
const location = { componentName, componentStack };
|
|
37
|
+
if (sourceAttr) location.sourceAttr = sourceAttr;
|
|
38
|
+
if (hashId) location.hashId = hashId;
|
|
39
|
+
return location;
|
|
40
|
+
}
|
|
41
|
+
function resolveComponentLocation(target) {
|
|
42
|
+
const directSrc = target.getAttribute(ASKDEPTH_SRC_ATTR) ?? void 0;
|
|
43
|
+
const directId = target.getAttribute(ASKDEPTH_ID_ATTR) ?? void 0;
|
|
44
|
+
const key = fiberKey(target);
|
|
45
|
+
if (!key && !directSrc && !directId) return null;
|
|
46
|
+
const stack = [];
|
|
47
|
+
let primaryName = "";
|
|
48
|
+
let sourceAttr = directSrc;
|
|
49
|
+
let hashId = directId;
|
|
50
|
+
let fiber = key ? target[key] ?? null : null;
|
|
51
|
+
let depth = 0;
|
|
52
|
+
while (fiber && depth < MAX_FIBER_DEPTH) {
|
|
53
|
+
depth += 1;
|
|
54
|
+
const tag = fiber.tag;
|
|
55
|
+
if (typeof tag === "number" && COMPOSITE_FIBER_TAGS.has(tag) && fiber.type && typeof fiber.type !== "symbol" && typeof fiber.type !== "string") {
|
|
56
|
+
const name = componentNameOf(fiber.type, /* @__PURE__ */ new Set()) ?? "Anonymous";
|
|
57
|
+
if (!name.startsWith("Askdepth")) {
|
|
58
|
+
if (!primaryName) primaryName = name;
|
|
59
|
+
stack.push(name);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (!sourceAttr) {
|
|
63
|
+
sourceAttr = readAttr(fiber.memoizedProps, ASKDEPTH_SRC_ATTR) ?? readAttr(fiber.pendingProps, ASKDEPTH_SRC_ATTR) ?? readAttr(fiber.alternate?.memoizedProps, ASKDEPTH_SRC_ATTR);
|
|
64
|
+
}
|
|
65
|
+
if (!hashId) {
|
|
66
|
+
hashId = readAttr(fiber.memoizedProps, ASKDEPTH_ID_ATTR) ?? readAttr(fiber.pendingProps, ASKDEPTH_ID_ATTR) ?? readAttr(fiber.alternate?.memoizedProps, ASKDEPTH_ID_ATTR);
|
|
67
|
+
}
|
|
68
|
+
fiber = fiber.return ?? null;
|
|
69
|
+
}
|
|
70
|
+
if (!primaryName && !sourceAttr && !hashId) return null;
|
|
71
|
+
return locationFrom(
|
|
72
|
+
primaryName || target.tagName.toLowerCase(),
|
|
73
|
+
stack.length > 0 ? stack : [target.tagName.toLowerCase()],
|
|
74
|
+
sourceAttr,
|
|
75
|
+
hashId
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/interaction.ts
|
|
80
|
+
var DEFAULT_MAX_INTERACTION_AGE_MS = 5e3;
|
|
81
|
+
var last = null;
|
|
82
|
+
var activeRefCount = 0;
|
|
83
|
+
var clickListener = null;
|
|
84
|
+
function elementFrom(target) {
|
|
85
|
+
if (typeof Element === "undefined") return null;
|
|
86
|
+
if (target instanceof Element) return target;
|
|
87
|
+
if (typeof Node !== "undefined" && target instanceof Node) return target.parentElement;
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function getLastUserInteraction(maxAgeMs = DEFAULT_MAX_INTERACTION_AGE_MS) {
|
|
91
|
+
if (!last) return null;
|
|
92
|
+
if (Date.now() - last.timestamp > maxAgeMs) {
|
|
93
|
+
last = null;
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return last;
|
|
97
|
+
}
|
|
98
|
+
function clearLastUserInteraction() {
|
|
99
|
+
last = null;
|
|
100
|
+
}
|
|
101
|
+
function installInteractionMemory() {
|
|
102
|
+
if (typeof window === "undefined") return () => void 0;
|
|
103
|
+
activeRefCount += 1;
|
|
104
|
+
if (!clickListener) {
|
|
105
|
+
clickListener = (event) => {
|
|
106
|
+
const target = elementFrom(event.target);
|
|
107
|
+
if (!target) return;
|
|
108
|
+
last = { targetElement: target, timestamp: Date.now() };
|
|
109
|
+
};
|
|
110
|
+
window.addEventListener("click", clickListener, { capture: true, passive: true });
|
|
111
|
+
}
|
|
112
|
+
let unsubscribed = false;
|
|
113
|
+
return () => {
|
|
114
|
+
if (unsubscribed) return;
|
|
115
|
+
unsubscribed = true;
|
|
116
|
+
activeRefCount = Math.max(0, activeRefCount - 1);
|
|
117
|
+
if (activeRefCount === 0 && clickListener) {
|
|
118
|
+
window.removeEventListener("click", clickListener, { capture: true });
|
|
119
|
+
clickListener = null;
|
|
120
|
+
last = null;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
var activeRefCount2 = 0;
|
|
125
|
+
var restore = null;
|
|
126
|
+
var pageViewNotify = null;
|
|
127
|
+
var unsubscribeConsent = null;
|
|
128
|
+
var initialPageViewPending = false;
|
|
129
|
+
var MAX_INPUT_PATH_LENGTH = 4096;
|
|
130
|
+
var MAX_PATH_SEGMENTS = 12;
|
|
131
|
+
var STATIC_ROUTE_SEGMENTS = /* @__PURE__ */ new Set([
|
|
132
|
+
"about",
|
|
133
|
+
"account",
|
|
134
|
+
"admin",
|
|
135
|
+
"api",
|
|
136
|
+
"app",
|
|
137
|
+
"auth",
|
|
138
|
+
"billing",
|
|
139
|
+
"blog",
|
|
140
|
+
"cart",
|
|
141
|
+
"checkout",
|
|
142
|
+
"contact",
|
|
143
|
+
"dashboard",
|
|
144
|
+
"docs",
|
|
145
|
+
"home",
|
|
146
|
+
"login",
|
|
147
|
+
"logout",
|
|
148
|
+
"orders",
|
|
149
|
+
"pricing",
|
|
150
|
+
"products",
|
|
151
|
+
"profile",
|
|
152
|
+
"search",
|
|
153
|
+
"settings",
|
|
154
|
+
"signup",
|
|
155
|
+
"support",
|
|
156
|
+
"users",
|
|
157
|
+
"v1"
|
|
158
|
+
]);
|
|
159
|
+
function currentUrl() {
|
|
160
|
+
const pathname = window.location.pathname || "/";
|
|
161
|
+
const bounded = pathname.slice(0, MAX_INPUT_PATH_LENGTH);
|
|
162
|
+
const segments = bounded.split("/").filter(Boolean);
|
|
163
|
+
const safe = segments.slice(0, MAX_PATH_SEGMENTS).map(
|
|
164
|
+
(segment) => STATIC_ROUTE_SEGMENTS.has(segment) ? segment : ":redacted"
|
|
165
|
+
);
|
|
166
|
+
if (pathname.length > MAX_INPUT_PATH_LENGTH || segments.length > MAX_PATH_SEGMENTS) {
|
|
167
|
+
safe.push(":truncated");
|
|
168
|
+
}
|
|
169
|
+
return safe.length > 0 ? `/${safe.join("/")}` : "/";
|
|
170
|
+
}
|
|
171
|
+
function startPageViews() {
|
|
172
|
+
if (typeof window === "undefined" || typeof window.history?.pushState !== "function") {
|
|
173
|
+
return () => void 0;
|
|
174
|
+
}
|
|
175
|
+
activeRefCount2 += 1;
|
|
176
|
+
if (!restore) {
|
|
177
|
+
const notify = () => {
|
|
178
|
+
if (activeRefCount2 > 0) {
|
|
179
|
+
Askdepth.track(PAGE_VIEW_EVENT, { url: currentUrl() });
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
pageViewNotify = notify;
|
|
183
|
+
initialPageViewPending = !Askdepth.isInitialized();
|
|
184
|
+
notify();
|
|
185
|
+
const currentPushState = window.history.pushState;
|
|
186
|
+
const currentReplaceState = window.history.replaceState;
|
|
187
|
+
const originalPushState = currentPushState.__askdepth_original__ ?? currentPushState;
|
|
188
|
+
const originalReplaceState = currentReplaceState.__askdepth_original__ ?? currentReplaceState;
|
|
189
|
+
const isPushWrapped = Boolean(
|
|
190
|
+
currentPushState.__askdepth_page_view__
|
|
191
|
+
);
|
|
192
|
+
const isReplaceWrapped = Boolean(
|
|
193
|
+
currentReplaceState.__askdepth_page_view__
|
|
194
|
+
);
|
|
195
|
+
const wrap = (original) => {
|
|
196
|
+
const fn = function(...args) {
|
|
197
|
+
const result = original.apply(this, args);
|
|
198
|
+
notify();
|
|
199
|
+
return result;
|
|
200
|
+
};
|
|
201
|
+
fn.__askdepth_original__ = original;
|
|
202
|
+
fn.__askdepth_page_view__ = true;
|
|
203
|
+
return fn;
|
|
204
|
+
};
|
|
205
|
+
const wrappedPushState = isPushWrapped ? currentPushState : wrap(originalPushState);
|
|
206
|
+
const wrappedReplaceState = isReplaceWrapped ? currentReplaceState : wrap(originalReplaceState);
|
|
207
|
+
if (!isPushWrapped) {
|
|
208
|
+
window.history.pushState = wrappedPushState;
|
|
209
|
+
}
|
|
210
|
+
if (!isReplaceWrapped) {
|
|
211
|
+
window.history.replaceState = wrappedReplaceState;
|
|
212
|
+
}
|
|
213
|
+
restore = () => {
|
|
214
|
+
if (window.history.pushState !== wrappedPushState || window.history.replaceState !== wrappedReplaceState) return;
|
|
215
|
+
window.history.pushState = originalPushState;
|
|
216
|
+
window.history.replaceState = originalReplaceState;
|
|
217
|
+
restore = null;
|
|
218
|
+
pageViewNotify = null;
|
|
219
|
+
initialPageViewPending = false;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (activeRefCount2 === 1 && pageViewNotify) {
|
|
223
|
+
window.addEventListener("popstate", pageViewNotify);
|
|
224
|
+
unsubscribeConsent = Askdepth.onConsentChange((consent) => {
|
|
225
|
+
if (consent === "granted" && initialPageViewPending) {
|
|
226
|
+
initialPageViewPending = false;
|
|
227
|
+
pageViewNotify?.();
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
let unsubscribed = false;
|
|
232
|
+
return () => {
|
|
233
|
+
if (unsubscribed) return;
|
|
234
|
+
unsubscribed = true;
|
|
235
|
+
activeRefCount2 = Math.max(0, activeRefCount2 - 1);
|
|
236
|
+
if (activeRefCount2 === 0) {
|
|
237
|
+
if (pageViewNotify) window.removeEventListener("popstate", pageViewNotify);
|
|
238
|
+
unsubscribeConsent?.();
|
|
239
|
+
unsubscribeConsent = null;
|
|
240
|
+
restore?.();
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
var AskdepthContext = createContext(null);
|
|
245
|
+
var noopContext = {
|
|
246
|
+
track: () => void 0,
|
|
247
|
+
identify: () => void 0,
|
|
248
|
+
getTraceparent: () => null,
|
|
249
|
+
isReady: () => false,
|
|
250
|
+
getSessionId: () => null
|
|
251
|
+
};
|
|
252
|
+
function getNoopAskdepth() {
|
|
253
|
+
return noopContext;
|
|
254
|
+
}
|
|
255
|
+
var AskdepthProvider = (props) => {
|
|
256
|
+
const { children, apiKey, writeKey: propWriteKey, ...restOptions } = props;
|
|
257
|
+
const writeKey = propWriteKey ?? apiKey ?? "";
|
|
258
|
+
const options = {
|
|
259
|
+
...restOptions,
|
|
260
|
+
writeKey
|
|
261
|
+
};
|
|
262
|
+
const key = JSON.stringify(options);
|
|
263
|
+
const stable = useMemo(() => options, [key]);
|
|
264
|
+
const booted = useRef(null);
|
|
265
|
+
const [initializedKey, setInitializedKey] = useState(null);
|
|
266
|
+
useEffect(() => {
|
|
267
|
+
if (typeof window === "undefined") return;
|
|
268
|
+
if (booted.current !== key) {
|
|
269
|
+
Askdepth.init(stable);
|
|
270
|
+
booted.current = key;
|
|
271
|
+
setInitializedKey(key);
|
|
272
|
+
}
|
|
273
|
+
const unbindResolver = Askdepth.registerComponentResolver(resolveComponentLocation);
|
|
274
|
+
const unbindInteraction = installInteractionMemory();
|
|
275
|
+
const unbindPageViews = startPageViews();
|
|
276
|
+
return () => {
|
|
277
|
+
unbindResolver();
|
|
278
|
+
unbindInteraction();
|
|
279
|
+
unbindPageViews();
|
|
280
|
+
};
|
|
281
|
+
}, [key, stable]);
|
|
282
|
+
const value = useMemo(
|
|
283
|
+
() => ({
|
|
284
|
+
track: (name, properties) => {
|
|
285
|
+
if (properties === void 0) Askdepth.track(name);
|
|
286
|
+
else Askdepth.track(name, properties);
|
|
287
|
+
},
|
|
288
|
+
identify: (userId, traits) => {
|
|
289
|
+
if (traits === void 0) Askdepth.identify(userId);
|
|
290
|
+
else Askdepth.identify(userId, traits);
|
|
291
|
+
},
|
|
292
|
+
getTraceparent: () => Askdepth.getTraceparent(),
|
|
293
|
+
isReady: () => Askdepth.isInitialized(),
|
|
294
|
+
getSessionId: () => Askdepth.getSessionId()
|
|
295
|
+
}),
|
|
296
|
+
[initializedKey]
|
|
297
|
+
);
|
|
298
|
+
return /* @__PURE__ */ jsx(AskdepthContext.Provider, { value, children });
|
|
299
|
+
};
|
|
300
|
+
AskdepthProvider.displayName = "AskdepthProvider";
|
|
301
|
+
function useAskdepth() {
|
|
302
|
+
return useContext(AskdepthContext) ?? getNoopAskdepth();
|
|
303
|
+
}
|
|
304
|
+
var AskdepthCatch = class extends Component {
|
|
305
|
+
static displayName = "AskdepthCatch";
|
|
306
|
+
reportTimer = null;
|
|
307
|
+
state = {
|
|
308
|
+
hasError: false,
|
|
309
|
+
error: null
|
|
310
|
+
};
|
|
311
|
+
static getDerivedStateFromError(error) {
|
|
312
|
+
return { hasError: true, error };
|
|
313
|
+
}
|
|
314
|
+
componentDidCatch(error, info) {
|
|
315
|
+
const target = getLastUserInteraction(500)?.targetElement ?? null;
|
|
316
|
+
const componentStack = info.componentStack ?? void 0;
|
|
317
|
+
if (Askdepth.isInitialized()) {
|
|
318
|
+
Askdepth.reportCaughtError(error, target, componentStack);
|
|
319
|
+
} else {
|
|
320
|
+
if (this.reportTimer) clearTimeout(this.reportTimer);
|
|
321
|
+
this.reportTimer = setTimeout(() => {
|
|
322
|
+
this.reportTimer = null;
|
|
323
|
+
Askdepth.reportCaughtError(error, target, componentStack);
|
|
324
|
+
}, 0);
|
|
325
|
+
}
|
|
326
|
+
clearLastUserInteraction();
|
|
327
|
+
}
|
|
328
|
+
componentWillUnmount() {
|
|
329
|
+
if (this.reportTimer) clearTimeout(this.reportTimer);
|
|
330
|
+
}
|
|
331
|
+
resetErrorBoundary = () => {
|
|
332
|
+
this.setState({ hasError: false, error: null });
|
|
333
|
+
};
|
|
334
|
+
render() {
|
|
335
|
+
if (this.state.hasError && this.state.error) {
|
|
336
|
+
const { fallback } = this.props;
|
|
337
|
+
if (typeof fallback === "function") return fallback(this.state.error, this.resetErrorBoundary);
|
|
338
|
+
if (fallback !== void 0) return fallback;
|
|
339
|
+
return /* @__PURE__ */ jsxs("div", { role: "alert", style: { padding: "16px", border: "1px solid #EF4444", borderRadius: "6px" }, children: [
|
|
340
|
+
/* @__PURE__ */ jsx("h2", { children: "Something went wrong" }),
|
|
341
|
+
/* @__PURE__ */ jsx("p", { children: "Please try again." }),
|
|
342
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: this.resetErrorBoundary, children: "Try again" })
|
|
343
|
+
] });
|
|
344
|
+
}
|
|
345
|
+
return this.props.children;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export { AskdepthCatch, AskdepthContext, AskdepthProvider, resolveComponentLocation, useAskdepth };
|
|
350
|
+
//# sourceMappingURL=index.mjs.map
|
|
351
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/fiber.ts","../src/interaction.ts","../src/page-view.ts","../src/provider.tsx","../src/hooks/use-askdepth.ts","../src/components/error-boundary.tsx"],"names":["activeRefCount","Askdepth","jsx"],"mappings":";;;;;;AAAO,IAAM,iBAAA,GAAoB,mBAAA;AAC1B,IAAM,gBAAA,GAAmB,kBAAA;AACzB,IAAM,gBAAA,GAAmB,eAAA;AACzB,IAAM,uBAAA,GAA0B,0BAAA;AAChC,IAAM,eAAA,GAAkB,WAAA;AAIxB,IAAM,oBAAA,mBAAuB,IAAI,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAE,CAAC,CAAA;;;ACLrE,IAAM,eAAA,GAAkB,EAAA;AAwBxB,SAAS,eAAA,CAAgB,MAAyB,IAAA,EAAkC;AAClF,EAAA,IAAI,CAAC,QAAQ,OAAO,IAAA,KAAS,YAAY,OAAO,IAAA,KAAS,UAAU,OAAO,IAAA;AAC1E,EAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,IAAA,MAAM,EA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AACF","file":"index.mjs","sourcesContent":["export const ASKDEPTH_SRC_ATTR = 'data-askdepth-src';\nexport const ASKDEPTH_ID_ATTR = 'data-askdepth-id';\nexport const FIBER_KEY_PREFIX = '__reactFiber$';\nexport const LEGACY_FIBER_KEY_PREFIX = '__reactInternalInstance$';\nexport const PAGE_VIEW_EVENT = 'page_view';\nexport const ERROR_CLICK_EVENT = 'ERROR_CLICK';\n\n/** Function, Class, Indeterminate, ForwardRef, Memo, SimpleMemo, Lazy. */\nexport const COMPOSITE_FIBER_TAGS = new Set([0, 1, 2, 11, 14, 15, 16]);\n","import { ASKDEPTH_ID_ATTR, ASKDEPTH_SRC_ATTR, COMPOSITE_FIBER_TAGS, FIBER_KEY_PREFIX, LEGACY_FIBER_KEY_PREFIX } from './constants.js';\nimport type { ResolvedComponentLocation } from './types.js';\n\nconst MAX_FIBER_DEPTH = 64;\n\ninterface FiberType {\n displayName?: string;\n name?: string;\n render?: FiberType;\n type?: FiberType;\n _payload?: {\n _result?: {\n displayName?: string;\n name?: string;\n };\n };\n}\n\ninterface FiberNode {\n tag?: number;\n type?: FiberType | string | symbol | null;\n return?: FiberNode | null;\n memoizedProps?: Record<string, unknown> | null;\n pendingProps?: Record<string, unknown> | null;\n alternate?: FiberNode | null;\n}\n\nfunction componentNameOf(type: FiberNode['type'], seen: Set<object>): string | null {\n if (!type || typeof type === 'string' || typeof type === 'symbol') return null;\n if (typeof type === 'function') {\n const fn = type as FiberType;\n return fn.displayName || fn.name || null;\n }\n if (typeof type !== 'object' || seen.has(type)) return null;\n seen.add(type);\n return (\n type.displayName ||\n type.name ||\n componentNameOf(type.render, seen) ||\n componentNameOf(type.type, seen) ||\n type._payload?._result?.displayName ||\n type._payload?._result?.name ||\n null\n );\n}\n\nfunction readAttr(props: Record<string, unknown> | null | undefined, key: string): string | undefined {\n const value = props?.[key];\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction fiberKey(target: Element): string | undefined {\n return Object.getOwnPropertyNames(target).find(\n (name) => name.startsWith(FIBER_KEY_PREFIX) || name.startsWith(LEGACY_FIBER_KEY_PREFIX),\n );\n}\n\nfunction locationFrom(\n componentName: string,\n componentStack: string[],\n sourceAttr: string | undefined,\n hashId: string | undefined,\n): ResolvedComponentLocation {\n const location: ResolvedComponentLocation = { componentName, componentStack };\n if (sourceAttr) location.sourceAttr = sourceAttr;\n if (hashId) location.hashId = hashId;\n return location;\n}\n\nexport function resolveComponentLocation(target: Element): ResolvedComponentLocation | null {\n const directSrc = target.getAttribute(ASKDEPTH_SRC_ATTR) ?? undefined;\n const directId = target.getAttribute(ASKDEPTH_ID_ATTR) ?? undefined;\n const key = fiberKey(target);\n if (!key && !directSrc && !directId) return null;\n\n const stack: string[] = [];\n let primaryName = '';\n let sourceAttr = directSrc;\n let hashId = directId;\n let fiber = key ? ((target as unknown as Record<string, FiberNode | undefined>)[key] ?? null) : null;\n let depth = 0;\n\n while (fiber && depth < MAX_FIBER_DEPTH) {\n depth += 1;\n const tag = fiber.tag;\n if (\n typeof tag === 'number' &&\n COMPOSITE_FIBER_TAGS.has(tag) &&\n fiber.type &&\n typeof fiber.type !== 'symbol' &&\n typeof fiber.type !== 'string'\n ) {\n const name = componentNameOf(fiber.type, new Set()) ?? 'Anonymous';\n if (!name.startsWith('Askdepth')) {\n if (!primaryName) primaryName = name;\n stack.push(name);\n }\n }\n if (!sourceAttr) {\n sourceAttr =\n readAttr(fiber.memoizedProps, ASKDEPTH_SRC_ATTR) ??\n readAttr(fiber.pendingProps, ASKDEPTH_SRC_ATTR) ??\n readAttr(fiber.alternate?.memoizedProps, ASKDEPTH_SRC_ATTR);\n }\n if (!hashId) {\n hashId =\n readAttr(fiber.memoizedProps, ASKDEPTH_ID_ATTR) ??\n readAttr(fiber.pendingProps, ASKDEPTH_ID_ATTR) ??\n readAttr(fiber.alternate?.memoizedProps, ASKDEPTH_ID_ATTR);\n }\n fiber = fiber.return ?? null;\n }\n\n if (!primaryName && !sourceAttr && !hashId) return null;\n\n return locationFrom(\n primaryName || target.tagName.toLowerCase(),\n stack.length > 0 ? stack : [target.tagName.toLowerCase()],\n sourceAttr,\n hashId,\n );\n}\n","export interface LastUserInteraction {\n targetElement: Element;\n timestamp: number;\n}\n\nexport const DEFAULT_MAX_INTERACTION_AGE_MS = 5_000;\n\nlet last: LastUserInteraction | null = null;\nlet activeRefCount = 0;\nlet clickListener: ((event: MouseEvent) => void) | null = null;\n\nfunction elementFrom(target: EventTarget | null): Element | null {\n if (typeof Element === 'undefined') return null;\n if (target instanceof Element) return target;\n if (typeof Node !== 'undefined' && target instanceof Node) return target.parentElement;\n return null;\n}\n\n/**\n * Returns the last user interaction if it occurred within `maxAgeMs`.\n * Automatically purges stale references to prevent retaining detached DOM trees.\n */\nexport function getLastUserInteraction(\n maxAgeMs = DEFAULT_MAX_INTERACTION_AGE_MS,\n): LastUserInteraction | null {\n if (!last) return null;\n if (Date.now() - last.timestamp > maxAgeMs) {\n last = null;\n return null;\n }\n return last;\n}\n\n/**\n * Releases the stored DOM element immediately to facilitate garbage collection.\n */\nexport function clearLastUserInteraction(): void {\n last = null;\n}\n\n/**\n * Installs interaction tracking with reference counting.\n * Returns an unsubscribe callback that removes the window listener once all providers unmount.\n */\nexport function installInteractionMemory(): () => void {\n if (typeof window === 'undefined') return () => undefined;\n\n activeRefCount += 1;\n if (!clickListener) {\n clickListener = (event: MouseEvent) => {\n const target = elementFrom(event.target);\n if (!target) return;\n last = { targetElement: target, timestamp: Date.now() };\n };\n window.addEventListener('click', clickListener, { capture: true, passive: true });\n }\n\n let unsubscribed = false;\n return () => {\n if (unsubscribed) return;\n unsubscribed = true;\n activeRefCount = Math.max(0, activeRefCount - 1);\n if (activeRefCount === 0 && clickListener) {\n window.removeEventListener('click', clickListener, { capture: true });\n clickListener = null;\n last = null;\n }\n };\n}\n\nexport function resetInteractionMemoryForTests(): void {\n if (clickListener && typeof window !== 'undefined') {\n window.removeEventListener('click', clickListener, { capture: true });\n }\n clickListener = null;\n activeRefCount = 0;\n last = null;\n}\n","import { Askdepth } from '@askdepth/core';\nimport { PAGE_VIEW_EVENT } from './constants.js';\n\nlet activeRefCount = 0;\nlet restore: (() => void) | null = null;\nlet pageViewNotify: (() => void) | null = null;\nlet unsubscribeConsent: (() => void) | null = null;\nlet initialPageViewPending = false;\n\nconst MAX_INPUT_PATH_LENGTH = 4_096;\nconst MAX_PATH_SEGMENTS = 12;\nconst STATIC_ROUTE_SEGMENTS = new Set([\n 'about', 'account', 'admin', 'api', 'app', 'auth', 'billing', 'blog', 'cart',\n 'checkout', 'contact', 'dashboard', 'docs', 'home', 'login', 'logout',\n 'orders', 'pricing', 'products', 'profile', 'search', 'settings', 'signup',\n 'support', 'users', 'v1',\n]);\n\nexport function currentUrl(): string {\n const pathname = window.location.pathname || '/';\n const bounded = pathname.slice(0, MAX_INPUT_PATH_LENGTH);\n const segments = bounded.split('/').filter(Boolean);\n const safe = segments.slice(0, MAX_PATH_SEGMENTS).map((segment) =>\n STATIC_ROUTE_SEGMENTS.has(segment) ? segment : ':redacted',\n );\n if (pathname.length > MAX_INPUT_PATH_LENGTH || segments.length > MAX_PATH_SEGMENTS) {\n safe.push(':truncated');\n }\n return safe.length > 0 ? `/${safe.join('/')}` : '/';\n}\n\n/**\n * Starts automatic SPA route tracking.\n * Returns an unsubscription function that cleans up history overrides and listeners\n * when all providers unmount.\n */\nexport function startPageViews(): () => void {\n if (typeof window === 'undefined' || typeof window.history?.pushState !== 'function') {\n return () => undefined;\n }\n\n activeRefCount += 1;\n\n if (!restore) {\n const notify = () => {\n if (activeRefCount > 0) {\n Askdepth.track(PAGE_VIEW_EVENT, { url: currentUrl() });\n }\n };\n pageViewNotify = notify;\n\n // Emit initial page view on mount\n initialPageViewPending = !Askdepth.isInitialized();\n notify();\n\n const currentPushState = window.history.pushState;\n const currentReplaceState = window.history.replaceState;\n\n const originalPushState =\n ((currentPushState as unknown as { __askdepth_original__?: History['pushState'] }).__askdepth_original__) ??\n currentPushState;\n const originalReplaceState =\n ((currentReplaceState as unknown as { __askdepth_original__?: History['replaceState'] }).__askdepth_original__) ??\n currentReplaceState;\n\n const isPushWrapped = Boolean(\n (currentPushState as unknown as { __askdepth_page_view__?: boolean }).__askdepth_page_view__,\n );\n const isReplaceWrapped = Boolean(\n (currentReplaceState as unknown as { __askdepth_page_view__?: boolean }).__askdepth_page_view__,\n );\n\n const wrap = (original: History['pushState']) => {\n const fn = function (this: History, ...args: Parameters<History['pushState']>) {\n const result = original.apply(this, args);\n notify();\n return result;\n };\n (fn as unknown as { __askdepth_original__: History['pushState']; __askdepth_page_view__: boolean }).__askdepth_original__ = original;\n (fn as unknown as { __askdepth_page_view__: boolean }).__askdepth_page_view__ = true;\n return fn;\n };\n\n const wrappedPushState = isPushWrapped ? currentPushState : wrap(originalPushState);\n const wrappedReplaceState = isReplaceWrapped ? currentReplaceState : wrap(originalReplaceState);\n\n if (!isPushWrapped) {\n window.history.pushState = wrappedPushState;\n }\n if (!isReplaceWrapped) {\n window.history.replaceState = wrappedReplaceState;\n }\n restore = () => {\n // A replay or router wrapper may still sit above ours. Keep our wrapper so a remount can reuse it.\n if (window.history.pushState !== wrappedPushState || window.history.replaceState !== wrappedReplaceState) return;\n window.history.pushState = originalPushState;\n window.history.replaceState = originalReplaceState;\n restore = null;\n pageViewNotify = null;\n initialPageViewPending = false;\n };\n }\n\n if (activeRefCount === 1 && pageViewNotify) {\n window.addEventListener('popstate', pageViewNotify);\n unsubscribeConsent = Askdepth.onConsentChange((consent) => {\n if (consent === 'granted' && initialPageViewPending) {\n initialPageViewPending = false;\n pageViewNotify?.();\n }\n });\n }\n\n let unsubscribed = false;\n return () => {\n if (unsubscribed) return;\n unsubscribed = true;\n activeRefCount = Math.max(0, activeRefCount - 1);\n if (activeRefCount === 0) {\n if (pageViewNotify) window.removeEventListener('popstate', pageViewNotify);\n unsubscribeConsent?.();\n unsubscribeConsent = null;\n restore?.();\n }\n };\n}\n\nexport function resetPageViewsForTests(): void {\n if (pageViewNotify && typeof window !== 'undefined') window.removeEventListener('popstate', pageViewNotify);\n unsubscribeConsent?.();\n const currentPush = typeof window !== 'undefined' ? window.history?.pushState : undefined;\n const currentReplace = typeof window !== 'undefined' ? window.history?.replaceState : undefined;\n const origPush = (currentPush as unknown as { __askdepth_original__?: History['pushState'] })?.__askdepth_original__;\n const origReplace = (currentReplace as unknown as { __askdepth_original__?: History['replaceState'] })?.__askdepth_original__;\n restore?.();\n if (origPush && typeof window !== 'undefined' && window.history) {\n window.history.pushState = origPush;\n }\n if (origReplace && typeof window !== 'undefined' && window.history) {\n window.history.replaceState = origReplace;\n }\n activeRefCount = 0;\n restore = null;\n pageViewNotify = null;\n unsubscribeConsent = null;\n initialPageViewPending = false;\n}\n","'use client';\n\nimport { Askdepth, type AskdepthInitOptions } from '@askdepth/core';\nimport React, { createContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { resolveComponentLocation } from './fiber.js';\nimport { installInteractionMemory } from './interaction.js';\nimport { startPageViews } from './page-view.js';\nimport type { AskdepthContextValue, AskdepthProviderProps } from './types.js';\n\nexport const AskdepthContext = createContext<AskdepthContextValue | null>(null);\n\nconst noopContext: AskdepthContextValue = {\n track: () => undefined,\n identify: () => undefined,\n getTraceparent: () => null,\n isReady: () => false,\n getSessionId: () => null,\n};\n\nexport function getNoopAskdepth(): AskdepthContextValue {\n return noopContext;\n}\n\nexport const AskdepthProvider: React.FC<AskdepthProviderProps> = (props) => {\n const { children, apiKey, writeKey: propWriteKey, ...restOptions } = props;\n const writeKey = propWriteKey ?? apiKey ?? '';\n const options: AskdepthInitOptions = {\n ...restOptions,\n writeKey,\n };\n const key = JSON.stringify(options);\n const stable = useMemo(() => options, [key]);\n const booted = useRef<string | null>(null);\n const [initializedKey, setInitializedKey] = useState<string | null>(null);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n if (booted.current !== key) {\n Askdepth.init(stable);\n booted.current = key;\n setInitializedKey(key);\n }\n const unbindResolver = Askdepth.registerComponentResolver(resolveComponentLocation);\n const unbindInteraction = installInteractionMemory();\n const unbindPageViews = startPageViews();\n return () => {\n unbindResolver();\n unbindInteraction();\n unbindPageViews();\n };\n }, [key, stable]);\n\n const value = useMemo<AskdepthContextValue>(\n () => ({\n track: (name, properties) => {\n if (properties === undefined) Askdepth.track(name);\n else Askdepth.track(name, properties);\n },\n identify: (userId, traits) => {\n if (traits === undefined) Askdepth.identify(userId);\n else Askdepth.identify(userId, traits);\n },\n getTraceparent: () => Askdepth.getTraceparent(),\n isReady: () => Askdepth.isInitialized(),\n getSessionId: () => Askdepth.getSessionId(),\n }),\n [initializedKey],\n );\n\n return <AskdepthContext.Provider value={value}>{children}</AskdepthContext.Provider>;\n};\n\nAskdepthProvider.displayName = 'AskdepthProvider';\n","'use client';\n\nimport { useContext } from 'react';\nimport { AskdepthContext, getNoopAskdepth } from '../provider.js';\nimport type { AskdepthContextValue } from '../types.js';\n\nexport function useAskdepth(): AskdepthContextValue {\n return useContext(AskdepthContext) ?? getNoopAskdepth();\n}\n","'use client';\n\nimport { Askdepth } from '@askdepth/core';\nimport React, { Component, type ErrorInfo, type ReactNode } from 'react';\nimport { clearLastUserInteraction, getLastUserInteraction } from '../interaction.js';\nimport type { AskdepthFallback } from '../types.js';\n\ninterface Props {\n children?: ReactNode;\n fallback?: AskdepthFallback;\n}\n\ninterface State {\n hasError: boolean;\n error: Error | null;\n}\n\nexport class AskdepthCatch extends Component<Props, State> {\n public static displayName = 'AskdepthCatch';\n private reportTimer: ReturnType<typeof setTimeout> | null = null;\n\n public override state: State = {\n hasError: false,\n error: null,\n };\n\n public static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error };\n }\n\n public override componentDidCatch(error: Error, info: ErrorInfo): void {\n const target = getLastUserInteraction(500)?.targetElement ?? null;\n const componentStack = info.componentStack ?? undefined;\n if (Askdepth.isInitialized()) {\n Askdepth.reportCaughtError(error, target, componentStack);\n } else {\n if (this.reportTimer) clearTimeout(this.reportTimer);\n this.reportTimer = setTimeout(() => {\n this.reportTimer = null;\n Askdepth.reportCaughtError(error, target, componentStack);\n }, 0);\n }\n clearLastUserInteraction();\n }\n\n public override componentWillUnmount(): void {\n if (this.reportTimer) clearTimeout(this.reportTimer);\n }\n\n private resetErrorBoundary = (): void => {\n this.setState({ hasError: false, error: null });\n };\n\n public override render(): ReactNode {\n if (this.state.hasError && this.state.error) {\n const { fallback } = this.props;\n if (typeof fallback === 'function') return fallback(this.state.error, this.resetErrorBoundary);\n if (fallback !== undefined) return fallback;\n return (\n <div role=\"alert\" style={{ padding: '16px', border: '1px solid #EF4444', borderRadius: '6px' }}>\n <h2>Something went wrong</h2>\n <p>Please try again.</p>\n <button type=\"button\" onClick={this.resetErrorBoundary}>\n Try again\n </button>\n </div>\n );\n }\n return this.props.children;\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _babel_generator from '@babel/generator';
|
|
2
|
+
|
|
3
|
+
interface JsxTransformOptions {
|
|
4
|
+
production: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface JsxTransformResult {
|
|
7
|
+
code: string;
|
|
8
|
+
map: ReturnType<typeof _babel_generator.default>['map'] | null;
|
|
9
|
+
locations: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
declare function shouldTransform(id: string, code?: string): boolean;
|
|
12
|
+
declare function transformJsxSource(code: string, filename: string, options: JsxTransformOptions): JsxTransformResult | null;
|
|
13
|
+
|
|
14
|
+
export { type JsxTransformResult as J, shouldTransform as s, transformJsxSource as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _babel_generator from '@babel/generator';
|
|
2
|
+
|
|
3
|
+
interface JsxTransformOptions {
|
|
4
|
+
production: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface JsxTransformResult {
|
|
7
|
+
code: string;
|
|
8
|
+
map: ReturnType<typeof _babel_generator.default>['map'] | null;
|
|
9
|
+
locations: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
declare function shouldTransform(id: string, code?: string): boolean;
|
|
12
|
+
declare function transformJsxSource(code: string, filename: string, options: JsxTransformOptions): JsxTransformResult | null;
|
|
13
|
+
|
|
14
|
+
export { type JsxTransformResult as J, shouldTransform as s, transformJsxSource as t };
|