@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,304 @@
1
+ "use strict";
2
+
3
+ import { create } from "zustand";
4
+ import { useShallow } from "zustand/react/shallow";
5
+ const initialState = {
6
+ config: null,
7
+ isActive: false,
8
+ currentStepIndex: 0,
9
+ isCompleted: false,
10
+ targetMeasurements: {},
11
+ isLoading: false,
12
+ error: null,
13
+ waitingForTarget: false,
14
+ waitingTargetId: null
15
+ };
16
+ export const useGuidonStore = create((set, get) => ({
17
+ ...initialState,
18
+ configure: config => {
19
+ set({
20
+ config,
21
+ currentStepIndex: 0,
22
+ isCompleted: false
23
+ });
24
+ },
25
+ start: () => {
26
+ const {
27
+ config
28
+ } = get();
29
+ if (!config || config.steps.length === 0) return;
30
+ set({
31
+ isActive: true,
32
+ currentStepIndex: 0,
33
+ isCompleted: false
34
+ });
35
+
36
+ // Call onStepEnter for the first step
37
+ const firstStep = config.steps[0];
38
+ firstStep?.onStepEnter?.();
39
+ if (firstStep) {
40
+ config.onStepChange?.(0, firstStep);
41
+ }
42
+ },
43
+ next: () => {
44
+ const {
45
+ config,
46
+ currentStepIndex,
47
+ isActive
48
+ } = get();
49
+ if (!config || !isActive) return;
50
+ const currentStep = config.steps[currentStepIndex];
51
+ currentStep?.onStepExit?.();
52
+ if (currentStepIndex < config.steps.length - 1) {
53
+ const nextIndex = currentStepIndex + 1;
54
+ const nextStep = config.steps[nextIndex];
55
+ set({
56
+ currentStepIndex: nextIndex
57
+ });
58
+ nextStep?.onStepEnter?.();
59
+ if (nextStep) {
60
+ config.onStepChange?.(nextIndex, nextStep);
61
+ }
62
+ } else {
63
+ // Last step completed
64
+ get().complete();
65
+ }
66
+ },
67
+ previous: () => {
68
+ const {
69
+ config,
70
+ currentStepIndex,
71
+ isActive
72
+ } = get();
73
+ if (!config || !isActive || currentStepIndex === 0) return;
74
+ const currentStep = config.steps[currentStepIndex];
75
+ currentStep?.onStepExit?.();
76
+ const prevIndex = currentStepIndex - 1;
77
+ const prevStep = config.steps[prevIndex];
78
+ set({
79
+ currentStepIndex: prevIndex
80
+ });
81
+ prevStep?.onStepEnter?.();
82
+ if (prevStep) {
83
+ config.onStepChange?.(prevIndex, prevStep);
84
+ }
85
+ },
86
+ goToStep: index => {
87
+ const {
88
+ config,
89
+ currentStepIndex,
90
+ isActive
91
+ } = get();
92
+ if (!config || !isActive) return;
93
+ if (index < 0 || index >= config.steps.length) return;
94
+ const currentStep = config.steps[currentStepIndex];
95
+ currentStep?.onStepExit?.();
96
+ const targetStep = config.steps[index];
97
+ set({
98
+ currentStepIndex: index
99
+ });
100
+ targetStep?.onStepEnter?.();
101
+ if (targetStep) {
102
+ config.onStepChange?.(index, targetStep);
103
+ }
104
+ },
105
+ skip: () => {
106
+ const {
107
+ config,
108
+ currentStepIndex
109
+ } = get();
110
+ if (!config) return;
111
+ const currentStep = config.steps[currentStepIndex];
112
+ currentStep?.onStepExit?.();
113
+ set({
114
+ isActive: false,
115
+ isCompleted: false
116
+ });
117
+ config.onSkip?.();
118
+ },
119
+ complete: () => {
120
+ const {
121
+ config,
122
+ currentStepIndex
123
+ } = get();
124
+ if (!config) return;
125
+ const currentStep = config.steps[currentStepIndex];
126
+ currentStep?.onStepExit?.();
127
+ set({
128
+ isActive: false,
129
+ isCompleted: true
130
+ });
131
+ config.onComplete?.();
132
+ },
133
+ reset: () => {
134
+ set(initialState);
135
+ },
136
+ registerTarget: (targetId, measurements) => {
137
+ const {
138
+ waitingTargetId
139
+ } = get();
140
+ set(state => ({
141
+ targetMeasurements: {
142
+ ...state.targetMeasurements,
143
+ [targetId]: measurements
144
+ },
145
+ // Clear waiting state if this was the target we were waiting for
146
+ waitingForTarget: waitingTargetId === targetId ? false : state.waitingForTarget,
147
+ waitingTargetId: waitingTargetId === targetId ? null : state.waitingTargetId
148
+ }));
149
+ },
150
+ unregisterTarget: targetId => {
151
+ set(state => {
152
+ const {
153
+ [targetId]: _,
154
+ ...rest
155
+ } = state.targetMeasurements;
156
+ return {
157
+ targetMeasurements: rest
158
+ };
159
+ });
160
+ },
161
+ setLoading: isLoading => {
162
+ set({
163
+ isLoading
164
+ });
165
+ },
166
+ setError: error => {
167
+ set({
168
+ error
169
+ });
170
+ }
171
+ }));
172
+
173
+ /**
174
+ * Guidon API for external control
175
+ * Can be used outside of React components
176
+ */
177
+ export const Guidon = {
178
+ /**
179
+ * Configure the walkthrough with steps and options
180
+ */
181
+ configure: config => {
182
+ useGuidonStore.getState().configure(config);
183
+ },
184
+ /**
185
+ * Start the walkthrough
186
+ */
187
+ start: () => {
188
+ useGuidonStore.getState().start();
189
+ },
190
+ /**
191
+ * Go to the next step
192
+ */
193
+ next: () => {
194
+ useGuidonStore.getState().next();
195
+ },
196
+ /**
197
+ * Go to the previous step
198
+ */
199
+ previous: () => {
200
+ useGuidonStore.getState().previous();
201
+ },
202
+ /**
203
+ * Go to a specific step by index
204
+ */
205
+ goToStep: index => {
206
+ useGuidonStore.getState().goToStep(index);
207
+ },
208
+ /**
209
+ * Skip the walkthrough
210
+ */
211
+ skip: () => {
212
+ useGuidonStore.getState().skip();
213
+ },
214
+ /**
215
+ * Complete the walkthrough
216
+ */
217
+ complete: () => {
218
+ useGuidonStore.getState().complete();
219
+ },
220
+ /**
221
+ * Reset the walkthrough to initial state
222
+ */
223
+ reset: () => {
224
+ useGuidonStore.getState().reset();
225
+ },
226
+ /**
227
+ * Check if the walkthrough is currently active
228
+ */
229
+ isActive: () => {
230
+ return useGuidonStore.getState().isActive;
231
+ },
232
+ /**
233
+ * Check if the walkthrough has been completed
234
+ */
235
+ isCompleted: () => {
236
+ return useGuidonStore.getState().isCompleted;
237
+ },
238
+ /**
239
+ * Get the current step index
240
+ */
241
+ getCurrentStepIndex: () => {
242
+ return useGuidonStore.getState().currentStepIndex;
243
+ },
244
+ /**
245
+ * Get the current step
246
+ */
247
+ getCurrentStep: () => {
248
+ const state = useGuidonStore.getState();
249
+ return state.config?.steps[state.currentStepIndex] ?? null;
250
+ },
251
+ /**
252
+ * Get all steps
253
+ */
254
+ getSteps: () => {
255
+ return useGuidonStore.getState().config?.steps ?? [];
256
+ },
257
+ /**
258
+ * Subscribe to store changes
259
+ */
260
+ subscribe: useGuidonStore.subscribe
261
+ };
262
+
263
+ /**
264
+ * Hook selectors for common use cases
265
+ */
266
+ export const useGuidonActive = () => useGuidonStore(state => state.isActive);
267
+ export const useGuidonStep = () => useGuidonStore(state => {
268
+ if (!state.config || !state.isActive) return null;
269
+ return state.config.steps[state.currentStepIndex];
270
+ });
271
+ export const useGuidonProgress = () => useGuidonStore(useShallow(state => ({
272
+ currentStep: state.currentStepIndex + 1,
273
+ totalSteps: state.config?.steps.length ?? 0,
274
+ percentage: state.config ? (state.currentStepIndex + 1) / state.config.steps.length * 100 : 0
275
+ })));
276
+ export const useTargetMeasurements = targetId => useGuidonStore(state => state.targetMeasurements[targetId]);
277
+
278
+ /**
279
+ * Hook to check if the guidon is waiting for a target element to mount
280
+ * Returns null if not active, not waiting, or if it's a floating step
281
+ */
282
+ export const useWaitingState = () => useGuidonStore(useShallow(state => {
283
+ if (!state.isActive || !state.config) return null;
284
+ const currentStep = state.config.steps[state.currentStepIndex];
285
+ const targetId = currentStep?.targetId;
286
+
287
+ // Floating step (no targetId) - not waiting
288
+ if (!targetId) return null;
289
+ const hasMeasurements = !!state.targetMeasurements[targetId];
290
+ return {
291
+ isWaiting: !hasMeasurements,
292
+ targetId: hasMeasurements ? null : targetId,
293
+ message: currentStep?.waitingMessage ?? null
294
+ };
295
+ }));
296
+
297
+ /**
298
+ * Hook to check if the current step is a floating step (no target element)
299
+ */
300
+ export const useIsFloatingStep = () => useGuidonStore(state => {
301
+ if (!state.config || !state.isActive) return false;
302
+ return !state.config.steps[state.currentStepIndex]?.targetId;
303
+ });
304
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["create","useShallow","initialState","config","isActive","currentStepIndex","isCompleted","targetMeasurements","isLoading","error","waitingForTarget","waitingTargetId","useGuidonStore","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","totalSteps","percentage","useTargetMeasurements","useWaitingState","hasMeasurements","isWaiting","message","waitingMessage","useIsFloatingStep"],"sourceRoot":"../../src","sources":["store.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAASC,UAAU,QAAQ,uBAAuB;AAOlD,MAAMC,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;AAED,OAAO,MAAMC,cAAc,GAAGZ,MAAM,CAAc,CAACa,GAAG,EAAEC,GAAG,MAAM;EAC/D,GAAGZ,YAAY;EAEfa,SAAS,EAAGZ,MAAoB,IAAK;IACnCU,GAAG,CAAC;MAAEV,MAAM;MAAEE,gBAAgB,EAAE,CAAC;MAAEC,WAAW,EAAE;IAAM,CAAC,CAAC;EAC1D,CAAC;EAEDU,KAAK,EAAEA,CAAA,KAAM;IACX,MAAM;MAAEb;IAAO,CAAC,GAAGW,GAAG,CAAC,CAAC;IACxB,IAAI,CAACX,MAAM,IAAIA,MAAM,CAACc,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IAE1CL,GAAG,CAAC;MAAET,QAAQ,EAAE,IAAI;MAAEC,gBAAgB,EAAE,CAAC;MAAEC,WAAW,EAAE;IAAM,CAAC,CAAC;;IAEhE;IACA,MAAMa,SAA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AEH;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAC/BpD,cAAc,CAAE6B,KAAkB,IAAK;EACrC,IAAI,CAACA,KAAK,CAACtC,MAAM,IAAI,CAACsC,KAAK,CAACrC,QAAQ,EAAE,OAAO,KAAK;EAClD,OAAO,CAACqC,KAAK,CAACtC,MAAM,CAACc,KAAK,CAACwB,KAAK,CAACpC,gBAAgB,CAAC,EAAEkC,QAAQ;AAC9D,CAAC,CAAC","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,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import type { GuidonTheme } from '../types';
2
+ interface GuidonOverlayProps {
3
+ theme?: GuidonTheme;
4
+ animationDuration?: number;
5
+ onBackdropPress?: () => void;
6
+ }
7
+ export declare function GuidonOverlay({ theme, animationDuration, onBackdropPress, }: GuidonOverlayProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
9
+ //# sourceMappingURL=GuidonOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidonOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/GuidonOverlay.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAsB,WAAW,EAAe,MAAM,UAAU,CAAC;AAgB7E,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAU,EACV,iBAAuB,EACvB,eAAe,GAChB,EAAE,kBAAkB,kDAuKpB"}
@@ -0,0 +1,14 @@
1
+ import type { GuidonProviderProps } from '../types';
2
+ interface GuidonContextValue {
3
+ start: () => void;
4
+ skip: () => void;
5
+ reset: () => void;
6
+ replay: () => Promise<void>;
7
+ isActive: boolean;
8
+ isCompleted: boolean;
9
+ isLoading: boolean;
10
+ }
11
+ export declare function useGuidonContext(): GuidonContextValue;
12
+ export declare function GuidonProvider({ children, config, autoStart, shouldStart, persistenceAdapter, portalComponent: Portal, renderTooltip, tooltipLabels, onBackdropPress, }: GuidonProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=GuidonProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidonProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/GuidonProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAElB,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB;AAID,wBAAgB,gBAAgB,uBAM/B;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,MAAM,EACN,SAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,eAAe,EAAE,MAAM,EACvB,aAAa,EACb,aAAa,EACb,eAAe,GAChB,EAAE,mBAAmB,2CAgJrB"}
@@ -0,0 +1,7 @@
1
+ import type { GuidonTargetProps } from "../types";
2
+ /**
3
+ * Wrapper component that marks an element as a walkthrough target
4
+ * Automatically measures and reports its position to the walkthrough store
5
+ */
6
+ export declare function GuidonTarget({ children, targetId, active, }: GuidonTargetProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=GuidonTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidonTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/GuidonTarget.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,MAAa,GACd,EAAE,iBAAiB,2CAyGnB"}
@@ -0,0 +1,24 @@
1
+ import type { GuidonTheme, GuidonStep } from '../types';
2
+ interface GuidonTooltipProps {
3
+ theme?: GuidonTheme;
4
+ animationDuration?: number;
5
+ renderCustomTooltip?: (props: {
6
+ step: GuidonStep;
7
+ currentIndex: number;
8
+ totalSteps: number;
9
+ onNext: () => void;
10
+ onPrevious: () => void;
11
+ onSkip: () => void;
12
+ }) => React.ReactNode;
13
+ labels?: {
14
+ next?: string;
15
+ previous?: string;
16
+ skip?: string;
17
+ finish?: string;
18
+ stepOf?: (current: number, total: number) => string;
19
+ waitingDefault?: string;
20
+ };
21
+ }
22
+ export declare function GuidonTooltip({ theme, animationDuration, renderCustomTooltip, labels, }: GuidonTooltipProps): import("react/jsx-runtime").JSX.Element | null;
23
+ export {};
24
+ //# sourceMappingURL=GuidonTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidonTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/GuidonTooltip.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAoD,UAAU,EAAoB,MAAM,UAAU,CAAC;AAyF5H,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC5B,IAAI,EAAE,UAAU,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;QACpD,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAU,EACV,iBAAuB,EACvB,mBAAmB,EACnB,MAAW,GACZ,EAAE,kBAAkB,kDAyQpB"}
@@ -0,0 +1,5 @@
1
+ export { GuidonTarget } from './GuidonTarget';
2
+ export { GuidonOverlay } from './GuidonOverlay';
3
+ export { GuidonTooltip } from './GuidonTooltip';
4
+ export { GuidonProvider, useGuidonContext } from './GuidonProvider';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { useGuidonRef } from './useGuidonRef';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { type RefObject } from 'react';
2
+ /**
3
+ * Element type that can be measured
4
+ * Supports both web elements and React Native Views
5
+ */
6
+ type MeasurableElement = {
7
+ getBoundingClientRect?: () => DOMRect;
8
+ measureInWindow?: (callback: (x: number, y: number, width: number, height: number) => void) => void;
9
+ };
10
+ /**
11
+ * Hook that returns a ref to attach to an element for guidon targeting.
12
+ * Alternative to the GuidonTarget wrapper component.
13
+ *
14
+ * @param targetId - The target ID that matches a step's targetId
15
+ * @returns A ref to attach to the target element
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * function MyComponent() {
20
+ * const buttonRef = useGuidonRef<View>('my-button');
21
+ * return <Button ref={buttonRef}>Click me</Button>;
22
+ * }
23
+ * ```
24
+ *
25
+ * @example Web usage
26
+ * ```tsx
27
+ * function MyComponent() {
28
+ * const divRef = useGuidonRef<HTMLDivElement>('my-div');
29
+ * return <div ref={divRef}>Highlight me</div>;
30
+ * }
31
+ * ```
32
+ */
33
+ export declare function useGuidonRef<T extends MeasurableElement>(targetId: string): RefObject<T | null>;
34
+ export {};
35
+ //# sourceMappingURL=useGuidonRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGuidonRef.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGuidonRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvE;;;GAGG;AACH,KAAK,iBAAiB,GAAG;IACvB,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC;IACtC,eAAe,CAAC,EAAE,CAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,KACpE,IAAI,CAAC;CACX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,MAAM,GACf,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAgHrB"}
@@ -0,0 +1,7 @@
1
+ export { GuidonTarget, GuidonOverlay, GuidonTooltip, GuidonProvider, useGuidonContext, } from "./components";
2
+ export { useGuidonRef } from "./hooks";
3
+ export { useGuidonStore, Guidon, useGuidonActive, useGuidonStep, useGuidonProgress, useTargetMeasurements, useWaitingState, useIsFloatingStep, } from "./store";
4
+ export type { GuidonStep, GuidonConfig, GuidonTheme, GuidonProgress, GuidonPersistenceAdapter, GuidonProviderProps, GuidonTargetProps, GuidonTooltipLabels, GuidonTooltipRenderProps, TooltipPosition, FloatingPosition, TargetMeasurements, GuidonState, GuidonActions, GuidonStore, } from "./types";
5
+ export { createNoopAdapter, createMemoryAdapter, createLocalStorageAdapter, createAsyncStorageAdapter, createApiAdapter, createCompositeAdapter, } from "./persistence/adapters";
6
+ export { useGuidonPersistence, useShouldShowGuidon, } from "./persistence/hooks";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EACL,cAAc,EACd,MAAM,EACN,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,57 @@
1
+ import type { GuidonPersistenceAdapter } from '../types';
2
+ /**
3
+ * No-op adapter that doesn't persist anything
4
+ * Useful for testing or when persistence is not needed
5
+ */
6
+ export declare const createNoopAdapter: () => GuidonPersistenceAdapter;
7
+ /**
8
+ * Memory adapter that stores progress in memory
9
+ * Data is lost when the app is closed
10
+ */
11
+ export declare const createMemoryAdapter: () => GuidonPersistenceAdapter;
12
+ /**
13
+ * localStorage adapter for web
14
+ * Only works in browser environments
15
+ */
16
+ export declare const createLocalStorageAdapter: (keyPrefix?: string) => GuidonPersistenceAdapter;
17
+ /**
18
+ * AsyncStorage adapter for React Native
19
+ * Requires @react-native-async-storage/async-storage to be installed
20
+ *
21
+ * @example
22
+ * import AsyncStorage from '@react-native-async-storage/async-storage';
23
+ * const adapter = createAsyncStorageAdapter(AsyncStorage);
24
+ */
25
+ export declare const createAsyncStorageAdapter: (asyncStorage: {
26
+ getItem: (key: string) => Promise<string | null>;
27
+ setItem: (key: string, value: string) => Promise<void>;
28
+ removeItem: (key: string) => Promise<void>;
29
+ getAllKeys: () => Promise<readonly string[]>;
30
+ multiGet: (keys: readonly string[]) => Promise<readonly [string, string | null][]>;
31
+ }, keyPrefix?: string) => GuidonPersistenceAdapter;
32
+ /**
33
+ * Create a custom API adapter for backend persistence
34
+ * This is a factory function that creates an adapter based on your API endpoints
35
+ *
36
+ * @example
37
+ * const adapter = createApiAdapter({
38
+ * loadProgress: async (guidonId) => {
39
+ * const response = await fetch(`/api/guidon/${guidonId}`);
40
+ * return response.json();
41
+ * },
42
+ * saveProgress: async (progress) => {
43
+ * await fetch(`/api/guidon/${progress.guidonId}`, {
44
+ * method: 'POST',
45
+ * body: JSON.stringify(progress),
46
+ * });
47
+ * },
48
+ * });
49
+ */
50
+ export declare const createApiAdapter: (handlers: Partial<GuidonPersistenceAdapter>) => GuidonPersistenceAdapter;
51
+ /**
52
+ * Combine multiple adapters (e.g., save to both local and API)
53
+ * Loads from the first adapter that returns data
54
+ * Saves to all adapters
55
+ */
56
+ export declare const createCompositeAdapter: (adapters: GuidonPersistenceAdapter[]) => GuidonPersistenceAdapter;
57
+ //# sourceMappingURL=adapters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../../../src/persistence/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAkB,MAAM,UAAU,CAAC;AAIzE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,wBAKnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,wBAatC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GACpC,YAAW,MAA2B,KACrC,wBAwDD,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc;IACZ,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,UAAU,EAAE,MAAM,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACpF,EACD,YAAW,MAA2B,KACrC,wBA2CD,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,OAAO,CAAC,wBAAwB,CAAC,KAC1C,wBAQF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,wBAAwB,EAAE,KACnC,wBA0BD,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { GuidonPersistenceAdapter, GuidonProgress } from '../types';
2
+ /**
3
+ * Hook to manage guidon's walkthrough progress with a persistence adapter
4
+ */
5
+ export declare function useGuidonPersistence(adapter: GuidonPersistenceAdapter | undefined, guidonId: string): {
6
+ progress: GuidonProgress | null;
7
+ isLoading: boolean;
8
+ error: string | null;
9
+ isCompleted: boolean;
10
+ hasStarted: boolean;
11
+ saveProgress: (newProgress: Omit<GuidonProgress, "guidonId">) => Promise<void>;
12
+ clearProgress: () => Promise<void>;
13
+ markCompleted: () => Promise<void>;
14
+ markStepViewed: (stepIndex: number) => Promise<void>;
15
+ };
16
+ /**
17
+ * Hook to check if a guidon should be shown
18
+ */
19
+ export declare function useShouldShowGuidon(adapter: GuidonPersistenceAdapter | undefined, guidonId: string, options?: {
20
+ /** Show even if completed (for replay) */
21
+ forceShow?: boolean;
22
+ /** Additional condition to check */
23
+ additionalCondition?: () => boolean | Promise<boolean>;
24
+ }): {
25
+ shouldShow: boolean;
26
+ isChecking: boolean;
27
+ isCompleted: boolean;
28
+ };
29
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/persistence/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,GAAG,SAAS,EAC7C,QAAQ,EAAE,MAAM;;;;;;gCA0CM,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;;;gCA2ClC,MAAM;EAsB3B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,wBAAwB,GAAG,SAAS,EAC7C,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IACR,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,mBAAmB,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD;;;;EAkDF"}
@@ -0,0 +1,3 @@
1
+ export * from './adapters';
2
+ export * from './hooks';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/persistence/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}