@korsolutions/guidon 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/commonjs/babel.config.js +15 -0
  2. package/dist/commonjs/babel.config.js.map +1 -0
  3. package/dist/commonjs/bob.config.js +11 -0
  4. package/dist/commonjs/bob.config.js.map +1 -0
  5. package/dist/commonjs/components/GuidonOverlay.js +206 -0
  6. package/dist/commonjs/components/GuidonOverlay.js.map +1 -0
  7. package/dist/commonjs/components/GuidonProvider.js +157 -0
  8. package/dist/commonjs/components/GuidonProvider.js.map +1 -0
  9. package/dist/commonjs/components/GuidonTarget.js +110 -0
  10. package/dist/commonjs/components/GuidonTarget.js.map +1 -0
  11. package/dist/commonjs/components/GuidonTooltip.js +422 -0
  12. package/dist/commonjs/components/GuidonTooltip.js.map +1 -0
  13. package/dist/commonjs/components/index.js +40 -0
  14. package/dist/commonjs/components/index.js.map +1 -0
  15. package/dist/commonjs/hooks/index.js +13 -0
  16. package/dist/commonjs/hooks/index.js.map +1 -0
  17. package/dist/commonjs/hooks/useGuidonRef.js +132 -0
  18. package/dist/commonjs/hooks/useGuidonRef.js.map +1 -0
  19. package/dist/commonjs/index.js +143 -0
  20. package/dist/commonjs/index.js.map +1 -0
  21. package/dist/commonjs/package.json +1 -0
  22. package/dist/commonjs/persistence/adapters.js +213 -0
  23. package/dist/commonjs/persistence/adapters.js.map +1 -0
  24. package/dist/commonjs/persistence/hooks.js +153 -0
  25. package/dist/commonjs/persistence/hooks.js.map +1 -0
  26. package/dist/commonjs/persistence/index.js +28 -0
  27. package/dist/commonjs/persistence/index.js.map +1 -0
  28. package/dist/commonjs/store.js +314 -0
  29. package/dist/commonjs/store.js.map +1 -0
  30. package/dist/commonjs/tsconfig.json +32 -0
  31. package/dist/commonjs/types.js +6 -0
  32. package/dist/commonjs/types.js.map +1 -0
  33. package/dist/module/babel.config.js +15 -0
  34. package/dist/module/babel.config.js.map +1 -0
  35. package/dist/module/bob.config.js +11 -0
  36. package/dist/module/bob.config.js.map +1 -0
  37. package/dist/module/components/GuidonOverlay.js +201 -0
  38. package/dist/module/components/GuidonOverlay.js.map +1 -0
  39. package/dist/module/components/GuidonProvider.js +152 -0
  40. package/dist/module/components/GuidonProvider.js.map +1 -0
  41. package/dist/module/components/GuidonTarget.js +106 -0
  42. package/dist/module/components/GuidonTarget.js.map +1 -0
  43. package/dist/module/components/GuidonTooltip.js +417 -0
  44. package/dist/module/components/GuidonTooltip.js.map +1 -0
  45. package/dist/module/components/index.js +7 -0
  46. package/dist/module/components/index.js.map +1 -0
  47. package/dist/module/hooks/index.js +4 -0
  48. package/dist/module/hooks/index.js.map +1 -0
  49. package/dist/module/hooks/useGuidonRef.js +129 -0
  50. package/dist/module/hooks/useGuidonRef.js.map +1 -0
  51. package/dist/module/index.js +17 -0
  52. package/dist/module/index.js.map +1 -0
  53. package/dist/module/package.json +1 -0
  54. package/dist/module/persistence/adapters.js +203 -0
  55. package/dist/module/persistence/adapters.js.map +1 -0
  56. package/dist/module/persistence/hooks.js +148 -0
  57. package/dist/module/persistence/hooks.js.map +1 -0
  58. package/dist/module/persistence/index.js +5 -0
  59. package/dist/module/persistence/index.js.map +1 -0
  60. package/dist/module/store.js +304 -0
  61. package/dist/module/store.js.map +1 -0
  62. package/dist/module/tsconfig.json +32 -0
  63. package/dist/module/types.js +4 -0
  64. package/dist/module/types.js.map +1 -0
  65. package/dist/typescript/commonjs/components/GuidonOverlay.d.ts +9 -0
  66. package/dist/typescript/commonjs/components/GuidonOverlay.d.ts.map +1 -0
  67. package/dist/typescript/commonjs/components/GuidonProvider.d.ts +14 -0
  68. package/dist/typescript/commonjs/components/GuidonProvider.d.ts.map +1 -0
  69. package/dist/typescript/commonjs/components/GuidonTarget.d.ts +7 -0
  70. package/dist/typescript/commonjs/components/GuidonTarget.d.ts.map +1 -0
  71. package/dist/typescript/commonjs/components/GuidonTooltip.d.ts +24 -0
  72. package/dist/typescript/commonjs/components/GuidonTooltip.d.ts.map +1 -0
  73. package/dist/typescript/commonjs/components/index.d.ts +5 -0
  74. package/dist/typescript/commonjs/components/index.d.ts.map +1 -0
  75. package/dist/typescript/commonjs/hooks/index.d.ts +2 -0
  76. package/dist/typescript/commonjs/hooks/index.d.ts.map +1 -0
  77. package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts +35 -0
  78. package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts.map +1 -0
  79. package/dist/typescript/commonjs/index.d.ts +7 -0
  80. package/dist/typescript/commonjs/index.d.ts.map +1 -0
  81. package/dist/typescript/commonjs/package.json +1 -0
  82. package/dist/typescript/commonjs/persistence/adapters.d.ts +57 -0
  83. package/dist/typescript/commonjs/persistence/adapters.d.ts.map +1 -0
  84. package/dist/typescript/commonjs/persistence/hooks.d.ts +29 -0
  85. package/dist/typescript/commonjs/persistence/hooks.d.ts.map +1 -0
  86. package/dist/typescript/commonjs/persistence/index.d.ts +3 -0
  87. package/dist/typescript/commonjs/persistence/index.d.ts.map +1 -0
  88. package/dist/typescript/commonjs/store.d.ts +89 -0
  89. package/dist/typescript/commonjs/store.d.ts.map +1 -0
  90. package/dist/{index-D_JFvCIg.d.mts → typescript/commonjs/types.d.ts} +40 -104
  91. package/dist/typescript/commonjs/types.d.ts.map +1 -0
  92. package/dist/typescript/module/components/GuidonOverlay.d.ts +9 -0
  93. package/dist/typescript/module/components/GuidonOverlay.d.ts.map +1 -0
  94. package/dist/typescript/module/components/GuidonProvider.d.ts +14 -0
  95. package/dist/typescript/module/components/GuidonProvider.d.ts.map +1 -0
  96. package/dist/typescript/module/components/GuidonTarget.d.ts +7 -0
  97. package/dist/typescript/module/components/GuidonTarget.d.ts.map +1 -0
  98. package/dist/typescript/module/components/GuidonTooltip.d.ts +24 -0
  99. package/dist/typescript/module/components/GuidonTooltip.d.ts.map +1 -0
  100. package/dist/typescript/module/components/index.d.ts +5 -0
  101. package/dist/typescript/module/components/index.d.ts.map +1 -0
  102. package/dist/typescript/module/hooks/index.d.ts +2 -0
  103. package/dist/typescript/module/hooks/index.d.ts.map +1 -0
  104. package/dist/typescript/module/hooks/useGuidonRef.d.ts +35 -0
  105. package/dist/typescript/module/hooks/useGuidonRef.d.ts.map +1 -0
  106. package/dist/typescript/module/index.d.ts +7 -0
  107. package/dist/typescript/module/index.d.ts.map +1 -0
  108. package/dist/typescript/module/package.json +1 -0
  109. package/dist/typescript/module/persistence/adapters.d.ts +57 -0
  110. package/dist/typescript/module/persistence/adapters.d.ts.map +1 -0
  111. package/dist/typescript/module/persistence/hooks.d.ts +29 -0
  112. package/dist/typescript/module/persistence/hooks.d.ts.map +1 -0
  113. package/dist/typescript/module/persistence/index.d.ts +3 -0
  114. package/dist/typescript/module/persistence/index.d.ts.map +1 -0
  115. package/dist/typescript/module/store.d.ts +89 -0
  116. package/dist/typescript/module/store.d.ts.map +1 -0
  117. package/dist/{index-D_JFvCIg.d.ts → typescript/module/types.d.ts} +40 -104
  118. package/dist/typescript/module/types.d.ts.map +1 -0
  119. package/package.json +25 -13
  120. package/src/babel.config.js +18 -0
  121. package/src/bob.config.js +14 -0
  122. package/src/components/GuidonOverlay.tsx +60 -4
  123. package/src/components/GuidonProvider.tsx +29 -1
  124. package/src/components/GuidonTarget.tsx +41 -25
  125. package/src/components/GuidonTooltip.tsx +143 -9
  126. package/src/hooks/index.ts +1 -0
  127. package/src/hooks/useGuidonRef.ts +154 -0
  128. package/src/index.ts +6 -0
  129. package/src/store.ts +68 -15
  130. package/src/tsconfig.json +32 -0
  131. package/src/types.ts +32 -2
  132. package/dist/index.d.mts +0 -128
  133. package/dist/index.d.ts +0 -128
  134. package/dist/index.js +0 -1097
  135. package/dist/index.js.map +0 -1
  136. package/dist/index.mjs +0 -1072
  137. package/dist/index.mjs.map +0 -1
  138. package/dist/persistence/index.d.mts +0 -2
  139. package/dist/persistence/index.d.ts +0 -2
  140. package/dist/persistence/index.js +0 -300
  141. package/dist/persistence/index.js.map +0 -1
  142. package/dist/persistence/index.mjs +0 -291
  143. package/dist/persistence/index.mjs.map +0 -1
