@flowsterix/react 0.10.0 → 0.11.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/dist/chunk-AJZMUYBN.mjs +21 -0
- package/dist/components/TourPopoverPortal.d.ts.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/devtools/DevToolsContext.d.ts +31 -0
- package/dist/devtools/DevToolsContext.d.ts.map +1 -0
- package/dist/devtools/DevToolsProvider.d.ts +9 -0
- package/dist/devtools/DevToolsProvider.d.ts.map +1 -0
- package/dist/devtools/components/FlowEditModal.d.ts +11 -0
- package/dist/devtools/components/FlowEditModal.d.ts.map +1 -0
- package/dist/devtools/components/FlowItem.d.ts +8 -0
- package/dist/devtools/components/FlowItem.d.ts.map +1 -0
- package/dist/devtools/components/FlowsTab.d.ts +5 -0
- package/dist/devtools/components/FlowsTab.d.ts.map +1 -0
- package/dist/devtools/components/GrabberOverlay.d.ts +8 -0
- package/dist/devtools/components/GrabberOverlay.d.ts.map +1 -0
- package/dist/devtools/components/ShadowRoot.d.ts +7 -0
- package/dist/devtools/components/ShadowRoot.d.ts.map +1 -0
- package/dist/devtools/components/StepItem.d.ts +16 -0
- package/dist/devtools/components/StepItem.d.ts.map +1 -0
- package/dist/devtools/components/StepList.d.ts +17 -0
- package/dist/devtools/components/StepList.d.ts.map +1 -0
- package/dist/devtools/components/TabNav.d.ts +9 -0
- package/dist/devtools/components/TabNav.d.ts.map +1 -0
- package/dist/devtools/components/Toolbar.d.ts +11 -0
- package/dist/devtools/components/Toolbar.d.ts.map +1 -0
- package/dist/devtools/hooks/useElementInfo.d.ts +7 -0
- package/dist/devtools/hooks/useElementInfo.d.ts.map +1 -0
- package/dist/devtools/hooks/useFlowsData.d.ts +16 -0
- package/dist/devtools/hooks/useFlowsData.d.ts.map +1 -0
- package/dist/devtools/hooks/useGrabMode.d.ts +16 -0
- package/dist/devtools/hooks/useGrabMode.d.ts.map +1 -0
- package/dist/devtools/hooks/useStepStore.d.ts +22 -0
- package/dist/devtools/hooks/useStepStore.d.ts.map +1 -0
- package/dist/devtools/index.cjs +2736 -0
- package/dist/devtools/index.d.ts +32 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.mjs +2684 -0
- package/dist/devtools/types.d.ts +66 -0
- package/dist/devtools/types.d.ts.map +1 -0
- package/dist/devtools/utils/selectorGenerator.d.ts +11 -0
- package/dist/devtools/utils/selectorGenerator.d.ts.map +1 -0
- package/dist/devtools/utils/sourceExtractor.d.ts +45 -0
- package/dist/devtools/utils/sourceExtractor.d.ts.map +1 -0
- package/dist/devtools/utils/storage.d.ts +5 -0
- package/dist/devtools/utils/storage.d.ts.map +1 -0
- package/dist/index.cjs +299 -233
- package/dist/index.mjs +74 -11
- package/package.json +10 -1
package/dist/index.cjs
CHANGED
|
@@ -64,10 +64,16 @@ module.exports = __toCommonJS(index_exports);
|
|
|
64
64
|
|
|
65
65
|
// src/context.tsx
|
|
66
66
|
var import_core = require("@flowsterix/core");
|
|
67
|
-
var import_react6 = require("react");
|
|
68
67
|
|
|
69
|
-
// src/
|
|
68
|
+
// src/devtools/DevToolsContext.tsx
|
|
70
69
|
var import_react = require("react");
|
|
70
|
+
var DevToolsContext = (0, import_react.createContext)(null);
|
|
71
|
+
|
|
72
|
+
// src/context.tsx
|
|
73
|
+
var import_react7 = require("react");
|
|
74
|
+
|
|
75
|
+
// src/labels.ts
|
|
76
|
+
var import_react2 = require("react");
|
|
71
77
|
var defaultLabels = {
|
|
72
78
|
back: "Back",
|
|
73
79
|
next: "Next",
|
|
@@ -89,34 +95,34 @@ var defaultLabels = {
|
|
|
89
95
|
detachedBody: "Navigate back to the screen that contains this element or reopen it before continuing the tour."
|
|
90
96
|
}
|
|
91
97
|
};
|
|
92
|
-
var LabelsContext = (0,
|
|
98
|
+
var LabelsContext = (0, import_react2.createContext)(defaultLabels);
|
|
93
99
|
var LabelsProvider = LabelsContext.Provider;
|
|
94
100
|
function useTourLabels() {
|
|
95
|
-
return (0,
|
|
101
|
+
return (0, import_react2.useContext)(LabelsContext);
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
// src/dialog/DialogRegistryContext.tsx
|
|
99
|
-
var
|
|
105
|
+
var import_react3 = require("react");
|
|
100
106
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
101
|
-
var DialogRegistryContext = (0,
|
|
107
|
+
var DialogRegistryContext = (0, import_react3.createContext)(void 0);
|
|
102
108
|
var DialogRegistryProvider = ({ children }) => {
|
|
103
|
-
const controllersRef = (0,
|
|
104
|
-
const register = (0,
|
|
109
|
+
const controllersRef = (0, import_react3.useRef)(/* @__PURE__ */ new Map());
|
|
110
|
+
const register = (0, import_react3.useCallback)(
|
|
105
111
|
(dialogId, controller) => {
|
|
106
112
|
controllersRef.current.set(dialogId, controller);
|
|
107
113
|
},
|
|
108
114
|
[]
|
|
109
115
|
);
|
|
110
|
-
const unregister = (0,
|
|
116
|
+
const unregister = (0, import_react3.useCallback)((dialogId) => {
|
|
111
117
|
controllersRef.current.delete(dialogId);
|
|
112
118
|
}, []);
|
|
113
|
-
const getController = (0,
|
|
119
|
+
const getController = (0, import_react3.useCallback)((dialogId) => {
|
|
114
120
|
return controllersRef.current.get(dialogId);
|
|
115
121
|
}, []);
|
|
116
|
-
const isRegistered = (0,
|
|
122
|
+
const isRegistered = (0, import_react3.useCallback)((dialogId) => {
|
|
117
123
|
return controllersRef.current.has(dialogId);
|
|
118
124
|
}, []);
|
|
119
|
-
const value = (0,
|
|
125
|
+
const value = (0, import_react3.useMemo)(
|
|
120
126
|
() => ({
|
|
121
127
|
register,
|
|
122
128
|
unregister,
|
|
@@ -128,7 +134,7 @@ var DialogRegistryProvider = ({ children }) => {
|
|
|
128
134
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegistryContext.Provider, { value, children });
|
|
129
135
|
};
|
|
130
136
|
var useDialogRegistry = () => {
|
|
131
|
-
const context = (0,
|
|
137
|
+
const context = (0, import_react3.useContext)(DialogRegistryContext);
|
|
132
138
|
if (!context) {
|
|
133
139
|
throw new Error(
|
|
134
140
|
"useDialogRegistry must be used within a DialogRegistryProvider"
|
|
@@ -137,11 +143,11 @@ var useDialogRegistry = () => {
|
|
|
137
143
|
return context;
|
|
138
144
|
};
|
|
139
145
|
var useDialogRegistryOptional = () => {
|
|
140
|
-
return (0,
|
|
146
|
+
return (0, import_react3.useContext)(DialogRegistryContext);
|
|
141
147
|
};
|
|
142
148
|
|
|
143
149
|
// src/hooks/useDialogAutomation.ts
|
|
144
|
-
var
|
|
150
|
+
var import_react4 = require("react");
|
|
145
151
|
var resolveAutoOpen = (config) => {
|
|
146
152
|
if (!config) return { onEnter: true, onResume: true };
|
|
147
153
|
const { autoOpen } = config;
|
|
@@ -156,8 +162,8 @@ var resolveAutoOpen = (config) => {
|
|
|
156
162
|
};
|
|
157
163
|
var useDialogAutomation = (params) => {
|
|
158
164
|
const { flow, state, events, registry, onDialogNotMounted } = params;
|
|
159
|
-
const previousDialogIdRef = (0,
|
|
160
|
-
(0,
|
|
165
|
+
const previousDialogIdRef = (0, import_react4.useRef)(void 0);
|
|
166
|
+
(0, import_react4.useEffect)(() => {
|
|
161
167
|
if (!events || !flow || !registry) return;
|
|
162
168
|
const unsubscribeEnter = events.on("stepEnter", (payload) => {
|
|
163
169
|
const step = payload.currentStep;
|
|
@@ -233,7 +239,7 @@ var useDialogAutomation = (params) => {
|
|
|
233
239
|
unsubscribeComplete();
|
|
234
240
|
};
|
|
235
241
|
}, [events, flow, registry, onDialogNotMounted]);
|
|
236
|
-
(0,
|
|
242
|
+
(0, import_react4.useEffect)(() => {
|
|
237
243
|
if (!flow || !state || state.status !== "running") return;
|
|
238
244
|
if (state.stepIndex < 0 || state.stepIndex >= flow.steps.length) return;
|
|
239
245
|
const currentStep = flow.steps[state.stepIndex];
|
|
@@ -242,19 +248,19 @@ var useDialogAutomation = (params) => {
|
|
|
242
248
|
};
|
|
243
249
|
|
|
244
250
|
// src/motion/animationAdapter.tsx
|
|
245
|
-
var
|
|
246
|
-
var
|
|
251
|
+
var import_react5 = require("motion/react");
|
|
252
|
+
var import_react6 = require("react");
|
|
247
253
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
248
254
|
var defaultAdapter = {
|
|
249
255
|
components: {
|
|
250
|
-
MotionDiv:
|
|
251
|
-
MotionSection:
|
|
252
|
-
MotionSvg:
|
|
253
|
-
MotionDefs:
|
|
254
|
-
MotionMask:
|
|
255
|
-
MotionRect:
|
|
256
|
-
MotionSpan:
|
|
257
|
-
MotionButton:
|
|
256
|
+
MotionDiv: import_react5.motion.div,
|
|
257
|
+
MotionSection: import_react5.motion.section,
|
|
258
|
+
MotionSvg: import_react5.motion.svg,
|
|
259
|
+
MotionDefs: import_react5.motion.defs,
|
|
260
|
+
MotionMask: import_react5.motion.mask,
|
|
261
|
+
MotionRect: import_react5.motion.rect,
|
|
262
|
+
MotionSpan: import_react5.motion.span,
|
|
263
|
+
MotionButton: import_react5.motion.button
|
|
258
264
|
},
|
|
259
265
|
transitions: {
|
|
260
266
|
overlayHighlight: {
|
|
@@ -287,16 +293,16 @@ var defaultAdapter = {
|
|
|
287
293
|
}
|
|
288
294
|
}
|
|
289
295
|
};
|
|
290
|
-
var AnimationAdapterContext = (0,
|
|
296
|
+
var AnimationAdapterContext = (0, import_react6.createContext)(defaultAdapter);
|
|
291
297
|
var AnimationAdapterProvider = ({
|
|
292
298
|
adapter,
|
|
293
299
|
children
|
|
294
300
|
}) => {
|
|
295
|
-
const value = (0,
|
|
301
|
+
const value = (0, import_react6.useMemo)(() => adapter ?? defaultAdapter, [adapter]);
|
|
296
302
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AnimationAdapterContext.Provider, { value, children });
|
|
297
303
|
};
|
|
298
304
|
var useAnimationAdapter = () => {
|
|
299
|
-
return (0,
|
|
305
|
+
return (0, import_react6.useContext)(AnimationAdapterContext);
|
|
300
306
|
};
|
|
301
307
|
var defaultAnimationAdapter = defaultAdapter;
|
|
302
308
|
var reducedMotionAnimationAdapter = {
|
|
@@ -336,11 +342,11 @@ var usePreferredAnimationAdapter = (options) => {
|
|
|
336
342
|
reducedMotionAdapter: reducedOption = reducedMotionAnimationAdapter,
|
|
337
343
|
enabled = true
|
|
338
344
|
} = options ?? {};
|
|
339
|
-
const [prefersReduced, setPrefersReduced] = (0,
|
|
345
|
+
const [prefersReduced, setPrefersReduced] = (0, import_react6.useState)(() => {
|
|
340
346
|
if (!enabled || typeof window === "undefined") return false;
|
|
341
347
|
return window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
342
348
|
});
|
|
343
|
-
(0,
|
|
349
|
+
(0, import_react6.useEffect)(() => {
|
|
344
350
|
if (!enabled || typeof window === "undefined") return;
|
|
345
351
|
const mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
346
352
|
const handleChange = (event) => {
|
|
@@ -589,10 +595,10 @@ var matchRoute = (params) => {
|
|
|
589
595
|
|
|
590
596
|
// src/context.tsx
|
|
591
597
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
592
|
-
var TourContext = (0,
|
|
598
|
+
var TourContext = (0, import_react7.createContext)(void 0);
|
|
593
599
|
var DEFAULT_STORAGE_PREFIX = "tour";
|
|
594
600
|
var useFlowMap = (flows) => {
|
|
595
|
-
return (0,
|
|
601
|
+
return (0, import_react7.useMemo)(() => {
|
|
596
602
|
const map = /* @__PURE__ */ new Map();
|
|
597
603
|
for (const flow of flows) {
|
|
598
604
|
map.set(flow.id, flow);
|
|
@@ -616,25 +622,25 @@ var TourProvider = ({
|
|
|
616
622
|
labels: labelsProp,
|
|
617
623
|
onVersionMismatch
|
|
618
624
|
}) => {
|
|
619
|
-
const mergedLabels = (0,
|
|
625
|
+
const mergedLabels = (0, import_react7.useMemo)(
|
|
620
626
|
() => ({ ...defaultLabels, ...labelsProp }),
|
|
621
627
|
[labelsProp]
|
|
622
628
|
);
|
|
623
629
|
const flowMap = useFlowMap(flows);
|
|
624
|
-
const storeRef = (0,
|
|
625
|
-
const unsubscribeRef = (0,
|
|
626
|
-
const stepHooksUnsubscribeRef = (0,
|
|
627
|
-
const fallbackStorageRef = (0,
|
|
628
|
-
const pendingResumeRef = (0,
|
|
629
|
-
const autoStartRequestedRef = (0,
|
|
630
|
-
const [activeFlowId, setActiveFlowId] = (0,
|
|
631
|
-
const [state, setState] = (0,
|
|
632
|
-
const [events, setEvents] = (0,
|
|
630
|
+
const storeRef = (0, import_react7.useRef)(null);
|
|
631
|
+
const unsubscribeRef = (0, import_react7.useRef)(null);
|
|
632
|
+
const stepHooksUnsubscribeRef = (0, import_react7.useRef)(null);
|
|
633
|
+
const fallbackStorageRef = (0, import_react7.useRef)(void 0);
|
|
634
|
+
const pendingResumeRef = (0, import_react7.useRef)(/* @__PURE__ */ new Set());
|
|
635
|
+
const autoStartRequestedRef = (0, import_react7.useRef)(null);
|
|
636
|
+
const [activeFlowId, setActiveFlowId] = (0, import_react7.useState)(null);
|
|
637
|
+
const [state, setState] = (0, import_react7.useState)(null);
|
|
638
|
+
const [events, setEvents] = (0, import_react7.useState)(
|
|
633
639
|
null
|
|
634
640
|
);
|
|
635
|
-
const [debugEnabled, setDebugEnabled] = (0,
|
|
636
|
-
const [delayInfo, setDelayInfo] = (0,
|
|
637
|
-
const teardownStore = (0,
|
|
641
|
+
const [debugEnabled, setDebugEnabled] = (0, import_react7.useState)(defaultDebug);
|
|
642
|
+
const [delayInfo, setDelayInfo] = (0, import_react7.useState)(null);
|
|
643
|
+
const teardownStore = (0, import_react7.useCallback)(() => {
|
|
638
644
|
unsubscribeRef.current?.();
|
|
639
645
|
unsubscribeRef.current = null;
|
|
640
646
|
stepHooksUnsubscribeRef.current?.();
|
|
@@ -644,7 +650,7 @@ var TourProvider = ({
|
|
|
644
650
|
setDelayInfo(null);
|
|
645
651
|
pendingResumeRef.current.clear();
|
|
646
652
|
}, []);
|
|
647
|
-
(0,
|
|
653
|
+
(0, import_react7.useEffect)(() => {
|
|
648
654
|
return () => {
|
|
649
655
|
teardownStore();
|
|
650
656
|
setState(null);
|
|
@@ -652,7 +658,7 @@ var TourProvider = ({
|
|
|
652
658
|
setActiveFlowId(null);
|
|
653
659
|
};
|
|
654
660
|
}, [teardownStore]);
|
|
655
|
-
(0,
|
|
661
|
+
(0, import_react7.useEffect)(() => {
|
|
656
662
|
if (!activeFlowId) return;
|
|
657
663
|
const definition = flowMap.get(activeFlowId);
|
|
658
664
|
if (!definition) {
|
|
@@ -675,7 +681,7 @@ var TourProvider = ({
|
|
|
675
681
|
console.warn(`[tour][step] ${phase} hook failed`, error);
|
|
676
682
|
}
|
|
677
683
|
};
|
|
678
|
-
const ensureStore = (0,
|
|
684
|
+
const ensureStore = (0, import_react7.useCallback)(
|
|
679
685
|
(flowId) => {
|
|
680
686
|
const existing = storeRef.current;
|
|
681
687
|
if (existing && existing.definition.id === flowId) {
|
|
@@ -689,9 +695,9 @@ var TourProvider = ({
|
|
|
689
695
|
if (!storageAdapter && !fallbackStorageRef.current && isBrowser) {
|
|
690
696
|
fallbackStorageRef.current = (0, import_core.createLocalStorageAdapter)();
|
|
691
697
|
}
|
|
692
|
-
const
|
|
698
|
+
const resolvedStorageAdapter2 = storageAdapter ? storageAdapter : fallbackStorageRef.current;
|
|
693
699
|
const store = (0, import_core.createFlowStore)(definition, {
|
|
694
|
-
storageAdapter:
|
|
700
|
+
storageAdapter: resolvedStorageAdapter2,
|
|
695
701
|
storageKey: storageNamespace ? `${storageNamespace}:${definition.id}` : void 0,
|
|
696
702
|
persistOnChange,
|
|
697
703
|
analytics,
|
|
@@ -734,7 +740,7 @@ var TourProvider = ({
|
|
|
734
740
|
teardownStore
|
|
735
741
|
]
|
|
736
742
|
);
|
|
737
|
-
const getActiveStore = (0,
|
|
743
|
+
const getActiveStore = (0, import_react7.useCallback)(() => {
|
|
738
744
|
const store = storeRef.current;
|
|
739
745
|
if (!store) {
|
|
740
746
|
throw new Error(
|
|
@@ -746,7 +752,7 @@ var TourProvider = ({
|
|
|
746
752
|
const isPromiseLike2 = (value) => {
|
|
747
753
|
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
748
754
|
};
|
|
749
|
-
const invokeStepHook = (0,
|
|
755
|
+
const invokeStepHook = (0, import_react7.useCallback)(
|
|
750
756
|
async (hook, context, phase) => {
|
|
751
757
|
if (!hook) return;
|
|
752
758
|
try {
|
|
@@ -760,7 +766,7 @@ var TourProvider = ({
|
|
|
760
766
|
},
|
|
761
767
|
[]
|
|
762
768
|
);
|
|
763
|
-
const runResumeHooks = (0,
|
|
769
|
+
const runResumeHooks = (0, import_react7.useCallback)(
|
|
764
770
|
async (definition, flowState, strategy) => {
|
|
765
771
|
if (flowState.status !== "running") return;
|
|
766
772
|
if (strategy === "current") {
|
|
@@ -800,13 +806,13 @@ var TourProvider = ({
|
|
|
800
806
|
},
|
|
801
807
|
[invokeStepHook]
|
|
802
808
|
);
|
|
803
|
-
const resolveResumeStrategy = (0,
|
|
809
|
+
const resolveResumeStrategy = (0, import_react7.useCallback)(
|
|
804
810
|
(definition, options) => {
|
|
805
811
|
return options?.resumeStrategy ?? definition.resumeStrategy ?? "chain";
|
|
806
812
|
},
|
|
807
813
|
[]
|
|
808
814
|
);
|
|
809
|
-
const startFlow = (0,
|
|
815
|
+
const startFlow = (0, import_react7.useCallback)(
|
|
810
816
|
(flowId, options) => {
|
|
811
817
|
const store = ensureStore(flowId);
|
|
812
818
|
const previousState = store.getState();
|
|
@@ -835,8 +841,8 @@ var TourProvider = ({
|
|
|
835
841
|
},
|
|
836
842
|
[ensureStore, resolveResumeStrategy, runResumeHooks]
|
|
837
843
|
);
|
|
838
|
-
const [eligibleFlows, setEligibleFlows] = (0,
|
|
839
|
-
(0,
|
|
844
|
+
const [eligibleFlows, setEligibleFlows] = (0, import_react7.useState)([]);
|
|
845
|
+
(0, import_react7.useEffect)(() => {
|
|
840
846
|
const autoStartFlows = flows.filter((f) => f.autoStart);
|
|
841
847
|
if (autoStartFlows.length === 0) {
|
|
842
848
|
setEligibleFlows([]);
|
|
@@ -845,8 +851,8 @@ var TourProvider = ({
|
|
|
845
851
|
if (!storageAdapter && !fallbackStorageRef.current && isBrowser) {
|
|
846
852
|
fallbackStorageRef.current = (0, import_core.createLocalStorageAdapter)();
|
|
847
853
|
}
|
|
848
|
-
const
|
|
849
|
-
if (!
|
|
854
|
+
const resolvedStorageAdapter2 = storageAdapter ?? fallbackStorageRef.current;
|
|
855
|
+
if (!resolvedStorageAdapter2) {
|
|
850
856
|
setEligibleFlows(
|
|
851
857
|
autoStartFlows.map((flow) => ({
|
|
852
858
|
flow,
|
|
@@ -863,7 +869,7 @@ var TourProvider = ({
|
|
|
863
869
|
);
|
|
864
870
|
const snapshots = await Promise.all(
|
|
865
871
|
storageKeys.map(
|
|
866
|
-
(key) => (0, import_core.resolveMaybePromise)(
|
|
872
|
+
(key) => (0, import_core.resolveMaybePromise)(resolvedStorageAdapter2.get(key))
|
|
867
873
|
)
|
|
868
874
|
);
|
|
869
875
|
if (cancelled) return;
|
|
@@ -900,7 +906,7 @@ var TourProvider = ({
|
|
|
900
906
|
cancelled = true;
|
|
901
907
|
};
|
|
902
908
|
}, [flows, storageAdapter, storageNamespace]);
|
|
903
|
-
(0,
|
|
909
|
+
(0, import_react7.useEffect)(() => {
|
|
904
910
|
if (eligibleFlows.length === 0) {
|
|
905
911
|
autoStartRequestedRef.current = null;
|
|
906
912
|
return;
|
|
@@ -935,14 +941,14 @@ var TourProvider = ({
|
|
|
935
941
|
}
|
|
936
942
|
};
|
|
937
943
|
}, [activeFlowId, eligibleFlows, startFlow]);
|
|
938
|
-
const next = (0,
|
|
939
|
-
const back = (0,
|
|
940
|
-
const goToStep = (0,
|
|
944
|
+
const next = (0, import_react7.useCallback)(() => getActiveStore().next(), [getActiveStore]);
|
|
945
|
+
const back = (0, import_react7.useCallback)(() => getActiveStore().back(), [getActiveStore]);
|
|
946
|
+
const goToStep = (0, import_react7.useCallback)(
|
|
941
947
|
(step) => getActiveStore().goToStep(step),
|
|
942
948
|
[getActiveStore]
|
|
943
949
|
);
|
|
944
|
-
const pause = (0,
|
|
945
|
-
const resume = (0,
|
|
950
|
+
const pause = (0, import_react7.useCallback)(() => getActiveStore().pause(), [getActiveStore]);
|
|
951
|
+
const resume = (0, import_react7.useCallback)(() => {
|
|
946
952
|
const store = getActiveStore();
|
|
947
953
|
const previousState = store.getState();
|
|
948
954
|
if (previousState.status === "paused") {
|
|
@@ -960,31 +966,31 @@ var TourProvider = ({
|
|
|
960
966
|
}
|
|
961
967
|
return result;
|
|
962
968
|
}, [getActiveStore, resolveResumeStrategy, runResumeHooks]);
|
|
963
|
-
const cancel = (0,
|
|
969
|
+
const cancel = (0, import_react7.useCallback)(
|
|
964
970
|
(reason) => getActiveStore().cancel(reason),
|
|
965
971
|
[getActiveStore]
|
|
966
972
|
);
|
|
967
|
-
const complete = (0,
|
|
973
|
+
const complete = (0, import_react7.useCallback)(
|
|
968
974
|
() => getActiveStore().complete(),
|
|
969
975
|
[getActiveStore]
|
|
970
976
|
);
|
|
971
|
-
const advanceStep = (0,
|
|
977
|
+
const advanceStep = (0, import_react7.useCallback)(
|
|
972
978
|
(stepId) => getActiveStore().advanceStep(stepId),
|
|
973
979
|
[getActiveStore]
|
|
974
980
|
);
|
|
975
|
-
const toggleDebug = (0,
|
|
981
|
+
const toggleDebug = (0, import_react7.useCallback)(() => {
|
|
976
982
|
setDebugEnabled((previous) => !previous);
|
|
977
983
|
}, []);
|
|
978
|
-
const activeStep = (0,
|
|
984
|
+
const activeStep = (0, import_react7.useMemo)(() => {
|
|
979
985
|
if (!state || !storeRef.current) return null;
|
|
980
986
|
if (state.stepIndex < 0) return null;
|
|
981
987
|
return storeRef.current.definition.steps[state.stepIndex] ?? null;
|
|
982
988
|
}, [state]);
|
|
983
|
-
const activeDialogConfig = (0,
|
|
989
|
+
const activeDialogConfig = (0, import_react7.useMemo)(() => {
|
|
984
990
|
if (!activeStep?.dialogId || !storeRef.current) return void 0;
|
|
985
991
|
return storeRef.current.definition.dialogs?.[activeStep.dialogId];
|
|
986
992
|
}, [activeStep]);
|
|
987
|
-
(0,
|
|
993
|
+
(0, import_react7.useEffect)(() => {
|
|
988
994
|
if (!activeFlowId) return;
|
|
989
995
|
if (!pendingResumeRef.current.has(activeFlowId)) return;
|
|
990
996
|
if (!state || state.status !== "running") return;
|
|
@@ -999,7 +1005,7 @@ var TourProvider = ({
|
|
|
999
1005
|
pendingResumeRef.current.delete(activeFlowId);
|
|
1000
1006
|
void runResumeHooks(definition, state, resumeStrategy);
|
|
1001
1007
|
}, [activeFlowId, flowMap, resolveResumeStrategy, runResumeHooks, state]);
|
|
1002
|
-
const contextValue = (0,
|
|
1008
|
+
const contextValue = (0, import_react7.useMemo)(
|
|
1003
1009
|
() => ({
|
|
1004
1010
|
flows: flowMap,
|
|
1005
1011
|
activeFlowId,
|
|
@@ -1054,7 +1060,59 @@ var TourProvider = ({
|
|
|
1054
1060
|
reducedMotionAdapter,
|
|
1055
1061
|
enabled: autoDetectReducedMotion
|
|
1056
1062
|
});
|
|
1057
|
-
|
|
1063
|
+
const resolvedStorageAdapter = (0, import_react7.useMemo)(() => {
|
|
1064
|
+
if (storageAdapter) return storageAdapter;
|
|
1065
|
+
return fallbackStorageRef.current ?? null;
|
|
1066
|
+
}, [storageAdapter]);
|
|
1067
|
+
const devToolsContextValue = (0, import_react7.useMemo)(() => {
|
|
1068
|
+
const getStorageKey = (flowId) => storageNamespace ? `${storageNamespace}:${flowId}` : `${DEFAULT_STORAGE_PREFIX}:${flowId}`;
|
|
1069
|
+
return {
|
|
1070
|
+
flows: flowMap,
|
|
1071
|
+
activeFlowId,
|
|
1072
|
+
state,
|
|
1073
|
+
storageAdapter: resolvedStorageAdapter,
|
|
1074
|
+
storageNamespace: storageNamespace ?? DEFAULT_STORAGE_PREFIX,
|
|
1075
|
+
cancelFlow: (flowId) => {
|
|
1076
|
+
if (activeFlowId === flowId && storeRef.current) {
|
|
1077
|
+
storeRef.current.cancel();
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
1080
|
+
deleteFlowStorage: async (flowId) => {
|
|
1081
|
+
if (!resolvedStorageAdapter) return;
|
|
1082
|
+
const key = getStorageKey(flowId);
|
|
1083
|
+
await (0, import_core.resolveMaybePromise)(resolvedStorageAdapter.remove(key));
|
|
1084
|
+
},
|
|
1085
|
+
updateFlowStorage: async (flowId, newState) => {
|
|
1086
|
+
if (!resolvedStorageAdapter) return;
|
|
1087
|
+
const key = getStorageKey(flowId);
|
|
1088
|
+
const definition = flowMap.get(flowId);
|
|
1089
|
+
if (!definition) return;
|
|
1090
|
+
await (0, import_core.resolveMaybePromise)(
|
|
1091
|
+
resolvedStorageAdapter.set(key, {
|
|
1092
|
+
version: newState.version,
|
|
1093
|
+
value: newState,
|
|
1094
|
+
updatedAt: Date.now()
|
|
1095
|
+
})
|
|
1096
|
+
);
|
|
1097
|
+
},
|
|
1098
|
+
getFlowState: async (flowId) => {
|
|
1099
|
+
if (!resolvedStorageAdapter) return null;
|
|
1100
|
+
const key = getStorageKey(flowId);
|
|
1101
|
+
const snapshot = await (0, import_core.resolveMaybePromise)(
|
|
1102
|
+
resolvedStorageAdapter.get(key)
|
|
1103
|
+
);
|
|
1104
|
+
if (!snapshot) return null;
|
|
1105
|
+
return snapshot.value;
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
}, [
|
|
1109
|
+
flowMap,
|
|
1110
|
+
activeFlowId,
|
|
1111
|
+
state,
|
|
1112
|
+
resolvedStorageAdapter,
|
|
1113
|
+
storageNamespace
|
|
1114
|
+
]);
|
|
1115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AnimationAdapterProvider, { adapter: resolvedAnimationAdapter, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LabelsProvider, { value: mergedLabels, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DialogRegistryProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TourContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(DevToolsContext.Provider, { value: devToolsContextValue, children: [
|
|
1058
1116
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1059
1117
|
DialogAutomationBridge,
|
|
1060
1118
|
{
|
|
@@ -1064,7 +1122,7 @@ var TourProvider = ({
|
|
|
1064
1122
|
}
|
|
1065
1123
|
),
|
|
1066
1124
|
children
|
|
1067
|
-
] }) }) }) });
|
|
1125
|
+
] }) }) }) }) });
|
|
1068
1126
|
};
|
|
1069
1127
|
var DialogAutomationBridge = ({
|
|
1070
1128
|
flow,
|
|
@@ -1088,7 +1146,7 @@ var DialogAutomationBridge = ({
|
|
|
1088
1146
|
return null;
|
|
1089
1147
|
};
|
|
1090
1148
|
var useTour = () => {
|
|
1091
|
-
const context = (0,
|
|
1149
|
+
const context = (0, import_react7.useContext)(TourContext);
|
|
1092
1150
|
if (!context) {
|
|
1093
1151
|
throw new Error("useTour must be used within a TourProvider");
|
|
1094
1152
|
}
|
|
@@ -1096,14 +1154,14 @@ var useTour = () => {
|
|
|
1096
1154
|
};
|
|
1097
1155
|
var useTourEvents = (event, handler) => {
|
|
1098
1156
|
const { events } = useTour();
|
|
1099
|
-
(0,
|
|
1157
|
+
(0, import_react7.useEffect)(() => {
|
|
1100
1158
|
if (!events) return;
|
|
1101
1159
|
return events.on(event, handler);
|
|
1102
1160
|
}, [event, events, handler]);
|
|
1103
1161
|
};
|
|
1104
1162
|
|
|
1105
1163
|
// src/hooks/useTourTarget.ts
|
|
1106
|
-
var
|
|
1164
|
+
var import_react8 = require("react");
|
|
1107
1165
|
|
|
1108
1166
|
// src/hooks/scrollMargin.ts
|
|
1109
1167
|
var DEFAULT_SCROLL_MARGIN = 16;
|
|
@@ -1406,12 +1464,12 @@ var resolveStepTarget = (target) => {
|
|
|
1406
1464
|
};
|
|
1407
1465
|
var useTourTarget = () => {
|
|
1408
1466
|
const { activeStep, state, activeFlowId, flows } = useTour();
|
|
1409
|
-
const [targetInfo, setTargetInfo] = (0,
|
|
1410
|
-
const autoScrollStateRef = (0,
|
|
1411
|
-
const autoScrollRafRef = (0,
|
|
1412
|
-
const autoScrollTimeoutRef = (0,
|
|
1413
|
-
const lastRectRef = (0,
|
|
1414
|
-
const initialScrollStepRef = (0,
|
|
1467
|
+
const [targetInfo, setTargetInfo] = (0, import_react8.useState)(INITIAL_TARGET_INFO);
|
|
1468
|
+
const autoScrollStateRef = (0, import_react8.useRef)({ stepId: null, checks: 0, stalledChecks: 0, done: false, lastRect: null });
|
|
1469
|
+
const autoScrollRafRef = (0, import_react8.useRef)(null);
|
|
1470
|
+
const autoScrollTimeoutRef = (0, import_react8.useRef)(null);
|
|
1471
|
+
const lastRectRef = (0, import_react8.useRef)(null);
|
|
1472
|
+
const initialScrollStepRef = (0, import_react8.useRef)(null);
|
|
1415
1473
|
const cancelAutoScrollLoop = () => {
|
|
1416
1474
|
if (!isBrowser) return;
|
|
1417
1475
|
if (autoScrollTimeoutRef.current !== null) {
|
|
@@ -1423,7 +1481,7 @@ var useTourTarget = () => {
|
|
|
1423
1481
|
autoScrollRafRef.current = null;
|
|
1424
1482
|
}
|
|
1425
1483
|
};
|
|
1426
|
-
(0,
|
|
1484
|
+
(0, import_react8.useEffect)(() => {
|
|
1427
1485
|
if (!activeStep) {
|
|
1428
1486
|
initialScrollStepRef.current = null;
|
|
1429
1487
|
}
|
|
@@ -1431,7 +1489,7 @@ var useTourTarget = () => {
|
|
|
1431
1489
|
initialScrollStepRef.current = null;
|
|
1432
1490
|
};
|
|
1433
1491
|
}, [activeStep?.id]);
|
|
1434
|
-
(0,
|
|
1492
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
1435
1493
|
if (!isBrowser) return;
|
|
1436
1494
|
if (!activeStep) return;
|
|
1437
1495
|
if (targetInfo.status !== "ready") return;
|
|
@@ -1463,7 +1521,7 @@ var useTourTarget = () => {
|
|
|
1463
1521
|
targetInfo.status,
|
|
1464
1522
|
targetInfo.rectSource
|
|
1465
1523
|
]);
|
|
1466
|
-
(0,
|
|
1524
|
+
(0, import_react8.useEffect)(() => {
|
|
1467
1525
|
if (!activeStep || !state || state.status !== "running") {
|
|
1468
1526
|
setTargetInfo(INITIAL_TARGET_INFO);
|
|
1469
1527
|
autoScrollStateRef.current = {
|
|
@@ -1786,7 +1844,7 @@ var useTourTarget = () => {
|
|
|
1786
1844
|
waitForPredicateController = null;
|
|
1787
1845
|
};
|
|
1788
1846
|
}, [activeStep, activeFlowId, flows, state]);
|
|
1789
|
-
(0,
|
|
1847
|
+
(0, import_react8.useEffect)(() => {
|
|
1790
1848
|
if (!isBrowser) return;
|
|
1791
1849
|
if (!activeStep) {
|
|
1792
1850
|
cancelAutoScrollLoop();
|
|
@@ -1867,10 +1925,10 @@ var useTourTarget = () => {
|
|
|
1867
1925
|
};
|
|
1868
1926
|
|
|
1869
1927
|
// src/hooks/useHudState.ts
|
|
1870
|
-
var
|
|
1928
|
+
var import_react13 = require("react");
|
|
1871
1929
|
|
|
1872
1930
|
// src/hooks/useAdvanceRules.ts
|
|
1873
|
-
var
|
|
1931
|
+
var import_react9 = require("react");
|
|
1874
1932
|
var DEFAULT_POLL_MS2 = 250;
|
|
1875
1933
|
var isListenerTarget = (value) => {
|
|
1876
1934
|
return !!value && typeof value.addEventListener === "function" && typeof value.removeEventListener === "function";
|
|
@@ -1909,7 +1967,7 @@ var useAdvanceRules = (target) => {
|
|
|
1909
1967
|
complete,
|
|
1910
1968
|
setDelayInfo
|
|
1911
1969
|
} = useTour();
|
|
1912
|
-
(0,
|
|
1970
|
+
(0, import_react9.useEffect)(() => {
|
|
1913
1971
|
if (!isBrowser) return;
|
|
1914
1972
|
if (!state || state.status !== "running") return;
|
|
1915
1973
|
if (!activeStep) return;
|
|
@@ -2080,7 +2138,7 @@ var useAdvanceRules = (target) => {
|
|
|
2080
2138
|
};
|
|
2081
2139
|
|
|
2082
2140
|
// src/hooks/useHiddenTargetFallback.ts
|
|
2083
|
-
var
|
|
2141
|
+
var import_react10 = require("react");
|
|
2084
2142
|
var DEFAULT_DELAY_MS = 900;
|
|
2085
2143
|
var DEFAULT_GRACE_PERIOD_MS = 400;
|
|
2086
2144
|
var useHiddenTargetFallback = ({
|
|
@@ -2089,11 +2147,11 @@ var useHiddenTargetFallback = ({
|
|
|
2089
2147
|
viewportRect,
|
|
2090
2148
|
onSkip
|
|
2091
2149
|
}) => {
|
|
2092
|
-
const [usingScreenFallback, setUsingScreenFallback] = (0,
|
|
2093
|
-
const [isInGracePeriod, setIsInGracePeriod] = (0,
|
|
2094
|
-
const timeoutRef = (0,
|
|
2095
|
-
const graceTimeoutRef = (0,
|
|
2096
|
-
const skipTriggeredRef = (0,
|
|
2150
|
+
const [usingScreenFallback, setUsingScreenFallback] = (0, import_react10.useState)(false);
|
|
2151
|
+
const [isInGracePeriod, setIsInGracePeriod] = (0, import_react10.useState)(false);
|
|
2152
|
+
const timeoutRef = (0, import_react10.useRef)(null);
|
|
2153
|
+
const graceTimeoutRef = (0, import_react10.useRef)(null);
|
|
2154
|
+
const skipTriggeredRef = (0, import_react10.useRef)(false);
|
|
2097
2155
|
const hiddenMode = step?.targetBehavior?.hidden ?? "screen";
|
|
2098
2156
|
const hiddenDelayMs = Math.max(
|
|
2099
2157
|
0,
|
|
@@ -2111,7 +2169,7 @@ var useHiddenTargetFallback = ({
|
|
|
2111
2169
|
graceTimeoutRef.current = null;
|
|
2112
2170
|
}
|
|
2113
2171
|
};
|
|
2114
|
-
(0,
|
|
2172
|
+
(0, import_react10.useEffect)(() => {
|
|
2115
2173
|
skipTriggeredRef.current = false;
|
|
2116
2174
|
setUsingScreenFallback(false);
|
|
2117
2175
|
setIsInGracePeriod(false);
|
|
@@ -2122,7 +2180,7 @@ var useHiddenTargetFallback = ({
|
|
|
2122
2180
|
clearGraceTimeout();
|
|
2123
2181
|
};
|
|
2124
2182
|
}, [step?.id]);
|
|
2125
|
-
(0,
|
|
2183
|
+
(0, import_react10.useEffect)(() => {
|
|
2126
2184
|
if (!isBrowser) return void 0;
|
|
2127
2185
|
if (!step) return void 0;
|
|
2128
2186
|
clearPendingTimeout();
|
|
@@ -2168,7 +2226,7 @@ var useHiddenTargetFallback = ({
|
|
|
2168
2226
|
hiddenDelayMs,
|
|
2169
2227
|
onSkip
|
|
2170
2228
|
]);
|
|
2171
|
-
const resolvedTarget = (0,
|
|
2229
|
+
const resolvedTarget = (0, import_react10.useMemo)(() => {
|
|
2172
2230
|
if (!usingScreenFallback) {
|
|
2173
2231
|
return target;
|
|
2174
2232
|
}
|
|
@@ -2190,7 +2248,7 @@ var useHiddenTargetFallback = ({
|
|
|
2190
2248
|
};
|
|
2191
2249
|
|
|
2192
2250
|
// src/hooks/useRouteMismatch.ts
|
|
2193
|
-
var
|
|
2251
|
+
var import_react11 = require("react");
|
|
2194
2252
|
|
|
2195
2253
|
// src/router/utils.ts
|
|
2196
2254
|
var ensurePrefix = (value, prefix) => value.startsWith(prefix) ? value : `${prefix}${value}`;
|
|
@@ -2237,8 +2295,8 @@ var createPathString = (pathname, search, hash) => {
|
|
|
2237
2295
|
|
|
2238
2296
|
// src/hooks/useRouteMismatch.ts
|
|
2239
2297
|
var useRouteMismatch = (step) => {
|
|
2240
|
-
const [currentPath, setCurrentPath] = (0,
|
|
2241
|
-
(0,
|
|
2298
|
+
const [currentPath, setCurrentPath] = (0, import_react11.useState)(() => getCurrentRoutePath());
|
|
2299
|
+
(0, import_react11.useEffect)(() => {
|
|
2242
2300
|
return subscribeToRouteChanges((path) => {
|
|
2243
2301
|
setCurrentPath(path);
|
|
2244
2302
|
});
|
|
@@ -2253,13 +2311,13 @@ var useRouteMismatch = (step) => {
|
|
|
2253
2311
|
};
|
|
2254
2312
|
|
|
2255
2313
|
// src/hooks/useViewportRect.ts
|
|
2256
|
-
var
|
|
2314
|
+
var import_react12 = require("react");
|
|
2257
2315
|
var useViewportRect = () => {
|
|
2258
|
-
const [viewport, setViewport] = (0,
|
|
2316
|
+
const [viewport, setViewport] = (0, import_react12.useState)(
|
|
2259
2317
|
() => getViewportRect()
|
|
2260
2318
|
);
|
|
2261
|
-
const rafRef = (0,
|
|
2262
|
-
(0,
|
|
2319
|
+
const rafRef = (0, import_react12.useRef)(null);
|
|
2320
|
+
(0, import_react12.useEffect)(() => {
|
|
2263
2321
|
if (!isBrowser) return;
|
|
2264
2322
|
const updateViewport = () => {
|
|
2265
2323
|
rafRef.current = null;
|
|
@@ -2301,12 +2359,12 @@ var normalizeFlowFilter = (value) => {
|
|
|
2301
2359
|
};
|
|
2302
2360
|
var useHudState = (options = {}) => {
|
|
2303
2361
|
const { flowId } = options;
|
|
2304
|
-
const flowFilter = (0,
|
|
2362
|
+
const flowFilter = (0, import_react13.useMemo)(() => normalizeFlowFilter(flowId), [flowId]);
|
|
2305
2363
|
const { state, activeStep, activeFlowId, flows, next, complete, pause, resume } = useTour();
|
|
2306
2364
|
const target = useTourTarget();
|
|
2307
2365
|
const viewportRect = useViewportRect();
|
|
2308
2366
|
useAdvanceRules(target);
|
|
2309
|
-
const matchesFlowFilter = (0,
|
|
2367
|
+
const matchesFlowFilter = (0, import_react13.useMemo)(() => {
|
|
2310
2368
|
if (!flowFilter || flowFilter.length === 0) return true;
|
|
2311
2369
|
if (!activeFlowId) return false;
|
|
2312
2370
|
return flowFilter.includes(activeFlowId);
|
|
@@ -2314,15 +2372,15 @@ var useHudState = (options = {}) => {
|
|
|
2314
2372
|
const isRunning = state?.status === "running";
|
|
2315
2373
|
const runningState = isRunning && matchesFlowFilter ? state : null;
|
|
2316
2374
|
const runningStep = runningState && activeStep ? activeStep : null;
|
|
2317
|
-
const [shouldRender, setShouldRender] = (0,
|
|
2375
|
+
const [shouldRender, setShouldRender] = (0, import_react13.useState)(
|
|
2318
2376
|
Boolean(runningStep)
|
|
2319
2377
|
);
|
|
2320
|
-
(0,
|
|
2378
|
+
(0, import_react13.useEffect)(() => {
|
|
2321
2379
|
if (runningStep) {
|
|
2322
2380
|
setShouldRender(true);
|
|
2323
2381
|
}
|
|
2324
2382
|
}, [runningStep?.id]);
|
|
2325
|
-
(0,
|
|
2383
|
+
(0, import_react13.useEffect)(() => {
|
|
2326
2384
|
if (!shouldRender) return;
|
|
2327
2385
|
if (runningStep) return;
|
|
2328
2386
|
if (target.status !== "idle") return;
|
|
@@ -2334,19 +2392,19 @@ var useHudState = (options = {}) => {
|
|
|
2334
2392
|
};
|
|
2335
2393
|
}, [runningStep, shouldRender, target.status]);
|
|
2336
2394
|
const { isRouteMismatch, currentPath } = useRouteMismatch(activeStep);
|
|
2337
|
-
const pausedForMissingTargetRef = (0,
|
|
2338
|
-
(0,
|
|
2395
|
+
const pausedForMissingTargetRef = (0, import_react13.useRef)(null);
|
|
2396
|
+
(0, import_react13.useEffect)(() => {
|
|
2339
2397
|
if (!isRouteMismatch) return;
|
|
2340
2398
|
if (!runningState || runningState.status !== "running") return;
|
|
2341
2399
|
pause();
|
|
2342
2400
|
}, [isRouteMismatch, runningState, pause]);
|
|
2343
|
-
(0,
|
|
2401
|
+
(0, import_react13.useEffect)(() => {
|
|
2344
2402
|
if (isRouteMismatch) return;
|
|
2345
2403
|
if (pausedForMissingTargetRef.current !== null) return;
|
|
2346
2404
|
if (!state || state.status !== "paused") return;
|
|
2347
2405
|
resume();
|
|
2348
2406
|
}, [isRouteMismatch, state, resume]);
|
|
2349
|
-
const skipHiddenStep = (0,
|
|
2407
|
+
const skipHiddenStep = (0, import_react13.useCallback)(() => {
|
|
2350
2408
|
if (!runningState || runningState.status !== "running") return;
|
|
2351
2409
|
if (!activeFlowId) return;
|
|
2352
2410
|
const flow = flows.get(activeFlowId);
|
|
@@ -2364,7 +2422,7 @@ var useHudState = (options = {}) => {
|
|
|
2364
2422
|
viewportRect,
|
|
2365
2423
|
onSkip: skipHiddenStep
|
|
2366
2424
|
});
|
|
2367
|
-
(0,
|
|
2425
|
+
(0, import_react13.useEffect)(() => {
|
|
2368
2426
|
if (isRouteMismatch) return;
|
|
2369
2427
|
if (activeStep?.route !== void 0) return;
|
|
2370
2428
|
if (isInGracePeriod) return;
|
|
@@ -2383,14 +2441,14 @@ var useHudState = (options = {}) => {
|
|
|
2383
2441
|
currentPath,
|
|
2384
2442
|
pause
|
|
2385
2443
|
]);
|
|
2386
|
-
(0,
|
|
2444
|
+
(0, import_react13.useEffect)(() => {
|
|
2387
2445
|
if (pausedForMissingTargetRef.current === null) return;
|
|
2388
2446
|
if (!state || state.status !== "paused") return;
|
|
2389
2447
|
if (currentPath === pausedForMissingTargetRef.current) return;
|
|
2390
2448
|
pausedForMissingTargetRef.current = null;
|
|
2391
2449
|
resume();
|
|
2392
2450
|
}, [currentPath, state, resume]);
|
|
2393
|
-
(0,
|
|
2451
|
+
(0, import_react13.useEffect)(() => {
|
|
2394
2452
|
pausedForMissingTargetRef.current = null;
|
|
2395
2453
|
}, [activeStep?.id]);
|
|
2396
2454
|
const canRenderStep = Boolean(runningStep && runningState);
|
|
@@ -2415,24 +2473,24 @@ var useHudState = (options = {}) => {
|
|
|
2415
2473
|
};
|
|
2416
2474
|
|
|
2417
2475
|
// src/hooks/useHudDescription.ts
|
|
2418
|
-
var
|
|
2476
|
+
var import_react14 = require("react");
|
|
2419
2477
|
var sanitizeForId = (value) => {
|
|
2420
2478
|
const normalized = value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
2421
2479
|
return normalized.length > 0 ? normalized : "step";
|
|
2422
2480
|
};
|
|
2423
2481
|
var useHudDescription = (options) => {
|
|
2424
2482
|
const { step, fallbackAriaDescribedBy } = options;
|
|
2425
|
-
const targetDescription = (0,
|
|
2483
|
+
const targetDescription = (0, import_react14.useMemo)(() => {
|
|
2426
2484
|
if (!step) return null;
|
|
2427
2485
|
if (typeof step.target !== "object") return null;
|
|
2428
2486
|
const description = step.target.description;
|
|
2429
2487
|
return typeof description === "string" ? description : null;
|
|
2430
2488
|
}, [step]);
|
|
2431
|
-
const descriptionId = (0,
|
|
2489
|
+
const descriptionId = (0, import_react14.useMemo)(() => {
|
|
2432
2490
|
if (!step || !targetDescription) return void 0;
|
|
2433
2491
|
return `tour-step-${sanitizeForId(step.id)}-description`;
|
|
2434
2492
|
}, [step, targetDescription]);
|
|
2435
|
-
const combinedAriaDescribedBy = (0,
|
|
2493
|
+
const combinedAriaDescribedBy = (0, import_react14.useMemo)(() => {
|
|
2436
2494
|
const parts = [fallbackAriaDescribedBy, descriptionId].filter(Boolean);
|
|
2437
2495
|
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
2438
2496
|
}, [descriptionId, fallbackAriaDescribedBy]);
|
|
@@ -2444,10 +2502,10 @@ var useHudDescription = (options) => {
|
|
|
2444
2502
|
};
|
|
2445
2503
|
|
|
2446
2504
|
// src/hooks/useHudShortcuts.ts
|
|
2447
|
-
var
|
|
2505
|
+
var import_react16 = require("react");
|
|
2448
2506
|
|
|
2449
2507
|
// src/hooks/useTourControls.ts
|
|
2450
|
-
var
|
|
2508
|
+
var import_react15 = require("react");
|
|
2451
2509
|
var hasManualAdvance = (rules) => rules.some((rule) => rule.type === "manual");
|
|
2452
2510
|
var didPreviousAdvanceViaRoute = (rules) => rules.some((rule) => rule.type === "route");
|
|
2453
2511
|
var useTourControls = () => {
|
|
@@ -2462,7 +2520,7 @@ var useTourControls = () => {
|
|
|
2462
2520
|
flows,
|
|
2463
2521
|
activeStep
|
|
2464
2522
|
} = tour;
|
|
2465
|
-
const computed = (0,
|
|
2523
|
+
const computed = (0, import_react15.useMemo)(() => {
|
|
2466
2524
|
if (!state || state.status !== "running" || !activeStep) {
|
|
2467
2525
|
return {
|
|
2468
2526
|
isActive: false,
|
|
@@ -2511,11 +2569,11 @@ var useTourControls = () => {
|
|
|
2511
2569
|
} = computed;
|
|
2512
2570
|
const canGoBack = showBackButton && !backDisabled;
|
|
2513
2571
|
const canGoNext = showNextButton && !nextDisabled;
|
|
2514
|
-
const goBack = (0,
|
|
2572
|
+
const goBack = (0, import_react15.useCallback)(() => {
|
|
2515
2573
|
if (!canGoBack) return;
|
|
2516
2574
|
back();
|
|
2517
2575
|
}, [back, canGoBack]);
|
|
2518
|
-
const goNext = (0,
|
|
2576
|
+
const goNext = (0, import_react15.useCallback)(() => {
|
|
2519
2577
|
if (!canGoNext) return;
|
|
2520
2578
|
if (isLast) {
|
|
2521
2579
|
complete();
|
|
@@ -2523,7 +2581,7 @@ var useTourControls = () => {
|
|
|
2523
2581
|
next();
|
|
2524
2582
|
}
|
|
2525
2583
|
}, [canGoNext, complete, isLast, next]);
|
|
2526
|
-
return (0,
|
|
2584
|
+
return (0, import_react15.useMemo)(
|
|
2527
2585
|
() => ({
|
|
2528
2586
|
showBackButton,
|
|
2529
2587
|
backDisabled,
|
|
@@ -2568,7 +2626,7 @@ var useHudShortcuts = (target, options) => {
|
|
|
2568
2626
|
const escapeEnabled = options?.escape ?? true;
|
|
2569
2627
|
const { state } = useTour();
|
|
2570
2628
|
const { cancel, canGoBack, goBack, canGoNext, goNext, isActive } = useTourControls();
|
|
2571
|
-
(0,
|
|
2629
|
+
(0, import_react16.useEffect)(() => {
|
|
2572
2630
|
if (!isBrowser) return void 0;
|
|
2573
2631
|
if (!enabled) return void 0;
|
|
2574
2632
|
if (!target) return void 0;
|
|
@@ -2632,10 +2690,10 @@ var useHudShortcuts = (target, options) => {
|
|
|
2632
2690
|
};
|
|
2633
2691
|
|
|
2634
2692
|
// src/hooks/useTourHud.ts
|
|
2635
|
-
var
|
|
2693
|
+
var import_react19 = require("react");
|
|
2636
2694
|
|
|
2637
2695
|
// src/hooks/useBodyScrollLock.ts
|
|
2638
|
-
var
|
|
2696
|
+
var import_react17 = require("react");
|
|
2639
2697
|
var lockCount = 0;
|
|
2640
2698
|
var previousOverflow = null;
|
|
2641
2699
|
var acquireLock = () => {
|
|
@@ -2656,7 +2714,7 @@ var releaseLock = () => {
|
|
|
2656
2714
|
}
|
|
2657
2715
|
};
|
|
2658
2716
|
var useBodyScrollLock = (enabled) => {
|
|
2659
|
-
(0,
|
|
2717
|
+
(0, import_react17.useEffect)(() => {
|
|
2660
2718
|
if (!enabled) return;
|
|
2661
2719
|
acquireLock();
|
|
2662
2720
|
return () => {
|
|
@@ -2666,7 +2724,7 @@ var useBodyScrollLock = (enabled) => {
|
|
|
2666
2724
|
};
|
|
2667
2725
|
|
|
2668
2726
|
// src/hooks/useHudTargetIssue.ts
|
|
2669
|
-
var
|
|
2727
|
+
var import_react18 = require("react");
|
|
2670
2728
|
var deriveTargetIssue = (params) => {
|
|
2671
2729
|
const { target, labels } = params;
|
|
2672
2730
|
if (target.isScreen) return null;
|
|
@@ -2699,12 +2757,12 @@ var deriveTargetIssue = (params) => {
|
|
|
2699
2757
|
var useHudTargetIssue = (target, options) => {
|
|
2700
2758
|
const labels = useTourLabels();
|
|
2701
2759
|
const delayMs = Math.max(0, options?.delayMs ?? 500);
|
|
2702
|
-
const [armed, setArmed] = (0,
|
|
2703
|
-
const rawIssue = (0,
|
|
2760
|
+
const [armed, setArmed] = (0, import_react18.useState)(false);
|
|
2761
|
+
const rawIssue = (0, import_react18.useMemo)(
|
|
2704
2762
|
() => deriveTargetIssue({ target, labels }),
|
|
2705
2763
|
[target.isScreen, target.rectSource, target.status, target.visibility, labels]
|
|
2706
2764
|
);
|
|
2707
|
-
(0,
|
|
2765
|
+
(0, import_react18.useEffect)(() => {
|
|
2708
2766
|
if (!rawIssue) {
|
|
2709
2767
|
setArmed(false);
|
|
2710
2768
|
return;
|
|
@@ -2738,7 +2796,7 @@ var useTourHud = (options = {}) => {
|
|
|
2738
2796
|
const { backdropInteraction, lockBodyScroll } = useTour();
|
|
2739
2797
|
const hudState = useHudState();
|
|
2740
2798
|
const disableDefaultHud = hudState.hudRenderMode === "none";
|
|
2741
|
-
const [popoverNode, setPopoverNode] = (0,
|
|
2799
|
+
const [popoverNode, setPopoverNode] = (0, import_react19.useState)(null);
|
|
2742
2800
|
const popoverOptions = hudState.flowHudOptions?.popover;
|
|
2743
2801
|
const description = useHudDescription({
|
|
2744
2802
|
step: hudState.runningStep,
|
|
@@ -2762,7 +2820,7 @@ var useTourHud = (options = {}) => {
|
|
|
2762
2820
|
radius: overlayRadius,
|
|
2763
2821
|
interactionMode: hudState.flowHudOptions?.backdrop?.interaction ?? backdropInteraction
|
|
2764
2822
|
};
|
|
2765
|
-
const popover = (0,
|
|
2823
|
+
const popover = (0, import_react19.useMemo)(() => {
|
|
2766
2824
|
return {
|
|
2767
2825
|
offset: popoverOptions?.offset ?? 32,
|
|
2768
2826
|
role: popoverOptions?.role ?? "dialog",
|
|
@@ -2774,13 +2832,13 @@ var useTourHud = (options = {}) => {
|
|
|
2774
2832
|
placement: hudState.runningStep?.placement
|
|
2775
2833
|
};
|
|
2776
2834
|
}, [hudState.runningStep?.placement, popoverOptions]);
|
|
2777
|
-
const descriptionResult = (0,
|
|
2835
|
+
const descriptionResult = (0, import_react19.useMemo)(() => {
|
|
2778
2836
|
return {
|
|
2779
2837
|
...description,
|
|
2780
2838
|
text: description.targetDescription
|
|
2781
2839
|
};
|
|
2782
2840
|
}, [description]);
|
|
2783
|
-
const focusManager = (0,
|
|
2841
|
+
const focusManager = (0, import_react19.useMemo)(
|
|
2784
2842
|
() => ({
|
|
2785
2843
|
active: hudState.focusTrapActive,
|
|
2786
2844
|
target: hudState.hudTarget,
|
|
@@ -2810,7 +2868,7 @@ var useTourHud = (options = {}) => {
|
|
|
2810
2868
|
};
|
|
2811
2869
|
|
|
2812
2870
|
// src/hooks/useTourOverlay.ts
|
|
2813
|
-
var
|
|
2871
|
+
var import_react20 = require("react");
|
|
2814
2872
|
var DEFAULT_PADDING = 12;
|
|
2815
2873
|
var DEFAULT_RADIUS = 12;
|
|
2816
2874
|
var DEFAULT_EDGE_BUFFER = 0;
|
|
@@ -2823,9 +2881,9 @@ var useTourOverlay = (options) => {
|
|
|
2823
2881
|
interactionMode = "passthrough",
|
|
2824
2882
|
isInGracePeriod = false
|
|
2825
2883
|
} = options;
|
|
2826
|
-
const hasShownRef = (0,
|
|
2827
|
-
const lastReadyTargetRef = (0,
|
|
2828
|
-
(0,
|
|
2884
|
+
const hasShownRef = (0, import_react20.useRef)(false);
|
|
2885
|
+
const lastReadyTargetRef = (0, import_react20.useRef)(null);
|
|
2886
|
+
(0, import_react20.useEffect)(() => {
|
|
2829
2887
|
if (!isBrowser) return;
|
|
2830
2888
|
if (target.status === "ready") {
|
|
2831
2889
|
hasShownRef.current = true;
|
|
@@ -2875,15 +2933,15 @@ var useTourOverlay = (options) => {
|
|
|
2875
2933
|
height: highlightHeight,
|
|
2876
2934
|
radius: highlightRadius
|
|
2877
2935
|
} : null;
|
|
2878
|
-
const maskCapable = (0,
|
|
2936
|
+
const maskCapable = (0, import_react20.useMemo)(() => supportsMasking(), []);
|
|
2879
2937
|
const isActive = target.status === "ready" || target.status === "resolving" && cachedTarget !== null || isInGracePeriod;
|
|
2880
2938
|
const shouldMask = maskCapable && isActive;
|
|
2881
|
-
const maskId = (0,
|
|
2939
|
+
const maskId = (0, import_react20.useMemo)(
|
|
2882
2940
|
() => `tour-overlay-mask-${Math.random().toString(36).slice(2, 10)}`,
|
|
2883
2941
|
[]
|
|
2884
2942
|
);
|
|
2885
2943
|
const maskUrl = shouldMask ? `url(#${maskId})` : void 0;
|
|
2886
|
-
const fallbackSegments = (0,
|
|
2944
|
+
const fallbackSegments = (0, import_react20.useMemo)(() => {
|
|
2887
2945
|
if (!isActive || shouldMask || !hasHighlightBounds || !highlightRect) {
|
|
2888
2946
|
return null;
|
|
2889
2947
|
}
|
|
@@ -2936,7 +2994,7 @@ var useTourOverlay = (options) => {
|
|
|
2936
2994
|
viewport.height,
|
|
2937
2995
|
viewport.width
|
|
2938
2996
|
]);
|
|
2939
|
-
const blockerSegments = (0,
|
|
2997
|
+
const blockerSegments = (0, import_react20.useMemo)(() => {
|
|
2940
2998
|
if (interactionMode !== "block") {
|
|
2941
2999
|
return null;
|
|
2942
3000
|
}
|
|
@@ -3066,7 +3124,7 @@ var waitForDom = () => new Promise(
|
|
|
3066
3124
|
);
|
|
3067
3125
|
|
|
3068
3126
|
// src/hooks/useRadixTourDialog.ts
|
|
3069
|
-
var
|
|
3127
|
+
var import_react21 = require("react");
|
|
3070
3128
|
var resolveAutoOpen2 = (config) => {
|
|
3071
3129
|
if (!config) return { onEnter: true, onResume: true };
|
|
3072
3130
|
const { autoOpen } = config;
|
|
@@ -3084,27 +3142,27 @@ var useRadixTourDialog = (params) => {
|
|
|
3084
3142
|
const { activeFlowId, state, flows, goToStep, events } = useTour();
|
|
3085
3143
|
const registry = useDialogRegistryOptional();
|
|
3086
3144
|
const { suspendExternalFocusTrap } = useTourFocusDominance();
|
|
3087
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3088
|
-
const lastStepIndexRef = (0,
|
|
3089
|
-
const isResumeRef = (0,
|
|
3145
|
+
const [internalOpen, setInternalOpen] = (0, import_react21.useState)(false);
|
|
3146
|
+
const lastStepIndexRef = (0, import_react21.useRef)(-1);
|
|
3147
|
+
const isResumeRef = (0, import_react21.useRef)(false);
|
|
3090
3148
|
const flow = activeFlowId ? flows.get(activeFlowId) : void 0;
|
|
3091
3149
|
const dialogConfig = flow?.dialogs?.[dialogId];
|
|
3092
3150
|
const currentStep = flow && state && state.stepIndex >= 0 ? flow.steps[state.stepIndex] : void 0;
|
|
3093
3151
|
const isStepActive = currentStep?.dialogId === dialogId;
|
|
3094
3152
|
const autoOpenConfig = resolveAutoOpen2(dialogConfig);
|
|
3095
3153
|
const autoClose = dialogConfig?.autoClose ?? "differentDialog";
|
|
3096
|
-
const shouldBeOpen = (0,
|
|
3154
|
+
const shouldBeOpen = (0, import_react21.useMemo)(() => {
|
|
3097
3155
|
if (!isStepActive) return false;
|
|
3098
3156
|
return true;
|
|
3099
3157
|
}, [isStepActive]);
|
|
3100
|
-
(0,
|
|
3158
|
+
(0, import_react21.useEffect)(() => {
|
|
3101
3159
|
if (!events) return;
|
|
3102
3160
|
const unsubscribe = events.on("flowResume", () => {
|
|
3103
3161
|
isResumeRef.current = true;
|
|
3104
3162
|
});
|
|
3105
3163
|
return unsubscribe;
|
|
3106
3164
|
}, [events]);
|
|
3107
|
-
(0,
|
|
3165
|
+
(0, import_react21.useEffect)(() => {
|
|
3108
3166
|
if (!state || state.status !== "running") return;
|
|
3109
3167
|
if (!flow) return;
|
|
3110
3168
|
const currentStepIndex = state.stepIndex;
|
|
@@ -3145,7 +3203,7 @@ var useRadixTourDialog = (params) => {
|
|
|
3145
3203
|
autoOpenConfig.onResume,
|
|
3146
3204
|
autoClose
|
|
3147
3205
|
]);
|
|
3148
|
-
(0,
|
|
3206
|
+
(0, import_react21.useEffect)(() => {
|
|
3149
3207
|
if (!events) return;
|
|
3150
3208
|
const unsubscribeEnter = events.on("stepEnter", (payload) => {
|
|
3151
3209
|
const step = payload.currentStep;
|
|
@@ -3176,12 +3234,12 @@ var useRadixTourDialog = (params) => {
|
|
|
3176
3234
|
unsubscribeExit();
|
|
3177
3235
|
};
|
|
3178
3236
|
}, [events, dialogId, autoOpenConfig, autoClose]);
|
|
3179
|
-
const handleDismiss = (0,
|
|
3237
|
+
const handleDismiss = (0, import_react21.useCallback)(() => {
|
|
3180
3238
|
if (!dialogConfig) return;
|
|
3181
3239
|
setInternalOpen(false);
|
|
3182
3240
|
goToStep(dialogConfig.onDismissGoToStepId);
|
|
3183
3241
|
}, [dialogConfig, goToStep]);
|
|
3184
|
-
const onOpenChange = (0,
|
|
3242
|
+
const onOpenChange = (0, import_react21.useCallback)(
|
|
3185
3243
|
(open) => {
|
|
3186
3244
|
if (open) {
|
|
3187
3245
|
setInternalOpen(true);
|
|
@@ -3195,7 +3253,7 @@ var useRadixTourDialog = (params) => {
|
|
|
3195
3253
|
},
|
|
3196
3254
|
[isStepActive, dialogConfig, handleDismiss]
|
|
3197
3255
|
);
|
|
3198
|
-
(0,
|
|
3256
|
+
(0, import_react21.useEffect)(() => {
|
|
3199
3257
|
if (!registry) return;
|
|
3200
3258
|
const controller = {
|
|
3201
3259
|
open: () => setInternalOpen(true),
|
|
@@ -3205,7 +3263,7 @@ var useRadixTourDialog = (params) => {
|
|
|
3205
3263
|
registry.register(dialogId, controller);
|
|
3206
3264
|
return () => registry.unregister(dialogId);
|
|
3207
3265
|
}, [registry, dialogId, internalOpen]);
|
|
3208
|
-
const preventDismiss = (0,
|
|
3266
|
+
const preventDismiss = (0, import_react21.useCallback)(
|
|
3209
3267
|
(event) => {
|
|
3210
3268
|
if (suspendExternalFocusTrap) {
|
|
3211
3269
|
event.preventDefault();
|
|
@@ -3213,7 +3271,7 @@ var useRadixTourDialog = (params) => {
|
|
|
3213
3271
|
},
|
|
3214
3272
|
[suspendExternalFocusTrap]
|
|
3215
3273
|
);
|
|
3216
|
-
const handleEscapeKeyDown = (0,
|
|
3274
|
+
const handleEscapeKeyDown = (0, import_react21.useCallback)(
|
|
3217
3275
|
(event) => {
|
|
3218
3276
|
if (isStepActive && dialogConfig) {
|
|
3219
3277
|
event.preventDefault();
|
|
@@ -3222,7 +3280,7 @@ var useRadixTourDialog = (params) => {
|
|
|
3222
3280
|
},
|
|
3223
3281
|
[isStepActive, dialogConfig, handleDismiss]
|
|
3224
3282
|
);
|
|
3225
|
-
const handleInteractOutside = (0,
|
|
3283
|
+
const handleInteractOutside = (0, import_react21.useCallback)(
|
|
3226
3284
|
(event) => {
|
|
3227
3285
|
if (suspendExternalFocusTrap) {
|
|
3228
3286
|
event.preventDefault();
|
|
@@ -3254,12 +3312,12 @@ var useRadixTourDialog = (params) => {
|
|
|
3254
3312
|
};
|
|
3255
3313
|
|
|
3256
3314
|
// src/hooks/useDelayAdvance.ts
|
|
3257
|
-
var
|
|
3315
|
+
var import_react22 = require("react");
|
|
3258
3316
|
var getTimestamp = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
3259
3317
|
var useDelayAdvance = () => {
|
|
3260
3318
|
const { delayInfo, activeStep, state } = useTour();
|
|
3261
|
-
const [now, setNow] = (0,
|
|
3262
|
-
(0,
|
|
3319
|
+
const [now, setNow] = (0, import_react22.useState)(() => getTimestamp());
|
|
3320
|
+
(0, import_react22.useEffect)(() => {
|
|
3263
3321
|
if (!delayInfo) return;
|
|
3264
3322
|
if (!activeStep || activeStep.id !== delayInfo.stepId) return;
|
|
3265
3323
|
if (!state || state.status !== "running") return;
|
|
@@ -3276,12 +3334,12 @@ var useDelayAdvance = () => {
|
|
|
3276
3334
|
}
|
|
3277
3335
|
};
|
|
3278
3336
|
}, [delayInfo, activeStep, state]);
|
|
3279
|
-
(0,
|
|
3337
|
+
(0, import_react22.useEffect)(() => {
|
|
3280
3338
|
if (!delayInfo) {
|
|
3281
3339
|
setNow(getTimestamp());
|
|
3282
3340
|
}
|
|
3283
3341
|
}, [delayInfo]);
|
|
3284
|
-
return (0,
|
|
3342
|
+
return (0, import_react22.useMemo)(() => {
|
|
3285
3343
|
const matchingStep = !!delayInfo && !!activeStep && activeStep.id === delayInfo.stepId;
|
|
3286
3344
|
const isRunning = matchingStep && state?.status === "running";
|
|
3287
3345
|
if (!delayInfo) {
|
|
@@ -3334,9 +3392,9 @@ var useDelayAdvance = () => {
|
|
|
3334
3392
|
};
|
|
3335
3393
|
|
|
3336
3394
|
// src/components/OverlayBackdrop.tsx
|
|
3337
|
-
var
|
|
3395
|
+
var import_react23 = require("react");
|
|
3338
3396
|
var import_react_dom = require("react-dom");
|
|
3339
|
-
var
|
|
3397
|
+
var import_react24 = require("motion/react");
|
|
3340
3398
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3341
3399
|
var styles = {
|
|
3342
3400
|
root: {
|
|
@@ -3423,9 +3481,9 @@ var OverlayBackdrop = ({
|
|
|
3423
3481
|
viewport
|
|
3424
3482
|
} = overlay;
|
|
3425
3483
|
const hasHighlightBounds = Boolean(highlight.rect);
|
|
3426
|
-
const prevScreenTargetRef = (0,
|
|
3484
|
+
const prevScreenTargetRef = (0, import_react23.useRef)(null);
|
|
3427
3485
|
const shouldSnapHighlight = prevScreenTargetRef.current === true && !highlight.isScreen && hasHighlightBounds;
|
|
3428
|
-
(0,
|
|
3486
|
+
(0, import_react23.useEffect)(() => {
|
|
3429
3487
|
prevScreenTargetRef.current = highlight.isScreen;
|
|
3430
3488
|
}, [highlight.isScreen]);
|
|
3431
3489
|
const resolvedBlur = typeof blurAmount === "number" ? `${blurAmount}px` : "0px";
|
|
@@ -3493,7 +3551,7 @@ var OverlayBackdrop = ({
|
|
|
3493
3551
|
"aria-hidden": ariaHidden,
|
|
3494
3552
|
"data-tour-overlay": "",
|
|
3495
3553
|
children: [
|
|
3496
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.AnimatePresence, { mode: "popLayout", children: shouldMask ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3497
3555
|
MotionSvg,
|
|
3498
3556
|
{
|
|
3499
3557
|
width: "0",
|
|
@@ -3552,7 +3610,7 @@ var OverlayBackdrop = ({
|
|
|
3552
3610
|
},
|
|
3553
3611
|
"tour-mask"
|
|
3554
3612
|
) : null }),
|
|
3555
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3613
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.AnimatePresence, { mode: "popLayout", children: showBaseOverlay ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3556
3614
|
MotionDiv,
|
|
3557
3615
|
{
|
|
3558
3616
|
className: overlayClassName,
|
|
@@ -3580,7 +3638,7 @@ var OverlayBackdrop = ({
|
|
|
3580
3638
|
},
|
|
3581
3639
|
"tour-overlay"
|
|
3582
3640
|
) : null }),
|
|
3583
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.AnimatePresence, { mode: "popLayout", children: fallbackSegments ? fallbackSegments.map((segment) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3584
3642
|
MotionDiv,
|
|
3585
3643
|
{
|
|
3586
3644
|
className: segmentClassName,
|
|
@@ -3631,7 +3689,7 @@ var OverlayBackdrop = ({
|
|
|
3631
3689
|
))
|
|
3632
3690
|
}
|
|
3633
3691
|
) : null,
|
|
3634
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3692
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.AnimatePresence, { mode: "popLayout", children: showHighlightRing && isActive && hasHighlightBounds ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3635
3693
|
MotionDiv,
|
|
3636
3694
|
{
|
|
3637
3695
|
className: ringClassName,
|
|
@@ -3662,7 +3720,7 @@ var OverlayBackdrop = ({
|
|
|
3662
3720
|
};
|
|
3663
3721
|
|
|
3664
3722
|
// src/components/TourPopoverPortal.tsx
|
|
3665
|
-
var
|
|
3723
|
+
var import_react25 = require("react");
|
|
3666
3724
|
var import_react_dom2 = require("react-dom");
|
|
3667
3725
|
var import_dom13 = require("@floating-ui/dom");
|
|
3668
3726
|
var FLOATING_OFFSET = 8;
|
|
@@ -3723,12 +3781,12 @@ var TourPopoverPortal = ({
|
|
|
3723
3781
|
const popoverContentTransition = transitionsOverride?.popoverContent ?? adapter.transitions.popoverContent ?? DEFAULT_POPOVER_CONTENT_TRANSITION;
|
|
3724
3782
|
const viewport = useViewportRect();
|
|
3725
3783
|
const prefersMobileLayout = viewport.width <= MOBILE_BREAKPOINT || viewport.height <= MOBILE_HEIGHT_BREAKPOINT;
|
|
3726
|
-
const prefersMobileRef = (0,
|
|
3727
|
-
(0,
|
|
3784
|
+
const prefersMobileRef = (0, import_react25.useRef)(prefersMobileLayout);
|
|
3785
|
+
(0, import_react25.useEffect)(() => {
|
|
3728
3786
|
prefersMobileRef.current = prefersMobileLayout;
|
|
3729
3787
|
}, [prefersMobileLayout]);
|
|
3730
|
-
const lastReadyTargetRef = (0,
|
|
3731
|
-
(0,
|
|
3788
|
+
const lastReadyTargetRef = (0, import_react25.useRef)(null);
|
|
3789
|
+
(0, import_react25.useEffect)(() => {
|
|
3732
3790
|
if (target.status === "ready" && target.rect) {
|
|
3733
3791
|
lastReadyTargetRef.current = {
|
|
3734
3792
|
rect: { ...target.rect },
|
|
@@ -3744,7 +3802,7 @@ var TourPopoverPortal = ({
|
|
|
3744
3802
|
const shouldHidePopover = !resolvedRect && !target.isScreen;
|
|
3745
3803
|
const fallbackRect = resolvedRect ?? viewport;
|
|
3746
3804
|
const fallbackIsScreen = resolvedIsScreen;
|
|
3747
|
-
const [floatingSize, setFloatingSize] = (0,
|
|
3805
|
+
const [floatingSize, setFloatingSize] = (0, import_react25.useState)(null);
|
|
3748
3806
|
const clampVertical = (value) => Math.min(viewport.height - 24, Math.max(24, value));
|
|
3749
3807
|
const clampHorizontal = (value) => Math.min(viewport.width - 24, Math.max(24, value));
|
|
3750
3808
|
const screenCenteredTop = viewport.height / 2 - (floatingSize?.height ?? 0) / 2;
|
|
@@ -3755,7 +3813,7 @@ var TourPopoverPortal = ({
|
|
|
3755
3813
|
const leftBase = fallbackIsScreen ? screenCenteredLeft : fallbackRect.left + fallbackRect.width / 2 - floatingWidth / 2;
|
|
3756
3814
|
const left = clampHorizontal(leftBase);
|
|
3757
3815
|
const fallbackTransform = "translate3d(0px, 0px, 0px)";
|
|
3758
|
-
const fallbackPosition = (0,
|
|
3816
|
+
const fallbackPosition = (0, import_react25.useMemo)(
|
|
3759
3817
|
() => ({
|
|
3760
3818
|
top,
|
|
3761
3819
|
left,
|
|
@@ -3763,7 +3821,7 @@ var TourPopoverPortal = ({
|
|
|
3763
3821
|
}),
|
|
3764
3822
|
[fallbackTransform, left, top]
|
|
3765
3823
|
);
|
|
3766
|
-
const centerInitialPosition = (0,
|
|
3824
|
+
const centerInitialPosition = (0, import_react25.useMemo)(
|
|
3767
3825
|
() => ({
|
|
3768
3826
|
top: viewport.height / 2,
|
|
3769
3827
|
left: viewport.width / 2,
|
|
@@ -3771,23 +3829,23 @@ var TourPopoverPortal = ({
|
|
|
3771
3829
|
}),
|
|
3772
3830
|
[viewport.height, viewport.width]
|
|
3773
3831
|
);
|
|
3774
|
-
const floatingRef = (0,
|
|
3775
|
-
const cachedFloatingPositionRef = (0,
|
|
3776
|
-
const appliedFloatingCacheRef = (0,
|
|
3777
|
-
const deferredScreenSnapRef = (0,
|
|
3778
|
-
const [layoutMode, setLayoutMode] = (0,
|
|
3832
|
+
const floatingRef = (0, import_react25.useRef)(null);
|
|
3833
|
+
const cachedFloatingPositionRef = (0, import_react25.useRef)(null);
|
|
3834
|
+
const appliedFloatingCacheRef = (0, import_react25.useRef)(null);
|
|
3835
|
+
const deferredScreenSnapRef = (0, import_react25.useRef)(null);
|
|
3836
|
+
const [layoutMode, setLayoutMode] = (0, import_react25.useState)(
|
|
3779
3837
|
() => prefersMobileLayout ? "mobile" : "floating"
|
|
3780
3838
|
);
|
|
3781
|
-
const [floatingPosition, setFloatingPosition] = (0,
|
|
3782
|
-
const [dragPosition, setDragPosition] = (0,
|
|
3783
|
-
const [isDragging, setIsDragging] = (0,
|
|
3784
|
-
const dragStateRef = (0,
|
|
3785
|
-
const overflowRetryRef = (0,
|
|
3839
|
+
const [floatingPosition, setFloatingPosition] = (0, import_react25.useState)(fallbackPosition);
|
|
3840
|
+
const [dragPosition, setDragPosition] = (0, import_react25.useState)(null);
|
|
3841
|
+
const [isDragging, setIsDragging] = (0, import_react25.useState)(false);
|
|
3842
|
+
const dragStateRef = (0, import_react25.useRef)(null);
|
|
3843
|
+
const overflowRetryRef = (0, import_react25.useRef)({
|
|
3786
3844
|
stepId: null,
|
|
3787
3845
|
attempts: 0
|
|
3788
3846
|
});
|
|
3789
|
-
const overflowRetryTimeoutRef = (0,
|
|
3790
|
-
(0,
|
|
3847
|
+
const overflowRetryTimeoutRef = (0, import_react25.useRef)(null);
|
|
3848
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
3791
3849
|
if (!isBrowser) return;
|
|
3792
3850
|
const node = floatingRef.current;
|
|
3793
3851
|
if (!node) return;
|
|
@@ -3806,25 +3864,25 @@ var TourPopoverPortal = ({
|
|
|
3806
3864
|
const autoAlignment = resolvedPlacement.endsWith(
|
|
3807
3865
|
"-start"
|
|
3808
3866
|
) ? "start" : resolvedPlacement.endsWith("-end") ? "end" : void 0;
|
|
3809
|
-
(0,
|
|
3867
|
+
(0, import_react25.useEffect)(() => {
|
|
3810
3868
|
setDragPosition(null);
|
|
3811
3869
|
setLayoutMode(prefersMobileRef.current ? "mobile" : "floating");
|
|
3812
3870
|
cachedFloatingPositionRef.current = null;
|
|
3813
3871
|
appliedFloatingCacheRef.current = null;
|
|
3814
3872
|
}, [target.stepId]);
|
|
3815
|
-
(0,
|
|
3873
|
+
(0, import_react25.useEffect)(() => {
|
|
3816
3874
|
if (layoutMode !== "manual") {
|
|
3817
3875
|
setDragPosition(null);
|
|
3818
3876
|
}
|
|
3819
3877
|
}, [layoutMode]);
|
|
3820
|
-
(0,
|
|
3878
|
+
(0, import_react25.useEffect)(() => {
|
|
3821
3879
|
cachedFloatingPositionRef.current = floatingPosition;
|
|
3822
3880
|
const cacheKey = getFloatingCacheKey(target);
|
|
3823
3881
|
if (cacheKey) {
|
|
3824
3882
|
floatingPositionCache.set(cacheKey, floatingPosition);
|
|
3825
3883
|
}
|
|
3826
3884
|
}, [floatingPosition, target.isScreen, target.stepId]);
|
|
3827
|
-
const dockedPosition = (0,
|
|
3885
|
+
const dockedPosition = (0, import_react25.useMemo)(
|
|
3828
3886
|
() => ({
|
|
3829
3887
|
top: viewport.height - DOCKED_MARGIN,
|
|
3830
3888
|
left: viewport.width - DOCKED_MARGIN,
|
|
@@ -3832,7 +3890,7 @@ var TourPopoverPortal = ({
|
|
|
3832
3890
|
}),
|
|
3833
3891
|
[viewport.height, viewport.width]
|
|
3834
3892
|
);
|
|
3835
|
-
const mobilePosition = (0,
|
|
3893
|
+
const mobilePosition = (0, import_react25.useMemo)(
|
|
3836
3894
|
() => ({
|
|
3837
3895
|
top: viewport.height - MOBILE_HORIZONTAL_GUTTER,
|
|
3838
3896
|
left: viewport.width / 2,
|
|
@@ -3840,17 +3898,17 @@ var TourPopoverPortal = ({
|
|
|
3840
3898
|
}),
|
|
3841
3899
|
[viewport.height, viewport.width]
|
|
3842
3900
|
);
|
|
3843
|
-
(0,
|
|
3901
|
+
(0, import_react25.useEffect)(() => {
|
|
3844
3902
|
if (layoutMode === "docked") {
|
|
3845
3903
|
setFloatingPosition(dockedPosition);
|
|
3846
3904
|
}
|
|
3847
3905
|
}, [dockedPosition, layoutMode]);
|
|
3848
|
-
(0,
|
|
3906
|
+
(0, import_react25.useEffect)(() => {
|
|
3849
3907
|
if (layoutMode === "mobile") {
|
|
3850
3908
|
setFloatingPosition(mobilePosition);
|
|
3851
3909
|
}
|
|
3852
3910
|
}, [layoutMode, mobilePosition]);
|
|
3853
|
-
(0,
|
|
3911
|
+
(0, import_react25.useEffect)(() => {
|
|
3854
3912
|
if (prefersMobileLayout) {
|
|
3855
3913
|
if (layoutMode !== "mobile") {
|
|
3856
3914
|
setLayoutMode("mobile");
|
|
@@ -3863,7 +3921,7 @@ var TourPopoverPortal = ({
|
|
|
3863
3921
|
setFloatingPosition(fallbackPosition);
|
|
3864
3922
|
}
|
|
3865
3923
|
}, [fallbackPosition, layoutMode, prefersMobileLayout]);
|
|
3866
|
-
(0,
|
|
3924
|
+
(0, import_react25.useEffect)(() => {
|
|
3867
3925
|
if (layoutMode !== "floating") return;
|
|
3868
3926
|
const stepId = target.stepId;
|
|
3869
3927
|
if (!stepId) return;
|
|
@@ -3887,7 +3945,7 @@ var TourPopoverPortal = ({
|
|
|
3887
3945
|
target.stepId
|
|
3888
3946
|
]);
|
|
3889
3947
|
const shouldDeferScreenSnap = layoutMode === "floating" && target.isScreen && Boolean(layoutId);
|
|
3890
|
-
(0,
|
|
3948
|
+
(0, import_react25.useEffect)(() => {
|
|
3891
3949
|
return () => {
|
|
3892
3950
|
if (deferredScreenSnapRef.current !== null) {
|
|
3893
3951
|
cancelAnimationFrame(deferredScreenSnapRef.current);
|
|
@@ -3895,7 +3953,7 @@ var TourPopoverPortal = ({
|
|
|
3895
3953
|
}
|
|
3896
3954
|
};
|
|
3897
3955
|
}, []);
|
|
3898
|
-
(0,
|
|
3956
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
3899
3957
|
if (layoutMode !== "floating") return;
|
|
3900
3958
|
if (target.status === "ready" && !target.isScreen) return;
|
|
3901
3959
|
if (shouldDeferScreenSnap) return;
|
|
@@ -3907,7 +3965,7 @@ var TourPopoverPortal = ({
|
|
|
3907
3965
|
target.isScreen,
|
|
3908
3966
|
target.status
|
|
3909
3967
|
]);
|
|
3910
|
-
(0,
|
|
3968
|
+
(0, import_react25.useEffect)(() => {
|
|
3911
3969
|
if (!shouldDeferScreenSnap) return;
|
|
3912
3970
|
if (deferredScreenSnapRef.current !== null) {
|
|
3913
3971
|
cancelAnimationFrame(deferredScreenSnapRef.current);
|
|
@@ -3934,14 +3992,14 @@ var TourPopoverPortal = ({
|
|
|
3934
3992
|
}
|
|
3935
3993
|
};
|
|
3936
3994
|
}, [fallbackPosition, shouldDeferScreenSnap]);
|
|
3937
|
-
(0,
|
|
3995
|
+
(0, import_react25.useEffect)(() => {
|
|
3938
3996
|
return () => {
|
|
3939
3997
|
if (overflowRetryTimeoutRef.current !== null) {
|
|
3940
3998
|
window.clearTimeout(overflowRetryTimeoutRef.current);
|
|
3941
3999
|
}
|
|
3942
4000
|
};
|
|
3943
4001
|
}, []);
|
|
3944
|
-
(0,
|
|
4002
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
3945
4003
|
if (!isBrowser) return;
|
|
3946
4004
|
const floatingEl = floatingRef.current;
|
|
3947
4005
|
const rectInfo = target.rect;
|
|
@@ -3979,7 +4037,14 @@ var TourPopoverPortal = ({
|
|
|
3979
4037
|
padding: FLOATING_OFFSET,
|
|
3980
4038
|
alignment: autoAlignment
|
|
3981
4039
|
})
|
|
3982
|
-
] : [
|
|
4040
|
+
] : [
|
|
4041
|
+
(0, import_dom13.flip)({
|
|
4042
|
+
padding: FLOATING_OFFSET,
|
|
4043
|
+
fallbackStrategy: "bestFit",
|
|
4044
|
+
crossAxis: true,
|
|
4045
|
+
fallbackPlacements: ["bottom", "top", "right", "left"]
|
|
4046
|
+
})
|
|
4047
|
+
],
|
|
3983
4048
|
(0, import_dom13.shift)({ padding: FLOATING_OFFSET })
|
|
3984
4049
|
];
|
|
3985
4050
|
const updatePosition = async () => {
|
|
@@ -4024,9 +4089,10 @@ var TourPopoverPortal = ({
|
|
|
4024
4089
|
const spaceBelow = viewportBottom - targetRect.bottom;
|
|
4025
4090
|
const spaceLeft = targetRect.left - viewportLeft;
|
|
4026
4091
|
const spaceRight = viewportRight - targetRect.right;
|
|
4027
|
-
const
|
|
4028
|
-
const
|
|
4029
|
-
const
|
|
4092
|
+
const minVerticalSpaceNeeded = floatingBox.height + FLOATING_OFFSET * 2;
|
|
4093
|
+
const minHorizontalSpaceNeeded = floatingBox.width + FLOATING_OFFSET * 2;
|
|
4094
|
+
const hasVerticalSpace = spaceAbove >= minVerticalSpaceNeeded || spaceBelow >= minVerticalSpaceNeeded;
|
|
4095
|
+
const hasHorizontalSpace = spaceLeft >= minHorizontalSpaceNeeded || spaceRight >= minHorizontalSpaceNeeded;
|
|
4030
4096
|
const targetNearlyFillsViewport = !target.isScreen && !hasVerticalSpace && !hasHorizontalSpace;
|
|
4031
4097
|
const shouldDock = intersectsViewport && (targetNearlyFillsViewport || maxOverflow > overflowThreshold);
|
|
4032
4098
|
if (shouldDock) {
|
|
@@ -4075,7 +4141,7 @@ var TourPopoverPortal = ({
|
|
|
4075
4141
|
target.status,
|
|
4076
4142
|
target.stepId
|
|
4077
4143
|
]);
|
|
4078
|
-
(0,
|
|
4144
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
4079
4145
|
if (layoutMode !== "manual" || !dragPosition) return;
|
|
4080
4146
|
setFloatingPosition({
|
|
4081
4147
|
top: dragPosition.top,
|
|
@@ -4160,7 +4226,7 @@ var TourPopoverPortal = ({
|
|
|
4160
4226
|
}
|
|
4161
4227
|
event.preventDefault();
|
|
4162
4228
|
};
|
|
4163
|
-
(0,
|
|
4229
|
+
(0, import_react25.useEffect)(() => endDrag, []);
|
|
4164
4230
|
const shouldUseFallbackInitial = layoutMode !== "mobile" && (Boolean(target.lastResolvedRect) || Boolean(cachedTarget));
|
|
4165
4231
|
const floatingCacheKey = layoutMode === "mobile" ? null : getFloatingCacheKey(target);
|
|
4166
4232
|
const persistedFloatingInitial = floatingCacheKey && floatingPositionCache.has(floatingCacheKey) ? floatingPositionCache.get(floatingCacheKey) ?? null : null;
|
|
@@ -4252,7 +4318,7 @@ var TourPopoverPortal = ({
|
|
|
4252
4318
|
};
|
|
4253
4319
|
|
|
4254
4320
|
// src/components/TourFocusManager.tsx
|
|
4255
|
-
var
|
|
4321
|
+
var import_react26 = require("react");
|
|
4256
4322
|
var import_react_dom3 = require("react-dom");
|
|
4257
4323
|
|
|
4258
4324
|
// src/utils/focus.ts
|
|
@@ -4329,18 +4395,18 @@ var TourFocusManager = ({
|
|
|
4329
4395
|
highlightRect,
|
|
4330
4396
|
guardElementFocusRing
|
|
4331
4397
|
}) => {
|
|
4332
|
-
const previousFocusRef = (0,
|
|
4333
|
-
const guardNodesRef = (0,
|
|
4398
|
+
const previousFocusRef = (0, import_react26.useRef)(null);
|
|
4399
|
+
const guardNodesRef = (0, import_react26.useRef)({
|
|
4334
4400
|
"target-start": null,
|
|
4335
4401
|
"target-end": null,
|
|
4336
4402
|
"popover-start": null,
|
|
4337
4403
|
"popover-end": null
|
|
4338
4404
|
});
|
|
4339
|
-
const lastTabDirectionRef = (0,
|
|
4340
|
-
const suppressGuardHopRef = (0,
|
|
4341
|
-
const [targetRingActive, setTargetRingActive] = (0,
|
|
4342
|
-
const [popoverRingActive, setPopoverRingActive] = (0,
|
|
4343
|
-
const [popoverRect, setPopoverRect] = (0,
|
|
4405
|
+
const lastTabDirectionRef = (0, import_react26.useRef)("forward");
|
|
4406
|
+
const suppressGuardHopRef = (0, import_react26.useRef)(null);
|
|
4407
|
+
const [targetRingActive, setTargetRingActive] = (0, import_react26.useState)(false);
|
|
4408
|
+
const [popoverRingActive, setPopoverRingActive] = (0, import_react26.useState)(false);
|
|
4409
|
+
const [popoverRect, setPopoverRect] = (0, import_react26.useState)(null);
|
|
4344
4410
|
const restoreFocus = () => {
|
|
4345
4411
|
const previous = previousFocusRef.current;
|
|
4346
4412
|
previousFocusRef.current = null;
|
|
@@ -4350,7 +4416,7 @@ var TourFocusManager = ({
|
|
|
4350
4416
|
});
|
|
4351
4417
|
}
|
|
4352
4418
|
};
|
|
4353
|
-
(0,
|
|
4419
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
4354
4420
|
if (!isBrowser) return;
|
|
4355
4421
|
if (!active) {
|
|
4356
4422
|
restoreFocus();
|
|
@@ -4366,7 +4432,7 @@ var TourFocusManager = ({
|
|
|
4366
4432
|
restoreFocus();
|
|
4367
4433
|
};
|
|
4368
4434
|
}, [active, popoverNode, target.element]);
|
|
4369
|
-
(0,
|
|
4435
|
+
(0, import_react26.useEffect)(() => {
|
|
4370
4436
|
if (!isBrowser) return;
|
|
4371
4437
|
if (!active) return;
|
|
4372
4438
|
const doc = popoverNode?.ownerDocument ?? target.element?.ownerDocument ?? document;
|
|
@@ -4560,7 +4626,7 @@ var TourFocusManager = ({
|
|
|
4560
4626
|
target.stepId,
|
|
4561
4627
|
target.visibility
|
|
4562
4628
|
]);
|
|
4563
|
-
(0,
|
|
4629
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
4564
4630
|
if (popoverRingActive && popoverNode) {
|
|
4565
4631
|
setPopoverRect(popoverNode.getBoundingClientRect());
|
|
4566
4632
|
} else {
|
|
@@ -4616,7 +4682,7 @@ var TourFocusManager = ({
|
|
|
4616
4682
|
};
|
|
4617
4683
|
|
|
4618
4684
|
// src/motion/useHudMotion.ts
|
|
4619
|
-
var
|
|
4685
|
+
var import_react27 = require("react");
|
|
4620
4686
|
var DEFAULT_HIGHLIGHT_TRANSITION2 = {
|
|
4621
4687
|
duration: 0.35,
|
|
4622
4688
|
ease: "easeOut",
|
|
@@ -4643,7 +4709,7 @@ var DEFAULT_POPOVER_CONTENT_TRANSITION2 = {
|
|
|
4643
4709
|
};
|
|
4644
4710
|
var useHudMotion = () => {
|
|
4645
4711
|
const adapter = useAnimationAdapter();
|
|
4646
|
-
return (0,
|
|
4712
|
+
return (0, import_react27.useMemo)(() => {
|
|
4647
4713
|
const components = {
|
|
4648
4714
|
...adapter.components
|
|
4649
4715
|
};
|