@zealicsolutions/web-ui 1.0.96 → 1.0.97-beta.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 (23) hide show
  1. package/dist/cjs/components/RichTextViewer/components/VariableFormatter.d.ts +2 -1
  2. package/dist/cjs/components/RichTextViewer/utils/debugVariableState.d.ts +109 -0
  3. package/dist/cjs/containers/types/moleculeTypes.d.ts +4 -4
  4. package/dist/cjs/index.js +5 -5
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/molecules/Consent/Consent.stories.d.ts +3 -3
  7. package/dist/cjs/molecules/DateCalendar/DateCalendar.d.ts +1 -1
  8. package/dist/esm/components/RichTextViewer/components/Variable.js +1 -1
  9. package/dist/esm/components/RichTextViewer/components/Variable.js.map +1 -1
  10. package/dist/esm/components/RichTextViewer/components/VariableFormatter.d.ts +2 -1
  11. package/dist/esm/components/RichTextViewer/components/VariableFormatter.js +1 -1
  12. package/dist/esm/components/RichTextViewer/components/VariableFormatter.js.map +1 -1
  13. package/dist/esm/components/RichTextViewer/utils/debugVariableState.d.ts +109 -0
  14. package/dist/esm/components/RichTextViewer/utils/debugVariableState.js +2 -0
  15. package/dist/esm/components/RichTextViewer/utils/debugVariableState.js.map +1 -0
  16. package/dist/esm/containers/types/moleculeTypes.d.ts +4 -4
  17. package/dist/esm/molecules/BaseMolecule.js.map +1 -1
  18. package/dist/esm/molecules/Consent/Consent.stories.d.ts +3 -3
  19. package/dist/esm/molecules/DateCalendar/DateCalendar.d.ts +1 -1
  20. package/dist/esm/molecules/DateCalendar/DateCalendar.js +1 -1
  21. package/dist/esm/molecules/DateCalendar/DateCalendar.js.map +1 -1
  22. package/dist/index.d.ts +5 -5
  23. package/package.json +1 -1
@@ -6,8 +6,9 @@ interface VariableFormatterProps {
6
6
  stateObject: StateConfigType;
7
7
  variable: VariablePayload;
8
8
  leaf: {
9
- text: string;
9
+ text: string | number;
10
10
  };
11
+ debug?: boolean;
11
12
  }
12
13
  export declare const VariableFormatter: React.FC<VariableFormatterProps>;
13
14
  export {};