@@ -0,0 +1,314 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useWaitingState = exports.useTargetMeasurements = exports.useIsFloatingStep = exports.useGuidonStore = exports.useGuidonStep = exports.useGuidonProgress = exports.useGuidonActive = exports.Guidon = void 0;
7
+ var _zustand = require("zustand");
8
+ var _shallow = require("zustand/react/shallow");
9
+ const initialState = {
10
+ config: null,
11
+ isActive: false,
12
+ currentStepIndex: 0,
13
+ isCompleted: false,
14
+ targetMeasurements: {},
15
+ isLoading: false,
16
+ error: null,
17
+ waitingForTarget: false,
18
+ waitingTargetId: null
19
+ };
20
+ const useGuidonStore = exports.useGuidonStore = (0, _zustand.create)((set, get) => ({
21
+ ...initialState,
22
+ configure: config => {
23
+ set({
24
+ config,
25
+ currentStepIndex: 0,
26
+ isCompleted: false
27
+ });
28
+ },
29
+ start: () => {
30
+ const {
31
+ config
32
+ } = get();
33
+ if (!config || config.steps.length === 0) return;
34
+ set({
35
+ isActive: true,
36
+ currentStepIndex: 0,
37
+ isCompleted: false
38
+ });
39
+
40
+ // Call onStepEnter for the first step
41
+ const firstStep = config.steps[0];
42
+ firstStep?.onStepEnter?.();
43
+ if (firstStep) {
44
+ config.onStepChange?.(0, firstStep);
45
+ }
46
+ },
47
+ next: () => {
48
+ const {
49
+ config,
50
+ currentStepIndex,
51
+ isActive
52
+ } = get();
53
+ if (!config || !isActive) return;
54
+ const currentStep = config.steps[currentStepIndex];
55
+ currentStep?.onStepExit?.();
56
+ if (currentStepIndex < config.steps.length - 1) {
57
+ const nextIndex = currentStepIndex + 1;
58
+ const nextStep = config.steps[nextIndex];
59
+ set({
60
+ currentStepIndex: nextIndex
61
+ });
62
+ nextStep?.onStepEnter?.();
63
+ if (nextStep) {
64
+ config.onStepChange?.(nextIndex, nextStep);
65
+ }
66
+ } else {
67
+ // Last step completed
68
+ get().complete();
69
+ }
70
+ },
71
+ previous: () => {
72
+ const {
73
+ config,
74
+ currentStepIndex,
75
+ isActive
76
+ } = get();
77
+ if (!config || !isActive || currentStepIndex === 0) return;
78
+ const currentStep = config.steps[currentStepIndex];
79
+ currentStep?.onStepExit?.();
80
+ const prevIndex = currentStepIndex - 1;
81
+ const prevStep = config.steps[prevIndex];
82
+ set({
83
+ currentStepIndex: prevIndex
84
+ });
85
+ prevStep?.onStepEnter?.();
86
+ if (prevStep) {
87
+ config.onStepChange?.(prevIndex, prevStep);
88
+ }
89
+ },
90
+ goToStep: index => {
91
+ const {
92
+ config,
93
+ currentStepIndex,
94
+ isActive
95
+ } = get();
96
+ if (!config || !isActive) return;
97
+ if (index < 0 || index >= config.steps.length) return;
98
+ const currentStep = config.steps[currentStepIndex];
99
+ currentStep?.onStepExit?.();
100
+ const targetStep = config.steps[index];
101
+ set({
102
+ currentStepIndex: index
103
+ });
104
+ targetStep?.onStepEnter?.();
105
+ if (targetStep) {
106
+ config.onStepChange?.(index, targetStep);
107
+ }
108
+ },
109
+ skip: () => {
110
+ const {
111
+ config,
112
+ currentStepIndex
113
+ } = get();
114
+ if (!config) return;
115
+ const currentStep = config.steps[currentStepIndex];
116
+ currentStep?.onStepExit?.();
117
+ set({
118
+ isActive: false,
119
+ isCompleted: false
120
+ });
121
+ config.onSkip?.();
122
+ },
123
+ complete: () => {
124
+ const {
125
+ config,
126
+ currentStepIndex
127
+ } = get();
128
+ if (!config) return;
129
+ const currentStep = config.steps[currentStepIndex];
130
+ currentStep?.onStepExit?.();
131
+ set({
132
+ isActive: false,
133
+ isCompleted: true
134
+ });
135
+ config.onComplete?.();
136
+ },
137
+ reset: () => {
138
+ set(initialState);
139
+ },
140
+ registerTarget: (targetId, measurements) => {
141
+ const {
142
+ waitingTargetId
143
+ } = get();
144
+ set(state => ({
145
+ targetMeasurements: {
146
+ ...state.targetMeasurements,
147
+ [targetId]: measurements
148
+ },
149
+ // Clear waiting state if this was the target we were waiting for
150
+ waitingForTarget: waitingTargetId === targetId ? false : state.waitingForTarget,
151
+ waitingTargetId: waitingTargetId === targetId ? null : state.waitingTargetId
152
+ }));
153
+ },
154
+ unregisterTarget: targetId => {
155
+ set(state => {
156
+ const {
157
+ [targetId]: _,
158
+ ...rest
159
+ } = state.targetMeasurements;
160
+ return {
161
+ targetMeasurements: rest
162
+ };
163
+ });
164
+ },
165
+ setLoading: isLoading => {
166
+ set({
167
+ isLoading
168
+ });
169
+ },
170
+ setError: error => {
171
+ set({
172
+ error
173
+ });
174
+ }
175
+ }));
176
+
177
+ /**
178
+ * Guidon API for external control
179
+ * Can be used outside of React components
180
+ */
181
+ const Guidon = exports.Guidon = {
182
+ /**
183
+ * Configure the walkthrough with steps and options
184
+ */
185
+ configure: config => {
186
+ useGuidonStore.getState().configure(config);
187
+ },
188
+ /**
189
+ * Start the walkthrough
190
+ */
191
+ start: () => {
192
+ useGuidonStore.getState().start();
193
+ },
194
+ /**
195
+ * Go to the next step
196
+ */
197
+ next: () => {
198
+ useGuidonStore.getState().next();
199
+ },
200
+ /**
201
+ * Go to the previous step
202
+ */
203
+ previous: () => {
204
+ useGuidonStore.getState().previous();
205
+ },
206
+ /**
207
+ * Go to a specific step by index
208
+ */
209
+ goToStep: index => {
210
+ useGuidonStore.getState().goToStep(index);
211
+ },
212
+ /**
213
+ * Skip the walkthrough
214
+ */
215
+ skip: () => {
216
+ useGuidonStore.getState().skip();
217
+ },
218
+ /**
219
+ * Complete the walkthrough
220
+ */
221
+ complete: () => {
222
+ useGuidonStore.getState().complete();
223
+ },
224
+ /**
225
+ * Reset the walkthrough to initial state
226
+ */
227
+ reset: () => {
228
+ useGuidonStore.getState().reset();
229
+ },
230
+ /**
231
+ * Check if the walkthrough is currently active
232
+ */
233
+ isActive: () => {
234
+ return useGuidonStore.getState().isActive;
235
+ },
236
+ /**
237
+ * Check if the walkthrough has been completed
238
+ */
239
+ isCompleted: () => {
240
+ return useGuidonStore.getState().isCompleted;
241
+ },
242
+ /**
243
+ * Get the current step index
244
+ */
245
+ getCurrentStepIndex: () => {
246
+ return useGuidonStore.getState().currentStepIndex;
247
+ },
248
+ /**
249
+ * Get the current step
250
+ */
251
+ getCurrentStep: () => {
252
+ const state = useGuidonStore.getState();
253
+ return state.config?.steps[state.currentStepIndex] ?? null;
254
+ },
255
+ /**
256
+ * Get all steps
257
+ */
258
+ getSteps: () => {
259
+ return useGuidonStore.getState().config?.steps ?? [];
260
+ },
261
+ /**
262
+ * Subscribe to store changes
263
+ */
264
+ subscribe: useGuidonStore.subscribe
265
+ };
266
+
267
+ /**
268
+ * Hook selectors for common use cases
269
+ */
270
+ const useGuidonActive = () => useGuidonStore(state => state.isActive);
271
+ exports.useGuidonActive = useGuidonActive;
272
+ const useGuidonStep = () => useGuidonStore(state => {
273
+ if (!state.config || !state.isActive) return null;
274
+ return state.config.steps[state.currentStepIndex];
275
+ });
276
+ exports.useGuidonStep = useGuidonStep;
277
+ const useGuidonProgress = () => useGuidonStore((0, _shallow.useShallow)(state => ({
278
+ currentStep: state.currentStepIndex + 1,
279
+ totalSteps: state.config?.steps.length ?? 0,
280
+ percentage: state.config ? (state.currentStepIndex + 1) / state.config.steps.length * 100 : 0
281
+ })));
282
+ exports.useGuidonProgress = useGuidonProgress;
283
+ const useTargetMeasurements = targetId => useGuidonStore(state => state.targetMeasurements[targetId]);
284
+
285
+ /**
286
+ * Hook to check if the guidon is waiting for a target element to mount
287
+ * Returns null if not active, not waiting, or if it's a floating step
288
+ */
289
+ exports.useTargetMeasurements = useTargetMeasurements;
290
+ const useWaitingState = () => useGuidonStore((0, _shallow.useShallow)(state => {
291
+ if (!state.isActive || !state.config) return null;
292
+ const currentStep = state.config.steps[state.currentStepIndex];
293
+ const targetId = currentStep?.targetId;
294
+
295
+ // Floating step (no targetId) - not waiting
296
+ if (!targetId) return null;
297
+ const hasMeasurements = !!state.targetMeasurements[targetId];
298
+ return {
299
+ isWaiting: !hasMeasurements,
300
+ targetId: hasMeasurements ? null : targetId,
301
+ message: currentStep?.waitingMessage ?? null
302
+ };
303
+ }));
304
+
305
+ /**
306
+ * Hook to check if the current step is a floating step (no target element)
307
+ */
308
+ exports.useWaitingState = useWaitingState;
309
+ const useIsFloatingStep = () => useGuidonStore(state => {
310
+ if (!state.config || !state.isActive) return false;
311
+ return !state.config.steps[state.currentStepIndex]?.targetId;
312
+ });
313
+ exports.useIsFloatingStep = useIsFloatingStep;
314
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_zustand","require","_shallow","initialState","config","isActive","currentStepIndex","isCompleted","targetMeasurements","isLoading","error","waitingForTarget","waitingTargetId","useGuidonStore","exports","create","set","get","configure","start","steps","length","firstStep","onStepEnter","onStepChange","next","currentStep","onStepExit","nextIndex","nextStep","complete","previous","prevIndex","prevStep","goToStep","index","targetStep","skip","onSkip","onComplete","reset","registerTarget","targetId","measurements","state","unregisterTarget","_","rest","setLoading","setError","Guidon","getState","getCurrentStepIndex","getCurrentStep","getSteps","subscribe","useGuidonActive","useGuidonStep","useGuidonProgress","useShallow","totalSteps","percentage","useTargetMeasurements","useWaitingState","hasMeasurements","isWaiting","message","waitingMessage","useIsFloatingStep"],"sourceRoot":"../../src","sources":["store.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAOA,MAAME,YAAY,GAAG;EACnBC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,KAAK;EACfC,gBAAgB,EAAE,CAAC;EACnBC,WAAW,EAAE,KAAK;EAClBC,kBAAkB,EAAE,CAAC,CAAC;EACtBC,SAAS,EAAE,KAAK;EAChBC,KAAK,EAAE,IAAI;EACXC,gBAAgB,EAAE,KAAK;EACvBC,eAAe,EAAE;AACnB,CAAC;AAEM,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,eAAM,EAAc,CAACC,GAAG,EAAEC,GAAG,MAAM;EAC/D,GAAGd,YAAY;EAEfe,SAAS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A,CAAA,KAC7BlD,cAAc,CACZ,IAAA8C,mBAAU,EAAEf,KAAkB,IAAK;EACjC,IAAI,CAACA,KAAK,CAACvC,QAAQ,IAAI,CAACuC,KAAK,CAACxC,MAAM,EAAE,OAAO,IAAI;EAEjD,MAAMsB,WAAW,GAAGkB,KAAK,CAACxC,MAAM,CAACgB,KAAK,CAACwB,KAAK,CAACtC,gBAAgB,CAAC;EAC9D,MAAMoC,QAAQ,GAAGhB,WAAW,EAAEgB,QAAQ;;EAEtC;EACA,IAAI,CAACA,QAAQ,EAAE,OAAO,IAAI;EAE1B,MAAMsB,eAAe,GAAG,CAAC,CAACpB,KAAK,CAACpC,kBAAkB,CAACkC,QAAQ,CAAC;EAE5D,OAAO;IACLuB,SAAS,EAAE,CAACD,eAAe;IAC3BtB,QAAQ,EAAEsB,eAAe,GAAG,IAAI,GAAGtB,QAAQ;IAC3CwB,OAAO,EAAExC,WAAW,EAAEyC,cAAc,IAAI;EAC1C,CAAC;AACH,CAAC,CACH,CAAC;;AAEH;AACA;AACA;AAFArD,OAAA,CAAAiD,eAAA,GAAAA,eAAA;AAGO,MAAMK,iBAAiB,GAAGA,CAAA,KAC/BvD,cAAc,CAAE+B,KAAkB,IAAK;EACrC,IAAI,CAACA,KAAK,CAACxC,MAAM,IAAI,CAACwC,KAAK,CAACvC,QAAQ,EAAE,OAAO,KAAK;EAClD,OAAO,CAACuC,KAAK,CAACxC,MAAM,CAACgB,KAAK,CAACwB,KAAK,CAACtC,gBAAgB,CAAC,EAAEoC,QAAQ;AAC9D,CAAC,CAAC;AAAC5B,OAAA,CAAAsD,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "customConditions": ["dev-source", "react-native", "react-native-strict-api"],
4
+ "allowJs": true,
5
+ "esModuleInterop": true,
6
+ "jsx": "react-native",
7
+ "lib": ["DOM", "ESNext"],
8
+ "module": "preserve",
9
+ "moduleDetection": "force",
10
+ "moduleResolution": "bundler",
11
+ "noEmit": true,
12
+ "resolveJsonModule": true,
13
+ "skipLibCheck": true,
14
+ "target": "ESNext",
15
+ "strict": true,
16
+ "verbatimModuleSyntax": true,
17
+ "allowUnreachableCode": false,
18
+ "allowUnusedLabels": false,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "noImplicitReturns": true,
22
+ "noImplicitUseStrict": false,
23
+ "noStrictGenericChecks": false,
24
+ "noUncheckedIndexedAccess": true,
25
+ "noUnusedLocals": true,
26
+ "noUnusedParameters": true,
27
+ "paths": {
28
+ "@/*": ["./src/*"]
29
+ }
30
+ },
31
+ "exclude": ["node_modules", "dist"]
32
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ module.exports = function (api) {
4
+ api.cache(true);
5
+ return {
6
+ presets: ["module:react-native-builder-bob/babel-preset"],
7
+ plugins: [[require.resolve("babel-plugin-module-resolver"), {
8
+ root: ["./src"],
9
+ alias: {
10
+ "@": "./src"
11
+ }
12
+ }]]
13
+ };
14
+ };
15
+ //# sourceMappingURL=babel.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["module","exports","api","cache","presets","plugins","require","resolve","root","alias"],"sourceRoot":"../../src","sources":["babel.config.js"],"mappings":";;AAAAA,MAAM,CAACC,OAAO,GAAG,UAAUC,GAAG,EAAE;EAC9BA,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC;EAEf,OAAO;IACLC,OAAO,EAAE,CAAC,8CAA8C,CAAC;IACzDC,OAAO,EAAE,CACP,CACEC,OAAO,CAACC,OAAO,CAAC,8BAA8B,CAAC,EAC/C;MACEC,IAAI,EAAE,CAAC,OAAO,CAAC;MACfC,KAAK,EAAE;QACL,GAAG,EAAE;MACP;IACF,CAAC,CACF;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ source: "src",
5
+ output: "dist",
6
+ targets: [["module", {
7
+ esm: true,
8
+ configFile: true
9
+ }], "typescript"]
10
+ };
11
+ //# sourceMappingURL=bob.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["module","exports","source","output","targets","esm","configFile"],"sourceRoot":"../../src","sources":["bob.config.js"],"mappings":";;AAAAA,MAAM,CAACC,OAAO,GAAG;EACfC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAE,CACP,CACE,QAAQ,EACR;IACEC,GAAG,EAAE,IAAI;IACTC,UAAU,EAAE;EACd,CAAC,CACF,EACD,YAAY;AAEhB,CAAC","ignoreList":[]}
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+
3
+ import { useMemo } from 'react';
4
+ import { StyleSheet, Dimensions, TouchableWithoutFeedback, Platform } from 'react-native';
5
+ import Animated, { useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated';
6
+ import Svg, { Defs, Mask, Rect, G } from 'react-native-svg';
7
+ import { useGuidonStore, useWaitingState, useIsFloatingStep } from "../store.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const AnimatedSvg = Animated.createAnimatedComponent(Svg);
10
+ const DEFAULT_THEME = {
11
+ backdropColor: '#000000',
12
+ backdropOpacity: 0.75,
13
+ spotlightBorderRadius: 8,
14
+ spotlightPadding: 8
15
+ };
16
+ export function GuidonOverlay({
17
+ theme = {},
18
+ animationDuration = 300,
19
+ onBackdropPress
20
+ }) {
21
+ const isActive = useGuidonStore(state => state.isActive);
22
+ const config = useGuidonStore(state => state.config);
23
+ const currentStepIndex = useGuidonStore(state => state.currentStepIndex);
24
+ const targetMeasurements = useGuidonStore(state => state.targetMeasurements);
25
+
26
+ // Check for floating or waiting states
27
+ const isFloatingStep = useIsFloatingStep();
28
+ const waitingState = useWaitingState();
29
+ const isWaiting = waitingState?.isWaiting ?? false;
30
+ const mergedTheme = {
31
+ ...DEFAULT_THEME,
32
+ ...theme
33
+ };
34
+ const {
35
+ width: screenWidth,
36
+ height: screenHeight
37
+ } = Dimensions.get('window');
38
+
39
+ // Get current step's target measurements
40
+ const currentStep = config?.steps[currentStepIndex];
41
+ const currentTargetId = currentStep?.targetId;
42
+ const measurements = currentTargetId ? targetMeasurements[currentTargetId] : undefined;
43
+
44
+ // Determine if we should show full backdrop (no spotlight cutout)
45
+ const showFullBackdrop = isFloatingStep || isWaiting;
46
+
47
+ // Calculate spotlight dimensions with padding
48
+ const spotlight = useMemo(() => {
49
+ if (!measurements) {
50
+ return {
51
+ x: 0,
52
+ y: 0,
53
+ width: 0,
54
+ height: 0
55
+ };
56
+ }
57
+ return {
58
+ x: measurements.x - mergedTheme.spotlightPadding,
59
+ y: measurements.y - mergedTheme.spotlightPadding,
60
+ width: measurements.width + mergedTheme.spotlightPadding * 2,
61
+ height: measurements.height + mergedTheme.spotlightPadding * 2
62
+ };
63
+ }, [measurements, mergedTheme.spotlightPadding]);
64
+
65
+ // Animated styles for fade in/out
66
+ // Show backdrop for: normal steps with measurements, floating steps, or waiting states
67
+ const shouldShow = isActive && (measurements || showFullBackdrop);
68
+ const animatedStyle = useAnimatedStyle(() => {
69
+ return {
70
+ opacity: withTiming(shouldShow ? 1 : 0, {
71
+ duration: animationDuration,
72
+ easing: Easing.inOut(Easing.ease)
73
+ })
74
+ };
75
+ }, [shouldShow, animationDuration]);
76
+ if (!isActive) {
77
+ return null;
78
+ }
79
+
80
+ // Render full backdrop without spotlight for floating steps or waiting states
81
+ if (showFullBackdrop) {
82
+ if (Platform.OS === 'web') {
83
+ return /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
84
+ onPress: onBackdropPress,
85
+ children: /*#__PURE__*/_jsx(Animated.View, {
86
+ style: [styles.container, animatedStyle],
87
+ children: /*#__PURE__*/_jsx("div", {
88
+ style: {
89
+ position: 'absolute',
90
+ inset: 0,
91
+ backgroundColor: mergedTheme.backdropColor,
92
+ opacity: mergedTheme.backdropOpacity
93
+ }
94
+ })
95
+ })
96
+ });
97
+ }
98
+
99
+ // Native: full backdrop without cutout
100
+ return /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
101
+ onPress: onBackdropPress,
102
+ children: /*#__PURE__*/_jsx(AnimatedSvg, {
103
+ style: [styles.container, animatedStyle],
104
+ width: screenWidth,
105
+ height: screenHeight,
106
+ viewBox: `0 0 ${screenWidth} ${screenHeight}`,
107
+ children: /*#__PURE__*/_jsx(Rect, {
108
+ x: "0",
109
+ y: "0",
110
+ width: "100%",
111
+ height: "100%",
112
+ fill: mergedTheme.backdropColor,
113
+ fillOpacity: mergedTheme.backdropOpacity
114
+ })
115
+ })
116
+ });
117
+ }
118
+
119
+ // If we have a target but no measurements yet, don't render anything
120
+ if (!measurements) {
121
+ return null;
122
+ }
123
+
124
+ // For web, use a different approach with CSS
125
+ if (Platform.OS === 'web') {
126
+ return /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
127
+ onPress: onBackdropPress,
128
+ children: /*#__PURE__*/_jsx(Animated.View, {
129
+ style: [styles.container, animatedStyle],
130
+ children: /*#__PURE__*/_jsx("div", {
131
+ style: {
132
+ position: 'absolute',
133
+ inset: 0,
134
+ backgroundColor: mergedTheme.backdropColor,
135
+ opacity: mergedTheme.backdropOpacity,
136
+ clipPath: `polygon(
137
+ 0% 0%,
138
+ 0% 100%,
139
+ ${spotlight.x}px 100%,
140
+ ${spotlight.x}px ${spotlight.y}px,
141
+ ${spotlight.x + spotlight.width}px ${spotlight.y}px,
142
+ ${spotlight.x + spotlight.width}px ${spotlight.y + spotlight.height}px,
143
+ ${spotlight.x}px ${spotlight.y + spotlight.height}px,
144
+ ${spotlight.x}px 100%,
145
+ 100% 100%,
146
+ 100% 0%
147
+ )`
148
+ }
149
+ })
150
+ })
151
+ });
152
+ }
153
+
154
+ // Native implementation using SVG mask
155
+ return /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
156
+ onPress: onBackdropPress,
157
+ children: /*#__PURE__*/_jsxs(AnimatedSvg, {
158
+ style: [styles.container, animatedStyle],
159
+ width: screenWidth,
160
+ height: screenHeight,
161
+ viewBox: `0 0 ${screenWidth} ${screenHeight}`,
162
+ children: [/*#__PURE__*/_jsx(Defs, {
163
+ children: /*#__PURE__*/_jsxs(Mask, {
164
+ id: "spotlight-mask",
165
+ children: [/*#__PURE__*/_jsx(Rect, {
166
+ x: "0",
167
+ y: "0",
168
+ width: "100%",
169
+ height: "100%",
170
+ fill: "white"
171
+ }), /*#__PURE__*/_jsx(Rect, {
172
+ x: spotlight.x,
173
+ y: spotlight.y,
174
+ width: spotlight.width,
175
+ height: spotlight.height,
176
+ rx: mergedTheme.spotlightBorderRadius,
177
+ ry: mergedTheme.spotlightBorderRadius,
178
+ fill: "black"
179
+ })]
180
+ })
181
+ }), /*#__PURE__*/_jsx(G, {
182
+ mask: "url(#spotlight-mask)",
183
+ children: /*#__PURE__*/_jsx(Rect, {
184
+ x: "0",
185
+ y: "0",
186
+ width: "100%",
187
+ height: "100%",
188
+ fill: mergedTheme.backdropColor,
189
+ fillOpacity: mergedTheme.backdropOpacity
190
+ })
191
+ })]
192
+ })
193
+ });
194
+ }
195
+ const styles = StyleSheet.create({
196
+ container: {
197
+ ...StyleSheet.absoluteFillObject,
198
+ zIndex: 999
199
+ }
200
+ });
201
+ //# sourceMappingURL=GuidonOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMemo","StyleSheet","Dimensions","TouchableWithoutFeedback","Platform","Animated","useAnimatedStyle","withTiming","Easing","Svg","Defs","Mask","Rect","G","useGuidonStore","useWaitingState","useIsFloatingStep","jsx","_jsx","jsxs","_jsxs","AnimatedSvg","createAnimatedComponent","DEFAULT_THEME","backdropColor","backdropOpacity","spotlightBorderRadius","spotlightPadding","GuidonOverlay","theme","animationDuration","onBackdropPress","isActive","state","config","currentStepIndex","targetMeasurements","isFloatingStep","waitingState","isWaiting","mergedTheme","width","screenWidth","height","screenHeight","get","currentStep","steps","currentTargetId","targetId","measurements","undefined","showFullBackdrop","spotlight","x","y","shouldShow","animatedStyle","opacity","duration","easing","inOut","ease","OS","onPress","children","View","style","styles","container","position","inset","backgroundColor","viewBox","fill","fillOpacity","clipPath","id","rx","ry","mask","create","absoluteFillObject","zIndex"],"sourceRoot":"../../../src","sources":["components/GuidonOverlay.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,UAAU,EACVC,UAAU,EACVC,wBAAwB,EACxBC,QAAQ,QACH,cAAc;AACrB,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,UAAU,EACVC,MAAM,QACD,yBAAyB;AAChC,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,CAAC,QAAQ,kBAAkB;AAC3D,SAASC,cAAc,EAAEC,eAAe,EAAEC,iBAAiB,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG9E,MAAMC,WAAW,GAAGhB,QAAQ,CAACiB,uBAAuB,CAACb,GAAG,CAAC;AAEzD,MAAMc,aAKL,GAAG;EACFC,aAAa,EAAE,SAAS;EACxBC,eAAe,EAAE,IAAI;EACrBC,qBAAqB,EAAE,CAAC;EACxBC,gBAAgB,EAAE;AACpB,CAAC;AAQD,OAAO,SAASC,aAAaA,CAAC;EAC5BC,KAAK,GAAG,CAAC,CAAC;EACVC,iBAAiB,GAAG,GAAG;EACvBC;AACkB,CAAC,EAAE;EACrB,MAAMC,QAAQ,GAAGlB,cAAc,CAAEmB,KAAkB,IAAKA,KAAK,CAACD,QAAQ,CAAC;EACvE,MAAME,MAAM,GAAGpB,cAAc,CAAEmB,KAAkB,IAAKA,KAAK,CAACC,MAAM,CAAC;EACnE,MAAMC,gB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