@korsolutions/guidon 1.0.0 → 1.0.2

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 (144) hide show
  1. package/README.md +11 -11
  2. package/dist/commonjs/babel.config.js +15 -0
  3. package/dist/commonjs/babel.config.js.map +1 -0
  4. package/dist/commonjs/bob.config.js +11 -0
  5. package/dist/commonjs/bob.config.js.map +1 -0
  6. package/dist/commonjs/components/GuidonOverlay.js +206 -0
  7. package/dist/commonjs/components/GuidonOverlay.js.map +1 -0
  8. package/dist/commonjs/components/GuidonProvider.js +157 -0
  9. package/dist/commonjs/components/GuidonProvider.js.map +1 -0
  10. package/dist/commonjs/components/GuidonTarget.js +108 -0
  11. package/dist/commonjs/components/GuidonTarget.js.map +1 -0
  12. package/dist/commonjs/components/GuidonTooltip.js +422 -0
  13. package/dist/commonjs/components/GuidonTooltip.js.map +1 -0
  14. package/dist/commonjs/components/index.js +40 -0
  15. package/dist/commonjs/components/index.js.map +1 -0
  16. package/dist/commonjs/hooks/index.js +13 -0
  17. package/dist/commonjs/hooks/index.js.map +1 -0
  18. package/dist/commonjs/hooks/useGuidonRef.js +132 -0
  19. package/dist/commonjs/hooks/useGuidonRef.js.map +1 -0
  20. package/dist/commonjs/index.js +143 -0
  21. package/dist/commonjs/index.js.map +1 -0
  22. package/dist/commonjs/package.json +1 -0
  23. package/dist/commonjs/persistence/adapters.js +213 -0
  24. package/dist/commonjs/persistence/adapters.js.map +1 -0
  25. package/dist/commonjs/persistence/hooks.js +153 -0
  26. package/dist/commonjs/persistence/hooks.js.map +1 -0
  27. package/dist/commonjs/persistence/index.js +28 -0
  28. package/dist/commonjs/persistence/index.js.map +1 -0
  29. package/dist/commonjs/store.js +305 -0
  30. package/dist/commonjs/store.js.map +1 -0
  31. package/dist/commonjs/tsconfig.json +32 -0
  32. package/dist/commonjs/types.js +6 -0
  33. package/dist/commonjs/types.js.map +1 -0
  34. package/dist/module/babel.config.js +15 -0
  35. package/dist/module/babel.config.js.map +1 -0
  36. package/dist/module/bob.config.js +11 -0
  37. package/dist/module/bob.config.js.map +1 -0
  38. package/dist/module/components/GuidonOverlay.js +201 -0
  39. package/dist/module/components/GuidonOverlay.js.map +1 -0
  40. package/dist/module/components/GuidonProvider.js +152 -0
  41. package/dist/module/components/GuidonProvider.js.map +1 -0
  42. package/dist/module/components/GuidonTarget.js +104 -0
  43. package/dist/module/components/GuidonTarget.js.map +1 -0
  44. package/dist/module/components/GuidonTooltip.js +417 -0
  45. package/dist/module/components/GuidonTooltip.js.map +1 -0
  46. package/dist/module/components/index.js +7 -0
  47. package/dist/module/components/index.js.map +1 -0
  48. package/dist/module/hooks/index.js +4 -0
  49. package/dist/module/hooks/index.js.map +1 -0
  50. package/dist/module/hooks/useGuidonRef.js +129 -0
  51. package/dist/module/hooks/useGuidonRef.js.map +1 -0
  52. package/dist/module/index.js +17 -0
  53. package/dist/module/index.js.map +1 -0
  54. package/dist/module/package.json +1 -0
  55. package/dist/module/persistence/adapters.js +203 -0
  56. package/dist/module/persistence/adapters.js.map +1 -0
  57. package/dist/module/persistence/hooks.js +148 -0
  58. package/dist/module/persistence/hooks.js.map +1 -0
  59. package/dist/module/persistence/index.js +5 -0
  60. package/dist/module/persistence/index.js.map +1 -0
  61. package/dist/module/store.js +295 -0
  62. package/dist/module/store.js.map +1 -0
  63. package/dist/module/tsconfig.json +32 -0
  64. package/dist/module/types.js +4 -0
  65. package/dist/module/types.js.map +1 -0
  66. package/dist/typescript/commonjs/components/GuidonOverlay.d.ts +9 -0
  67. package/dist/typescript/commonjs/components/GuidonOverlay.d.ts.map +1 -0
  68. package/dist/typescript/commonjs/components/GuidonProvider.d.ts +14 -0
  69. package/dist/typescript/commonjs/components/GuidonProvider.d.ts.map +1 -0
  70. package/dist/typescript/commonjs/components/GuidonTarget.d.ts +7 -0
  71. package/dist/typescript/commonjs/components/GuidonTarget.d.ts.map +1 -0
  72. package/dist/typescript/commonjs/components/GuidonTooltip.d.ts +24 -0
  73. package/dist/typescript/commonjs/components/GuidonTooltip.d.ts.map +1 -0
  74. package/dist/typescript/commonjs/components/index.d.ts +5 -0
  75. package/dist/typescript/commonjs/components/index.d.ts.map +1 -0
  76. package/dist/typescript/commonjs/hooks/index.d.ts +2 -0
  77. package/dist/typescript/commonjs/hooks/index.d.ts.map +1 -0
  78. package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts +35 -0
  79. package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts.map +1 -0
  80. package/dist/typescript/commonjs/index.d.ts +7 -0
  81. package/dist/typescript/commonjs/index.d.ts.map +1 -0
  82. package/dist/typescript/commonjs/package.json +1 -0
  83. package/dist/typescript/commonjs/persistence/adapters.d.ts +57 -0
  84. package/dist/typescript/commonjs/persistence/adapters.d.ts.map +1 -0
  85. package/dist/typescript/commonjs/persistence/hooks.d.ts +29 -0
  86. package/dist/typescript/commonjs/persistence/hooks.d.ts.map +1 -0
  87. package/dist/typescript/commonjs/persistence/index.d.ts +3 -0
  88. package/dist/typescript/commonjs/persistence/index.d.ts.map +1 -0
  89. package/dist/typescript/commonjs/store.d.ts +89 -0
  90. package/dist/typescript/commonjs/store.d.ts.map +1 -0
  91. package/dist/{index-D_JFvCIg.d.mts → typescript/commonjs/types.d.ts} +40 -104
  92. package/dist/typescript/commonjs/types.d.ts.map +1 -0
  93. package/dist/typescript/module/components/GuidonOverlay.d.ts +9 -0
  94. package/dist/typescript/module/components/GuidonOverlay.d.ts.map +1 -0
  95. package/dist/typescript/module/components/GuidonProvider.d.ts +14 -0
  96. package/dist/typescript/module/components/GuidonProvider.d.ts.map +1 -0
  97. package/dist/typescript/module/components/GuidonTarget.d.ts +7 -0
  98. package/dist/typescript/module/components/GuidonTarget.d.ts.map +1 -0
  99. package/dist/typescript/module/components/GuidonTooltip.d.ts +24 -0
  100. package/dist/typescript/module/components/GuidonTooltip.d.ts.map +1 -0
  101. package/dist/typescript/module/components/index.d.ts +5 -0
  102. package/dist/typescript/module/components/index.d.ts.map +1 -0
  103. package/dist/typescript/module/hooks/index.d.ts +2 -0
  104. package/dist/typescript/module/hooks/index.d.ts.map +1 -0
  105. package/dist/typescript/module/hooks/useGuidonRef.d.ts +35 -0
  106. package/dist/typescript/module/hooks/useGuidonRef.d.ts.map +1 -0
  107. package/dist/typescript/module/index.d.ts +7 -0
  108. package/dist/typescript/module/index.d.ts.map +1 -0
  109. package/dist/typescript/module/package.json +1 -0
  110. package/dist/typescript/module/persistence/adapters.d.ts +57 -0
  111. package/dist/typescript/module/persistence/adapters.d.ts.map +1 -0
  112. package/dist/typescript/module/persistence/hooks.d.ts +29 -0
  113. package/dist/typescript/module/persistence/hooks.d.ts.map +1 -0
  114. package/dist/typescript/module/persistence/index.d.ts +3 -0
  115. package/dist/typescript/module/persistence/index.d.ts.map +1 -0
  116. package/dist/typescript/module/store.d.ts +89 -0
  117. package/dist/typescript/module/store.d.ts.map +1 -0
  118. package/dist/{index-D_JFvCIg.d.ts → typescript/module/types.d.ts} +40 -104
  119. package/dist/typescript/module/types.d.ts.map +1 -0
  120. package/package.json +25 -13
  121. package/src/babel.config.js +18 -0
  122. package/src/bob.config.js +14 -0
  123. package/src/components/GuidonOverlay.tsx +60 -4
  124. package/src/components/GuidonProvider.tsx +29 -1
  125. package/src/components/GuidonTarget.tsx +26 -16
  126. package/src/components/GuidonTooltip.tsx +143 -9
  127. package/src/hooks/index.ts +1 -0
  128. package/src/hooks/useGuidonRef.ts +154 -0
  129. package/src/index.ts +6 -0
  130. package/src/store.ts +40 -0
  131. package/src/tsconfig.json +32 -0
  132. package/src/types.ts +32 -2
  133. package/dist/index.d.mts +0 -128
  134. package/dist/index.d.ts +0 -128
  135. package/dist/index.js +0 -1098
  136. package/dist/index.js.map +0 -1
  137. package/dist/index.mjs +0 -1073
  138. package/dist/index.mjs.map +0 -1
  139. package/dist/persistence/index.d.mts +0 -2
  140. package/dist/persistence/index.d.ts +0 -2
  141. package/dist/persistence/index.js +0 -300
  142. package/dist/persistence/index.js.map +0 -1
  143. package/dist/persistence/index.mjs +0 -291
  144. package/dist/persistence/index.mjs.map +0 -1
