@flowsterix/react 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/radixDialogHelpers.d.ts +0 -40
- package/dist/adapters/radixDialogHelpers.d.ts.map +1 -1
- package/dist/context.d.ts +2 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/dialog/DialogRegistryContext.d.ts +16 -0
- package/dist/dialog/DialogRegistryContext.d.ts.map +1 -0
- package/dist/hooks/useDialogAutomation.d.ts +16 -0
- package/dist/hooks/useDialogAutomation.d.ts.map +1 -0
- package/dist/hooks/useRadixTourDialog.d.ts +26 -0
- package/dist/hooks/useRadixTourDialog.d.ts.map +1 -0
- package/dist/index.cjs +581 -227
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +556 -199
- package/package.json +2 -2
|
@@ -1,46 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper utilities for programmatically controlling Radix Dialog components
|
|
3
|
-
* in tour lifecycle hooks (onEnter, onResume, onExit).
|
|
4
|
-
*/
|
|
5
1
|
/**
|
|
6
2
|
* Wait for next animation frame + microtask flush.
|
|
7
3
|
* Use this to ensure DOM updates have completed after triggering UI changes.
|
|
8
4
|
*/
|
|
9
5
|
export declare const waitForDom: () => Promise<void>;
|
|
10
|
-
export interface CreateRadixDialogHelpersParams {
|
|
11
|
-
/** Selector for the dialog content element (visible when open) */
|
|
12
|
-
contentSelector: string;
|
|
13
|
-
/** Selector for the trigger button that opens the dialog */
|
|
14
|
-
triggerSelector: string;
|
|
15
|
-
}
|
|
16
|
-
export interface RadixDialogHelpers {
|
|
17
|
-
/** Check if the dialog is currently open */
|
|
18
|
-
isOpen: () => boolean;
|
|
19
|
-
/** Open the dialog if not already open */
|
|
20
|
-
open: () => Promise<void>;
|
|
21
|
-
/** Close the dialog if currently open */
|
|
22
|
-
close: () => Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Create helpers for programmatically controlling a Radix Dialog.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```tsx
|
|
29
|
-
* const settingsDialog = createRadixDialogHelpers({
|
|
30
|
-
* contentSelector: '[data-tour-target="settings-dialog"]',
|
|
31
|
-
* triggerSelector: '[data-tour-target="settings-trigger"]',
|
|
32
|
-
* })
|
|
33
|
-
*
|
|
34
|
-
* // In flow step:
|
|
35
|
-
* {
|
|
36
|
-
* id: 'settings-panel',
|
|
37
|
-
* target: { selector: '[data-tour-target="settings-dialog"]' },
|
|
38
|
-
* onEnter: settingsDialog.open,
|
|
39
|
-
* onResume: settingsDialog.open,
|
|
40
|
-
* onExit: settingsDialog.close,
|
|
41
|
-
* content: <p>Configure your settings here</p>,
|
|
42
|
-
* }
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare const createRadixDialogHelpers: (params: CreateRadixDialogHelpersParams) => RadixDialogHelpers;
|
|
46
6
|
//# sourceMappingURL=radixDialogHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radixDialogHelpers.d.ts","sourceRoot":"","sources":["../../src/adapters/radixDialogHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"radixDialogHelpers.d.ts","sourceRoot":"","sources":["../../src/adapters/radixDialogHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,IAAI,CAGvC,CAAA"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BackdropInteractionMode, EventBus, FlowAnalyticsHandlers, FlowCancelReason, FlowDefinition, FlowEvents, FlowState, MaybePromise, StartFlowOptions, Step, StorageAdapter, VersionMismatchInfo } from '@flowsterix/core';
|
|
1
|
+
import type { BackdropInteractionMode, DialogConfig, EventBus, FlowAnalyticsHandlers, FlowCancelReason, FlowDefinition, FlowEvents, FlowState, MaybePromise, StartFlowOptions, Step, StorageAdapter, VersionMismatchInfo } from '@flowsterix/core';
|
|
2
2
|
import type { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
|
3
3
|
import type { TourLabels } from './labels';
|
|
4
4
|
import type { AnimationAdapter } from './motion/animationAdapter';
|
|
@@ -32,6 +32,7 @@ export interface TourContextValue {
|
|
|
32
32
|
activeFlowId: string | null;
|
|
33
33
|
state: FlowState | null;
|
|
34
34
|
activeStep: Step<ReactNode> | null;
|
|
35
|
+
activeDialogConfig: DialogConfig | undefined;
|
|
35
36
|
startFlow: (flowId: string, options?: StartFlowOptions) => MaybePromise<FlowState>;
|
|
36
37
|
next: () => MaybePromise<FlowState>;
|
|
37
38
|
back: () => MaybePromise<FlowState>;
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,SAAS,EAET,YAAY,EAEZ,gBAAgB,EAChB,IAAI,EACJ,cAAc,EAEd,mBAAmB,EACpB,MAAM,kBAAkB,CAAA;AAUzB,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,cAAc,EACf,MAAM,OAAO,CAAA;AAUd,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EACZ,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,SAAS,EAET,YAAY,EAEZ,gBAAgB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AC5C,cAAc,EAAE,OAAO,CAAA;CACxB;AAeD,eAAO,MAAM,YAAY,GAAI,kTAe1B,iBAAiB,CAAC,iBAAiB,CAAC,4CA4lBtC,CAAA;AAiCD,eAAO,MAAM,OAAO,QAAO,gBAM1B,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,SAAS,SAAS,OAAO,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,EAE9D,OAAO,SAAS,EAChB,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,KAAK,IAAI,SAQ7D,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
export interface DialogController {
|
|
3
|
+
open: () => void;
|
|
4
|
+
close: () => void;
|
|
5
|
+
isOpen: () => boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface DialogRegistryContextValue {
|
|
8
|
+
register: (dialogId: string, controller: DialogController) => void;
|
|
9
|
+
unregister: (dialogId: string) => void;
|
|
10
|
+
getController: (dialogId: string) => DialogController | undefined;
|
|
11
|
+
isRegistered: (dialogId: string) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const DialogRegistryProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const useDialogRegistry: () => DialogRegistryContextValue;
|
|
15
|
+
export declare const useDialogRegistryOptional: () => DialogRegistryContextValue | undefined;
|
|
16
|
+
//# sourceMappingURL=DialogRegistryContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogRegistryContext.d.ts","sourceRoot":"","sources":["../../src/dialog/DialogRegistryContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAS9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,MAAM,EAAE,MAAM,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAClE,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAA;IACjE,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAA;CAC5C;AAMD,eAAO,MAAM,sBAAsB,GAAI,cAAc,iBAAiB,4CAqCrE,CAAA;AAED,eAAO,MAAM,iBAAiB,QAAO,0BAQpC,CAAA;AAED,eAAO,MAAM,yBAAyB,QAClC,0BAA0B,GAC1B,SAEH,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EventBus, FlowDefinition, FlowEvents, FlowState } from '@flowsterix/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { DialogRegistryContextValue } from '../dialog/DialogRegistryContext';
|
|
4
|
+
export interface UseDialogAutomationParams {
|
|
5
|
+
flow: FlowDefinition<ReactNode> | undefined;
|
|
6
|
+
state: FlowState | null;
|
|
7
|
+
events: EventBus<FlowEvents<ReactNode>> | null;
|
|
8
|
+
registry: DialogRegistryContextValue | undefined;
|
|
9
|
+
onDialogNotMounted?: (dialogId: string, stepId: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Internal hook for TourProvider that handles dialog auto-open/close
|
|
13
|
+
* based on step transitions. Works in conjunction with useTourDialog.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useDialogAutomation: (params: UseDialogAutomationParams) => void;
|
|
16
|
+
//# sourceMappingURL=useDialogAutomation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogAutomation.d.ts","sourceRoot":"","sources":["../../src/hooks/useDialogAutomation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,SAAS,EACV,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAEjF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IAC3C,KAAK,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAA;IAC9C,QAAQ,EAAE,0BAA0B,GAAG,SAAS,CAAA;IAChD,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAChE;AAiBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,yBAAyB,KAAG,IAkHvE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface UseRadixTourDialogParams {
|
|
2
|
+
dialogId: string;
|
|
3
|
+
}
|
|
4
|
+
export interface UseRadixTourDialogResult {
|
|
5
|
+
/** True when current step has this dialogId */
|
|
6
|
+
isStepActive: boolean;
|
|
7
|
+
/** Computed open state based on step + autoOpen rules */
|
|
8
|
+
shouldBeOpen: boolean;
|
|
9
|
+
/** Call when dialog open state changes */
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
/** Props for Radix Dialog root */
|
|
12
|
+
dialogProps: {
|
|
13
|
+
open: boolean;
|
|
14
|
+
onOpenChange: (open: boolean) => void;
|
|
15
|
+
modal: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** Props for Radix DialogContent */
|
|
18
|
+
contentProps: {
|
|
19
|
+
trapFocus: boolean;
|
|
20
|
+
onInteractOutside: (e: Event) => void;
|
|
21
|
+
onFocusOutside: (e: Event) => void;
|
|
22
|
+
onEscapeKeyDown: (e: Event) => void;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare const useRadixTourDialog: (params: UseRadixTourDialogParams) => UseRadixTourDialogResult;
|
|
26
|
+
//# sourceMappingURL=useRadixTourDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRadixTourDialog.d.ts","sourceRoot":"","sources":["../../src/hooks/useRadixTourDialog.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,YAAY,EAAE,OAAO,CAAA;IACrB,yDAAyD;IACzD,YAAY,EAAE,OAAO,CAAA;IACrB,0CAA0C;IAC1C,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,kCAAkC;IAClC,WAAW,EAAE;QACX,IAAI,EAAE,OAAO,CAAA;QACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;QACrC,KAAK,EAAE,OAAO,CAAA;KACf,CAAA;IACD,oCAAoC;IACpC,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO,CAAA;QAClB,iBAAiB,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;QACrC,cAAc,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;QAClC,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;KACpC,CAAA;CACF;AAiBD,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,wBAAwB,KAC/B,wBA2OF,CAAA"}
|