@@ -0,0 +1,109 @@
1
+ import { StateConfigType } from 'containers/types/types';
2
+ import { VariablePayload } from '../types';
3
+ /**
4
+ * Variable State Debugging Utilities
5
+ *
6
+ * These utilities help troubleshoot issues with variable values not appearing from the state object.
7
+ *
8
+ * ## Usage Methods:
9
+ *
10
+ * ### 1. Automatic Debug Mode (Integrated)
11
+ * The VariableFormatter component automatically enables debugging in development mode when:
12
+ * - NODE_ENV === 'development' AND
13
+ * - REACT_APP_DEBUG_VARIABLES=true in .env OR
14
+ * - window.__ZEAL_DEBUG_VARIABLES__ = true in browser console
15
+ *
16
+ * ### 2. Manual Debug (Standalone)
17
+ * ```typescript
18
+ * import { debugVariableStateDetailed } from '../utils/debugVariableState';
19
+ *
20
+ * // In your component or wherever you have access to variable and stateObject:
21
+ * debugVariableStateDetailed(variablePayload, stateObject);
22
+ * ```
23
+ *
24
+ * ### 3. Browser Console Debug
25
+ * ```javascript
26
+ * // Enable debug mode globally
27
+ * window.__ZEAL_DEBUG_VARIABLES__ = true;
28
+ *
29
+ * // Then reload or trigger variable rendering
30
+ * ```
31
+ *
32
+ * ### 4. Environment Variable
33
+ * Add to your .env.development file:
34
+ * ```
35
+ * REACT_APP_DEBUG_VARIABLES=true
36
+ * ```
37
+ *
38
+ * ## Debug Output Includes:
39
+ * - Variable configuration (dataModelFieldId, format, etc.)
40
+ * - State object structure and available keys
41
+ * - Direct lookup results
42
+ * - Potential key matches (fuzzy search)
43
+ * - Actionable recommendations
44
+ */
45
+ /**
46
+ * Debugging utility to help troubleshoot variable state issues
47
+ * @param variable The variable payload from the Rich Text Editor
48
+ * @param stateObject The current state object (localStateObject or stateConfig)
49
+ * @param logToConsole Whether to log debug information to console (default: true)
50
+ * @returns Debug information object
51
+ */
52
+ export declare const debugVariableState: (variable: VariablePayload, stateObject: StateConfigType, logToConsole?: boolean) => {
53
+ variable: {
54
+ id: string;
55
+ text: string;
56
+ dataModelFieldId: string | undefined;
57
+ pmiObjectName: string | undefined;
58
+ dataFieldName: string | undefined;
59
+ dataType: string | undefined;
60
+ format: import("../types").DataDisplayFormatType | undefined;
61
+ defaultValue: string | number | boolean | null | undefined;
62
+ };
63
+ stateObject: {
64
+ exists: boolean;
65
+ keys: string[];
66
+ totalKeys: number;
67
+ };
68
+ lookup: {
69
+ keyExists: boolean;
70
+ rawValue: string | boolean | import("containers/types/types").FormDataStateConfig | import("containers/types/types").ActionEventType | import("containers/types/types").BaseStateValue | null | undefined;
71
+ valueType: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
72
+ };
73
+ recommendations: string[];
74
+ };
75
+ /**
76
+ * Enhanced version of debugVariableState that also shows potential matches
77
+ * @param variable The variable payload
78
+ * @param stateObject The current state object
79
+ * @param logToConsole Whether to log to console
80
+ * @returns Debug info with potential matches
81
+ */
82
+ export declare const debugVariableStateDetailed: (variable: VariablePayload, stateObject: StateConfigType, logToConsole?: boolean) => {
83
+ potentialMatches: {
84
+ key: string;
85
+ value: unknown;
86
+ reason: string;
87
+ }[];
88
+ variable: {
89
+ id: string;
90
+ text: string;
91
+ dataModelFieldId: string | undefined;
92
+ pmiObjectName: string | undefined;
93
+ dataFieldName: string | undefined;
94
+ dataType: string | undefined;
95
+ format: import("../types").DataDisplayFormatType | undefined;
96
+ defaultValue: string | number | boolean | null | undefined;
97
+ };
98
+ stateObject: {
99
+ exists: boolean;
100
+ keys: string[];
101
+ totalKeys: number;
102
+ };
103
+ lookup: {
104
+ keyExists: boolean;
105
+ rawValue: string | boolean | import("containers/types/types").FormDataStateConfig | import("containers/types/types").ActionEventType | import("containers/types/types").BaseStateValue | null | undefined;
106
+ valueType: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
107
+ };
108
+ recommendations: string[];
109
+ };
@@ -404,7 +404,7 @@ export interface DatePickerMoleculeType extends BaseMoleculeType {
404
404
  export interface TimePickerMoleculeType extends BaseMoleculeType {
405
405
  type: 'time_picker' | 'time_picker_display';
406
406
  config: {
407
- props?: any;
407
+ props?: Record<string, unknown>;
408
408
  };
409
409
  properties: {
410
410
  text: TextProperties;
@@ -571,10 +571,10 @@ export interface BinaryRadioButtonsMoleculeType extends BaseMoleculeType {
571
571
  };
572
572
  }
573
573
  export type Molecule = StrictUnion<SimpleTextMoleculeType | TextMoleculeType | ConsentFieldMoleculeType | PasswordSetupMoleculeType | StepperMoleculeType | ChecklistsMoleculeType | AccordionMoleculeType | MenuMoleculeType | DrawerMoleculeType | TabsMoleculeType | DividerMoleculeType | LinkMoleculeType | VideoMoleculeType | ImageMoleculeType | ButtonMoleculeType | ChipMoleculeType | BadgeMoleculeType | AlertMoleculeType | BasicTextFieldMoleculeType | RatingMoleculeType | SwitchMoleculeType | SliderMoleculeType | SelectMoleculeType | DatePickerMoleculeType | TimePickerMoleculeType | EmailInputFieldMoleculeType | PhoneNumberInputFieldMoleculeType | NumericInputFieldMoleculeType | CurrencyInputFieldMoleculeType | AvatarMoleculeType | VisitMoleculeType | CalendarMoleculeType | DateCalendarMoleculeType | SpeedDialMoleculeType | CheckboxMoleculeType | BinaryRadioButtonsMoleculeType> & Partial<{
574
- form: UseFormReturn<any>;
574
+ form: UseFormReturn<Record<string, unknown>>;
575
575
  formData: AnyObject;
576
576
  setFormData: Dispatch<SetStateAction<AnyObject>>;
577
577
  }>;
578
- export type ConsentType = any;
579
- export type VisitMoleculeProps = any;
578
+ export type ConsentType = Record<string, unknown>;
579
+ export type VisitMoleculeProps = Record<string, unknown>;
580
580
  export {};