@@ -0,0 +1,295 @@
1
+ "use strict";
2
+
3
+ import { create } from "zustand";
4
+ const initialState = {
5
+ config: null,
6
+ isActive: false,
7
+ currentStepIndex: 0,
8
+ isCompleted: false,
9
+ targetMeasurements: {},
10
+ isLoading: false,
11
+ error: null,
12
+ waitingForTarget: false,
13
+ waitingTargetId: null
14
+ };
15
+ export const useGuidonStore = create((set, get) => ({
16
+ ...initialState,
17
+ configure: config => {
18
+ set({
19
+ config,
20
+ currentStepIndex: 0,
21
+ isCompleted: false
22
+ });
23
+ },
24
+ start: () => {
25
+ const {
26
+ config
27
+ } = get();
28
+ if (!config || config.steps.length === 0) return;
29
+ set({
30
+ isActive: true,
31
+ currentStepIndex: 0,
32
+ isCompleted: false
33
+ });
34
+
35
+ // Call onStepEnter for the first step
36
+ const firstStep = config.steps[0];
37
+ firstStep.onStepEnter?.();
38
+ config.onStepChange?.(0, firstStep);
39
+ },
40
+ next: () => {
41
+ const {
42
+ config,
43
+ currentStepIndex,
44
+ isActive
45
+ } = get();
46
+ if (!config || !isActive) return;
47
+ const currentStep = config.steps[currentStepIndex];
48
+ currentStep?.onStepExit?.();
49
+ if (currentStepIndex < config.steps.length - 1) {
50
+ const nextIndex = currentStepIndex + 1;
51
+ const nextStep = config.steps[nextIndex];
52
+ set({
53
+ currentStepIndex: nextIndex
54
+ });
55
+ nextStep.onStepEnter?.();
56
+ config.onStepChange?.(nextIndex, nextStep);
57
+ } else {
58
+ // Last step completed
59
+ get().complete();
60
+ }
61
+ },
62
+ previous: () => {
63
+ const {
64
+ config,
65
+ currentStepIndex,
66
+ isActive
67
+ } = get();
68
+ if (!config || !isActive || currentStepIndex === 0) return;
69
+ const currentStep = config.steps[currentStepIndex];
70
+ currentStep?.onStepExit?.();
71
+ const prevIndex = currentStepIndex - 1;
72
+ const prevStep = config.steps[prevIndex];
73
+ set({
74
+ currentStepIndex: prevIndex
75
+ });
76
+ prevStep.onStepEnter?.();
77
+ config.onStepChange?.(prevIndex, prevStep);
78
+ },
79
+ goToStep: index => {
80
+ const {
81
+ config,
82
+ currentStepIndex,
83
+ isActive
84
+ } = get();
85
+ if (!config || !isActive) return;
86
+ if (index < 0 || index >= config.steps.length) return;
87
+ const currentStep = config.steps[currentStepIndex];
88
+ currentStep?.onStepExit?.();
89
+ const targetStep = config.steps[index];
90
+ set({
91
+ currentStepIndex: index
92
+ });
93
+ targetStep.onStepEnter?.();
94
+ config.onStepChange?.(index, targetStep);
95
+ },
96
+ skip: () => {
97
+ const {
98
+ config,
99
+ currentStepIndex
100
+ } = get();
101
+ if (!config) return;
102
+ const currentStep = config.steps[currentStepIndex];
103
+ currentStep?.onStepExit?.();
104
+ set({
105
+ isActive: false,
106
+ isCompleted: false
107
+ });
108
+ config.onSkip?.();
109
+ },
110
+ complete: () => {
111
+ const {
112
+ config,
113
+ currentStepIndex
114
+ } = get();
115
+ if (!config) return;
116
+ const currentStep = config.steps[currentStepIndex];
117
+ currentStep?.onStepExit?.();
118
+ set({
119
+ isActive: false,
120
+ isCompleted: true
121
+ });
122
+ config.onComplete?.();
123
+ },
124
+ reset: () => {
125
+ set(initialState);
126
+ },
127
+ registerTarget: (targetId, measurements) => {
128
+ const {
129
+ waitingTargetId
130
+ } = get();
131
+ set(state => ({
132
+ targetMeasurements: {
133
+ ...state.targetMeasurements,
134
+ [targetId]: measurements
135
+ },
136
+ // Clear waiting state if this was the target we were waiting for
137
+ waitingForTarget: waitingTargetId === targetId ? false : state.waitingForTarget,
138
+ waitingTargetId: waitingTargetId === targetId ? null : state.waitingTargetId
139
+ }));
140
+ },
141
+ unregisterTarget: targetId => {
142
+ set(state => {
143
+ const {
144
+ [targetId]: _,
145
+ ...rest
146
+ } = state.targetMeasurements;
147
+ return {
148
+ targetMeasurements: rest
149
+ };
150
+ });
151
+ },
152
+ setLoading: isLoading => {
153
+ set({
154
+ isLoading
155
+ });
156
+ },
157
+ setError: error => {
158
+ set({
159
+ error
160
+ });
161
+ }
162
+ }));
163
+
164
+ /**
165
+ * Guidon API for external control
166
+ * Can be used outside of React components
167
+ */
168
+ export const Guidon = {
169
+ /**
170
+ * Configure the walkthrough with steps and options
171
+ */
172
+ configure: config => {
173
+ useGuidonStore.getState().configure(config);
174
+ },
175
+ /**
176
+ * Start the walkthrough
177
+ */
178
+ start: () => {
179
+ useGuidonStore.getState().start();
180
+ },
181
+ /**
182
+ * Go to the next step
183
+ */
184
+ next: () => {
185
+ useGuidonStore.getState().next();
186
+ },
187
+ /**
188
+ * Go to the previous step
189
+ */
190
+ previous: () => {
191
+ useGuidonStore.getState().previous();
192
+ },
193
+ /**
194
+ * Go to a specific step by index
195
+ */
196
+ goToStep: index => {
197
+ useGuidonStore.getState().goToStep(index);
198
+ },
199
+ /**
200
+ * Skip the walkthrough
201
+ */
202
+ skip: () => {
203
+ useGuidonStore.getState().skip();
204
+ },
205
+ /**
206
+ * Complete the walkthrough
207
+ */
208
+ complete: () => {
209
+ useGuidonStore.getState().complete();
210
+ },
211
+ /**
212
+ * Reset the walkthrough to initial state
213
+ */
214
+ reset: () => {
215
+ useGuidonStore.getState().reset();
216
+ },
217
+ /**
218
+ * Check if the walkthrough is currently active
219
+ */
220
+ isActive: () => {
221
+ return useGuidonStore.getState().isActive;
222
+ },
223
+ /**
224
+ * Check if the walkthrough has been completed
225
+ */
226
+ isCompleted: () => {
227
+ return useGuidonStore.getState().isCompleted;
228
+ },
229
+ /**
230
+ * Get the current step index
231
+ */
232
+ getCurrentStepIndex: () => {
233
+ return useGuidonStore.getState().currentStepIndex;
234
+ },
235
+ /**
236
+ * Get the current step
237
+ */
238
+ getCurrentStep: () => {
239
+ const state = useGuidonStore.getState();
240
+ return state.config?.steps[state.currentStepIndex] ?? null;
241
+ },
242
+ /**
243
+ * Get all steps
244
+ */
245
+ getSteps: () => {
246
+ return useGuidonStore.getState().config?.steps ?? [];
247
+ },
248
+ /**
249
+ * Subscribe to store changes
250
+ */
251
+ subscribe: useGuidonStore.subscribe
252
+ };
253
+
254
+ /**
255
+ * Hook selectors for common use cases
256
+ */
257
+ export const useGuidonActive = () => useGuidonStore(state => state.isActive);
258
+ export const useGuidonStep = () => useGuidonStore(state => {
259
+ if (!state.config || !state.isActive) return null;
260
+ return state.config.steps[state.currentStepIndex];
261
+ });
262
+ export const useGuidonProgress = () => useGuidonStore(state => ({
263
+ currentStep: state.currentStepIndex + 1,
264
+ totalSteps: state.config?.steps.length ?? 0,
265
+ percentage: state.config ? (state.currentStepIndex + 1) / state.config.steps.length * 100 : 0
266
+ }));
267
+ export const useTargetMeasurements = targetId => useGuidonStore(state => state.targetMeasurements[targetId]);
268
+
269
+ /**
270
+ * Hook to check if the guidon is waiting for a target element to mount
271
+ * Returns null if not active, not waiting, or if it's a floating step
272
+ */
273
+ export const useWaitingState = () => useGuidonStore(state => {
274
+ if (!state.isActive || !state.config) return null;
275
+ const currentStep = state.config.steps[state.currentStepIndex];
276
+ const targetId = currentStep?.targetId;
277
+
278
+ // Floating step (no targetId) - not waiting
279
+ if (!targetId) return null;
280
+ const hasMeasurements = !!state.targetMeasurements[targetId];
281
+ return {
282
+ isWaiting: !hasMeasurements,
283
+ targetId: hasMeasurements ? null : targetId,
284
+ message: currentStep?.waitingMessage ?? null
285
+ };
286
+ });
287
+
288
+ /**
289
+ * Hook to check if the current step is a floating step (no target element)
290
+ */
291
+ export const useIsFloatingStep = () => useGuidonStore(state => {
292
+ if (!state.config || !state.isActive) return false;
293
+ return !state.config.steps[state.currentStepIndex]?.targetId;
294
+ });
295
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["create","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;AAOhC,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,GAAGX,MAAM,CAAc,CAACY,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,SAAS,GAAGhB,MAAM,CAACc,KAAK,CAAC,CAAC,CAAC;IACjCE,SAAS,CAACC,WAAW,GAAG,CAAC;IACzBjB,MAAM,CAACkB,YAAY,GAAG,CAAC,EAAEF,SAAS,CAAC;EACrC,CAAC;EAEDG,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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,2CAmGnB"}
@@ -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"}